linux/drivers
John Garry d8c22c4697 scsi: pm8001: Fix running_req for internal abort commands
Disabling the remote phy for a SATA disk causes a hang:

root@(none)$ more /sys/class/sas_phy/phy-0:0:8/target_port_protocols
sata
root@(none)$ echo 0 > sys/class/sas_phy/phy-0:0:8/enable
root@(none)$ [   67.855950] sas: ex 500e004aaaaaaa1f phy08 change count has changed
[   67.920585] sd 0:0:2:0: [sdc] Synchronizing SCSI cache
[   67.925780] sd 0:0:2:0: [sdc] Synchronize Cache(10) failed: Result: hostbyte=0x04 driverbyte=DRIVER_OK
[   67.935094] sd 0:0:2:0: [sdc] Stopping disk
[   67.939305] sd 0:0:2:0: [sdc] Start/Stop Unit failed: Result: hostbyte=0x04 driverbyte=DRIVER_OK
...
[  123.998998] INFO: task kworker/u192:1:642 blocked for more than 30 seconds.
[  124.005960]   Not tainted 6.0.0-rc1-205202-gf26f8f761e83 #218
[  124.012049] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  124.019872] task:kworker/u192:1  state:D stack:0 pid:  642 ppid: 2 flags:0x00000008
[  124.028223] Workqueue: 0000:04:00.0_event_q sas_port_event_worker
[  124.034319] Call trace:
[  124.036758]  __switch_to+0x128/0x278
[  124.040333]  __schedule+0x434/0xa58
[  124.043820]  schedule+0x94/0x138
[  124.047045]  schedule_timeout+0x2fc/0x368
[  124.051052]  wait_for_completion+0xdc/0x200
[  124.055234]  __flush_workqueue+0x1a8/0x708
[  124.059328]  sas_porte_broadcast_rcvd+0xa8/0xc0
[  124.063858]  sas_port_event_worker+0x60/0x98
[  124.068126]  process_one_work+0x3f8/0x660
[  124.072134]  worker_thread+0x70/0x700
[  124.075793]  kthread+0x1a4/0x1b8
[  124.079014]  ret_from_fork+0x10/0x20

The issue is that the per-device running_req read in
pm8001_dev_gone_notify() never goes to zero and we never make progress.
This is caused by missing accounting for running_req for when an internal
abort command completes.

In commit 2cbbf48977 ("scsi: pm8001: Use libsas internal abort support")
we started to send internal abort commands as a proper sas_task. In this
when we deliver a sas_task to HW the per-device running_req is incremented
in pm8001_queue_command(). However it is never decremented for internal
abort commnds, so decrement in pm8001_mpi_task_abort_resp().

