Skip to contentSkip to conversation

scsi: hpsa: Increase controller error handling timeout

bug report [email protected] 2 participants 2 messages Jul 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello Don Brace,

The patch c73deaf3b001: "scsi: hpsa: Increase controller error handling timeout" from Jul 20, 2020, leads to the following static checker warning:

	drivers/scsi/hpsa.c:2163 hpsa_slave_configure()
	error: uninitialized symbol 'queue_depth'.

drivers/scsi/hpsa.c

  2136  /* configure scsi device based on internal per-device structure */
  2137  #define CTLR_TIMEOUT (120 * HZ)
  2138  static int hpsa_slave_configure(struct scsi_device *sdev)
  2139  {
  2140          struct hpsa_scsi_dev_t *sd;
  2141          int queue_depth;
                ^^^^^^^^^^^^^^^
  2142  
  2143          sd = sdev->hostdata;
  2144          sdev->no_uld_attach = !sd || !sd->expose_device;
  2145  
  2146          if (sd) {
  2147                  sd->was_removed = 0;
  2148                  if (sd->external) {
  2149                          queue_depth = EXTERNAL_QD;
  2150                          sdev->eh_timeout = HPSA_EH_PTRAID_TIMEOUT;
  2151                          blk_queue_rq_timeout(sdev->request_queue,
  2152                                                  HPSA_EH_PTRAID_TIMEOUT);
  2153                  } else if (is_hba_lunid(sd->scsi3addr)) {
  2154                          sdev->eh_timeout = CTLR_TIMEOUT;
  2155                          blk_queue_rq_timeout(sdev->request_queue, CTLR_TIMEOUT);

Not set on this path.

  2156                  } else {
  2157                          queue_depth = sd->queue_depth != 0 ?
  2158                                          sd->queue_depth : sdev->host->can_queue;
  2159                  }
  2160          } else
  2161                  queue_depth = sdev->host->can_queue;
  2162  
  2163          scsi_change_queue_depth(sdev, queue_depth);
                                              ^^^^^^^^^^^
  2164  
  2165          return 0;
  2166  }

regards,
dan carpenter

maintainer Reviewed-by Scott Teel
#1 lore raw

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: Monday, July 27, 2020 6:19 AM
To: [email protected]

Hello Don Brace,

The patch c73deaf3b001: "scsi: hpsa: Increase controller error handling timeout" from Jul 20, 2020, leads to the following static checker warning:

drivers/scsi/hpsa.c:2163 hpsa_slave_configure()
error: uninitialized symbol 'queue_depth'.

I uploaded the patch bellow on Friday to correct this. I should have asked for the patch to be squashed into this patch.

commit e5ad119720fd64cb7dd1fdd41e12f2fa5655b608

Author: Don Brace <[email protected]>
Date:   Fri Jul 24 15:26:39 2020 -0500

hpsa: correct ctrl queue depth

- need to set queue depth for controller devices.
- corrects compiler warning in patch:
hpsa-increase-ctlr-eh-timeout

drivers/scsi/hpsa.c +6 -5
index 90c36d75bf92..91794a50b31f 100644
@@ -2145,20 +2145,21 @@ static int hpsa_slave_configure(struct scsi_device *sdev)
 
        if (sd) {
                sd->was_removed = 0;
+               queue_depth = sd->queue_depth != 0 ?
+                               sd->queue_depth : sdev->host->can_queue;
                if (sd->external) {
                        queue_depth = EXTERNAL_QD;
                        sdev->eh_timeout = HPSA_EH_PTRAID_TIMEOUT;
                        blk_queue_rq_timeout(sdev->request_queue,
                                                HPSA_EH_PTRAID_TIMEOUT);
-               } else if (is_hba_lunid(sd->scsi3addr)) {
+               }
+               if (is_hba_lunid(sd->scsi3addr)) {
                        sdev->eh_timeout = CTLR_TIMEOUT;
                        blk_queue_rq_timeout(sdev->request_queue, CTLR_TIMEOUT);
-               } else {
-                       queue_depth = sd->queue_depth != 0 ?
-                                       sd->queue_depth : sdev->host->can_queue;
                }
-       } else
+       } else {
                queue_depth = sdev->host->can_queue;
+       }
 
        scsi_change_queue_depth(sdev, queue_depth);
 

regards,
dan carpenter