diff mbox series

qla2xxx: Fix hardlockup in abort command during driver remove.

Message ID 20190614143627.10768-1-hmadhani@marvell.com (mailing list archive)
State Mainlined
Commit 5589b08e5be47e426158f659a892153b4a831921
Headers show
Series qla2xxx: Fix hardlockup in abort command during driver remove. | expand

Commit Message

Himanshu Madhani June 14, 2019, 2:36 p.m. UTC
From: Arun Easi <aeasi@marvell.com>

[436194.555537] NMI watchdog: Watchdog detected hard LOCKUP on cpu 5
[436194.555558] RIP: 0010:native_queued_spin_lock_slowpath+0x63/0x1e0

[436194.555563] Call Trace:
[436194.555564]  _raw_spin_lock_irqsave+0x30/0x40
[436194.555564]  qla24xx_async_abort_command+0x29/0xd0 [qla2xxx]
[436194.555565]  qla24xx_abort_command+0x208/0x2d0 [qla2xxx]
[436194.555565]  __qla2x00_abort_all_cmds+0x16b/0x290 [qla2xxx]
[436194.555565]  qla2x00_abort_all_cmds+0x42/0x60 [qla2xxx]
[436194.555566]  qla2x00_abort_isp_cleanup+0x2bd/0x3a0 [qla2xxx]
[436194.555566]  qla2x00_remove_one+0x1ad/0x360 [qla2xxx]
[436194.555566]  pci_device_remove+0x3b/0xb0

Fixes: 219d27d7147e (scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands)
Cc: stable@vger.kernel.org # 5.2
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
---
Hi Martin,

This patch fixes issue we found during our driver reset recovery testing with 5.2.0 kernel.

Please apply this patch to 5.2/scsi-fixes branch at your earliest convenience.

Thanks,
Himanshu 
---
 drivers/scsi/qla2xxx/qla_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bart Van Assche June 14, 2019, 8:25 p.m. UTC | #1
On 6/14/19 7:36 AM, Himanshu Madhani wrote:
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 172ef21827dd..d056f5e7cf93 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -1731,8 +1731,8 @@ static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res,
>   	     !test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) &&
>   	     !qla2x00_isp_reg_stat(ha))) {
>   		sp->comp = &comp;
> -		rval = ha->isp_ops->abort_command(sp);
>   		spin_unlock_irqrestore(qp->qp_lock_ptr, *flags);
> +		rval = ha->isp_ops->abort_command(sp);
>   
>   		switch (rval) {
>   		case QLA_SUCCESS:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Martin K. Petersen June 19, 2019, 2:53 a.m. UTC | #2
Himanshu,

> From: Arun Easi <aeasi@marvell.com>
>
> [436194.555537] NMI watchdog: Watchdog detected hard LOCKUP on cpu 5
> [436194.555558] RIP: 0010:native_queued_spin_lock_slowpath+0x63/0x1e0
>
> [436194.555563] Call Trace:
> [436194.555564]  _raw_spin_lock_irqsave+0x30/0x40
> [436194.555564]  qla24xx_async_abort_command+0x29/0xd0 [qla2xxx]
> [436194.555565]  qla24xx_abort_command+0x208/0x2d0 [qla2xxx]
> [436194.555565]  __qla2x00_abort_all_cmds+0x16b/0x290 [qla2xxx]
> [436194.555565]  qla2x00_abort_all_cmds+0x42/0x60 [qla2xxx]
> [436194.555566]  qla2x00_abort_isp_cleanup+0x2bd/0x3a0 [qla2xxx]
> [436194.555566]  qla2x00_remove_one+0x1ad/0x360 [qla2xxx]
> [436194.555566]  pci_device_remove+0x3b/0xb0

Applied to 5.2/scsi-fixes. Thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 172ef21827dd..d056f5e7cf93 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1731,8 +1731,8 @@  static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res,
 	     !test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) &&
 	     !qla2x00_isp_reg_stat(ha))) {
 		sp->comp = &comp;
-		rval = ha->isp_ops->abort_command(sp);
 		spin_unlock_irqrestore(qp->qp_lock_ptr, *flags);
+		rval = ha->isp_ops->abort_command(sp);
 
 		switch (rval) {
 		case QLA_SUCCESS: