diff mbox series

[05/14] scsi: qla2xxx: tcm_qla2xxx: Remove BUG_ON(in_interrupt()).

Message ID 20201126132952.2287996-6-bigeasy@linutronix.de (mailing list archive)
State Accepted
Headers show
Series scsi: Remove in_interrupt() usage. | expand

Commit Message

Sebastian Andrzej Siewior Nov. 26, 2020, 1:29 p.m. UTC
From: "Ahmed S. Darwish" <a.darwish@linutronix.de>

tcm_qla2xxx_free_session() has a BUG_ON(in_interrupt()).

While in_interrupt() is ill-defined and does not provide what the name
suggests, it is not needed here: the function is always invoked from
workqueue context through "struct qla_tgt_func_tmpl" ->free_session()
hook it is bound to.

The function also calls wait_event_timeout() down the chain, which
already has a might_sleep().

Remove the in_interrupt() check.

Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Nilesh Javali <njavali@marvell.com>
Cc: <GR-QLogic-Storage-Upstream@marvell.com>
---
 drivers/scsi/qla2xxx/tcm_qla2xxx.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Daniel Wagner Nov. 30, 2020, 11:02 a.m. UTC | #1
On Thu, Nov 26, 2020 at 02:29:43PM +0100, Sebastian Andrzej Siewior wrote:
> From: "Ahmed S. Darwish" <a.darwish@linutronix.de>
> 
> tcm_qla2xxx_free_session() has a BUG_ON(in_interrupt()).
> 
> While in_interrupt() is ill-defined and does not provide what the name
> suggests, it is not needed here: the function is always invoked from
> workqueue context through "struct qla_tgt_func_tmpl" ->free_session()
> hook it is bound to.
> 
> The function also calls wait_event_timeout() down the chain, which
> already has a might_sleep().
> 
> Remove the in_interrupt() check.
> 
> Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: Nilesh Javali <njavali@marvell.com>
> Cc: <GR-QLogic-Storage-Upstream@marvell.com>

Reviewed-by: Daniel Wagner <dwagner@suse.de>
Himanshu Madhani Nov. 30, 2020, 7:13 p.m. UTC | #2
> On Nov 26, 2020, at 7:29 AM, Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> 
> From: "Ahmed S. Darwish" <a.darwish@linutronix.de>
> 
> tcm_qla2xxx_free_session() has a BUG_ON(in_interrupt()).
> 
> While in_interrupt() is ill-defined and does not provide what the name
> suggests, it is not needed here: the function is always invoked from
> workqueue context through "struct qla_tgt_func_tmpl" ->free_session()
> hook it is bound to.
> 
> The function also calls wait_event_timeout() down the chain, which
> already has a might_sleep().
> 
> Remove the in_interrupt() check.
> 
> Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: Nilesh Javali <njavali@marvell.com>
> Cc: <GR-QLogic-Storage-Upstream@marvell.com>
> ---
> drivers/scsi/qla2xxx/tcm_qla2xxx.c | 2 --
> 1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
> index 784b43f181818..b55fc768a2a7a 100644
> --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
> +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
> @@ -1400,8 +1400,6 @@ static void tcm_qla2xxx_free_session(struct fc_port *sess)
> 	struct se_session *se_sess;
> 	struct tcm_qla2xxx_lport *lport;
> 
> -	BUG_ON(in_interrupt());
> -
> 	se_sess = sess->se_sess;
> 	if (!se_sess) {
> 		pr_err("struct fc_port->se_sess is NULL\n");
> -- 
> 2.29.2
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index 784b43f181818..b55fc768a2a7a 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -1400,8 +1400,6 @@  static void tcm_qla2xxx_free_session(struct fc_port *sess)
 	struct se_session *se_sess;
 	struct tcm_qla2xxx_lport *lport;
 
-	BUG_ON(in_interrupt());
-
 	se_sess = sess->se_sess;
 	if (!se_sess) {
 		pr_err("struct fc_port->se_sess is NULL\n");