linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: hisi-sfc-v3xx: Return IRQ_NONE if no interrupts were detected
@ 2024-01-23  7:11 Devyn Liu
  2024-01-24 18:11 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Devyn Liu @ 2024-01-23  7:11 UTC (permalink / raw)
  To: broonie; +Cc: f.fangjian, jonathan.cameron, linux-spi, liudingyuan

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>
---
 drivers/spi/spi-hisi-sfc-v3xx.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/spi/spi-hisi-sfc-v3xx.c b/drivers/spi/spi-hisi-sfc-v3xx.c
index 9d22018f7985..1301d14483d4 100644
--- a/drivers/spi/spi-hisi-sfc-v3xx.c
+++ b/drivers/spi/spi-hisi-sfc-v3xx.c
@@ -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);
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: hisi-sfc-v3xx: Return IRQ_NONE if no interrupts were detected
  2024-01-23  7:11 [PATCH] spi: hisi-sfc-v3xx: Return IRQ_NONE if no interrupts were detected Devyn Liu
@ 2024-01-24 18:11 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2024-01-24 18:11 UTC (permalink / raw)
  To: Devyn Liu; +Cc: f.fangjian, jonathan.cameron, linux-spi

On Tue, 23 Jan 2024 15:11:49 +0800, Devyn Liu wrote:
> 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
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: hisi-sfc-v3xx: Return IRQ_NONE if no interrupts were detected
      commit: de8b6e1c231a95abf95ad097b993d34b31458ec9

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-24 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-23  7:11 [PATCH] spi: hisi-sfc-v3xx: Return IRQ_NONE if no interrupts were detected Devyn Liu
2024-01-24 18:11 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).