Skip to content

Commit

Permalink
[SCSI] qla4xxx: ql4_os.c bugfixes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David C Somayajulu authored and James Bottomley committed May 26, 2007
1 parent c0e344c commit bee4fe8
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions drivers/scsi/qla4xxx/ql4_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#include <scsi/scsicam.h>

#include "ql4_def.h"
#include "ql4_version.h"
#include "ql4_glbl.h"
#include "ql4_dbg.h"
#include "ql4_inline.h"

/*
* Driver version
Expand Down Expand Up @@ -711,7 +715,7 @@ static int qla4xxx_cmd_wait(struct scsi_qla_host *ha)
return stat;
}

static void qla4xxx_hw_reset(struct scsi_qla_host *ha)
void qla4xxx_hw_reset(struct scsi_qla_host *ha)
{
uint32_t ctrl_status;
unsigned long flags = 0;
Expand Down Expand Up @@ -1081,13 +1085,13 @@ static void qla4xxx_free_adapter(struct scsi_qla_host *ha)
if (ha->timer_active)
qla4xxx_stop_timer(ha);

/* free extra memory */
qla4xxx_mem_free(ha);

/* Detach interrupts */
if (test_and_clear_bit(AF_IRQ_ATTACHED, &ha->flags))
free_irq(ha->pdev->irq, ha);

/* free extra memory */
qla4xxx_mem_free(ha);

pci_disable_device(ha->pdev);

}
Expand Down Expand Up @@ -1332,6 +1336,11 @@ static void __devexit qla4xxx_remove_adapter(struct pci_dev *pdev)

ha = pci_get_drvdata(pdev);

qla4xxx_disable_intrs(ha);

while (test_bit(DPC_RESET_HA_INTR, &ha->dpc_flags))
ssleep(1);

/* remove devs from iscsi_sessions to scsi_devices */
qla4xxx_free_ddb_list(ha);

Expand Down

0 comments on commit bee4fe8

Please sign in to comment.