Skip to content

Commit

Permalink
spi: hisi-sfc-v3xx: Return IRQ_NONE if no interrupts were detected
Browse files Browse the repository at this point in the history
[ Upstream commit de8b6e1 ]

Return IRQ_NONE from the interrupt handler when no interrupt was
detected. Because an empty interrupt will cause a null pointer error:

    Unable to handle kernel NULL pointer dereference at virtual
  address 0000000000000008
    Call trace:
        complete+0x54/0x100
        hisi_sfc_v3xx_isr+0x2c/0x40 [spi_hisi_sfc_v3xx]
        __handle_irq_event_percpu+0x64/0x1e0
        handle_irq_event+0x7c/0x1cc

Signed-off-by: Devyn Liu <liudingyuan@huawei.com>
Link: https://msgid.link/r/20240123071149.917678-1-liudingyuan@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Devyn Liu authored and gregkh committed Mar 1, 2024
1 parent 8298ea0 commit d637b51
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/spi/spi-hisi-sfc-v3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ static const struct spi_controller_mem_ops hisi_sfc_v3xx_mem_ops = {
static irqreturn_t hisi_sfc_v3xx_isr(int irq, void *data)
{
struct hisi_sfc_v3xx_host *host = data;
u32 reg;

reg = readl(host->regbase + HISI_SFC_V3XX_INT_STAT);
if (!reg)
return IRQ_NONE;

hisi_sfc_v3xx_disable_int(host);

Expand Down

0 comments on commit d637b51

Please sign in to comment.