diff options
author | Reddy, Sreekanth <Sreekanth.Reddy@avagotech.com> | 2014-07-14 02:30:49 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-25 17:17:03 -0400 |
commit | 02b7708134037f85656d15992912226134b10250 (patch) | |
tree | d691ca369a5913e04b620c59e921fbefc521ae22 | |
parent | 3533f8603d28b77c62d75ec899449a99bc6b77a1 (diff) |
mpt2sas: delay scsi_add_host call to work with scsi-mq
In _scsih_probe, delay the call to scsi_add_host until the host has been
fully set up.
Otherwise, the default .can_queue value of 1 causes scsi-mq to set the block
layer request queue size to its minimum size, resulting in awful performance.
In _scsih_probe error handling, call mpt3sas_base_detach rather than
scsi_remove_host to properly clean up in reverse order.
In _scsih_remove, call scsi_remove_host earlier to clean up in reverse order.
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@avagotech.com>
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 2 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 25 |
2 files changed, 13 insertions, 14 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 92a1f19437a5..2f262be890c5 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -277,7 +277,7 @@ mpt2sas_base_stop_watchdog(struct MPT2SAS_ADAPTER *ioc) | |||
277 | ioc->fault_reset_work_q = NULL; | 277 | ioc->fault_reset_work_q = NULL; |
278 | spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); | 278 | spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); |
279 | if (wq) { | 279 | if (wq) { |
280 | if (!cancel_delayed_work(&ioc->fault_reset_work)) | 280 | if (!cancel_delayed_work_sync(&ioc->fault_reset_work)) |
281 | flush_workqueue(wq); | 281 | flush_workqueue(wq); |
282 | destroy_workqueue(wq); | 282 | destroy_workqueue(wq); |
283 | } | 283 | } |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index e7801ff00d19..dd461015813f 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
@@ -2900,11 +2900,10 @@ _scsih_fw_event_cleanup_queue(struct MPT2SAS_ADAPTER *ioc) | |||
2900 | return; | 2900 | return; |
2901 | 2901 | ||
2902 | list_for_each_entry_safe(fw_event, next, &ioc->fw_event_list, list) { | 2902 | list_for_each_entry_safe(fw_event, next, &ioc->fw_event_list, list) { |
2903 | if (cancel_delayed_work(&fw_event->delayed_work)) { | 2903 | if (cancel_delayed_work_sync(&fw_event->delayed_work)) { |
2904 | _scsih_fw_event_free(ioc, fw_event); | 2904 | _scsih_fw_event_free(ioc, fw_event); |
2905 | continue; | 2905 | continue; |
2906 | } | 2906 | } |
2907 | fw_event->cancel_pending_work = 1; | ||
2908 | } | 2907 | } |
2909 | } | 2908 | } |
2910 | 2909 | ||
@@ -7419,7 +7418,7 @@ _firmware_event_work(struct work_struct *work) | |||
7419 | struct MPT2SAS_ADAPTER *ioc = fw_event->ioc; | 7418 | struct MPT2SAS_ADAPTER *ioc = fw_event->ioc; |
7420 | 7419 | ||
7421 | /* the queue is being flushed so ignore this event */ | 7420 | /* the queue is being flushed so ignore this event */ |
7422 | if (ioc->remove_host || fw_event->cancel_pending_work || | 7421 | if (ioc->remove_host || |
7423 | ioc->pci_error_recovery) { | 7422 | ioc->pci_error_recovery) { |
7424 | _scsih_fw_event_free(ioc, fw_event); | 7423 | _scsih_fw_event_free(ioc, fw_event); |
7425 | return; | 7424 | return; |
@@ -7867,9 +7866,9 @@ _scsih_remove(struct pci_dev *pdev) | |||
7867 | } | 7866 | } |
7868 | 7867 | ||
7869 | sas_remove_host(shost); | 7868 | sas_remove_host(shost); |
7869 | scsi_remove_host(shost); | ||
7870 | mpt2sas_base_detach(ioc); | 7870 | mpt2sas_base_detach(ioc); |
7871 | list_del(&ioc->list); | 7871 | list_del(&ioc->list); |
7872 | scsi_remove_host(shost); | ||
7873 | scsi_host_put(shost); | 7872 | scsi_host_put(shost); |
7874 | } | 7873 | } |
7875 | 7874 | ||
@@ -8210,13 +8209,6 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
8210 | } | 8209 | } |
8211 | } | 8210 | } |
8212 | 8211 | ||
8213 | if ((scsi_add_host(shost, &pdev->dev))) { | ||
8214 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", | ||
8215 | ioc->name, __FILE__, __LINE__, __func__); | ||
8216 | list_del(&ioc->list); | ||
8217 | goto out_add_shost_fail; | ||
8218 | } | ||
8219 | |||
8220 | /* register EEDP capabilities with SCSI layer */ | 8212 | /* register EEDP capabilities with SCSI layer */ |
8221 | if (prot_mask) | 8213 | if (prot_mask) |
8222 | scsi_host_set_prot(shost, prot_mask); | 8214 | scsi_host_set_prot(shost, prot_mask); |
@@ -8258,16 +8250,23 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
8258 | } | 8250 | } |
8259 | } else | 8251 | } else |
8260 | ioc->hide_drives = 0; | 8252 | ioc->hide_drives = 0; |
8253 | |||
8254 | if ((scsi_add_host(shost, &pdev->dev))) { | ||
8255 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", | ||
8256 | ioc->name, __FILE__, __LINE__, __func__); | ||
8257 | goto out_add_shost_fail; | ||
8258 | } | ||
8259 | |||
8261 | scsi_scan_host(shost); | 8260 | scsi_scan_host(shost); |
8262 | 8261 | ||
8263 | return 0; | 8262 | return 0; |
8264 | 8263 | ||
8264 | out_add_shost_fail: | ||
8265 | mpt2sas_base_detach(ioc); | ||
8265 | out_attach_fail: | 8266 | out_attach_fail: |
8266 | destroy_workqueue(ioc->firmware_event_thread); | 8267 | destroy_workqueue(ioc->firmware_event_thread); |
8267 | out_thread_fail: | 8268 | out_thread_fail: |
8268 | list_del(&ioc->list); | 8269 | list_del(&ioc->list); |
8269 | scsi_remove_host(shost); | ||
8270 | out_add_shost_fail: | ||
8271 | scsi_host_put(shost); | 8270 | scsi_host_put(shost); |
8272 | return -ENODEV; | 8271 | return -ENODEV; |
8273 | } | 8272 | } |