diff mbox series

[11/14] scsi: myrs: Remove WARN_ON(in_interrupt()).

Message ID 20201126132952.2287996-12-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>

The in_interrupt() macro is ill-defined and does not provide what the
name suggests. The usage especially in driver code is deprecated and a
tree-wide effort to clean up and consolidate the (ab)usage of
in_interrupt() and related checks is happening.

In this case the check covers only parts of the contexts in which these
functions cannot be called. It fails to detect preemption or interrupt
disabled invocations.

As wait_for_completion() already contains a broad variety of checks
(always enabled or debug option dependent) which cover all invalid
conditions already, there is no point in having extra inconsistent
warnings in drivers.

Just remove it.

Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Hannes Reinecke <hare@kernel.org>
---
 drivers/scsi/myrs.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Daniel Wagner Nov. 30, 2020, 3:21 p.m. UTC | #1
On Thu, Nov 26, 2020 at 02:29:49PM +0100, Sebastian Andrzej Siewior wrote:
> From: "Ahmed S. Darwish" <a.darwish@linutronix.de>
> 
> The in_interrupt() macro is ill-defined and does not provide what the
> name suggests. The usage especially in driver code is deprecated and a
> tree-wide effort to clean up and consolidate the (ab)usage of
> in_interrupt() and related checks is happening.
> 
> In this case the check covers only parts of the contexts in which these
> functions cannot be called. It fails to detect preemption or interrupt
> disabled invocations.
> 
> As wait_for_completion() already contains a broad variety of checks
> (always enabled or debug option dependent) which cover all invalid
> conditions already, there is no point in having extra inconsistent
> warnings in drivers.
> 
> Just remove it.
> 
> Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: Hannes Reinecke <hare@kernel.org>

Reviewed-by: Daniel Wagner <dwagner@suse.de>
diff mbox series

Patch

diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c
index 7a3ade765ce3b..4adf9ded296aa 100644
--- a/drivers/scsi/myrs.c
+++ b/drivers/scsi/myrs.c
@@ -136,7 +136,6 @@  static void myrs_exec_cmd(struct myrs_hba *cs,
 	myrs_qcmd(cs, cmd_blk);
 	spin_unlock_irqrestore(&cs->queue_lock, flags);
 
-	WARN_ON(in_interrupt());
 	wait_for_completion(&complete);
 }