From: <bva...@us...> - 2012-07-29 14:24:05
|
Revision: 4438 http://scst.svn.sourceforge.net/scst/?rev=4438&view=rev Author: bvassche Date: 2012-07-29 14:23:58 +0000 (Sun, 29 Jul 2012) Log Message: ----------- qla2x00t: Fix a deadlock crash The symptom of the crash is that one finds the system deadlocked spinning on scsi_qla_host_t.hardware_lock in qla2x00_enable_tgt_mode with a stack something like this: crash> bt PID: 6155 TASK: ffff88006e4bc3c0 CPU: 1 COMMAND: "scst_uid" #0 [ffff88007b915b28] machine_kexec at ffffffff8103163b #1 [ffff88007b915b88] crash_kexec at ffffffff810b8e52 #2 [ffff88007b915c58] panic at ffffffff814ed0ab #3 [ffff88007b915cd8] spin_bug at ffffffff8127cd46 #4 [ffff88007b915d18] _raw_spin_lock at ffffffff8127d015 #5 [ffff88007b915d68] _spin_lock_irqsave at ffffffff814f02e4 #6 [ffff88007b915d88] qla2x00_enable_tgt_mode at ffffffffa047b672 [qla2xxx] #7 [ffff88007b915db8] q2t_host_action at ffffffffa06db6a6 [qla2x00tgt] #8 [ffff88007b915df8] q2t_enable_tgt at ffffffffa06db6ea [qla2x00tgt] #9 [ffff88007b915e18] scst_process_tgt_enable_store at ffffffffa04f102e [scst] #10 [ffff88007b915e48] scst_tgt_enable_store_work_fn at ffffffffa04f1176 [scst] #11 [ffff88007b915e58] scst_process_sysfs_works at ffffffffa04e8bbe [scst] #12 [ffff88007b915e78] sysfs_work_thread_fn at ffffffffa04e8db5 [scst] #13 [ffff88007b915ed8] kthread at ffffffff8108f976 #14 [ffff88007b915f48] kernel_thread at ffffffff8100c20a I was pulling my hair out on this one, because with the spinlock debugging (enhanced to capture the PID along with the task pointer), I figured out that the task (and process) that originally locked the lock was gone! It got really confusing when I added more spinlock debug code to the kernel to detect locks held in the task switching and task/process termination paths -- and didn't catch anything terminating with locks held! I finally tracked the problem down to two things: 1. When qla24xx_create_vhost creates a new virtual scsi_qla_host_t it does it by copying the physical (aka parent) scsi_qla_host_t. Under the right unlucky conditions, this can happen with the hardware_lock held (the spinlock is embedded in the structure). 2. The code should only be locking the hardware_lock of the physical scsi_qla_host_t, because the lock is associated with the hardware. Unfortunately, quite a few places are not using to_qla_parent to make sure they lock the correct lock. One of those places is qla2x00_enable_tgt_mode. Along with the deadlock, this has the potential to leave the hardware and driver structures in unpredictable states, because the lock isn't always providing serialization. The fix entails two things: 1. Zeroing the lock after copying the scsi_qla_host_t structure: This won't stop the deadlock, but will enable the spinlock debug code to easily catch anything that misbehaves and locks the wrong lock. I also initialized the other locks because they could have the same problem. I also initialized the list heads, because they could end up holding dangling references. I did not initialize all pointers, because there are quite a few that point to read only data and are OK (and I didn't have time to research all of them). 2. Using to_qla_parent everywhere when locking and the scsi_qla_host_t structure might be virtual. This is a lot of changes, but they are the same thing over and over again. I did not make an effort to look for scalar or pointer fields that are being picked from the wrong structure. That's getting to be as much pain as merging up to the latest QLogic driver (which would have gotten rid of this problem). >From "Robinson, Herbie" <Her...@st...> (Merge r4420 from trunk) Revision Links: -------------- http://scst.svn.sourceforge.net/scst/?rev=4420&view=rev Modified Paths: -------------- branches/2.2.x/qla2x00t/qla2x_tgt.h branches/2.2.x/qla2x00t/qla_attr.c branches/2.2.x/qla2x00t/qla_init.c branches/2.2.x/qla2x00t/qla_iocb.c branches/2.2.x/qla2x00t/qla_isr.c branches/2.2.x/qla2x00t/qla_mbx.c branches/2.2.x/qla2x00t/qla_mid.c branches/2.2.x/qla2x00t/qla_os.c branches/2.2.x/qla2x00t/qla_sup.c Property Changed: ---------------- branches/2.2.x/qla2x00t/ Property changes on: branches/2.2.x/qla2x00t ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/qla2x00t:3583,4099,4101,4311,4380,4418 + /trunk/qla2x00t:3583,4099,4101,4311,4380,4418,4420 Modified: branches/2.2.x/qla2x00t/qla2x_tgt.h =================================================================== --- branches/2.2.x/qla2x00t/qla2x_tgt.h 2012-07-29 14:21:14 UTC (rev 4437) +++ branches/2.2.x/qla2x00t/qla2x_tgt.h 2012-07-29 14:23:58 UTC (rev 4438) @@ -122,9 +122,10 @@ { if (!IS_FWI2_CAPABLE(ha)) { unsigned long flags; - spin_lock_irqsave(&ha->hardware_lock, flags); + scsi_qla_host_t *pha = to_qla_parent(ha); + spin_lock_irqsave(&pha->hardware_lock, flags); __qla2x00_send_enable_lun(ha, enable); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); } } Modified: branches/2.2.x/qla2x00t/qla_attr.c =================================================================== --- branches/2.2.x/qla2x00t/qla_attr.c 2012-07-29 14:21:14 UTC (rev 4437) +++ branches/2.2.x/qla2x00t/qla_attr.c 2012-07-29 14:23:58 UTC (rev 4438) @@ -36,6 +36,7 @@ struct device_attribute *attr, const char *buffer, size_t size) { struct scsi_qla_host *ha = shost_priv(class_to_shost(dev)); + scsi_qla_host_t *pha = to_qla_parent(ha); int reset = 0; unsigned long flags; int res = size; @@ -43,7 +44,7 @@ if (buffer == NULL) goto out; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); switch (buffer[0]) { case '0': @@ -76,7 +77,7 @@ goto out_unlock; } - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); if (reset) set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); @@ -85,7 +86,7 @@ return size; out_unlock: - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); goto out; } @@ -176,12 +177,13 @@ struct device_attribute *attr, const char *buffer, size_t size) { struct scsi_qla_host *ha = shost_priv(class_to_shost(dev)); + scsi_qla_host_t *pha = to_qla_parent(ha); unsigned long flags; if (buffer == NULL) return size; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); switch (buffer[0]) { case '0': @@ -202,7 +204,7 @@ break; } - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); return size; } @@ -232,12 +234,13 @@ struct device_attribute *attr, const char *buffer, size_t size) { struct scsi_qla_host *ha = shost_priv(class_to_shost(dev)); + scsi_qla_host_t *pha = to_qla_parent(ha); unsigned long flags; if (buffer == NULL) return size; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); switch (buffer[0]) { case '0': @@ -264,7 +267,7 @@ break; } - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); qla2xxx_wake_dpc(ha); @@ -274,7 +277,7 @@ return size; out_unlock: - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); goto out; } Modified: branches/2.2.x/qla2x00t/qla_init.c =================================================================== --- branches/2.2.x/qla2x00t/qla_init.c 2012-07-29 14:21:14 UTC (rev 4437) +++ branches/2.2.x/qla2x00t/qla_init.c 2012-07-29 14:23:58 UTC (rev 4438) @@ -4143,10 +4143,11 @@ qla2x00_enable_tgt_mode(scsi_qla_host_t *ha) { unsigned long flags; + scsi_qla_host_t *pha = to_qla_parent(ha); - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); qla_set_tgt_mode(ha); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); if (ha->parent) ha = ha->parent; Modified: branches/2.2.x/qla2x00t/qla_iocb.c =================================================================== --- branches/2.2.x/qla2x00t/qla_iocb.c 2012-07-29 14:21:14 UTC (rev 4437) +++ branches/2.2.x/qla2x00t/qla_iocb.c 2012-07-29 14:23:58 UTC (rev 4438) @@ -268,7 +268,7 @@ { int ret, nseg; unsigned long flags; - scsi_qla_host_t *ha; + scsi_qla_host_t *ha, *pha; struct scsi_cmnd *cmd; uint32_t *clr_ptr; uint32_t index; @@ -282,6 +282,7 @@ /* Setup device pointers. */ ret = 0; ha = sp->ha; + pha = to_qla_parent(ha); reg = &ha->iobase->isp; cmd = sp->cmd; /* So we know we haven't pci_map'ed anything yet */ @@ -296,7 +297,7 @@ } /* Acquire ring specific lock */ - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); /* Check for room in outstanding command list. */ handle = ha->current_outstanding_cmd; @@ -385,14 +386,14 @@ ha->response_ring_ptr->signature != RESPONSE_PROCESSED) qla2x00_process_response_queue(ha); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); return (QLA_SUCCESS); queuing_error: if (tot_dsds) scsi_dma_unmap(cmd); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); return (QLA_FUNCTION_FAILED); } @@ -477,6 +478,7 @@ qla2x00_req_pkt(scsi_qla_host_t *ha) { device_reg_t __iomem *reg = ha->iobase; + scsi_qla_host_t *pha = to_qla_parent(ha); request_t *pkt = NULL; uint16_t cnt; uint32_t *dword_ptr; @@ -519,7 +521,7 @@ } /* Release ring specific lock */ - spin_unlock(&ha->hardware_lock); + spin_unlock(&pha->hardware_lock); udelay(2); /* 2 us */ @@ -528,7 +530,7 @@ if (!ha->marker_needed && !ha->flags.init_done) qla2x00_poll(ha); - spin_lock_irq(&ha->hardware_lock); + spin_lock_irq(&pha->hardware_lock); } if (!pkt) { DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__)); Modified: branches/2.2.x/qla2x00t/qla_isr.c =================================================================== --- branches/2.2.x/qla2x00t/qla_isr.c 2012-07-29 14:21:14 UTC (rev 4437) +++ branches/2.2.x/qla2x00t/qla_isr.c 2012-07-29 14:23:58 UTC (rev 4438) @@ -2018,6 +2018,7 @@ { int ret; device_reg_t __iomem *reg = ha->iobase; + scsi_qla_host_t *pha = to_qla_parent(ha); /* If possible, enable MSI-X. */ if (!IS_QLA2432(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha)) @@ -2078,7 +2079,7 @@ clear_risc_ints: ha->isp_ops->disable_intrs(ha); - spin_lock_irq(&ha->hardware_lock); + spin_lock_irq(&pha->hardware_lock); if (IS_FWI2_CAPABLE(ha)) { WRT_REG_DWORD(®->isp24.hccr, HCCRX_CLR_HOST_INT); WRT_REG_DWORD(®->isp24.hccr, HCCRX_CLR_RISC_INT); @@ -2087,7 +2088,7 @@ WRT_REG_WORD(®->isp.hccr, HCCR_CLR_RISC_INT); WRT_REG_WORD(®->isp.hccr, HCCR_CLR_HOST_INT); } - spin_unlock_irq(&ha->hardware_lock); + spin_unlock_irq(&pha->hardware_lock); fail: return ret; Modified: branches/2.2.x/qla2x00t/qla_mbx.c =================================================================== --- branches/2.2.x/qla2x00t/qla_mbx.c 2012-07-29 14:21:14 UTC (rev 4437) +++ branches/2.2.x/qla2x00t/qla_mbx.c 2012-07-29 14:23:58 UTC (rev 4438) @@ -742,6 +742,7 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp) { unsigned long flags = 0; + scsi_qla_host_t *pha = to_qla_parent(ha); fc_port_t *fcport; int rval; uint32_t handle; @@ -752,12 +753,12 @@ fcport = sp->fcport; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { if (ha->outstanding_cmds[handle] == sp) break; } - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); if (handle == MAX_OUTSTANDING_COMMANDS) { /* command not found */ @@ -2309,7 +2310,7 @@ int rval; fc_port_t *fcport; unsigned long flags = 0; - + scsi_qla_host_t *pha = to_qla_parent(ha); struct abort_entry_24xx *abt; dma_addr_t abt_dma; uint32_t handle; @@ -2318,12 +2319,12 @@ fcport = sp->fcport; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { if (ha->outstanding_cmds[handle] == sp) break; } - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); if (handle == MAX_OUTSTANDING_COMMANDS) { /* Command not found. */ return QLA_FUNCTION_FAILED; Modified: branches/2.2.x/qla2x00t/qla_mid.c =================================================================== --- branches/2.2.x/qla2x00t/qla_mid.c 2012-07-29 14:21:14 UTC (rev 4437) +++ branches/2.2.x/qla2x00t/qla_mid.c 2012-07-29 14:23:58 UTC (rev 4438) @@ -385,6 +385,13 @@ /* clone the parent hba */ memcpy(vha, ha, sizeof (scsi_qla_host_t)); + memset(&vha->hardware_lock, 0, sizeof(spinlock_t)); + INIT_LIST_HEAD(&vha->vp_list); + spin_lock_init(&vha->dpc_lock); + mutex_init(&vha->tgt_mutex); + mutex_init(&vha->tgt_host_action_mutex); + INIT_LIST_HEAD(&vha->ha_list_entry); + fc_vport->dd_data = vha; vha->node_name = kmalloc(WWN_SIZE * sizeof(char), GFP_KERNEL); Modified: branches/2.2.x/qla2x00t/qla_os.c =================================================================== --- branches/2.2.x/qla2x00t/qla_os.c 2012-07-29 14:21:14 UTC (rev 4437) +++ branches/2.2.x/qla2x00t/qla_os.c 2012-07-29 14:23:58 UTC (rev 4438) @@ -1307,14 +1307,15 @@ qla2x00_enable_intrs(scsi_qla_host_t *ha) { unsigned long flags = 0; + scsi_qla_host_t *pha = to_qla_parent(ha); struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); ha->interrupts_on = 1; /* enable risc and host interrupts */ WRT_REG_WORD(®->ictrl, ICR_EN_INT | ICR_EN_RISC); RD_REG_WORD(®->ictrl); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); } @@ -1322,40 +1323,43 @@ qla2x00_disable_intrs(scsi_qla_host_t *ha) { unsigned long flags = 0; + scsi_qla_host_t *pha = to_qla_parent(ha); struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); ha->interrupts_on = 0; /* disable risc and host interrupts */ WRT_REG_WORD(®->ictrl, 0); RD_REG_WORD(®->ictrl); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); } static void qla24xx_enable_intrs(scsi_qla_host_t *ha) { unsigned long flags = 0; + scsi_qla_host_t *pha = to_qla_parent(ha); struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); ha->interrupts_on = 1; WRT_REG_DWORD(®->ictrl, ICRX_EN_RISC_INT); RD_REG_DWORD(®->ictrl); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); } static void qla24xx_disable_intrs(scsi_qla_host_t *ha) { unsigned long flags = 0; + scsi_qla_host_t *pha = to_qla_parent(ha); struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); ha->interrupts_on = 0; WRT_REG_DWORD(®->ictrl, 0); RD_REG_DWORD(®->ictrl); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); } static struct isp_operations qla2100_isp_ops = { Modified: branches/2.2.x/qla2x00t/qla_sup.c =================================================================== --- branches/2.2.x/qla2x00t/qla_sup.c 2012-07-29 14:21:14 UTC (rev 4437) +++ branches/2.2.x/qla2x00t/qla_sup.c 2012-07-29 14:23:58 UTC (rev 4438) @@ -836,10 +836,11 @@ uint32_t i; uint16_t *wptr; unsigned long flags; + scsi_qla_host_t *pha = to_qla_parent(ha); ret = QLA_SUCCESS; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); qla2x00_lock_nvram_access(ha); /* Disable NVRAM write-protection. */ @@ -856,7 +857,7 @@ qla2x00_set_nvram_protection(ha, stat); qla2x00_unlock_nvram_access(ha); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); return ret; } @@ -870,10 +871,11 @@ uint32_t *dwptr; struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; unsigned long flags; + scsi_qla_host_t *pha = to_qla_parent(ha); ret = QLA_SUCCESS; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); /* Enable flash write. */ WRT_REG_DWORD(®->ctrl_status, RD_REG_DWORD(®->ctrl_status) | CSRX_FLASH_ENABLE); @@ -907,7 +909,7 @@ WRT_REG_DWORD(®->ctrl_status, RD_REG_DWORD(®->ctrl_status) & ~CSRX_FLASH_ENABLE); RD_REG_DWORD(®->ctrl_status); /* PCI Posting. */ - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); return ret; } @@ -986,8 +988,9 @@ uint16_t led_color = 0; unsigned long flags; struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; + scsi_qla_host_t *pha = to_qla_parent(ha); - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); /* Save the Original GPIOE. */ if (ha->pio_address) { @@ -1024,7 +1027,7 @@ RD_REG_WORD(®->gpiod); } - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); } int @@ -1034,6 +1037,7 @@ uint16_t gpio_data; unsigned long flags; struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; + scsi_qla_host_t *pha = to_qla_parent(ha); ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING; ha->fw_options[1] |= FO1_DISABLE_GPIO6_7; @@ -1045,7 +1049,7 @@ } /* Turn off LEDs. */ - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); if (ha->pio_address) { gpio_enable = RD_REG_WORD_PIO(PIO_REG(ha, gpioe)); gpio_data = RD_REG_WORD_PIO(PIO_REG(ha, gpiod)); @@ -1071,7 +1075,7 @@ WRT_REG_WORD(®->gpiod, gpio_data); RD_REG_WORD(®->gpiod); } - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); /* * Let the per HBA timer kick off the blinking process based on @@ -1131,9 +1135,10 @@ uint32_t gpio_data; unsigned long flags; struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; + scsi_qla_host_t *pha = to_qla_parent(ha); /* Save the Original GPIOD. */ - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); gpio_data = RD_REG_DWORD(®->gpiod); /* Enable the gpio_data reg for update. */ @@ -1154,7 +1159,7 @@ /* Set the modified gpio_data values. */ WRT_REG_DWORD(®->gpiod, gpio_data); gpio_data = RD_REG_DWORD(®->gpiod); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); } int @@ -1165,6 +1170,8 @@ struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; if (ha->beacon_blink_led == 0) { + scsi_qla_host_t *pha = to_qla_parent(ha); + /* Enable firmware for update */ ha->fw_options[1] |= ADD_FO1_DISABLE_GPIO_LED_CTRL; @@ -1178,7 +1185,7 @@ return QLA_FUNCTION_FAILED; } - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); gpio_data = RD_REG_DWORD(®->gpiod); /* Enable the gpio_data reg for update. */ @@ -1186,7 +1193,7 @@ WRT_REG_DWORD(®->gpiod, gpio_data); RD_REG_DWORD(®->gpiod); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); } /* So all colors blink together. */ @@ -1204,6 +1211,7 @@ uint32_t gpio_data; unsigned long flags; struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; + scsi_qla_host_t *pha = to_qla_parent(ha); ha->beacon_blink_led = 0; ha->beacon_color_state = QLA_LED_ALL_ON; @@ -1211,14 +1219,14 @@ ha->isp_ops->beacon_blink(ha); /* Will flip to all off. */ /* Give control back to firmware. */ - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); gpio_data = RD_REG_DWORD(®->gpiod); /* Disable the gpio_data reg for update. */ gpio_data &= ~GPDX_LED_UPDATE_MASK; WRT_REG_DWORD(®->gpiod, gpio_data); RD_REG_DWORD(®->gpiod); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); ha->fw_options[1] &= ~ADD_FO1_DISABLE_GPIO_LED_CTRL; @@ -1591,6 +1599,7 @@ int cnt; unsigned long flags; struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; + scsi_qla_host_t *pha = to_qla_parent(ha); /* Suspend HBA. */ scsi_block_requests(ha->host); @@ -1598,7 +1607,7 @@ set_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags); /* Pause RISC. */ - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(&pha->hardware_lock, flags); WRT_REG_WORD(®->hccr, HCCR_PAUSE_RISC); RD_REG_WORD(®->hccr); if (IS_QLA2100(ha) || IS_QLA2200(ha) || IS_QLA2300(ha)) { @@ -1610,7 +1619,7 @@ } else { udelay(10); } - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(&pha->hardware_lock, flags); } static inline void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |