media: pluto2: BUG: spinlock bad magic in pluto_irq() on early IRQ

From: Jaeyoung Chung

Date: Wed Jun 10 2026 - 07:26:53 EST


Hi,

pluto2_probe() in drivers/media/pci/pluto2/pluto2.c registers the
interrupt handler with request_irq() before dvb_dmx_init() initializes
the demux spinlock with spin_lock_init(). If an interrupt arrives
before dvb_dmx_init() runs, the handler acquires the uninitialized
demux lock, which triggers a kernel warning.

The probe path, in pluto2_probe():

pluto = kzalloc_obj(struct pluto); /* demux.lock is zeroed */
...
ret = request_irq(pdev->irq, pluto_irq, IRQF_SHARED,
DRIVER_NAME, pluto); /* register handler */
...
ret = dvb_dmx_init(dvbdemux); /* spin_lock_init(&dvbdemux->lock); */

On a DMA-end interrupt (TSCR_DE) the handler runs pluto_irq() ->
pluto_dma_end() -> dvb_dmx_swfilter_packets(), which acquires the demux
lock.

If the device raises an interrupt before dvb_dmx_init() runs, the
handler acquires the uninitialized spinlock, which triggers "BUG:
spinlock bad magic" when CONFIG_DEBUG_SPINLOCK is enabled.

Suggested fix: register the handler only after dvb_dmx_init(), so the
demux is initialized before the handler can run.

Reported-by: Sangyun Kim <sangyun.kim@xxxxxxxxx>
Reported-by: Kyungwook Boo <bookyungwook@xxxxxxxxx>

Thanks,
Jaeyoung Chung