Skip to content

media: Cleanup in_interrupt() usage

Thomas Gleixner linux-media linux-usb lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4media: Bulk remove BUG_ON(in_interrupt())drivers/media/common/saa7146/saa7146_fops.c drivers/media/pci/bt8xx/bttv-risc.c drivers/media/pci/cx23885/cx23885-core.c +4 more+0 -110 replies
2/4media: omap3isp: Remove misleading commentdrivers/media/platform/omap3isp/ispccdc.c+2 -31 reply
3/4media: au0828: Consolidate dmesg outputdrivers/media/usb/au0828/au0828-video.c+2 -30 replies
4/4media: cx231xx: Consolidate dmesg outputdrivers/media/usb/cx231xx/cx231xx-core.c drivers/media/usb/cx231xx/cx231xx-vbi.c+5 -82 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchLaurent Pinchart
1/4
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [patch 0/4] media: Cleanup in_interrupt() usage

Folks,

in the discussion about preempt count consistency accross kernel configurations:

https://lore.kernel.org/r/[email protected]/

it was concluded that the usage of in_interrupt() and related context checks should be removed from non-core code.

The media subsystem has a few instances of in_interrupt() usage:

1) BUG_ON(in_interrupt()

BUG_ON() is considered the last resort and the usage there is clearly not in that category. It could be replaced by a lockdep_assert_preemption_enabled(), but all these usage sites invoke core functionality which will catch incorrect context already. So adding more there is not really useful

2) Comments and printk()'s

The comment is misleading and the checks in the printk()'s are pointless as the code can never be called from in_interrupt() as it contains GFP_KERNEL allocations.

I'm collecting related cleanups all over the tree, but feel free to route them through the media tree as they have no dependencies. Let me know which route you prefer.

Thanks,

tglx

---
 common/saa7146/saa7146_fops.c |    2 --
 pci/bt8xx/bttv-risc.c         |    1 -
 pci/cx23885/cx23885-core.c    |    1 -
 pci/cx25821/cx25821-core.c    |    1 -
 platform/fsl-viu.c            |    2 --
 platform/omap3isp/ispccdc.c   |    5 ++---
 usb/au0828/au0828-video.c     |    5 ++---
 usb/cx231xx/cx231xx-core.c    |   10 ++++------
 usb/cx231xx/cx231xx-vbi.c     |    3 +--
 usb/tm6000/tm6000-video.c     |    2 --
 usb/zr364xx/zr364xx.c         |    2 --
 11 files changed, 9 insertions(+), 25 deletions(-)