Skip to content

Commit ceb5370

Browse files
P33Mpopcornmix
authored andcommitted
drivers: dwc_otg: don't call disable_irq on the fake FIQ
The local spinlock protects the handlers from racing against each other on separate cores, hard IRQs don't preempt each other, and disabling/enabling the interrupt is more expensive than letting the fake FIQ contend the spinlock. So turn local_fiq_en/disable into no-ops. Signed-off-by: Jonathan Bell <[email protected]>
1 parent 3c9eb7e commit ceb5370

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -406,19 +406,17 @@ static struct dwc_otg_hcd_function_ops hcd_fops = {
406406

407407
#ifdef CONFIG_ARM64
408408

409-
static int simfiq_irq = -1;
410-
411-
void local_fiq_enable(void)
412-
{
413-
if (simfiq_irq >= 0)
414-
enable_irq(simfiq_irq);
415-
}
409+
/*
410+
* With no FIQ support on AARCH64, the "FIQ handler" is demoted to a
411+
* regular IRQ handler. With a nested spinlock preventing the two
412+
* handlers from racing against each other, and a HCD lock preventing
413+
* thread context from racing against the "bottom half" IRQ, there's no
414+
* point manipulating global IRQ enable/disable state - so these two
415+
* functions are no-ops.
416+
*/
417+
void local_fiq_enable(void) { }
416418

417-
void local_fiq_disable(void)
418-
{
419-
if (simfiq_irq >= 0)
420-
disable_irq(simfiq_irq);
421-
}
419+
void local_fiq_disable(void) { }
422420

423421
static irqreturn_t fiq_irq_handler(int irq, void *dev_id)
424422
{
@@ -521,7 +519,6 @@ static void hcd_init_fiq(void *cookie)
521519
return;
522520
}
523521

524-
simfiq_irq = irq;
525522
#else
526523
#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER
527524
irq = otg_dev->os_dep.fiq_num;

0 commit comments

Comments
 (0)