]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: mac_scsi: Disallow bus errors during PDMA send
authorFinn Thain <fthain@linux-m68k.org>
Wed, 7 Aug 2024 03:36:28 +0000 (13:36 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:33:31 +0000 (16:33 +0200)
commitca1e502067182ed5867d78d7ced615da56256db1
tree292289c61d413fdd14b1e3923fbdc9fa89bde078
parenta960eb7988b4be3329c671d784b63f41c5a80e95
scsi: mac_scsi: Disallow bus errors during PDMA send

commit 5551bc30e4a69ad86d0d008e2f56cd59b6583476 upstream.

SD cards can produce write latency spikes on the order of a hundred
milliseconds. If the target firmware does not hide that latency during DATA
IN and OUT phases it can cause the PDMA circuitry to raise a processor bus
fault which in turn leads to an unreliable byte count and a DMA overrun.

The Last Byte Sent flag is used to detect the overrun but this mechanism is
unreliable on some systems. Instead, set a DID_ERROR result whenever there
is a bus fault during a PDMA send, unless the cause was a phase mismatch.

Cc: stable@vger.kernel.org # 5.15+
Reported-and-tested-by: Stan Johnson <userm57@yahoo.com>
Fixes: 7c1f3e3447a1 ("scsi: mac_scsi: Treat Last Byte Sent time-out as failure")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Link: https://lore.kernel.org/r/cc38df687ace2c4ffc375a683b2502fc476b600d.1723001788.git.fthain@linux-m68k.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/mac_scsi.c