aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/init.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 22:01:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 22:01:32 -0400
commit3151367f8778a1789d6f6e6f6c642681b6cd6d64 (patch)
tree1869d5429a25abd994ae94079808b8db060ec6f3 /drivers/scsi/isci/init.c
parent16642a2e7be23bbda013fc32d8f6c68982eab603 (diff)
parentfe709ed827d370e6b0c0a9f9456da1c22bdcd118 (diff)
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull first round of SCSI updates from James Bottomley: "This is a large set of updates, mostly for drivers (qla2xxx [including support for new 83xx based card], qla4xxx, mpt2sas, bfa, zfcp, hpsa, be2iscsi, isci, lpfc, ipr, ibmvfc, ibmvscsi, megaraid_sas). There's also a rework for tape adding virtually unlimited numbers of tape drives plus a set of dif fixes for sd and a fix for a live lock on hot remove of SCSI devices. This round includes a signed tag pull of isci-for-3.6 Signed-off-by: James Bottomley <JBottomley@Parallels.com>" Fix up trivial conflict in drivers/scsi/qla2xxx/qla_nx.c due to new PCI helper function use in a function that was removed by this pull. * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (198 commits) [SCSI] st: remove st_mutex [SCSI] sd: Ensure we correctly disable devices with unknown protection type [SCSI] hpsa: gen8plus Smart Array IDs [SCSI] qla4xxx: Update driver version to 5.03.00-k1 [SCSI] qla4xxx: Disable generating pause frames for ISP83XX [SCSI] qla4xxx: Fix double clearing of risc_intr for ISP83XX [SCSI] qla4xxx: IDC implementation for Loopback [SCSI] qla4xxx: update copyrights in LICENSE.qla4xxx [SCSI] qla4xxx: Fix panic while rmmod [SCSI] qla4xxx: Fail probe_adapter if IRQ allocation fails [SCSI] qla4xxx: Prevent MSI/MSI-X falling back to INTx for ISP82XX [SCSI] qla4xxx: Update idc reg in case of PCI AER [SCSI] qla4xxx: Fix double IDC locking in qla4_8xxx_error_recovery [SCSI] qla4xxx: Clear interrupt while unloading driver for ISP83XX [SCSI] qla4xxx: Print correct IDC version [SCSI] qla4xxx: Added new mbox cmd to pass driver version to FW [SCSI] scsi_dh_alua: Enable STPG for unavailable ports [SCSI] scsi_remove_target: fix softlockup regression on hot remove [SCSI] ibmvscsi: Fix host config length field overflow [SCSI] ibmvscsi: Remove backend abstraction ...
Diffstat (limited to 'drivers/scsi/isci/init.c')
-rw-r--r--drivers/scsi/isci/init.c59
1 files changed, 57 insertions, 2 deletions
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index 9be45a2b2232..b74050b95d6a 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -156,7 +156,7 @@ static struct scsi_host_template isci_sht = {
156 .target_alloc = sas_target_alloc, 156 .target_alloc = sas_target_alloc,
157 .slave_configure = sas_slave_configure, 157 .slave_configure = sas_slave_configure,
158 .scan_finished = isci_host_scan_finished, 158 .scan_finished = isci_host_scan_finished,
159 .scan_start = isci_host_scan_start, 159 .scan_start = isci_host_start,
160 .change_queue_depth = sas_change_queue_depth, 160 .change_queue_depth = sas_change_queue_depth,
161 .change_queue_type = sas_change_queue_type, 161 .change_queue_type = sas_change_queue_type,
162 .bios_param = sas_bios_param, 162 .bios_param = sas_bios_param,
@@ -644,7 +644,6 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic
644 orom->hdr.version)) { 644 orom->hdr.version)) {
645 dev_warn(&pdev->dev, 645 dev_warn(&pdev->dev,
646 "[%d]: invalid oem parameters detected, falling back to firmware\n", i); 646 "[%d]: invalid oem parameters detected, falling back to firmware\n", i);
647 devm_kfree(&pdev->dev, orom);
648 orom = NULL; 647 orom = NULL;
649 break; 648 break;
650 } 649 }
@@ -722,11 +721,67 @@ static void __devexit isci_pci_remove(struct pci_dev *pdev)
722 } 721 }
723} 722}
724 723
724#ifdef CONFIG_PM
725static int isci_suspend(struct device *dev)
726{
727 struct pci_dev *pdev = to_pci_dev(dev);
728 struct isci_host *ihost;
729 int i;
730
731 for_each_isci_host(i, ihost, pdev) {
732 sas_suspend_ha(&ihost->sas_ha);
733 isci_host_deinit(ihost);
734 }
735
736 pci_save_state(pdev);
737 pci_disable_device(pdev);
738 pci_set_power_state(pdev, PCI_D3hot);
739
740 return 0;
741}
742
743static int isci_resume(struct device *dev)
744{
745 struct pci_dev *pdev = to_pci_dev(dev);
746 struct isci_host *ihost;
747 int rc, i;
748
749 pci_set_power_state(pdev, PCI_D0);
750 pci_restore_state(pdev);
751
752 rc = pcim_enable_device(pdev);
753 if (rc) {
754 dev_err(&pdev->dev,
755 "enabling device failure after resume(%d)\n", rc);
756 return rc;
757 }
758
759 pci_set_master(pdev);
760
761 for_each_isci_host(i, ihost, pdev) {
762 sas_prep_resume_ha(&ihost->sas_ha);
763
764 isci_host_init(ihost);
765 isci_host_start(ihost->sas_ha.core.shost);
766 wait_for_start(ihost);
767
768 sas_resume_ha(&ihost->sas_ha);
769 }
770
771 return 0;
772}
773
774static SIMPLE_DEV_PM_OPS(isci_pm_ops, isci_suspend, isci_resume);
775#endif
776
725static struct pci_driver isci_pci_driver = { 777static struct pci_driver isci_pci_driver = {
726 .name = DRV_NAME, 778 .name = DRV_NAME,
727 .id_table = isci_id_table, 779 .id_table = isci_id_table,
728 .probe = isci_pci_probe, 780 .probe = isci_pci_probe,
729 .remove = __devexit_p(isci_pci_remove), 781 .remove = __devexit_p(isci_pci_remove),
782#ifdef CONFIG_PM
783 .driver.pm = &isci_pm_ops,
784#endif
730}; 785};
731 786
732static __init int isci_init(void) 787static __init int isci_init(void)