> -----Original Message-----
> From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
> ow...@vger.kernel.org] On Behalf Of Hannes Reinecke
> Sent: Wednesday, May 29, 2019 7:29 AM
> To: Martin K. Petersen <martin.peter...@oracle.com>
> Cc: Christoph Hellwig <h...@lst.de>; James Bottomley
> <james.bottom...@hansenpartnership.com>; linux-scsi@vger.kernel.org;
> Hannes Reinecke <h...@suse.de>; Hannes Reinecke <h...@suse.com>
> Subject: [PATCH 19/24] aacraid: move scsi_add_host()
> 
> Move the call to scsi_add_host() so that the Scsi_Host structure is 
> initialized
> before any I/O is sent.
> 
> Signed-off-by: Hannes Reinecke <h...@suse.com>
> ---
>  drivers/scsi/aacraid/linit.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index
> 8e28a505f7e8..71d97881fc26 100644
> --- a/drivers/scsi/aacraid/linit.c
> +++ b/drivers/scsi/aacraid/linit.c
> @@ -1669,6 +1669,9 @@ static int aac_probe_one(struct pci_dev *pdev,
> const struct pci_device_id *id)
>       shost->unique_id = unique_id;
>       shost->max_cmd_len = 16;
>       shost->use_cmd_list = 1;
> +     shost->max_id = MAXIMUM_NUM_CONTAINERS;
> +     shost->max_lun = AAC_MAX_LUN;
> +     shost->sg_tablesize = HBA_MAX_SG_SEPARATE;
> 
>       if (aac_cfg_major == AAC_CHARDEV_NEEDS_REINIT)
>               aac_init_char();
> @@ -1731,6 +1734,10 @@ static int aac_probe_one(struct pci_dev *pdev,
> const struct pci_device_id *id)
>               goto out_deinit;
>       }
> 
> +     error = scsi_add_host(shost, &pdev->dev);
> +     if (error)
> +             goto out_deinit;
> +
>       aac->maximum_num_channels = aac_drivers[index].channels;
>       error = aac_get_adapter_info(aac);

Hi Hannes,

I think this will be problematic, as the get_adapter_info() call gets a number 
of parameters from the controller, namely

        - can_queue
        - sg_tablesize

>From the sync command GET_PREFERRED_SETTINGS.

In looking at scsi_add_host(), it sets up the tags with input from those 
values. I'm still reviewing the others, but that was why the scsi_add_host was 
delayed.

Thanks, -Dave
 

Reply via email to