Finn Thain
6c86105bd2
scsi: mesh: Fix panic after host or bus reset
[ Upstream commit edd7dd2292 ]
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: 1da177e4c3 ("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>
2023-05-16 08:46:49 +09:00
..
2023-05-15 11:51:07 +09:00
2023-05-15 16:58:46 +09:00
2023-05-15 11:34:48 +09:00
2016-10-26 22:17:43 -04:00
2023-05-16 08:46:28 +09:00
2018-03-22 09:17:43 +01:00
2023-05-15 16:33:37 +09:00
2023-05-15 13:49:03 +09:00
2023-05-15 16:35:43 +09:00
2023-05-15 16:56:18 +09:00
2023-05-15 16:34:38 +09:00
2016-09-14 12:47:42 -04:00
2023-05-15 14:56:51 +09:00
2023-05-15 16:35:41 +09:00
2023-05-15 14:15:37 +09:00
2023-05-15 16:54:48 +09:00
2023-05-15 12:16:49 +09:00
2023-05-16 08:18:43 +09:00
2023-05-15 09:06:57 +09:00
2023-05-15 15:17:31 +09:00
2023-05-15 16:46:00 +09:00
2023-05-15 16:30:02 +09:00
2023-05-16 08:18:30 +09:00
2023-05-15 16:57:21 +09:00
2023-05-16 08:19:10 +09: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
2023-05-15 16:21:17 +09:00
2023-05-16 08:18:17 +09:00
2023-05-15 16:56:19 +09:00
2023-05-15 13:50:10 +09:00
2017-08-06 18:59:49 -07:00
2023-05-15 15:08:47 +09:00
2023-05-15 17:31:16 +09:00
2023-05-15 08:14:20 +09:00
2015-04-27 10:10:19 -07:00
2023-05-15 08:14:20 +09:00
2015-04-27 10:04:39 -07:00
2023-05-15 08:14:20 +09: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
2013-11-26 11:09:07 +01: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
2023-05-15 16:21:11 +09: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
2013-06-26 18:32:47 -07: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
2023-05-15 15:17:37 +09:00
2016-04-11 16:57:09 -04:00
2016-02-23 21:27:02 -05:00
2014-07-17 22:07:37 +02:00
2016-05-10 22:01:07 -04:00
2014-11-24 14:45:27 +01:00
2023-05-15 09:20:02 +09:00
2023-05-15 09:20:02 +09: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
2013-04-09 14:13:16 -04:00
2016-02-25 21:16:49 -05:00
2013-04-09 14:13:16 -04:00
2013-11-26 11:09:07 +01:00
2016-10-07 09:28:53 -07:00
2023-05-15 13:56:49 +09:00
2023-05-15 14:19:00 +09: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
2023-05-15 17:11:36 +09:00
2023-05-15 17:11:36 +09:00
2023-05-15 15:17:27 +09:00
2013-04-09 14:13:27 -04:00
2023-05-16 08:19:55 +09:00
2023-05-15 16:59:19 +09:00
2016-01-27 20:36:10 +08:00
2014-10-20 16:21:33 +02:00
2023-05-15 14:56:54 +09:00
2013-01-03 15:57:01 -08:00
2016-01-27 20:36:10 +08:00
2023-05-15 16:17:58 +09:00
2016-02-05 16:29:28 -06:00
2023-05-15 09:20:02 +09:00
2023-05-15 16:21:11 +09:00
2016-09-26 20:49:25 -04:00
2023-05-15 14:49:58 +09:00
2014-03-27 08:26:31 -07:00
2023-05-16 08:46:49 +09:00
2014-10-20 16:21:33 +02:00
2013-04-09 14:13:15 -04:00
2016-03-05 17:07:46 -05:00
2013-04-15 14:30:44 -06:00
2014-11-24 14:45:27 +01:00
2014-07-17 22:07:35 +02:00
2015-05-31 18:06:28 -07:00
2023-05-15 15:10:53 +09:00
2016-09-14 14:11:12 -04:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08: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
2023-05-16 08:46:38 +09:00
2023-05-16 08:20:42 +09:00
2023-05-15 12:38:47 +09:00
2016-06-18 11:59:01 -07:00
2014-11-12 11:16:12 +01:00
2023-05-15 17:32:00 +09:00
2023-05-15 14:41:06 +09:00
2014-11-12 11:16:05 +01:00
2014-04-24 13:44:54 -04:00
2023-05-15 11:01:25 +09: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
2023-05-15 12:17:00 +09:00
2014-06-06 16:08:16 -07:00
2023-05-15 14:50:42 +09:00
2023-05-15 16:35:45 +09:00
2016-04-11 16:57:09 -04:00
2023-05-15 17:22:37 +09:00
2016-08-18 22:23:20 -04:00
2023-05-16 08:31:27 +09: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
2023-05-15 17:11:46 +09: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
2023-05-15 17:27:31 +09:00
2014-10-20 16:21:33 +02:00
2016-02-23 21:27:02 -05:00
2023-05-15 14:56:53 +09:00
2023-05-15 10:26:52 +09:00
2014-07-17 22:07:39 +02:00
2023-05-16 08:18:42 +09: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
2023-05-15 12:38:49 +09:00
2014-05-28 12:16:28 +02:00
2023-05-15 16:21:11 +09: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
2023-05-15 12:05:57 +09:00
2023-05-15 13:56:02 +09:00
2016-11-01 13:31:23 -04:00
2015-02-02 09:57:46 -08:00
2013-04-09 14:13:15 -04:00
2016-09-01 17:52:01 -07:00
2015-05-31 18:06:28 -07:00
2023-05-12 17:04:04 +09:00
2013-01-03 15:57:01 -08:00
2013-11-26 11:09:07 +01:00