2024-04-01 12:12:17

by Takashi Sakamoto

[permalink] [raw]
Subject: [PATCH] firewire: ohci: always handle IRQ event for bus reset

In the former commit, the spurious interrupt events are suppressed as
possible, when masking the expected interrupts events for bus reset. The
change was written to be less intrusive, thus it does not work at the
first event of bus reset. However, it has few trouble to make it work at
the first event.

This commit is to mask the interrupt events as a default for the purpose.

Signed-off-by: Takashi Sakamoto <[email protected]>
---
drivers/firewire/ohci.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 38d19410a2be..4e86205f81bf 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -2060,8 +2060,7 @@ static void bus_reset_work(struct work_struct *work)

ohci->generation = generation;
reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset);
- if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS)
- reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset);
+ reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset);

if (ohci->quirks & QUIRK_RESET_PACKET)
ohci->request_generation = generation;
@@ -2133,6 +2132,7 @@ static irqreturn_t irq_handler(int irq, void *data)
reg_write(ohci, OHCI1394_IntEventClear,
event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr));
log_irqs(ohci, event);
+ // The flag is masked again at bus_reset_work() scheduled by selfID event.
if (event & OHCI1394_busReset)
reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);

@@ -2472,9 +2472,8 @@ static int ohci_enable(struct fw_card *card,
OHCI1394_cycleInconsistent |
OHCI1394_unrecoverableError |
OHCI1394_cycleTooLong |
- OHCI1394_masterIntEnable;
- if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS)
- irqs |= OHCI1394_busReset;
+ OHCI1394_masterIntEnable |
+ OHCI1394_busReset;
reg_write(ohci, OHCI1394_IntMaskSet, irqs);

reg_write(ohci, OHCI1394_HCControlSet,
--
2.43.0