aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt3sas
diff options
context:
space:
mode:
authorReddy, Sreekanth <Sreekanth.Reddy@avagotech.com>2014-07-14 02:31:35 -0400
committerChristoph Hellwig <hch@lst.de>2014-07-25 17:17:04 -0400
commit4dc06fd84645c323a1f20482b9b571cab6dc7d93 (patch)
tree97bd392143a71032120e3dd4e60d046343a323d4 /drivers/scsi/mpt3sas
parent02b7708134037f85656d15992912226134b10250 (diff)
mpt3sas: 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>
Diffstat (limited to 'drivers/scsi/mpt3sas')
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_base.c2
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_scsih.c26
2 files changed, 13 insertions, 15 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index c608a616941a..93ce2b2baa41 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -266,7 +266,7 @@ mpt3sas_base_stop_watchdog(struct MPT3SAS_ADAPTER *ioc)
266 ioc->fault_reset_work_q = NULL; 266 ioc->fault_reset_work_q = NULL;
267 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 267 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
268 if (wq) { 268 if (wq) {
269 if (!cancel_delayed_work(&ioc->fault_reset_work)) 269 if (!cancel_delayed_work_sync(&ioc->fault_reset_work))
270 flush_workqueue(wq); 270 flush_workqueue(wq);
271 destroy_workqueue(wq); 271 destroy_workqueue(wq);
272 } 272 }
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 57020d528035..7cf48c5c15a7 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -2581,11 +2581,10 @@ _scsih_fw_event_cleanup_queue(struct MPT3SAS_ADAPTER *ioc)
2581 return; 2581 return;
2582 2582
2583 list_for_each_entry_safe(fw_event, next, &ioc->fw_event_list, list) { 2583 list_for_each_entry_safe(fw_event, next, &ioc->fw_event_list, list) {
2584 if (cancel_delayed_work(&fw_event->delayed_work)) { 2584 if (cancel_delayed_work_sync(&fw_event->delayed_work)) {
2585 _scsih_fw_event_free(ioc, fw_event); 2585 _scsih_fw_event_free(ioc, fw_event);
2586 continue; 2586 continue;
2587 } 2587 }
2588 fw_event->cancel_pending_work = 1;
2589 } 2588 }
2590} 2589}
2591 2590
@@ -7039,7 +7038,7 @@ static void
7039_mpt3sas_fw_work(struct MPT3SAS_ADAPTER *ioc, struct fw_event_work *fw_event) 7038_mpt3sas_fw_work(struct MPT3SAS_ADAPTER *ioc, struct fw_event_work *fw_event)
7040{ 7039{
7041 /* the queue is being flushed so ignore this event */ 7040 /* the queue is being flushed so ignore this event */
7042 if (ioc->remove_host || fw_event->cancel_pending_work || 7041 if (ioc->remove_host ||
7043 ioc->pci_error_recovery) { 7042 ioc->pci_error_recovery) {
7044 _scsih_fw_event_free(ioc, fw_event); 7043 _scsih_fw_event_free(ioc, fw_event);
7045 return; 7044 return;
@@ -7439,9 +7438,9 @@ static void _scsih_remove(struct pci_dev *pdev)
7439 } 7438 }
7440 7439
7441 sas_remove_host(shost); 7440 sas_remove_host(shost);
7441 scsi_remove_host(shost);
7442 mpt3sas_base_detach(ioc); 7442 mpt3sas_base_detach(ioc);
7443 list_del(&ioc->list); 7443 list_del(&ioc->list);
7444 scsi_remove_host(shost);
7445 scsi_host_put(shost); 7444 scsi_host_put(shost);
7446} 7445}
7447 7446
@@ -7809,13 +7808,6 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
7809 } 7808 }
7810 } 7809 }
7811 7810
7812 if ((scsi_add_host(shost, &pdev->dev))) {
7813 pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
7814 ioc->name, __FILE__, __LINE__, __func__);
7815 list_del(&ioc->list);
7816 goto out_add_shost_fail;
7817 }
7818
7819 /* register EEDP capabilities with SCSI layer */ 7811 /* register EEDP capabilities with SCSI layer */
7820 if (prot_mask > 0) 7812 if (prot_mask > 0)
7821 scsi_host_set_prot(shost, prot_mask); 7813 scsi_host_set_prot(shost, prot_mask);
@@ -7843,15 +7835,21 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
7843 ioc->name, __FILE__, __LINE__, __func__); 7835 ioc->name, __FILE__, __LINE__, __func__);
7844 goto out_attach_fail; 7836 goto out_attach_fail;
7845 } 7837 }
7838 if ((scsi_add_host(shost, &pdev->dev))) {
7839 pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
7840 ioc->name, __FILE__, __LINE__, __func__);
7841 list_del(&ioc->list);
7842 goto out_add_shost_fail;
7843 }
7844
7846 scsi_scan_host(shost); 7845 scsi_scan_host(shost);
7847 return 0; 7846 return 0;
7848 7847out_add_shost_fail:
7848 mpt3sas_base_detach(ioc);
7849 out_attach_fail: 7849 out_attach_fail:
7850 destroy_workqueue(ioc->firmware_event_thread); 7850 destroy_workqueue(ioc->firmware_event_thread);
7851 out_thread_fail: 7851 out_thread_fail:
7852 list_del(&ioc->list); 7852 list_del(&ioc->list);
7853 scsi_remove_host(shost);
7854 out_add_shost_fail:
7855 scsi_host_put(shost); 7853 scsi_host_put(shost);
7856 return -ENODEV; 7854 return -ENODEV;
7857} 7855}