android_kernel_xiaomi_sm8350/drivers/s390/scsi
Christof Schmitt d74cf7c3e9 [SCSI] zfcp: Fix hang when offlining device with offline chpid
Running chchp --vary 0 and chccwdev -d on a FCP device with scsi
devices attached can lead to this thread hanging:

================================================================
STACK TRACE FOR TASK: 0x2fbfcc00 (kslowcrw)

 STACK:
 0 schedule+1136 [0x45f99c]
 1 schedule_timeout+534 [0x46054e]
 2 wait_for_common+374 [0x45f442]
 3 blk_execute_rq+160 [0x217a2c]
 4 scsi_execute+278 [0x26daf2]
 5 scsi_execute_req+150 [0x26dc86]
 6 sd_sync_cache+138 [0x28460a]
 7 sd_shutdown+130 [0x28486a]
 8 sd_remove+104 [0x284c84]
 9 __device_release_driver+152 [0x257430]
10 device_release_driver+56 [0x2575c8]
11 bus_remove_device+214 [0x25672a]
12 device_del+352 [0x25456c]
13 __scsi_remove_device+108 [0x272630]
14 scsi_remove_device+66 [0x2726ba]
15 zfcp_ccw_remove+824 [0x335558]
16 ccw_device_remove+62 [0x2b3f2a]
17 __device_release_driver+152 [0x257430]
18 device_release_driver+56 [0x2575c8]
19 bus_remove_device+214 [0x25672a]
20 device_del+352 [0x25456c]
21 ccw_device_unregister+92 [0x2b48c4]
22 io_subchannel_remove+108 [0x2b4950]
23 css_remove+62 [0x2af7ee]
24 __device_release_driver+152 [0x257430]
25 device_release_driver+56 [0x2575c8]
26 bus_remove_device+214 [0x25672a]
27 device_del+352 [0x25456c]
28 device_unregister+38 [0x25464a]
29 css_sch_device_unregister+68 [0x2af97c]
30 ccw_device_call_sch_unregister+78 [0x2b581e]
31 worker_thread+604 [0x69eb0]
32 kthread+154 [0x6ff42]
33 kernel_thread_starter+6 [0x1c952]
================================================================

The problem is that the chchp --vary 0 leads to zfcp first calling
fc_remote_port_delete which blocks all scsi devices on the remote
port. Calling scsi_remove_device later lets the sd driver issue a
SYNCHRONIZE_CACHE command. This command stays on the "stopped" request
requeue because the SCSI device is blocked. Fix this by first removing
the scsi and fc hosts which removes all scsi devices and do not use
scsi_remove_device.

Reviewed-by: Felix Beck <felix.beck@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-10-02 09:50:21 -05:00
..
Makefile
zfcp_aux.c [SCSI] zfcp: Fix hang when offlining device with offline chpid 2009-10-02 09:50:21 -05:00
zfcp_ccw.c [SCSI] zfcp: Fix hang when offlining device with offline chpid 2009-10-02 09:50:21 -05:00
zfcp_cfdc.c [SCSI] zfcp: Fix initial device and cfdc for delayed adapter allocation 2009-10-02 09:49:47 -05:00
zfcp_dbf.c [SCSI] zfcp: Remove duplicated code for debug timestamps 2009-09-05 08:49:48 -05:00
zfcp_dbf.h [SCSI] zfcp: Update dbf calls 2009-09-05 08:49:30 -05:00
zfcp_def.h [SCSI] zfcp: optimize zfcp_qdio_account 2009-09-05 08:49:49 -05:00
zfcp_erp.c [SCSI] zfcp: Defer resource allocation to first ccw_set_online call 2009-09-05 08:49:41 -05:00
zfcp_ext.h [SCSI] zfcp: Fix initial device and cfdc for delayed adapter allocation 2009-10-02 09:49:47 -05:00
zfcp_fc.c [SCSI] zfcp: Replace config semaphore with mutex 2009-09-05 08:49:42 -05:00
zfcp_fsf.c [SCSI] zfcp: correctly initialize unchained requests 2009-10-02 09:49:35 -05:00
zfcp_fsf.h [SCSI] zfcp: Move debug data from zfcp_data to own data structure 2009-09-05 08:49:06 -05:00
zfcp_qdio.c [SCSI] zfcp: optimize zfcp_qdio_account 2009-09-05 08:49:49 -05:00
zfcp_scsi.c trivial: remove unnecessary semicolons 2009-09-21 15:14:58 +02:00
zfcp_sysfs.c [SCSI] zfcp: Replace config semaphore with mutex 2009-09-05 08:49:42 -05:00