aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorVikas Chaudhary <vikas.chaudhary@qlogic.com>2010-10-07 01:50:56 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-10-25 15:53:42 -0400
commit7b3595df0e064c8d85ddb6836aaa2af3956fb2ba (patch)
tree21081bc21edc0421c96036e347e2a4cc11a04a5c /drivers/scsi
parentb25ee66f2d4e5f14e69d75a7363e55889e9aff92 (diff)
[SCSI] qla4xxx: update AER support for ISP82XX
* Cleanup qla4xxx_pci_mmio_enabled(): don't want to return PCI_ERS_NEED_RESET if firmware hung. IDC will take care of it. * Request irq after initialize_adapter() in qla82xx_error_recovery(). * Return all active commands from qla4xxx_pci_error_detected(). * Cleanup ql4_def.h Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: Ravi Anand <ravi.anand@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla4xxx/ql4_def.h19
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c45
2 files changed, 29 insertions, 35 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index f595ab13c2e1..0f3bfc3da5cf 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -24,6 +24,7 @@
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/mutex.h> 26#include <linux/mutex.h>
27#include <linux/aer.h>
27 28
28#include <net/tcp.h> 29#include <net/tcp.h>
29#include <scsi/scsi.h> 30#include <scsi/scsi.h>
@@ -36,24 +37,6 @@
36#include "ql4_dbg.h" 37#include "ql4_dbg.h"
37#include "ql4_nx.h" 38#include "ql4_nx.h"
38 39
39#if defined(CONFIG_PCIEAER)
40#include <linux/aer.h>
41#else
42/* AER releated */
43static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
44{
45 return -EINVAL;
46}
47static inline int pci_disable_pcie_error_reporting(struct pci_dev *dev)
48{
49 return -EINVAL;
50}
51static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
52{
53 return -EINVAL;
54}
55#endif
56
57#ifndef PCI_DEVICE_ID_QLOGIC_ISP4010 40#ifndef PCI_DEVICE_ID_QLOGIC_ISP4010
58#define PCI_DEVICE_ID_QLOGIC_ISP4010 0x4010 41#define PCI_DEVICE_ID_QLOGIC_ISP4010 0x4010
59#endif 42#endif
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 779745f4e59c..4b6cdb68a52a 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -2252,6 +2252,8 @@ qla4xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
2252 qla4xxx_mailbox_premature_completion(ha); 2252 qla4xxx_mailbox_premature_completion(ha);
2253 qla4xxx_free_irqs(ha); 2253 qla4xxx_free_irqs(ha);
2254 pci_disable_device(pdev); 2254 pci_disable_device(pdev);
2255 /* Return back all IOs */
2256 qla4xxx_abort_active_cmds(ha, DID_RESET << 16);
2255 return PCI_ERS_RESULT_NEED_RESET; 2257 return PCI_ERS_RESULT_NEED_RESET;
2256 case pci_channel_io_perm_failure: 2258 case pci_channel_io_perm_failure:
2257 set_bit(AF_EEH_BUSY, &ha->flags); 2259 set_bit(AF_EEH_BUSY, &ha->flags);
@@ -2275,17 +2277,13 @@ qla4xxx_pci_mmio_enabled(struct pci_dev *pdev)
2275 if (!is_aer_supported(ha)) 2277 if (!is_aer_supported(ha))
2276 return PCI_ERS_RESULT_NONE; 2278 return PCI_ERS_RESULT_NONE;
2277 2279
2278 if (test_bit(AF_FW_RECOVERY, &ha->flags)) { 2280 return PCI_ERS_RESULT_RECOVERED;
2279 ql4_printk(KERN_WARNING, ha, "scsi%ld: %s: firmware hang -- "
2280 "mmio_enabled\n", ha->host_no, __func__);
2281 return PCI_ERS_RESULT_NEED_RESET;
2282 } else
2283 return PCI_ERS_RESULT_RECOVERED;
2284} 2281}
2285 2282
2286uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha) 2283static uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha)
2287{ 2284{
2288 uint32_t rval = QLA_ERROR; 2285 uint32_t rval = QLA_ERROR;
2286 uint32_t ret = 0;
2289 int fn; 2287 int fn;
2290 struct pci_dev *other_pdev = NULL; 2288 struct pci_dev *other_pdev = NULL;
2291 2289
@@ -2297,7 +2295,6 @@ uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha)
2297 clear_bit(AF_ONLINE, &ha->flags); 2295 clear_bit(AF_ONLINE, &ha->flags);
2298 qla4xxx_mark_all_devices_missing(ha); 2296 qla4xxx_mark_all_devices_missing(ha);
2299 qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS); 2297 qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS);
2300 qla4xxx_abort_active_cmds(ha, DID_RESET << 16);
2301 } 2298 }
2302 2299
2303 fn = PCI_FUNC(ha->pdev->devfn); 2300 fn = PCI_FUNC(ha->pdev->devfn);
@@ -2360,7 +2357,16 @@ uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha)
2360 /* Clear driver state register */ 2357 /* Clear driver state register */
2361 qla4_8xxx_wr_32(ha, QLA82XX_CRB_DRV_STATE, 0); 2358 qla4_8xxx_wr_32(ha, QLA82XX_CRB_DRV_STATE, 0);
2362 qla4_8xxx_set_drv_active(ha); 2359 qla4_8xxx_set_drv_active(ha);
2363 ha->isp_ops->enable_intrs(ha); 2360 ret = qla4xxx_request_irqs(ha);
2361 if (ret) {
2362 ql4_printk(KERN_WARNING, ha, "Failed to "
2363 "reserve interrupt %d already in use.\n",
2364 ha->pdev->irq);
2365 rval = QLA_ERROR;
2366 } else {
2367 ha->isp_ops->enable_intrs(ha);
2368 rval = QLA_SUCCESS;
2369 }
2364 } 2370 }
2365 qla4_8xxx_idc_unlock(ha); 2371 qla4_8xxx_idc_unlock(ha);
2366 } else { 2372 } else {
@@ -2372,8 +2378,18 @@ uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha)
2372 clear_bit(AF_FW_RECOVERY, &ha->flags); 2378 clear_bit(AF_FW_RECOVERY, &ha->flags);
2373 rval = qla4xxx_initialize_adapter(ha, 2379 rval = qla4xxx_initialize_adapter(ha,
2374 PRESERVE_DDB_LIST); 2380 PRESERVE_DDB_LIST);
2375 if (rval == QLA_SUCCESS) 2381 if (rval == QLA_SUCCESS) {
2376 ha->isp_ops->enable_intrs(ha); 2382 ret = qla4xxx_request_irqs(ha);
2383 if (ret) {
2384 ql4_printk(KERN_WARNING, ha, "Failed to"
2385 " reserve interrupt %d already in"
2386 " use.\n", ha->pdev->irq);
2387 rval = QLA_ERROR;
2388 } else {
2389 ha->isp_ops->enable_intrs(ha);
2390 rval = QLA_SUCCESS;
2391 }
2392 }
2377 qla4_8xxx_idc_lock(ha); 2393 qla4_8xxx_idc_lock(ha);
2378 qla4_8xxx_set_drv_active(ha); 2394 qla4_8xxx_set_drv_active(ha);
2379 qla4_8xxx_idc_unlock(ha); 2395 qla4_8xxx_idc_unlock(ha);
@@ -2415,12 +2431,7 @@ qla4xxx_pci_slot_reset(struct pci_dev *pdev)
2415 goto exit_slot_reset; 2431 goto exit_slot_reset;
2416 } 2432 }
2417 2433
2418 ret = qla4xxx_request_irqs(ha); 2434 ha->isp_ops->disable_intrs(ha);
2419 if (ret) {
2420 ql4_printk(KERN_WARNING, ha, "Failed to reserve interrupt %d"
2421 " already in use.\n", pdev->irq);
2422 goto exit_slot_reset;
2423 }
2424 2435
2425 if (is_qla8022(ha)) { 2436 if (is_qla8022(ha)) {
2426 if (qla4_8xxx_error_recovery(ha) == QLA_SUCCESS) { 2437 if (qla4_8xxx_error_recovery(ha) == QLA_SUCCESS) {