Skip to content

Commit

Permalink
drivers: dwc_otg: don't call disable_irq on the fake FIQ
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
P33M committed Sep 13, 2024
1 parent 173bd52 commit 7d13394
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,19 +406,17 @@ static struct dwc_otg_hcd_function_ops hcd_fops = {

#ifdef CONFIG_ARM64

static int simfiq_irq = -1;

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

void local_fiq_disable(void)
{
if (simfiq_irq >= 0)
disable_irq(simfiq_irq);
}
void local_fiq_disable(void) { }

irqreturn_t fiq_irq_handler(int irq, void *dev_id)
{
Expand Down Expand Up @@ -521,7 +519,6 @@ static void hcd_init_fiq(void *cookie)
return;
}

simfiq_irq = irq;
#else
#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER
irq = otg_dev->os_dep.fiq_num;
Expand Down

0 comments on commit 7d13394

Please sign in to comment.