linux/drivers/nvme/host
Keith Busch be647e2c76 nvme: use srcu for iterating namespace list
The nvme pci driver synchronizes with all the namespace queues during a
reset to ensure that there's no pending timeout work.

Meanwhile the timeout work potentially iterates those same namespaces to
freeze their queues.

Each of those namespace iterations use the same read lock. If a write
lock should somehow get between the synchronize and freeze steps, then
forward progress is deadlocked.

We had been relying on the nvme controller state machine to ensure the
reset work wouldn't conflict with timeout work. That guarantee may be a
bit fragile to rely on, so iterate the namespace lists without taking
potentially circular locks, as reported by lockdep.

Link: https://lore.kernel.org/all/20220930001943.zdbvolc3gkekfmcv@shindev/
Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
History 2024-05-28 09:43:32 -07:00
..
apple.c nvme-apple: Convert to platform remove callback returning void 2024-03-08 06:55:47 -08:00
auth.c nvme: do not retry authentication failures 2024-05-01 03:07:20 -07:00
constants.c nvme: remove redundant status mask 2024-01-31 16:06:12 -08:00
core.c nvme: use srcu for iterating namespace list 2024-05-28 09:43:32 -07:00
fabrics.c nvme: do not retry authentication failures 2024-05-01 03:07:20 -07:00
fabrics.h nvme-fabrics: short-circuit reconnect retries 2024-05-01 03:07:20 -07:00
fault_inject.c nvme: fix parameter check in nvme_fault_inject_init() 2023-07-12 08:48:33 -07:00
fc.c nvme updates for Linux 6.10 2024-05-14 09:14:49 -06:00
fc.h nvme-fc: Update header and host for common definitions for LS handling 2020-05-09 16:18:33 -06:00
hwmon.c nvme: host: hwmon: constify pointers to hwmon_channel_info 2023-08-21 12:54:02 -07:00
ioctl.c nvme: use srcu for iterating namespace list 2024-05-28 09:43:32 -07:00
Kconfig nvme: improve NVME_HOST_AUTH and NVME_TARGET_AUTH config descriptions 2023-12-04 08:39:03 -08:00
Makefile nvme: rework NVME_AUTH Kconfig selection 2023-10-12 08:04:49 -07:00
multipath.c nvme: use srcu for iterating namespace list 2024-05-28 09:43:32 -07:00
nvme.h nvme: use srcu for iterating namespace list 2024-05-28 09:43:32 -07:00
pci.c nvme: adjust multiples of NVME_CTRL_PAGE_SIZE in offset 2024-05-24 08:59:16 -07:00
pr.c nvme: use nvme_disk_is_ns_head helper 2024-03-14 11:34:55 -07:00
rdma.c nvme-rdma, nvme-tcp: include max reconnects for reconnect logging 2024-05-07 08:50:37 -07:00
sysfs.c nvme updates for Linux 6.9 2024-03-21 13:23:07 -06:00
tcp.c nvme updates for Linux 6.10 2024-05-14 09:14:49 -06:00
trace.c nvme: parse format command's lbafu when tracing 2024-03-14 11:38:28 -07:00
trace.h nvme: fix async event trace event 2023-04-13 08:59:04 +02:00
zns.c nvme: split nvme_update_zone_info 2024-04-02 08:21:33 -07:00