All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nilesh Javali <njavali@marvell.com>
To: <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>, <GR-QLogic-Storage-Upstream@marvell.com>
Subject: [PATCH 06/16] qla2xxx: Fix scheduling while atomic
Date: Thu, 23 Dec 2021 23:07:02 -0800	[thread overview]
Message-ID: <20211224070712.17905-7-njavali@marvell.com> (raw)
In-Reply-To: <20211224070712.17905-1-njavali@marvell.com>

From: Quinn Tran <qutran@marvell.com>

QLA makes a call into midlayer (fc_remote_port_delete) which
can put the thread to sleep. The thread that originate the call
is in interrupt context. The combination of the 2 trigger a
crash. This patch schedule the call in non-interrupt context
where it is more safe.

kernel: BUG: scheduling while atomic: swapper/7/0/0x00010000
kernel: Call Trace:
kernel:  <IRQ>
kernel:  dump_stack+0x66/0x81
kernel:  __schedule_bug.cold.90+0x5/0x1d
kernel:  __schedule+0x7af/0x960
kernel:  schedule+0x28/0x80
kernel:  schedule_timeout+0x26d/0x3b0
kernel:  wait_for_completion+0xb4/0x140
kernel:  ? wake_up_q+0x70/0x70
kernel:  __wait_rcu_gp+0x12c/0x160
kernel:  ? sdev_evt_alloc+0xc0/0x180 [scsi_mod]
kernel:  synchronize_sched+0x6c/0x80
kernel:  ? call_rcu_bh+0x20/0x20
kernel:  ? __bpf_trace_rcu_invoke_callback+0x10/0x10
kernel:  sdev_evt_alloc+0xfd/0x180 [scsi_mod]
kernel:  starget_for_each_device+0x85/0xb0 [scsi_mod]
kernel:  ? scsi_init_io+0x360/0x3d0 [scsi_mod]
kernel:  scsi_init_io+0x388/0x3d0 [scsi_mod]
kernel:  device_for_each_child+0x54/0x90
kernel:  fc_remote_port_delete+0x70/0xe0 [scsi_transport_fc]
kernel:  qla2x00_schedule_rport_del+0x62/0xf0 [qla2xxx]
kernel:  qla2x00_mark_device_lost+0x9c/0xd0 [qla2xxx]
kernel:  qla24xx_handle_plogi_done_event+0x55f/0x570 [qla2xxx]
kernel:  qla2x00_async_login_sp_done+0xd2/0x100 [qla2xxx]
kernel:  qla24xx_logio_entry+0x13a/0x3c0 [qla2xxx]
kernel:  qla24xx_process_response_queue+0x306/0x400 [qla2xxx]
kernel:  qla24xx_msix_rsp_q+0x3f/0xb0 [qla2xxx]
kernel:  __handle_irq_event_percpu+0x40/0x180
kernel:  handle_irq_event_percpu+0x30/0x80
kernel:  handle_irq_event+0x36/0x60

Cc: stable@vger.kernel.org
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index e54c31296fab..ac25d2bfa90b 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2231,12 +2231,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
 		ql_dbg(ql_dbg_disc, vha, 0x20eb, "%s %d %8phC cmd error %x\n",
 		    __func__, __LINE__, ea->fcport->port_name, ea->data[1]);
 
-		ea->fcport->flags &= ~FCF_ASYNC_SENT;
-		qla2x00_set_fcport_disc_state(ea->fcport, DSC_LOGIN_FAILED);
-		if (ea->data[1] & QLA_LOGIO_LOGIN_RETRIED)
-			set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
-		else
-			qla2x00_mark_device_lost(vha, ea->fcport, 1);
+		qlt_schedule_sess_for_deletion(ea->fcport);
 		break;
 	case MBS_LOOP_ID_USED:
 		/* data[1] = IO PARAM 1 = nport ID  */
-- 
2.23.1


  parent reply	other threads:[~2021-12-24  7:08 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-24  7:06 [PATCH 00/16] qla2xxx misc bug fixes and features Nilesh Javali
2021-12-24  7:06 ` [PATCH 01/16] qla2xxx: Refactor asynchronous command initialization Nilesh Javali
2022-01-03  0:32   ` Himanshu Madhani
2021-12-24  7:06 ` [PATCH 02/16] qla2xxx: Implement ref count for srb Nilesh Javali
2021-12-28 11:12   ` Daniel Wagner
2021-12-28 11:31     ` Saurav Kashyap
2022-01-03  0:32   ` Himanshu Madhani
2022-01-03  3:56     ` Saurav Kashyap
2022-01-04 12:32       ` Daniel Wagner
2022-01-05  1:55         ` Himanshu Madhani
2022-01-05  4:28           ` Saurav Kashyap
2021-12-24  7:06 ` [PATCH 03/16] qla2xxx: fix stuck session in gpdb Nilesh Javali
2022-01-03  0:34   ` Himanshu Madhani
2021-12-24  7:07 ` [PATCH 04/16] qla2xxx: Fix warning message due to adisc is being flush Nilesh Javali
2022-01-03  0:37   ` Himanshu Madhani
2021-12-24  7:07 ` [PATCH 05/16] qla2xxx: Fix premature hw access after pci error Nilesh Javali
2022-01-03  0:39   ` Himanshu Madhani
2021-12-24  7:07 ` Nilesh Javali [this message]
2022-01-03  0:41   ` [PATCH 06/16] qla2xxx: Fix scheduling while atomic Himanshu Madhani
2021-12-24  7:07 ` [PATCH 07/16] qla2xxx: add retry for exec fw Nilesh Javali
2022-01-03  0:42   ` Himanshu Madhani
2021-12-24  7:07 ` [PATCH 08/16] qla2xxx: Show wrong FDMI data for 64G adaptor Nilesh Javali
2022-01-03  0:43   ` Himanshu Madhani
2021-12-24  7:07 ` [PATCH 09/16] qla2xxx: Add ql2xnvme_queues module param to configure number of NVME queues Nilesh Javali
2022-01-03  0:44   ` Himanshu Madhani
2021-12-24  7:07 ` [PATCH 10/16] qla2xxx: Fix device reconnect in loop topology Nilesh Javali
2022-01-03  0:46   ` Himanshu Madhani
2021-12-24  7:07 ` [PATCH 11/16] qla2xxx: fix warning for missing error code Nilesh Javali
2022-01-03  0:46   ` Himanshu Madhani
2021-12-24  7:07 ` [PATCH 12/16] qla2xxx: edif: Fix clang warning Nilesh Javali
2022-01-03  0:47   ` Himanshu Madhani
2021-12-24  7:07 ` [PATCH 13/16] qla2xxx: Fix T10 PI tag escape and IP guard options for 28XX adapters Nilesh Javali
2022-01-03  0:48   ` Himanshu Madhani
2021-12-24  7:07 ` [PATCH 14/16] qla2xxx: Add devid's and conditionals for 28xx Nilesh Javali
2022-01-03  0:52   ` Himanshu Madhani
2022-01-03 16:02     ` Nilesh Javali
2022-01-06  0:55     ` Arun Easi
2021-12-24  7:07 ` [PATCH 15/16] qla2xxx: Suppress a kernel complaint in qla_create_qpair() Nilesh Javali
2022-01-03  0:52   ` Himanshu Madhani
2021-12-24  7:07 ` [PATCH 16/16] qla2xxx: Update version to 10.02.07.300-k Nilesh Javali
2022-01-03  0:53   ` Himanshu Madhani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211224070712.17905-7-njavali@marvell.com \
    --to=njavali@marvell.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.