Link: https://lore.kernel.org/r/1663854664-76165-1-git-send-email-john.garry@huawei.com
Fixes: 2cbbf48977 ("scsi: pm8001: Use libsas internal abort support")
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2022-09-25 12:58:37 -04:00
..
accessibility TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
acpi More ACPI updates for 5.20-rc1 2022-08-11 13:26:09 -07:00
amba ARM: 9220/1: amba: Remove deferred device addition 2022-07-28 15:09:23 +01:00
android - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
ata powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
atm atm: idt77252: fix use-after-free bugs caused by tst_timer 2022-08-08 20:51:59 -07:00
auxdisplay
base Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
bcma
block xen: branch for v6.0-rc1b 2022-08-14 09:28:54 -07:00
bluetooth SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
bus SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
cdrom
char s390 updates for 5.20 merge window 2022-08-06 17:05:21 -07:00
clk The clk core gains a new set of APIs that allow drivers to both acquire clks 2022-08-04 18:40:08 -07:00
clocksource RISC-V: Add Sstc extension support 2022-08-11 14:41:52 -07:00
comedi pci-v5.20-changes 2022-08-04 19:30:35 -07:00
connector
counter
cpufreq More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
cpuidle More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
crypto This update includes the following changes: 2022-08-02 17:45:14 -07:00
cxl cxl/hdm: Fix skip allocations vs multiple pmem allocations 2022-08-05 16:11:38 -07:00
dax
dca
devfreq More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
dio
dma pci-v5.20-changes 2022-08-04 19:30:35 -07:00
dma-buf drm for 5.20/6.0 2022-08-03 19:52:08 -07:00
edac powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
eisa
extcon
firewire firewire: net: Make use of get_unaligned_be48(), put_unaligned_be48() 2022-07-28 22:21:54 -07:00
firmware RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
fpga
fsi
gnss
gpio gpio: updates for v6.0-rc1 2022-08-04 18:34:05 -07:00
gpu drm fixes for 6.0-rc1 2022-08-11 19:12:15 -07:00
greybus
hid platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
hsi
hte
hv
hwmon hwmon: (nct6775) Fix platform driver suspend regression 2022-08-10 06:37:01 -07:00
hwspinlock
hwtracing asm-generic: updates for 6.0 2022-08-05 10:07:23 -07:00
i2c i2c: move core from strlcpy to strscpy 2022-08-11 23:02:52 +02:00
i3c
idle Power management updates for 5.20-rc1 2022-08-02 11:17:00 -07:00
iio
infiniband dma-mapping updates 2022-08-06 10:56:45 -07:00
input Input updates for 5.20 (6.0) merge window: 2022-08-11 09:23:08 -07:00
interconnect
iommu Bitmap patches for v6.0-rc1 2022-08-07 17:52:35 -07:00
ipack
irqchip RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
isdn
leds LED updates for 5.20: new driver for bcm63138, is31fl319x updates, 2022-08-08 11:36:21 -07:00
macintosh
mailbox - mtk: use rx_callback instead of cmdq_task_cb. 2022-08-08 10:19:40 -07:00
mcb
md - A few fixes for the DM verity and bufio changes from the 6.0 merge. 2022-08-11 19:46:48 -07:00
media More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
memory More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
memstick MMC core: 2022-08-04 19:41:09 -07:00
message scsi: message: fusion: Remove redundant variable iocnum 2022-08-31 23:39:57 -04:00
mfd - Core Frameworks 2022-08-06 10:25:16 -07:00
misc - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
mmc MMC core: 2022-08-04 19:41:09 -07:00
most
mtd MTD core changes: 2022-08-05 14:13:45 -07:00
mux
net virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
nfc
ntb NTB: epf: Allow more flexibility in the memory BAR map method 2022-08-09 17:54:03 -04:00
nubus
nvdimm virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
nvme block-6.0-2022-08-12 2022-08-13 13:37:36 -07:00
nvmem SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
of RISC-V Patches for the 5.20 Merge Window, Part 2 2022-08-12 18:39:43 -07:00
opp OPP updates for 5.20-rc1 2022-08-03 17:49:38 +02:00
parisc parisc architecture fixes and updates for kernel v5.20-rc1: 2022-08-05 09:58:58 -07:00
parport
pci Fix of heap data and clang warnings, support for a new Intel NTB device, 2022-08-13 14:00:45 -07:00
pcmcia
peci
perf perf: riscv_pmu{,_sbi}: Miscallenous improvement & fixes 2022-08-12 07:17:38 -07:00
phy pci-v5.20-changes 2022-08-04 19:30:35 -07:00
pinctrl Pin control bulk changes for v6.0: 2022-08-10 11:01:44 -07:00
platform virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
pnp
power power supply and reset changes for the v6.0 series 2022-08-12 09:37:33 -07:00
powercap Power management updates for 5.20-rc1 2022-08-02 11:17:00 -07:00
pps
ps3
ptp SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
pwm SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
rapidio
ras
regulator chrome platform changes for 5.20 2022-08-04 18:13:19 -07:00
remoteproc virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
reset ARM: SoC: late updates for 6.0 2022-08-05 10:02:33 -07:00
rpmsg
rtc rtc: spear: set range max 2022-08-09 00:56:41 +02:00
s390 SCSI misc on 20220813 2022-08-13 13:41:48 -07:00
sbus
scsi scsi: pm8001: Fix running_req for internal abort commands 2022-09-25 12:58:37 -04:00
sh
siox
slimbus
soc More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
soundwire sound updates for 6.0-rc1 2022-08-06 10:19:51 -07:00
spi powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
spmi
ssb
staging Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00
target scsi: target: Remove unused se_tmr_req_cache declaration 2022-09-15 21:46:46 -04:00
tc
tee
thermal More thermal control updates for 5.20-rc1 2022-08-08 14:23:37 -07:00
thunderbolt USB / Thunderbolt changes for 6.0-rc1 2022-08-04 11:41:28 -07:00
tty TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
ufs scsi: ufs: core: Remove redundant function definitions from ufshcd.h 2022-09-25 12:50:44 -04:00
uio
usb scsi: uas: Drop DID_TARGET_FAILURE use 2022-09-06 22:05:58 -04:00
vdpa vdpa/mlx5: Fix possible uninitialized return value 2022-08-11 10:00:36 -04:00
vfio vfio: Move vfio.c to vfio_main.c 2022-08-08 14:33:41 -06:00
vhost virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
video TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
virt Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
virtio virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
vlynq
w1
watchdog linux-watchdog 5.20-rc1 tag 2022-08-08 15:04:04 -07:00
xen scsi: xen: Drop use of internal host codes 2022-09-06 22:05:58 -04:00
zorro
Kconfig
Makefile Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00