diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 136 |
1 files changed, 54 insertions, 82 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index a5723ad0a099..afca45cdbcef 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -268,6 +268,8 @@ lpfc_config_port_post(struct lpfc_hba * phba) | |||
268 | kfree(mp); | 268 | kfree(mp); |
269 | pmb->context1 = NULL; | 269 | pmb->context1 = NULL; |
270 | 270 | ||
271 | if (phba->cfg_soft_wwnn) | ||
272 | u64_to_wwn(phba->cfg_soft_wwnn, phba->fc_sparam.nodeName.u.wwn); | ||
271 | if (phba->cfg_soft_wwpn) | 273 | if (phba->cfg_soft_wwpn) |
272 | u64_to_wwn(phba->cfg_soft_wwpn, phba->fc_sparam.portName.u.wwn); | 274 | u64_to_wwn(phba->cfg_soft_wwpn, phba->fc_sparam.portName.u.wwn); |
273 | memcpy(&phba->fc_nodename, &phba->fc_sparam.nodeName, | 275 | memcpy(&phba->fc_nodename, &phba->fc_sparam.nodeName, |
@@ -349,8 +351,8 @@ lpfc_config_port_post(struct lpfc_hba * phba) | |||
349 | phba->hba_state = LPFC_LINK_DOWN; | 351 | phba->hba_state = LPFC_LINK_DOWN; |
350 | 352 | ||
351 | /* Only process IOCBs on ring 0 till hba_state is READY */ | 353 | /* Only process IOCBs on ring 0 till hba_state is READY */ |
352 | if (psli->ring[psli->ip_ring].cmdringaddr) | 354 | if (psli->ring[psli->extra_ring].cmdringaddr) |
353 | psli->ring[psli->ip_ring].flag |= LPFC_STOP_IOCB_EVENT; | 355 | psli->ring[psli->extra_ring].flag |= LPFC_STOP_IOCB_EVENT; |
354 | if (psli->ring[psli->fcp_ring].cmdringaddr) | 356 | if (psli->ring[psli->fcp_ring].cmdringaddr) |
355 | psli->ring[psli->fcp_ring].flag |= LPFC_STOP_IOCB_EVENT; | 357 | psli->ring[psli->fcp_ring].flag |= LPFC_STOP_IOCB_EVENT; |
356 | if (psli->ring[psli->next_ring].cmdringaddr) | 358 | if (psli->ring[psli->next_ring].cmdringaddr) |
@@ -517,7 +519,8 @@ lpfc_handle_eratt(struct lpfc_hba * phba) | |||
517 | struct lpfc_sli_ring *pring; | 519 | struct lpfc_sli_ring *pring; |
518 | uint32_t event_data; | 520 | uint32_t event_data; |
519 | 521 | ||
520 | if (phba->work_hs & HS_FFER6) { | 522 | if (phba->work_hs & HS_FFER6 || |
523 | phba->work_hs & HS_FFER5) { | ||
521 | /* Re-establishing Link */ | 524 | /* Re-establishing Link */ |
522 | lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, | 525 | lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, |
523 | "%d:1301 Re-establishing Link " | 526 | "%d:1301 Re-establishing Link " |
@@ -611,7 +614,7 @@ lpfc_handle_latt(struct lpfc_hba * phba) | |||
611 | pmb->mbox_cmpl = lpfc_mbx_cmpl_read_la; | 614 | pmb->mbox_cmpl = lpfc_mbx_cmpl_read_la; |
612 | rc = lpfc_sli_issue_mbox (phba, pmb, (MBX_NOWAIT | MBX_STOP_IOCB)); | 615 | rc = lpfc_sli_issue_mbox (phba, pmb, (MBX_NOWAIT | MBX_STOP_IOCB)); |
613 | if (rc == MBX_NOT_FINISHED) | 616 | if (rc == MBX_NOT_FINISHED) |
614 | goto lpfc_handle_latt_free_mp; | 617 | goto lpfc_handle_latt_free_mbuf; |
615 | 618 | ||
616 | /* Clear Link Attention in HA REG */ | 619 | /* Clear Link Attention in HA REG */ |
617 | spin_lock_irq(phba->host->host_lock); | 620 | spin_lock_irq(phba->host->host_lock); |
@@ -621,6 +624,8 @@ lpfc_handle_latt(struct lpfc_hba * phba) | |||
621 | 624 | ||
622 | return; | 625 | return; |
623 | 626 | ||
627 | lpfc_handle_latt_free_mbuf: | ||
628 | lpfc_mbuf_free(phba, mp->virt, mp->phys); | ||
624 | lpfc_handle_latt_free_mp: | 629 | lpfc_handle_latt_free_mp: |
625 | kfree(mp); | 630 | kfree(mp); |
626 | lpfc_handle_latt_free_pmb: | 631 | lpfc_handle_latt_free_pmb: |
@@ -802,19 +807,13 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) | |||
802 | { | 807 | { |
803 | lpfc_vpd_t *vp; | 808 | lpfc_vpd_t *vp; |
804 | uint16_t dev_id = phba->pcidev->device; | 809 | uint16_t dev_id = phba->pcidev->device; |
805 | uint16_t dev_subid = phba->pcidev->subsystem_device; | ||
806 | uint8_t hdrtype; | ||
807 | int max_speed; | 810 | int max_speed; |
808 | char * ports; | ||
809 | struct { | 811 | struct { |
810 | char * name; | 812 | char * name; |
811 | int max_speed; | 813 | int max_speed; |
812 | char * ports; | ||
813 | char * bus; | 814 | char * bus; |
814 | } m = {"<Unknown>", 0, "", ""}; | 815 | } m = {"<Unknown>", 0, ""}; |
815 | 816 | ||
816 | pci_read_config_byte(phba->pcidev, PCI_HEADER_TYPE, &hdrtype); | ||
817 | ports = (hdrtype == 0x80) ? "2-port " : ""; | ||
818 | if (mdp && mdp[0] != '\0' | 817 | if (mdp && mdp[0] != '\0' |
819 | && descp && descp[0] != '\0') | 818 | && descp && descp[0] != '\0') |
820 | return; | 819 | return; |
@@ -834,130 +833,93 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) | |||
834 | 833 | ||
835 | switch (dev_id) { | 834 | switch (dev_id) { |
836 | case PCI_DEVICE_ID_FIREFLY: | 835 | case PCI_DEVICE_ID_FIREFLY: |
837 | m = (typeof(m)){"LP6000", max_speed, "", "PCI"}; | 836 | m = (typeof(m)){"LP6000", max_speed, "PCI"}; |
838 | break; | 837 | break; |
839 | case PCI_DEVICE_ID_SUPERFLY: | 838 | case PCI_DEVICE_ID_SUPERFLY: |
840 | if (vp->rev.biuRev >= 1 && vp->rev.biuRev <= 3) | 839 | if (vp->rev.biuRev >= 1 && vp->rev.biuRev <= 3) |
841 | m = (typeof(m)){"LP7000", max_speed, "", "PCI"}; | 840 | m = (typeof(m)){"LP7000", max_speed, "PCI"}; |
842 | else | 841 | else |
843 | m = (typeof(m)){"LP7000E", max_speed, "", "PCI"}; | 842 | m = (typeof(m)){"LP7000E", max_speed, "PCI"}; |
844 | break; | 843 | break; |
845 | case PCI_DEVICE_ID_DRAGONFLY: | 844 | case PCI_DEVICE_ID_DRAGONFLY: |
846 | m = (typeof(m)){"LP8000", max_speed, "", "PCI"}; | 845 | m = (typeof(m)){"LP8000", max_speed, "PCI"}; |
847 | break; | 846 | break; |
848 | case PCI_DEVICE_ID_CENTAUR: | 847 | case PCI_DEVICE_ID_CENTAUR: |
849 | if (FC_JEDEC_ID(vp->rev.biuRev) == CENTAUR_2G_JEDEC_ID) | 848 | if (FC_JEDEC_ID(vp->rev.biuRev) == CENTAUR_2G_JEDEC_ID) |
850 | m = (typeof(m)){"LP9002", max_speed, "", "PCI"}; | 849 | m = (typeof(m)){"LP9002", max_speed, "PCI"}; |
851 | else | 850 | else |
852 | m = (typeof(m)){"LP9000", max_speed, "", "PCI"}; | 851 | m = (typeof(m)){"LP9000", max_speed, "PCI"}; |
853 | break; | 852 | break; |
854 | case PCI_DEVICE_ID_RFLY: | 853 | case PCI_DEVICE_ID_RFLY: |
855 | m = (typeof(m)){"LP952", max_speed, "", "PCI"}; | 854 | m = (typeof(m)){"LP952", max_speed, "PCI"}; |
856 | break; | 855 | break; |
857 | case PCI_DEVICE_ID_PEGASUS: | 856 | case PCI_DEVICE_ID_PEGASUS: |
858 | m = (typeof(m)){"LP9802", max_speed, "", "PCI-X"}; | 857 | m = (typeof(m)){"LP9802", max_speed, "PCI-X"}; |
859 | break; | 858 | break; |
860 | case PCI_DEVICE_ID_THOR: | 859 | case PCI_DEVICE_ID_THOR: |
861 | if (hdrtype == 0x80) | 860 | m = (typeof(m)){"LP10000", max_speed, "PCI-X"}; |
862 | m = (typeof(m)){"LP10000DC", | ||
863 | max_speed, ports, "PCI-X"}; | ||
864 | else | ||
865 | m = (typeof(m)){"LP10000", | ||
866 | max_speed, ports, "PCI-X"}; | ||
867 | break; | 861 | break; |
868 | case PCI_DEVICE_ID_VIPER: | 862 | case PCI_DEVICE_ID_VIPER: |
869 | m = (typeof(m)){"LPX1000", max_speed, "", "PCI-X"}; | 863 | m = (typeof(m)){"LPX1000", max_speed, "PCI-X"}; |
870 | break; | 864 | break; |
871 | case PCI_DEVICE_ID_PFLY: | 865 | case PCI_DEVICE_ID_PFLY: |
872 | m = (typeof(m)){"LP982", max_speed, "", "PCI-X"}; | 866 | m = (typeof(m)){"LP982", max_speed, "PCI-X"}; |
873 | break; | 867 | break; |
874 | case PCI_DEVICE_ID_TFLY: | 868 | case PCI_DEVICE_ID_TFLY: |
875 | if (hdrtype == 0x80) | 869 | m = (typeof(m)){"LP1050", max_speed, "PCI-X"}; |
876 | m = (typeof(m)){"LP1050DC", max_speed, ports, "PCI-X"}; | ||
877 | else | ||
878 | m = (typeof(m)){"LP1050", max_speed, ports, "PCI-X"}; | ||
879 | break; | 870 | break; |
880 | case PCI_DEVICE_ID_HELIOS: | 871 | case PCI_DEVICE_ID_HELIOS: |
881 | if (hdrtype == 0x80) | 872 | m = (typeof(m)){"LP11000", max_speed, "PCI-X2"}; |
882 | m = (typeof(m)){"LP11002", max_speed, ports, "PCI-X2"}; | ||
883 | else | ||
884 | m = (typeof(m)){"LP11000", max_speed, ports, "PCI-X2"}; | ||
885 | break; | 873 | break; |
886 | case PCI_DEVICE_ID_HELIOS_SCSP: | 874 | case PCI_DEVICE_ID_HELIOS_SCSP: |
887 | m = (typeof(m)){"LP11000-SP", max_speed, ports, "PCI-X2"}; | 875 | m = (typeof(m)){"LP11000-SP", max_speed, "PCI-X2"}; |
888 | break; | 876 | break; |
889 | case PCI_DEVICE_ID_HELIOS_DCSP: | 877 | case PCI_DEVICE_ID_HELIOS_DCSP: |
890 | m = (typeof(m)){"LP11002-SP", max_speed, ports, "PCI-X2"}; | 878 | m = (typeof(m)){"LP11002-SP", max_speed, "PCI-X2"}; |
891 | break; | 879 | break; |
892 | case PCI_DEVICE_ID_NEPTUNE: | 880 | case PCI_DEVICE_ID_NEPTUNE: |
893 | if (hdrtype == 0x80) | 881 | m = (typeof(m)){"LPe1000", max_speed, "PCIe"}; |
894 | m = (typeof(m)){"LPe1002", max_speed, ports, "PCIe"}; | ||
895 | else | ||
896 | m = (typeof(m)){"LPe1000", max_speed, ports, "PCIe"}; | ||
897 | break; | 882 | break; |
898 | case PCI_DEVICE_ID_NEPTUNE_SCSP: | 883 | case PCI_DEVICE_ID_NEPTUNE_SCSP: |
899 | m = (typeof(m)){"LPe1000-SP", max_speed, ports, "PCIe"}; | 884 | m = (typeof(m)){"LPe1000-SP", max_speed, "PCIe"}; |
900 | break; | 885 | break; |
901 | case PCI_DEVICE_ID_NEPTUNE_DCSP: | 886 | case PCI_DEVICE_ID_NEPTUNE_DCSP: |
902 | m = (typeof(m)){"LPe1002-SP", max_speed, ports, "PCIe"}; | 887 | m = (typeof(m)){"LPe1002-SP", max_speed, "PCIe"}; |
903 | break; | 888 | break; |
904 | case PCI_DEVICE_ID_BMID: | 889 | case PCI_DEVICE_ID_BMID: |
905 | m = (typeof(m)){"LP1150", max_speed, ports, "PCI-X2"}; | 890 | m = (typeof(m)){"LP1150", max_speed, "PCI-X2"}; |
906 | break; | 891 | break; |
907 | case PCI_DEVICE_ID_BSMB: | 892 | case PCI_DEVICE_ID_BSMB: |
908 | m = (typeof(m)){"LP111", max_speed, ports, "PCI-X2"}; | 893 | m = (typeof(m)){"LP111", max_speed, "PCI-X2"}; |
909 | break; | 894 | break; |
910 | case PCI_DEVICE_ID_ZEPHYR: | 895 | case PCI_DEVICE_ID_ZEPHYR: |
911 | if (hdrtype == 0x80) | 896 | m = (typeof(m)){"LPe11000", max_speed, "PCIe"}; |
912 | m = (typeof(m)){"LPe11002", max_speed, ports, "PCIe"}; | ||
913 | else | ||
914 | m = (typeof(m)){"LPe11000", max_speed, ports, "PCIe"}; | ||
915 | break; | 897 | break; |
916 | case PCI_DEVICE_ID_ZEPHYR_SCSP: | 898 | case PCI_DEVICE_ID_ZEPHYR_SCSP: |
917 | m = (typeof(m)){"LPe11000", max_speed, ports, "PCIe"}; | 899 | m = (typeof(m)){"LPe11000", max_speed, "PCIe"}; |
918 | break; | 900 | break; |
919 | case PCI_DEVICE_ID_ZEPHYR_DCSP: | 901 | case PCI_DEVICE_ID_ZEPHYR_DCSP: |
920 | m = (typeof(m)){"LPe11002-SP", max_speed, ports, "PCIe"}; | 902 | m = (typeof(m)){"LPe11002-SP", max_speed, "PCIe"}; |
921 | break; | 903 | break; |
922 | case PCI_DEVICE_ID_ZMID: | 904 | case PCI_DEVICE_ID_ZMID: |
923 | m = (typeof(m)){"LPe1150", max_speed, ports, "PCIe"}; | 905 | m = (typeof(m)){"LPe1150", max_speed, "PCIe"}; |
924 | break; | 906 | break; |
925 | case PCI_DEVICE_ID_ZSMB: | 907 | case PCI_DEVICE_ID_ZSMB: |
926 | m = (typeof(m)){"LPe111", max_speed, ports, "PCIe"}; | 908 | m = (typeof(m)){"LPe111", max_speed, "PCIe"}; |
927 | break; | 909 | break; |
928 | case PCI_DEVICE_ID_LP101: | 910 | case PCI_DEVICE_ID_LP101: |
929 | m = (typeof(m)){"LP101", max_speed, ports, "PCI-X"}; | 911 | m = (typeof(m)){"LP101", max_speed, "PCI-X"}; |
930 | break; | 912 | break; |
931 | case PCI_DEVICE_ID_LP10000S: | 913 | case PCI_DEVICE_ID_LP10000S: |
932 | m = (typeof(m)){"LP10000-S", max_speed, ports, "PCI"}; | 914 | m = (typeof(m)){"LP10000-S", max_speed, "PCI"}; |
933 | break; | 915 | break; |
934 | case PCI_DEVICE_ID_LP11000S: | 916 | case PCI_DEVICE_ID_LP11000S: |
917 | m = (typeof(m)){"LP11000-S", max_speed, | ||
918 | "PCI-X2"}; | ||
919 | break; | ||
935 | case PCI_DEVICE_ID_LPE11000S: | 920 | case PCI_DEVICE_ID_LPE11000S: |
936 | switch (dev_subid) { | 921 | m = (typeof(m)){"LPe11000-S", max_speed, |
937 | case PCI_SUBSYSTEM_ID_LP11000S: | 922 | "PCIe"}; |
938 | m = (typeof(m)){"LP11000-S", max_speed, | ||
939 | ports, "PCI-X2"}; | ||
940 | break; | ||
941 | case PCI_SUBSYSTEM_ID_LP11002S: | ||
942 | m = (typeof(m)){"LP11002-S", max_speed, | ||
943 | ports, "PCI-X2"}; | ||
944 | break; | ||
945 | case PCI_SUBSYSTEM_ID_LPE11000S: | ||
946 | m = (typeof(m)){"LPe11000-S", max_speed, | ||
947 | ports, "PCIe"}; | ||
948 | break; | ||
949 | case PCI_SUBSYSTEM_ID_LPE11002S: | ||
950 | m = (typeof(m)){"LPe11002-S", max_speed, | ||
951 | ports, "PCIe"}; | ||
952 | break; | ||
953 | case PCI_SUBSYSTEM_ID_LPE11010S: | ||
954 | m = (typeof(m)){"LPe11010-S", max_speed, | ||
955 | "10-port ", "PCIe"}; | ||
956 | break; | ||
957 | default: | ||
958 | m = (typeof(m)){ NULL }; | ||
959 | break; | ||
960 | } | ||
961 | break; | 923 | break; |
962 | default: | 924 | default: |
963 | m = (typeof(m)){ NULL }; | 925 | m = (typeof(m)){ NULL }; |
@@ -968,8 +930,8 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) | |||
968 | snprintf(mdp, 79,"%s", m.name); | 930 | snprintf(mdp, 79,"%s", m.name); |
969 | if (descp && descp[0] == '\0') | 931 | if (descp && descp[0] == '\0') |
970 | snprintf(descp, 255, | 932 | snprintf(descp, 255, |
971 | "Emulex %s %dGb %s%s Fibre Channel Adapter", | 933 | "Emulex %s %dGb %s Fibre Channel Adapter", |
972 | m.name, m.max_speed, m.ports, m.bus); | 934 | m.name, m.max_speed, m.bus); |
973 | } | 935 | } |
974 | 936 | ||
975 | /**************************************************/ | 937 | /**************************************************/ |
@@ -1651,6 +1613,14 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1651 | if (error) | 1613 | if (error) |
1652 | goto out_remove_host; | 1614 | goto out_remove_host; |
1653 | 1615 | ||
1616 | if (phba->cfg_use_msi) { | ||
1617 | error = pci_enable_msi(phba->pcidev); | ||
1618 | if (error) | ||
1619 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, "%d:0452 " | ||
1620 | "Enable MSI failed, continuing with " | ||
1621 | "IRQ\n", phba->brd_no); | ||
1622 | } | ||
1623 | |||
1654 | error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED, | 1624 | error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED, |
1655 | LPFC_DRIVER_NAME, phba); | 1625 | LPFC_DRIVER_NAME, phba); |
1656 | if (error) { | 1626 | if (error) { |
@@ -1730,6 +1700,7 @@ out_free_irq: | |||
1730 | lpfc_stop_timer(phba); | 1700 | lpfc_stop_timer(phba); |
1731 | phba->work_hba_events = 0; | 1701 | phba->work_hba_events = 0; |
1732 | free_irq(phba->pcidev->irq, phba); | 1702 | free_irq(phba->pcidev->irq, phba); |
1703 | pci_disable_msi(phba->pcidev); | ||
1733 | out_free_sysfs_attr: | 1704 | out_free_sysfs_attr: |
1734 | lpfc_free_sysfs_attr(phba); | 1705 | lpfc_free_sysfs_attr(phba); |
1735 | out_remove_host: | 1706 | out_remove_host: |
@@ -1796,6 +1767,7 @@ lpfc_pci_remove_one(struct pci_dev *pdev) | |||
1796 | 1767 | ||
1797 | /* Release the irq reservation */ | 1768 | /* Release the irq reservation */ |
1798 | free_irq(phba->pcidev->irq, phba); | 1769 | free_irq(phba->pcidev->irq, phba); |
1770 | pci_disable_msi(phba->pcidev); | ||
1799 | 1771 | ||
1800 | lpfc_cleanup(phba, 0); | 1772 | lpfc_cleanup(phba, 0); |
1801 | lpfc_stop_timer(phba); | 1773 | lpfc_stop_timer(phba); |