Finn Thain
6bd5aeb624
scsi: mesh: Fix panic after host or bus reset
...
[ Upstream commit edd7dd2292ab9c3628b65c4d04514c3068ad54f6 ]
Booting Linux with a Conner CP3200 drive attached to the MESH SCSI bus
results in EH measures and a panic:
[ 25.499838] mesh: configured for synchronous 5 MB/s
[ 25.787154] mesh: performing initial bus reset...
[ 29.867115] scsi host0: MESH
[ 29.929527] mesh: target 0 synchronous at 3.6 MB/s
[ 29.998763] scsi 0:0:0:0: Direct-Access CONNER CP3200-200mb-3.5 4040 PQ: 0 ANSI: 1 CCS
[ 31.989975] sd 0:0:0:0: [sda] 415872 512-byte logical blocks: (213 MB/203 MiB)
[ 32.070975] sd 0:0:0:0: [sda] Write Protect is off
[ 32.137197] sd 0:0:0:0: [sda] Mode Sense: 5b 00 00 08
[ 32.209661] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 32.332708] sda: [mac] sda1 sda2 sda3
[ 32.417733] sd 0:0:0:0: [sda] Attached SCSI disk
... snip ...
[ 76.687067] mesh_abort((ptrval))
[ 76.743606] mesh: state at (ptrval), regs at (ptrval), dma at (ptrval)
[ 76.810798] ct=6000 seq=86 bs=4017 fc= 0 exc= 0 err= 0 im= 7 int= 0 sp=85
[ 76.880720] dma stat=84e0 cmdptr=1f73d000
[ 76.941387] phase=4 msgphase=0 conn_tgt=0 data_ptr=24576
[ 77.005567] dma_st=1 dma_ct=0 n_msgout=0
[ 77.065456] target 0: req=(ptrval) goes_out=0 saved_ptr=0
[ 77.130512] mesh_abort((ptrval))
[ 77.187670] mesh: state at (ptrval), regs at (ptrval), dma at (ptrval)
[ 77.255594] ct=6000 seq=86 bs=4017 fc= 0 exc= 0 err= 0 im= 7 int= 0 sp=85
[ 77.325778] dma stat=84e0 cmdptr=1f73d000
[ 77.387239] phase=4 msgphase=0 conn_tgt=0 data_ptr=24576
[ 77.453665] dma_st=1 dma_ct=0 n_msgout=0
[ 77.515900] target 0: req=(ptrval) goes_out=0 saved_ptr=0
[ 77.582902] mesh_host_reset
[ 88.187083] Kernel panic - not syncing: mesh: double DMA start !
[ 88.254510] CPU: 0 PID: 358 Comm: scsi_eh_0 Not tainted 5.6.13-pmac #1
[ 88.323302] Call Trace:
[ 88.378854] [e16ddc58] [c0027080] panic+0x13c/0x308 (unreliable)
[ 88.446221] [e16ddcb8] [c02b2478] mesh_start.part.12+0x130/0x414
[ 88.513298] [e16ddcf8] [c02b2fc8] mesh_queue+0x54/0x70
[ 88.577097] [e16ddd18] [c02a1848] scsi_send_eh_cmnd+0x374/0x384
[ 88.643476] [e16dddc8] [c02a1938] scsi_eh_tur+0x5c/0xb8
[ 88.707878] [e16dddf8] [c02a1ab8] scsi_eh_test_devices+0x124/0x178
[ 88.775663] [e16dde28] [c02a2094] scsi_eh_ready_devs+0x588/0x8a8
[ 88.843124] [e16dde98] [c02a31d8] scsi_error_handler+0x344/0x520
[ 88.910697] [e16ddf08] [c00409c8] kthread+0xe4/0xe8
[ 88.975166] [e16ddf38] [c000f234] ret_from_kernel_thread+0x14/0x1c
[ 89.044112] Rebooting in 180 seconds..
In theory, a panic can happen after a bus or host reset with dma_started
flag set. Fix this by halting the DMA before reinitializing the host.
Don't assume that ms->current_req is set when halt_dma() is invoked as it
may not hold for bus or host reset.
BTW, this particular Conner drive can be made to work by inhibiting
disconnect/reselect with 'mesh.resel_targets=0'.
Link: https://lore.kernel.org/r/3952bc691e150a7128b29120999b6092071b039a.1595460351.git.fthain@telegraphics.com.au
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: Paul Mackerras <paulus@ozlabs.org>
Reported-and-tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-21 11:02:02 +02:00
..
2019-03-13 14:05:01 -07:00
2020-02-28 15:42:27 +01:00
2019-02-20 10:18:35 +01:00
2016-10-26 22:17:43 -04:00
2020-08-21 11:02:01 +02:00
2018-03-22 09:17:43 +01:00
2020-01-14 20:04:31 +01:00
2019-06-22 08:17:20 +02:00
2020-01-23 08:19:43 +01:00
2020-02-14 16:31:05 -05:00
2020-01-23 08:19:37 +01:00
2016-09-14 12:47:42 -04:00
2019-11-10 11:23:14 +01:00
2020-01-23 08:19:42 +01:00
2019-08-11 12:22:12 +02:00
2020-02-05 13:05:52 +00:00
2019-04-05 22:29:06 +02:00
2020-06-30 15:38:23 -04:00
2018-10-20 09:51:30 +02:00
2019-11-28 18:28:24 +01:00
2020-01-29 10:24:28 +01:00
2020-01-12 11:24:10 +01:00
2020-06-30 15:38:22 -04:00
2020-02-14 16:31:10 -05:00
2020-06-30 15:38:24 -04:00
2018-05-25 16:13:08 +02:00
2016-07-20 17:38:35 -06:00
2015-05-31 18:06:28 -07:00
2020-01-04 13:40:59 +01:00
2020-06-30 15:38:21 -04:00
2020-02-14 16:31:05 -05:00
2019-06-22 08:17:24 +02:00
2017-08-06 18:59:49 -07:00
2019-11-25 09:52:13 +01:00
2020-06-11 09:22:21 +02:00
2018-09-19 22:47:14 +02:00
2015-04-27 10:10:19 -07:00
2018-09-19 22:47:14 +02:00
2015-04-27 10:04:39 -07:00
2018-09-19 22:47:14 +02:00
2015-04-27 10:05:55 -07:00
2016-07-13 22:33:23 -04:00
2016-07-13 22:33:23 -04:00
2015-08-07 15:03:42 +02:00
2014-10-20 16:21:33 +02:00
2014-10-20 16:21:33 +02:00
2018-02-25 11:05:53 +01:00
2015-05-31 18:06:28 -07:00
2016-02-23 21:27:02 -05:00
2015-04-09 18:08:31 -07:00
2015-05-31 18:06:28 -07:00
2015-05-31 18:06:28 -07:00
2015-04-17 10:13:56 -07:00
2020-01-04 13:40:54 +01:00
2015-11-25 22:08:55 -05:00
2015-11-25 22:08:52 -05:00
2015-02-02 09:57:45 -08:00
2014-10-20 16:21:33 +02:00
2015-04-14 09:50:27 -07:00
2016-08-16 00:49:32 -04:00
2019-11-28 18:28:27 +01:00
2016-04-11 16:57:09 -04:00
2016-02-23 21:27:02 -05:00
2016-05-10 22:01:07 -04:00
2014-11-24 14:45:27 +01:00
2018-11-13 11:16:51 -08:00
2018-11-13 11:16:51 -08:00
2016-02-23 21:27:02 -05:00
2015-11-09 16:32:14 -08:00
2017-01-12 11:39:29 +01:00
2016-09-29 21:52:43 -04:00
2016-02-25 21:16:49 -05:00
2016-02-25 21:16:49 -05:00
2016-10-07 09:28:53 -07:00
2019-07-10 09:55:43 +02:00
2019-08-25 10:51:46 +02:00
2017-12-20 10:07:22 +01:00
2015-08-12 13:14:57 -07:00
2015-08-12 13:14:57 -07:00
2016-02-25 21:10:53 -05:00
2015-11-20 11:39:03 -05:00
2020-04-02 17:20:32 +02:00
2020-04-02 17:20:32 +02:00
2019-11-28 18:28:23 +01:00
2020-06-30 15:38:28 -04:00
2020-02-28 15:42:34 +01:00
2016-01-27 20:36:10 +08:00
2014-10-20 16:21:33 +02:00
2019-11-10 11:23:15 +01:00
2016-01-27 20:36:10 +08:00
2019-12-21 10:42:33 +01:00
2016-02-05 16:29:28 -06:00
2018-11-13 11:16:51 -08:00
2020-01-04 13:40:54 +01:00
2016-09-26 20:49:25 -04:00
2019-10-29 09:14:57 +01:00
2020-08-21 11:02:02 +02:00
2014-10-20 16:21:33 +02:00
2016-03-05 17:07:46 -05:00
2014-11-24 14:45:27 +01:00
2015-05-31 18:06:28 -07:00
2019-11-25 09:53:05 +01:00
2016-09-14 14:11:12 -04:00
2015-05-31 18:06:28 -07:00
2014-11-24 20:01:28 +01:00
2016-09-04 01:28:07 -04:00
2016-02-23 21:27:02 -05:00
2015-05-31 18:06:28 -07:00
2016-04-30 09:25:26 -07:00
2015-05-31 18:06:28 -07:00
2016-03-01 20:06:49 -05:00
2016-11-28 15:51:31 -05:00
2016-04-04 12:07:42 -04:00
2020-08-21 11:02:01 +02:00
2020-06-30 15:38:37 -04:00
2019-05-08 07:19:10 +02:00
2016-06-18 11:59:01 -07:00
2014-11-12 11:16:12 +01:00
2020-06-20 10:24:07 +02:00
2019-10-07 18:53:15 +02:00
2014-11-12 11:16:05 +01:00
2019-01-23 08:10:54 +01:00
2016-10-07 09:28:53 -07:00
2016-04-11 16:57:09 -04:00
2016-03-14 21:05:04 -04:00
2019-04-05 22:29:08 +02:00
2019-10-29 09:15:19 +01:00
2020-01-23 08:19:43 +01:00
2016-04-11 16:57:09 -04:00
2020-05-02 17:23:04 +02:00
2016-08-18 22:23:20 -04:00
2020-07-31 16:44:01 +02:00
2018-06-06 16:44:38 +02:00
2016-09-26 20:58:42 -04:00
2014-11-12 11:15:54 +01:00
2016-09-15 09:51:14 -04:00
2020-04-02 17:20:33 +02:00
2016-09-15 09:51:14 -04:00
2016-04-11 16:57:09 -04:00
2018-03-22 09:17:55 +01:00
2020-05-20 08:15:34 +02:00
2014-10-20 16:21:33 +02:00
2016-02-23 21:27:02 -05:00
2019-11-10 11:23:14 +01:00
2018-12-13 09:20:29 +01:00
2020-06-30 15:38:23 -04:00
2014-11-12 11:15:57 +01:00
2016-10-18 14:13:37 -07:00
2015-11-18 11:59:09 -05:00
2016-02-23 21:27:02 -05:00
2019-05-08 07:19:10 +02:00
2020-01-04 13:40:54 +01:00
2014-11-20 09:11:15 +01:00
2015-08-10 23:07:05 -04:00
2014-10-20 16:21:33 +02:00
2015-05-31 18:06:28 -07:00
2019-03-23 13:19:46 +01:00
2019-07-10 09:55:39 +02:00
2016-11-01 13:31:23 -04:00
2015-02-02 09:57:46 -08:00
2016-09-01 17:52:01 -07:00
2015-05-31 18:06:28 -07:00
2018-08-24 13:12:29 +02:00