Linux SPI subsystem development
 help / color / mirror / Atom feed
From: Kevin Hao <haokexin@gmail.com>
To: linux-spi@vger.kernel.org
Cc: Han Xu <han.xu@nxp.com>, Mark Brown <broonie@kernel.org>,
	 Volker Haspel <volker.haspel@linutronix.de>,
	 John Ogness <john.ogness@linutronix.de>,
	imx@lists.linux.dev,  Kevin Hao <haokexin@gmail.com>,
	stable@vger.kernel.org
Subject: [PATCH 0/2] spi: fsl-qspi: Fix kernel panic when unbinding the SPI host
Date: Fri, 21 Mar 2025 20:40:20 +0800	[thread overview]
Message-ID: <20250321-spi-v1-0-b9939baa64b6@gmail.com> (raw)

Hi,

I observed a kernel panic on my imx8mq-evk board. It can be easily
reproduced with the following steps:
  while true; do cat /dev/mtd0 >/dev/null; done &
  echo 30bb0000.spi >/sys/bus/platform/drivers/fsl-quadspi/unbind

The following is the kernel log:
  Unable to handle kernel paging request at virtual address ffffffc082a6015c
  Mem abort info:
    ESR = 0x0000000096000007
    EC = 0x25: DABT (current EL), IL = 32 bits
    SET = 0, FnV = 0
    EA = 0, S1PTW = 0
    FSC = 0x07: level 3 translation fault
  Data abort info:
    ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
    CM = 0, WnR = 0, TnD = 0, TagAccess = 0
    GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
  swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000041dc3000
  [ffffffc082a6015c] pgd=1000000042779003, p4d=1000000042779003, pud=1000000042779003, pmd=1000000044631403, pte=0000000000000000
  Internal error: Oops: 0000000096000007 [#1]  SMP
  Modules linked in: 8021q ath10k_pci ath10k_core etnaviv snd_soc_fsl_asoc_card ath snd_soc_imx_audmux gpu_sched snd_soc_fsl_sai snd_soc_fsl_spdif imx_sdma imx_pcm_dma snd_soc_fsl_utils snd_soc_wm8524 sch_fq_codel openvswitch nsh nf_conncount nf_nat fuse configfs nfnetlink
  Hardware name: NXP i.MX8MQ EVK (DT)
  pc : fsl_qspi_exec_op+0xa8/0x7c0
  lr : fsl_qspi_exec_op+0x88/0x7c0
  sp : ffffffc08433b650
  x8 : ffffffc08433b748 x7 : 0000000000000000 x6 : 0000000000000004
  x5 : 0000000000000001 x4 : 0000000000000000 x3 : 0000000000004174
  x2 : 0032724c809254be x1 : 000000000000c2a2 x0 : 000000173a720be8
  Call trace:
   fsl_qspi_exec_op+0xa8/0x7c0 (P)
   spi_mem_exec_op+0x410/0x4a0
   spi_mem_no_dirmap_read+0xb0/0xd0
   spi_mem_dirmap_read+0xdc/0x150
   spi_nor_read_data+0x128/0x1a0
   spi_nor_read+0xf4/0x2c8
   mtd_read_oob_std+0x80/0x98
   mtd_read_oob+0x9c/0x168
   mtd_read+0x70/0xe0
   mtdchar_read+0x224/0x2a8
   vfs_read+0xcc/0x310
   ksys_read+0x78/0x118
   __arm64_sys_read+0x24/0x38
   invoke_syscall+0x5c/0x130
   el0_svc_common.constprop.0+0x48/0xf0
   do_el0_svc+0x24/0x38
   el0_svc+0x30/0xd0
   el0t_64_sync_handler+0x10c/0x138
   el0t_64_sync+0x198/0x1a0

CPU: 1 UID: 0 PID: 527 Comm: cat Not tainted 6.14.0-rc7-next-20250321-yocto-standard+ #11 PREEMPT
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
x29: ffffffc08433b670 x28: 0000007f8019f000 x27: 000000000000000e
x26: ffffff8004781140 x25: 000000173a814e28 x24: 0000000000000006
x23: ffffffc082a6015c x22: ffffff80046a3d80 x21: ffffff80046a3d98
x20: ffffffc082a60000 x19: ffffffc08433b9b8 x18: 0000000000000000
x17: 0000000000000000 x16: 003135312e373631 x15: 2e3432322e383231
x14: 0000000000000000 x13: ffffff80bf74d940 x12: 0000000000000000
x11: 0000000000000160 x10: 00000000000009b0 x9 : ffffffc08010ea78
Code: d2800141 d2800060 941ecb48 d503203f (b94002e1)
---
Kevin Hao (2):
      spi: fsl-qsi: Optimize fsl_qspi struct
      spi: fsl-qspi: Explicitly unregister SPI host in remove()

 drivers/spi/spi-fsl-qspi.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
---
base-commit: 9388ec571cb1adba59d1cded2300eeb11827679c
change-id: 20250321-spi-8d7999765767

Best regards,
-- 
Kevin Hao <haokexin@gmail.com>


             reply	other threads:[~2025-03-21 12:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-21 12:40 Kevin Hao [this message]
2025-03-21 12:40 ` [PATCH 1/2] spi: fsl-qsi: Optimize fsl_qspi struct Kevin Hao
2025-03-21 15:26   ` Han Xu
2025-03-21 12:40 ` [PATCH 2/2] spi: fsl-qspi: Explicitly unregister SPI host in remove() Kevin Hao
2025-03-21 15:23   ` Han Xu
2025-03-21 15:55     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250321-spi-v1-0-b9939baa64b6@gmail.com \
    --to=haokexin@gmail.com \
    --cc=broonie@kernel.org \
    --cc=han.xu@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=john.ogness@linutronix.de \
    --cc=linux-spi@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=volker.haspel@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox