diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 69 |
1 files changed, 37 insertions, 32 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 0856ff7d3b33..4e04470321a2 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -537,12 +537,6 @@ lpfc_handle_eratt(struct lpfc_hba * phba) | |||
537 | 537 | ||
538 | lpfc_offline(phba); | 538 | lpfc_offline(phba); |
539 | 539 | ||
540 | /* | ||
541 | * Restart all traffic to this host. Since the fc_transport | ||
542 | * block functions (future) were not called in lpfc_offline, | ||
543 | * don't call them here. | ||
544 | */ | ||
545 | scsi_unblock_requests(phba->host); | ||
546 | } | 540 | } |
547 | } | 541 | } |
548 | 542 | ||
@@ -772,10 +766,12 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) | |||
772 | { | 766 | { |
773 | lpfc_vpd_t *vp; | 767 | lpfc_vpd_t *vp; |
774 | uint32_t id; | 768 | uint32_t id; |
769 | uint8_t hdrtype; | ||
775 | char str[16]; | 770 | char str[16]; |
776 | 771 | ||
777 | vp = &phba->vpd; | 772 | vp = &phba->vpd; |
778 | pci_read_config_dword(phba->pcidev, PCI_VENDOR_ID, &id); | 773 | pci_read_config_dword(phba->pcidev, PCI_VENDOR_ID, &id); |
774 | pci_read_config_byte(phba->pcidev, PCI_HEADER_TYPE, &hdrtype); | ||
779 | 775 | ||
780 | switch ((id >> 16) & 0xffff) { | 776 | switch ((id >> 16) & 0xffff) { |
781 | case PCI_DEVICE_ID_FIREFLY: | 777 | case PCI_DEVICE_ID_FIREFLY: |
@@ -803,7 +799,10 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) | |||
803 | strcpy(str, "LP9802 2"); | 799 | strcpy(str, "LP9802 2"); |
804 | break; | 800 | break; |
805 | case PCI_DEVICE_ID_THOR: | 801 | case PCI_DEVICE_ID_THOR: |
806 | strcpy(str, "LP10000 2"); | 802 | if (hdrtype == 0x80) |
803 | strcpy(str, "LP10000DC 2"); | ||
804 | else | ||
805 | strcpy(str, "LP10000 2"); | ||
807 | break; | 806 | break; |
808 | case PCI_DEVICE_ID_VIPER: | 807 | case PCI_DEVICE_ID_VIPER: |
809 | strcpy(str, "LPX1000 10"); | 808 | strcpy(str, "LPX1000 10"); |
@@ -812,10 +811,16 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) | |||
812 | strcpy(str, "LP982 2"); | 811 | strcpy(str, "LP982 2"); |
813 | break; | 812 | break; |
814 | case PCI_DEVICE_ID_TFLY: | 813 | case PCI_DEVICE_ID_TFLY: |
815 | strcpy(str, "LP1050 2"); | 814 | if (hdrtype == 0x80) |
815 | strcpy(str, "LP1050DC 2"); | ||
816 | else | ||
817 | strcpy(str, "LP1050 2"); | ||
816 | break; | 818 | break; |
817 | case PCI_DEVICE_ID_HELIOS: | 819 | case PCI_DEVICE_ID_HELIOS: |
818 | strcpy(str, "LP11000 4"); | 820 | if (hdrtype == 0x80) |
821 | strcpy(str, "LP11002 4"); | ||
822 | else | ||
823 | strcpy(str, "LP11000 4"); | ||
819 | break; | 824 | break; |
820 | case PCI_DEVICE_ID_BMID: | 825 | case PCI_DEVICE_ID_BMID: |
821 | strcpy(str, "LP1150 4"); | 826 | strcpy(str, "LP1150 4"); |
@@ -824,13 +829,16 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) | |||
824 | strcpy(str, "LP111 4"); | 829 | strcpy(str, "LP111 4"); |
825 | break; | 830 | break; |
826 | case PCI_DEVICE_ID_ZEPHYR: | 831 | case PCI_DEVICE_ID_ZEPHYR: |
827 | strcpy(str, "LP11000e 4"); | 832 | if (hdrtype == 0x80) |
833 | strcpy(str, "LPe11002 4"); | ||
834 | else | ||
835 | strcpy(str, "LPe11000 4"); | ||
828 | break; | 836 | break; |
829 | case PCI_DEVICE_ID_ZMID: | 837 | case PCI_DEVICE_ID_ZMID: |
830 | strcpy(str, "LP1150e 4"); | 838 | strcpy(str, "LPe1150 4"); |
831 | break; | 839 | break; |
832 | case PCI_DEVICE_ID_ZSMB: | 840 | case PCI_DEVICE_ID_ZSMB: |
833 | strcpy(str, "LP111e 4"); | 841 | strcpy(str, "LPe111 4"); |
834 | break; | 842 | break; |
835 | case PCI_DEVICE_ID_LP101: | 843 | case PCI_DEVICE_ID_LP101: |
836 | strcpy(str, "LP101 2"); | 844 | strcpy(str, "LP101 2"); |
@@ -862,8 +870,7 @@ lpfc_post_buffer(struct lpfc_hba * phba, struct lpfc_sli_ring * pring, int cnt, | |||
862 | int type) | 870 | int type) |
863 | { | 871 | { |
864 | IOCB_t *icmd; | 872 | IOCB_t *icmd; |
865 | struct list_head *lpfc_iocb_list = &phba->lpfc_iocb_list; | 873 | struct lpfc_iocbq *iocb; |
866 | struct lpfc_iocbq *iocb = NULL; | ||
867 | struct lpfc_dmabuf *mp1, *mp2; | 874 | struct lpfc_dmabuf *mp1, *mp2; |
868 | 875 | ||
869 | cnt += pring->missbufcnt; | 876 | cnt += pring->missbufcnt; |
@@ -872,13 +879,12 @@ lpfc_post_buffer(struct lpfc_hba * phba, struct lpfc_sli_ring * pring, int cnt, | |||
872 | while (cnt > 0) { | 879 | while (cnt > 0) { |
873 | /* Allocate buffer for command iocb */ | 880 | /* Allocate buffer for command iocb */ |
874 | spin_lock_irq(phba->host->host_lock); | 881 | spin_lock_irq(phba->host->host_lock); |
875 | list_remove_head(lpfc_iocb_list, iocb, struct lpfc_iocbq, list); | 882 | iocb = lpfc_sli_get_iocbq(phba); |
876 | spin_unlock_irq(phba->host->host_lock); | 883 | spin_unlock_irq(phba->host->host_lock); |
877 | if (iocb == NULL) { | 884 | if (iocb == NULL) { |
878 | pring->missbufcnt = cnt; | 885 | pring->missbufcnt = cnt; |
879 | return cnt; | 886 | return cnt; |
880 | } | 887 | } |
881 | memset(iocb, 0, sizeof (struct lpfc_iocbq)); | ||
882 | icmd = &iocb->iocb; | 888 | icmd = &iocb->iocb; |
883 | 889 | ||
884 | /* 2 buffers can be posted per command */ | 890 | /* 2 buffers can be posted per command */ |
@@ -891,7 +897,7 @@ lpfc_post_buffer(struct lpfc_hba * phba, struct lpfc_sli_ring * pring, int cnt, | |||
891 | if (mp1) | 897 | if (mp1) |
892 | kfree(mp1); | 898 | kfree(mp1); |
893 | spin_lock_irq(phba->host->host_lock); | 899 | spin_lock_irq(phba->host->host_lock); |
894 | list_add_tail(&iocb->list, lpfc_iocb_list); | 900 | lpfc_sli_release_iocbq(phba, iocb); |
895 | spin_unlock_irq(phba->host->host_lock); | 901 | spin_unlock_irq(phba->host->host_lock); |
896 | pring->missbufcnt = cnt; | 902 | pring->missbufcnt = cnt; |
897 | return cnt; | 903 | return cnt; |
@@ -910,7 +916,7 @@ lpfc_post_buffer(struct lpfc_hba * phba, struct lpfc_sli_ring * pring, int cnt, | |||
910 | lpfc_mbuf_free(phba, mp1->virt, mp1->phys); | 916 | lpfc_mbuf_free(phba, mp1->virt, mp1->phys); |
911 | kfree(mp1); | 917 | kfree(mp1); |
912 | spin_lock_irq(phba->host->host_lock); | 918 | spin_lock_irq(phba->host->host_lock); |
913 | list_add_tail(&iocb->list, lpfc_iocb_list); | 919 | lpfc_sli_release_iocbq(phba, iocb); |
914 | spin_unlock_irq(phba->host->host_lock); | 920 | spin_unlock_irq(phba->host->host_lock); |
915 | pring->missbufcnt = cnt; | 921 | pring->missbufcnt = cnt; |
916 | return cnt; | 922 | return cnt; |
@@ -947,7 +953,7 @@ lpfc_post_buffer(struct lpfc_hba * phba, struct lpfc_sli_ring * pring, int cnt, | |||
947 | kfree(mp2); | 953 | kfree(mp2); |
948 | cnt++; | 954 | cnt++; |
949 | } | 955 | } |
950 | list_add_tail(&iocb->list, lpfc_iocb_list); | 956 | lpfc_sli_release_iocbq(phba, iocb); |
951 | pring->missbufcnt = cnt; | 957 | pring->missbufcnt = cnt; |
952 | spin_unlock_irq(phba->host->host_lock); | 958 | spin_unlock_irq(phba->host->host_lock); |
953 | return cnt; | 959 | return cnt; |
@@ -1226,12 +1232,6 @@ lpfc_online(struct lpfc_hba * phba) | |||
1226 | phba->fc_flag &= ~FC_OFFLINE_MODE; | 1232 | phba->fc_flag &= ~FC_OFFLINE_MODE; |
1227 | spin_unlock_irq(phba->host->host_lock); | 1233 | spin_unlock_irq(phba->host->host_lock); |
1228 | 1234 | ||
1229 | /* | ||
1230 | * Restart all traffic to this host. Since the fc_transport block | ||
1231 | * functions (future) were not called in lpfc_offline, don't call them | ||
1232 | * here. | ||
1233 | */ | ||
1234 | scsi_unblock_requests(phba->host); | ||
1235 | return 0; | 1235 | return 0; |
1236 | } | 1236 | } |
1237 | 1237 | ||
@@ -1249,13 +1249,6 @@ lpfc_offline(struct lpfc_hba * phba) | |||
1249 | if (phba->fc_flag & FC_OFFLINE_MODE) | 1249 | if (phba->fc_flag & FC_OFFLINE_MODE) |
1250 | return 0; | 1250 | return 0; |
1251 | 1251 | ||
1252 | /* | ||
1253 | * Don't call the fc_transport block api (future). The device is | ||
1254 | * going offline and causing a timer to fire in the midlayer is | ||
1255 | * unproductive. Just block all new requests until the driver | ||
1256 | * comes back online. | ||
1257 | */ | ||
1258 | scsi_block_requests(phba->host); | ||
1259 | psli = &phba->sli; | 1252 | psli = &phba->sli; |
1260 | pring = &psli->ring[psli->fcp_ring]; | 1253 | pring = &psli->ring[psli->fcp_ring]; |
1261 | 1254 | ||
@@ -1333,6 +1326,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1333 | unsigned long bar0map_len, bar2map_len; | 1326 | unsigned long bar0map_len, bar2map_len; |
1334 | int error = -ENODEV, retval; | 1327 | int error = -ENODEV, retval; |
1335 | int i; | 1328 | int i; |
1329 | uint16_t iotag; | ||
1336 | 1330 | ||
1337 | if (pci_enable_device(pdev)) | 1331 | if (pci_enable_device(pdev)) |
1338 | goto out; | 1332 | goto out; |
@@ -1434,6 +1428,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1434 | if (!phba->slim2p) | 1428 | if (!phba->slim2p) |
1435 | goto out_iounmap; | 1429 | goto out_iounmap; |
1436 | 1430 | ||
1431 | memset(phba->slim2p, 0, SLI2_SLIM_SIZE); | ||
1437 | 1432 | ||
1438 | /* Initialize the SLI Layer to run with lpfc HBAs. */ | 1433 | /* Initialize the SLI Layer to run with lpfc HBAs. */ |
1439 | lpfc_sli_setup(phba); | 1434 | lpfc_sli_setup(phba); |
@@ -1456,6 +1451,15 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1456 | } | 1451 | } |
1457 | 1452 | ||
1458 | memset(iocbq_entry, 0, sizeof(struct lpfc_iocbq)); | 1453 | memset(iocbq_entry, 0, sizeof(struct lpfc_iocbq)); |
1454 | iotag = lpfc_sli_next_iotag(phba, iocbq_entry); | ||
1455 | if (iotag == 0) { | ||
1456 | kfree (iocbq_entry); | ||
1457 | printk(KERN_ERR "%s: failed to allocate IOTAG. " | ||
1458 | "Unloading driver.\n", | ||
1459 | __FUNCTION__); | ||
1460 | error = -ENOMEM; | ||
1461 | goto out_free_iocbq; | ||
1462 | } | ||
1459 | spin_lock_irq(phba->host->host_lock); | 1463 | spin_lock_irq(phba->host->host_lock); |
1460 | list_add(&iocbq_entry->list, &phba->lpfc_iocb_list); | 1464 | list_add(&iocbq_entry->list, &phba->lpfc_iocb_list); |
1461 | phba->total_iocbq_bufs++; | 1465 | phba->total_iocbq_bufs++; |
@@ -1702,6 +1706,7 @@ MODULE_DEVICE_TABLE(pci, lpfc_id_table); | |||
1702 | 1706 | ||
1703 | static struct pci_driver lpfc_driver = { | 1707 | static struct pci_driver lpfc_driver = { |
1704 | .name = LPFC_DRIVER_NAME, | 1708 | .name = LPFC_DRIVER_NAME, |
1709 | .owner = THIS_MODULE, | ||
1705 | .id_table = lpfc_id_table, | 1710 | .id_table = lpfc_id_table, |
1706 | .probe = lpfc_pci_probe_one, | 1711 | .probe = lpfc_pci_probe_one, |
1707 | .remove = __devexit_p(lpfc_pci_remove_one), | 1712 | .remove = __devexit_p(lpfc_pci_remove_one), |