diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2009-06-03 12:55:30 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-08 15:47:00 -0400 |
commit | 18e7555a38eaadb757353c4b76667e07166ad26c (patch) | |
tree | 3b8b0f43076aff5d87c0c8800fb3c4a221af78a0 /drivers/scsi/qla2xxx/qla_init.c | |
parent | 656e89122a737b60cebc7b8fcb669faf0e7bc905 (diff) |
[SCSI] qla2xxx: Synchronize MPI settings after a PE Reset.
Ensure MPS remains in synchronization across all NIC/FCoE
functions after a reset.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 36cea2224b3c..262026129325 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -886,6 +886,56 @@ cont_alloc: | |||
886 | htonl(offsetof(struct qla2xxx_fw_dump, isp)); | 886 | htonl(offsetof(struct qla2xxx_fw_dump, isp)); |
887 | } | 887 | } |
888 | 888 | ||
889 | static int | ||
890 | qla81xx_mpi_sync(scsi_qla_host_t *vha) | ||
891 | { | ||
892 | #define MPS_MASK 0xe0 | ||
893 | int rval; | ||
894 | uint16_t dc; | ||
895 | uint32_t dw; | ||
896 | struct qla_hw_data *ha = vha->hw; | ||
897 | |||
898 | if (!IS_QLA81XX(vha->hw)) | ||
899 | return QLA_SUCCESS; | ||
900 | |||
901 | rval = qla2x00_write_ram_word(vha, 0x7c00, 1); | ||
902 | if (rval != QLA_SUCCESS) { | ||
903 | DEBUG2(qla_printk(KERN_WARNING, ha, | ||
904 | "Sync-MPI: Unable to acquire semaphore.\n")); | ||
905 | goto done; | ||
906 | } | ||
907 | |||
908 | pci_read_config_word(vha->hw->pdev, 0x54, &dc); | ||
909 | rval = qla2x00_read_ram_word(vha, 0x7a15, &dw); | ||
910 | if (rval != QLA_SUCCESS) { | ||
911 | DEBUG2(qla_printk(KERN_WARNING, ha, | ||
912 | "Sync-MPI: Unable to read sync.\n")); | ||
913 | goto done_release; | ||
914 | } | ||
915 | |||
916 | dc &= MPS_MASK; | ||
917 | if (dc == (dw & MPS_MASK)) | ||
918 | goto done_release; | ||
919 | |||
920 | dw &= ~MPS_MASK; | ||
921 | dw |= dc; | ||
922 | rval = qla2x00_write_ram_word(vha, 0x7a15, dw); | ||
923 | if (rval != QLA_SUCCESS) { | ||
924 | DEBUG2(qla_printk(KERN_WARNING, ha, | ||
925 | "Sync-MPI: Unable to gain sync.\n")); | ||
926 | } | ||
927 | |||
928 | done_release: | ||
929 | rval = qla2x00_write_ram_word(vha, 0x7c00, 0); | ||
930 | if (rval != QLA_SUCCESS) { | ||
931 | DEBUG2(qla_printk(KERN_WARNING, ha, | ||
932 | "Sync-MPI: Unable to release semaphore.\n")); | ||
933 | } | ||
934 | |||
935 | done: | ||
936 | return rval; | ||
937 | } | ||
938 | |||
889 | /** | 939 | /** |
890 | * qla2x00_setup_chip() - Load and start RISC firmware. | 940 | * qla2x00_setup_chip() - Load and start RISC firmware. |
891 | * @ha: HA context | 941 | * @ha: HA context |
@@ -910,6 +960,8 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) | |||
910 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 960 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
911 | } | 961 | } |
912 | 962 | ||
963 | qla81xx_mpi_sync(vha); | ||
964 | |||
913 | /* Load firmware sequences */ | 965 | /* Load firmware sequences */ |
914 | rval = ha->isp_ops->load_risc(vha, &srisc_address); | 966 | rval = ha->isp_ops->load_risc(vha, &srisc_address); |
915 | if (rval == QLA_SUCCESS) { | 967 | if (rval == QLA_SUCCESS) { |