Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] qla4xxx: ql4_os.c bugfixes

Free memory resources after invoking free_irq() in
qla4xxx_free_adapter(). QLA4xxx has two pci functions per port
(Ethernet and iSCSI). When one of these PCI functions issues a HBA
reset, all other functions are notified and need to acknowledge and
re-initialize. During module qla4xxx_remove_adapter() gets
invoked. This function needs to wait if it is currently responding to
a reset from another function.

Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

David C Somayajulu and committed by
James Bottomley
bee4fe8e c0e344c9

+13 -4
+13 -4
drivers/scsi/qla4xxx/ql4_os.c
··· 10 10 #include <scsi/scsicam.h> 11 11 12 12 #include "ql4_def.h" 13 + #include "ql4_version.h" 14 + #include "ql4_glbl.h" 15 + #include "ql4_dbg.h" 16 + #include "ql4_inline.h" 13 17 14 18 /* 15 19 * Driver version ··· 715 711 return stat; 716 712 } 717 713 718 - static void qla4xxx_hw_reset(struct scsi_qla_host *ha) 714 + void qla4xxx_hw_reset(struct scsi_qla_host *ha) 719 715 { 720 716 uint32_t ctrl_status; 721 717 unsigned long flags = 0; ··· 1085 1081 if (ha->timer_active) 1086 1082 qla4xxx_stop_timer(ha); 1087 1083 1088 - /* free extra memory */ 1089 - qla4xxx_mem_free(ha); 1090 - 1091 1084 /* Detach interrupts */ 1092 1085 if (test_and_clear_bit(AF_IRQ_ATTACHED, &ha->flags)) 1093 1086 free_irq(ha->pdev->irq, ha); 1087 + 1088 + /* free extra memory */ 1089 + qla4xxx_mem_free(ha); 1094 1090 1095 1091 pci_disable_device(ha->pdev); 1096 1092 ··· 1335 1331 struct scsi_qla_host *ha; 1336 1332 1337 1333 ha = pci_get_drvdata(pdev); 1334 + 1335 + qla4xxx_disable_intrs(ha); 1336 + 1337 + while (test_bit(DPC_RESET_HA_INTR, &ha->dpc_flags)) 1338 + ssleep(1); 1338 1339 1339 1340 /* remove devs from iscsi_sessions to scsi_devices */ 1340 1341 qla4xxx_free_ddb_list(ha);