Skip to content

Commit

Permalink
i2c: cht-wc: Use generic_handle_irq_safe().
Browse files Browse the repository at this point in the history
Instead of manually disabling interrupts before invoking use
generic_handle_irq_safe() which can be invoked with enabled and disabled
interrupts.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Wolfram Sang <wsa@kernel.org>
Link: https://lore.kernel.org/r/20220211181500.1856198-4-bigeasy@linutronix.de
(cherry picked from commit 8ea8588239d645dd673108f87db99a2773578a15)
Signed-off-by: Clark Williams <williams@redhat.com>
  • Loading branch information
Sebastian Andrzej Siewior authored and clrkwllms committed Mar 1, 2022
1 parent dfbecfd commit 538a1e3
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions drivers/i2c/busses/i2c-cht-wc.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,8 @@ static irqreturn_t cht_wc_i2c_adap_thread_handler(int id, void *data)
* interrupt handler as well, so running the client irq handler from
* this thread will cause things to lock up.
*/
if (reg & CHT_WC_EXTCHGRIRQ_CLIENT_IRQ) {
/*
* generic_handle_irq expects local IRQs to be disabled
* as normally it is called from interrupt context.
*/
local_irq_disable();
generic_handle_irq(adap->client_irq);
local_irq_enable();
}
if (reg & CHT_WC_EXTCHGRIRQ_CLIENT_IRQ)
generic_handle_irq_safe(adap->client_irq);

return IRQ_HANDLED;
}
Expand Down

0 comments on commit 538a1e3

Please sign in to comment.