]> asedeno.scripts.mit.edu Git - linux.git/commit
scsi: mac_scsi: Increase PIO/PDMA transfer length threshold
authorFinn Thain <fthain@telegraphics.com.au>
Sun, 9 Jun 2019 01:19:11 +0000 (11:19 +1000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 20 Jun 2019 19:37:03 +0000 (15:37 -0400)
commit7398cee4c3e6aea1ba07a6449e5533ecd0b92cdd
treef1b57024c5f85156dfe3c088261d017b6af71e03
parentf9dfed1c785734b95b08d67600e05d2092508ab0
scsi: mac_scsi: Increase PIO/PDMA transfer length threshold

Some targets introduce delays when handshaking the response to certain
commands. For example, a disk may send a 96-byte response to an INQUIRY
command (or a 24-byte response to a MODE SENSE command) too slowly.

Apparently the first 12 or 14 bytes are handshaked okay but then the system
bus error timeout is reached while transferring the next word.

Since the scsi bus phase hasn't changed, the driver then sets the target
borken flag to prevent further PDMA transfers. The driver also logs the
warning, "switching to slow handshake".

Raise the PDMA threshold to 512 bytes so that PIO transfers will be used
for these commands. This default is sufficiently low that PDMA will still
be used for READ and WRITE commands.

The existing threshold (16 bytes) was chosen more or less at random.
However, best performance requires the threshold to be as low as possible.
Those systems that don't need the PIO workaround at all may benefit from
mac_scsi.setup_use_pdma=1

Cc: Michael Schmitz <schmitzmic@gmail.com>
Cc: stable@vger.kernel.org # v4.14+
Fixes: 3a0f64bfa907 ("mac_scsi: Fix pseudo DMA implementation")
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Tested-by: Stan Johnson <userm57@yahoo.com>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mac_scsi.c