Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: message: fusion: Remove in_interrupt() usage in mpt_config()

in_interrupt() is referenced all over the place in these drivers. Most of
these references are comments which are outdated and wrong.

Aside of that in_interrupt() is deprecated as it does not provide what the
name suggests. It covers more than hard/soft interrupt servicing context
and is semantically ill defined.

>From reading the mpt_config() code and the history this is clearly a debug
mechanism and should probably be replaced by might_sleep() or completely
removed because such checks are already in the subsequent functions.

Remove the in_interrupt() references and replace the usage in mpt_config()
with might_sleep().

Link: https://lore.kernel.org/r/20201126132952.2287996-14-bigeasy@linutronix.de
Cc: Sathya Prakash <sathya.prakash@broadcom.com>
Cc: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Cc: MPT-FusionLinux.pdl@broadcom.com
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Thomas Gleixner and committed by
Martin K. Petersen
b8a51443 ca685369

+5 -15
+2 -12
drivers/message/fusion/mptbase.c
··· 57 57 #include <linux/kdev_t.h> 58 58 #include <linux/blkdev.h> 59 59 #include <linux/delay.h> 60 - #include <linux/interrupt.h> /* needed for in_interrupt() proto */ 60 + #include <linux/interrupt.h> 61 61 #include <linux/dma-mapping.h> 62 62 #include <linux/kthread.h> 63 63 #include <scsi/scsi_host.h> ··· 6335 6335 * Page header is updated. 6336 6336 * 6337 6337 * Returns 0 for success 6338 - * -EPERM if not allowed due to ISR context 6339 6338 * -EAGAIN if no msg frames currently available 6340 6339 * -EFAULT for non-successful reply or no reply (timeout) 6341 6340 */ ··· 6352 6353 u8 page_type = 0, extend_page; 6353 6354 unsigned long timeleft; 6354 6355 unsigned long flags; 6355 - int in_isr; 6356 6356 u8 issue_hard_reset = 0; 6357 6357 u8 retry_count = 0; 6358 6358 6359 - /* Prevent calling wait_event() (below), if caller happens 6360 - * to be in ISR context, because that is fatal! 6361 - */ 6362 - in_isr = in_interrupt(); 6363 - if (in_isr) { 6364 - dcprintk(ioc, printk(MYIOC_s_WARN_FMT "Config request not allowed in ISR context!\n", 6365 - ioc->name)); 6366 - return -EPERM; 6367 - } 6359 + might_sleep(); 6368 6360 6369 6361 /* don't send a config page during diag reset */ 6370 6362 spin_lock_irqsave(&ioc->taskmgmt_lock, flags);
+1 -1
drivers/message/fusion/mptfc.c
··· 50 50 #include <linux/kdev_t.h> 51 51 #include <linux/blkdev.h> 52 52 #include <linux/delay.h> /* for mdelay */ 53 - #include <linux/interrupt.h> /* needed for in_interrupt() proto */ 53 + #include <linux/interrupt.h> 54 54 #include <linux/reboot.h> /* notifier code */ 55 55 #include <linux/workqueue.h> 56 56 #include <linux/sort.h>
+1 -1
drivers/message/fusion/mptscsih.c
··· 52 52 #include <linux/kdev_t.h> 53 53 #include <linux/blkdev.h> 54 54 #include <linux/delay.h> /* for mdelay */ 55 - #include <linux/interrupt.h> /* needed for in_interrupt() proto */ 55 + #include <linux/interrupt.h> 56 56 #include <linux/reboot.h> /* notifier code */ 57 57 #include <linux/workqueue.h> 58 58
+1 -1
drivers/message/fusion/mptspi.c
··· 52 52 #include <linux/kdev_t.h> 53 53 #include <linux/blkdev.h> 54 54 #include <linux/delay.h> /* for mdelay */ 55 - #include <linux/interrupt.h> /* needed for in_interrupt() proto */ 55 + #include <linux/interrupt.h> 56 56 #include <linux/reboot.h> /* notifier code */ 57 57 #include <linux/workqueue.h> 58 58 #include <linux/raid_class.h>