linux-stable/drivers
Adam Goldman 6fafe36617 firewire: ohci: mask bus reset interrupts between ISR and bottom half
[ Upstream commit 752e3c53de ]

In the FireWire OHCI interrupt handler, if a bus reset interrupt has
occurred, mask bus reset interrupts until bus_reset_work has serviced and
cleared the interrupt.

Normally, we always leave bus reset interrupts masked. We infer the bus
reset from the self-ID interrupt that happens shortly thereafter. A
scenario where we unmask bus reset interrupts was introduced in 2008 in
a007bb857e: If
OHCI_PARAM_DEBUG_BUSRESETS (8) is set in the debug parameter bitmask, we
will unmask bus reset interrupts so we can log them.

irq_handler logs the bus reset interrupt. However, we can't clear the bus
reset event flag in irq_handler, because we won't service the event until
later. irq_handler exits with the event flag still set. If the
corresponding interrupt is still unmasked, the first bus reset will
usually freeze the system due to irq_handler being called again each
time it exits. This freeze can be reproduced by loading firewire_ohci
with "modprobe firewire_ohci debug=-1" (to enable all debugging output).
Apparently there are also some cases where bus_reset_work will get called
soon enough to clear the event, and operation will continue normally.

This freeze was first reported a few months after a007bb85 was committed,
but until now it was never fixed. The debug level could safely be set
to -1 through sysfs after the module was loaded, but this would be
ineffectual in logging bus reset interrupts since they were only
unmasked during initialization.

irq_handler will now leave the event flag set but mask bus reset
interrupts, so irq_handler won't be called again and there will be no
freeze. If OHCI_PARAM_DEBUG_BUSRESETS is enabled, bus_reset_work will
unmask the interrupt after servicing the event, so future interrupts
will be caught as desired.

As a side effect to this change, OHCI_PARAM_DEBUG_BUSRESETS can now be
enabled through sysfs in addition to during initial module loading.
However, when enabled through sysfs, logging of bus reset interrupts will
be effective only starting with the second bus reset, after
bus_reset_work has executed.

Signed-off-by: Adam Goldman <adamg@pobox.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-05-17 11:56:05 +02:00
..
accessibility speakup: Avoid crash on very long word 2024-04-27 17:07:15 +02:00
acpi ACPI: CPPC: Fix access width used for PCC registers 2024-05-02 16:29:29 +02:00
amba
android binder: check offset alignment in binder_get_object() 2024-04-27 17:07:13 +02:00
ata ata: sata_gemini: Check clk_enable() result 2024-05-17 11:56:05 +02:00
atm
auxdisplay
base
bcma
block
bluetooth Bluetooth: qca: add support for QCA2066 2024-05-17 11:55:51 +02:00
bus
cdrom
char
clk clk: sunxi-ng: h6: Reparent CPUX during PLL CPUX rate change 2024-05-17 11:56:02 +02:00
clocksource
comedi comedi: vmk80xx: fix incomplete endpoint checking 2024-04-27 17:07:14 +02:00
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma dmaengine: Revert "dmaengine: pl330: issue_pending waits until WFP state" 2024-05-17 11:55:50 +02:00
dma-buf
edac
eisa
extcon
firewire firewire: ohci: mask bus reset interrupts between ISR and bottom half 2024-05-17 11:56:05 +02:00
firmware x86/efistub: Remap kernel text read-only before dropping NX attribute 2024-04-27 17:07:07 +02:00
fpga
fsi
gnss
gpio
gpu drm/panel: ili9341: Use predefined error codes 2024-05-17 11:56:02 +02:00
greybus
hid HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up 2024-05-02 16:29:28 +02:00
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c i2c: smbus: fix NULL function pointer dereference 2024-05-02 16:29:32 +02:00
i3c
idle
iio
infiniband RDMA/mlx5: Fix port number for counter query in multi-port configuration 2024-04-27 17:07:09 +02:00
input
interconnect
iommu
ipack
irqchip irqchip/gic-v3-its: Prevent double free on error 2024-05-02 16:29:29 +02:00
isdn
leds
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc eeprom: at24: fix memory corruption race condition 2024-05-17 11:55:51 +02:00
mmc mmc: sdhci-msm: pervent access to suspended controller 2024-05-02 16:29:28 +02:00
most
mtd mtd: diskonchip: work around ubsan link failure 2024-05-02 16:29:30 +02:00
mux
net net: bcmgenet: Reset RBUF on first open 2024-05-17 11:56:05 +02:00
nfc NFC: trf7970a: disable all regulators on removal 2024-05-02 16:29:24 +02:00
ntb
nubus
nvdimm
nvme nvme: fix warn output about shared namespaces without CONFIG_NVME_MULTIPATH 2024-05-17 11:55:56 +02:00
nvmem
of
opp
parisc
parport
pci PCI/ASPM: Fix deadlock when enabling ASPM 2024-04-27 17:07:18 +02:00
pcmcia
peci
perf
phy phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered 2024-05-02 16:29:31 +02:00
pinctrl pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map() 2024-05-17 11:55:55 +02:00
platform
pnp
power power: supply: mt6360_charger: Fix of_match for usb-otg-vbus regulator 2024-05-17 11:55:55 +02:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: mt6360: De-capitalize devicetree regulator subnodes 2024-05-17 11:55:55 +02:00
remoteproc
reset
rpmsg
rtc
s390 s390/qeth: Fix kernel panic after setting hsuid 2024-05-17 11:56:01 +02:00
sbus
scsi scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload 2024-05-17 11:56:04 +02:00
sh
siox
slimbus
soc
soundwire
spi spi: fix null pointer dereference within spi_sync 2024-05-17 11:56:01 +02:00
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt thunderbolt: Fix wake configurations after device unplug 2024-04-27 17:07:14 +02:00
tty serial: stm32: Reset .throttled state in .startup() 2024-04-27 17:07:14 +02:00
ufs scsi: ufs: core: WLUN suspend dev/link state error recovery 2024-05-17 11:56:05 +02:00
uio
usb usb: gadget: f_ncm: Fix UAF ncm object at re-bind after usb ep transport error 2024-04-27 17:07:15 +02:00
vdpa
vfio
vhost
video fbdev: fix incorrect address computation in deferred IO 2024-05-02 16:29:30 +02:00
virt
virtio
vlynq
w1
watchdog
xen
zorro
Kconfig
Makefile