[PATCH V2 5/5] blk-mq: Replace tags->lock with SRCU for tag iterators - Rockchip UFS regression

Sebastian Reichel sebastian.reichel at collabora.com
Fri Oct 3 10:17:46 PDT 2025


Hi,

On Sat, Aug 30, 2025 at 10:18:23AM +0800, Ming Lei wrote:
> Replace the spinlock in blk_mq_find_and_get_req() with an SRCU read lock
> around the tag iterators.
> 
> This is done by:
> 
> - Holding the SRCU read lock in blk_mq_queue_tag_busy_iter(),
> blk_mq_tagset_busy_iter(), and blk_mq_hctx_has_requests().
> 
> - Removing the now-redundant tags->lock from blk_mq_find_and_get_req().
> 
> This change fixes lockup issue in scsi_host_busy() in case of shost->host_blocked.
> 
> Also avoids big tags->lock when reading disk sysfs attribute `inflight`.
> 
> Reviewed-by: Hannes Reinecke <hare at suse.de>
> Signed-off-by: Ming Lei <ming.lei at redhat.com>
> ---

This patch landed in the last few hours and I now see the following
fatal error on the Radxa ROCK 4D (most likely Rockchip UFS in
general). After reverting this patch the error is gone and things
are working as expected:

[    2.713204] CPU: 7 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.17.0-g472ea195cdf3 #1 PREEMPT
[    2.713956] Hardware name: Radxa ROCK 4D (DT)
[    2.714342] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    2.714955] pc : __srcu_read_lock+0x30/0x80
[    2.715341] lr : blk_mq_tagset_busy_iter+0x44/0x300
[    2.715779] sp : ffff80008005b8b0
[    2.716073] x29: ffff80008005b8b0 x28: 0000000000000000 x27: 0000000000000000
[    2.716711] x26: ffff0000ca718898 x25: ffff0000c1595410 x24: ffff0000ca7180e0
[    2.717348] x23: ffffa77abec3f8e0 x22: ffffa77abf5dce68 x21: ffff0000c1595410
[    2.717984] x20: 0000000000000000 x19: 0000000000000000 x18: 000000000000000a
[    2.718620] x17: 000000040044ffff x16: 00500074b5503510 x15: 0000000000000000
[    2.719256] x14: 0000000000000000 x13: 303d657461747320 x12: 74736f4820534655
[    2.719892] x11: 0000000000000058 x10: 0000000000000018 x9 : ffffa77abf096cd0
[    2.720529] x8 : 0000000000057fa8 x7 : 000000000000010a x6 : ffffa77abf0eecd0
[    2.721165] x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff58893efc6000
[    2.721800] x2 : ffff0000c0268000 x1 : ffff58893efc6000 x0 : ffff0000ca718188
[    2.722437] Call trace:
[    2.722658]  __srcu_read_lock+0x30/0x80 (P)
[    2.723037]  blk_mq_tagset_busy_iter+0x44/0x300
[    2.723442]  scsi_host_busy+0x38/0x70
[    2.723774]  ufshcd_print_host_state+0x34/0x1bc
[    2.724178]  ufshcd_link_startup.constprop.0+0xe4/0x2e0
[    2.724644]  ufshcd_init+0x944/0xf80
[    2.724967]  ufshcd_pltfrm_init+0x504/0x820
[    2.725344]  ufs_rockchip_probe+0x2c/0x88
[    2.725706]  platform_probe+0x5c/0xa4
[    2.726039]  really_probe+0xc0/0x38c
[    2.726360]  __driver_probe_device+0x7c/0x150
[    2.726749]  driver_probe_device+0x40/0x120
[    2.727122]  __driver_attach+0xc8/0x1e0
[    2.727466]  bus_for_each_dev+0x7c/0xdc
[    2.727808]  driver_attach+0x24/0x30
[    2.728128]  bus_add_driver+0x110/0x230
[    2.728471]  driver_register+0x68/0x130
[    2.728815]  __platform_driver_register+0x20/0x2c
[    2.729236]  ufs_rockchip_pltform_init+0x1c/0x28
[    2.729654]  do_one_initcall+0x60/0x1e0
[    2.729999]  kernel_init_freeable+0x248/0x2c4
[    2.730394]  kernel_init+0x20/0x140
[    2.730712]  ret_from_fork+0x10/0x20
[    2.731038] Code: d2800024 aa0503e1 d538d083 8b030021 (c85f7c27)
[    2.731574] ---[ end trace 0000000000000000 ]---

Greetings,

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-rockchip/attachments/20251003/2e202179/attachment.sig>


More information about the Linux-rockchip mailing list