From: Finn Thain <fthain@telegraphics.com.au>
To: "James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Michael Schmitz <schmitzmic@gmail.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: [PATCH 4/7] scsi: mac_scsi: Increase PIO/PDMA transfer length threshold
Date: Sun, 02 Jun 2019 11:24:12 +1000 [thread overview]
Message-ID: <666248afffd5a75c3259f06737ddcfb2b833b1f7.1559438652.git.fthain@telegraphics.com.au> (raw)
In-Reply-To: <cover.1559438652.git.fthain@telegraphics.com.au>
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")
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
drivers/scsi/mac_scsi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index 8b4b5b1a13d7..ba1afcaadae8 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -52,7 +52,7 @@ static int setup_cmd_per_lun = -1;
module_param(setup_cmd_per_lun, int, 0);
static int setup_sg_tablesize = -1;
module_param(setup_sg_tablesize, int, 0);
-static int setup_use_pdma = -1;
+static int setup_use_pdma = 512;
module_param(setup_use_pdma, int, 0);
static int setup_hostid = -1;
module_param(setup_hostid, int, 0);
@@ -305,7 +305,7 @@ static int macscsi_dma_xfer_len(struct NCR5380_hostdata *hostdata,
struct scsi_cmnd *cmd)
{
if (hostdata->flags & FLAG_NO_PSEUDO_DMA ||
- cmd->SCp.this_residual < 16)
+ cmd->SCp.this_residual < setup_use_pdma)
return 0;
return cmd->SCp.this_residual;
--
2.21.0
next prev parent reply other threads:[~2019-06-02 1:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-02 1:24 [PATCH 0/7] NCR5380 drivers: fixes and improvements Finn Thain
2019-06-02 1:24 ` [PATCH 1/7] Revert "scsi: ncr5380: Increase register polling limit" Finn Thain
2019-06-02 1:24 ` [PATCH 5/7] scsi: mac_scsi: Fix pseudo DMA implementation, take 2 Finn Thain
2019-06-02 9:07 ` Geert Uytterhoeven
2019-06-02 23:32 ` Finn Thain
2019-06-03 6:23 ` Geert Uytterhoeven
2019-06-03 7:40 ` Finn Thain
2019-06-03 7:53 ` Geert Uytterhoeven
2019-06-03 21:25 ` Michael Schmitz
2019-06-04 0:05 ` Finn Thain
2019-06-02 1:24 ` [PATCH 6/7] scsi: mac_scsi: Enable PDMA on Mac IIfx Finn Thain
2019-06-02 9:04 ` Geert Uytterhoeven
2019-06-02 1:24 ` Finn Thain [this message]
2019-06-02 1:24 ` [PATCH 3/7] scsi: NCR5380: Handle PDMA failure reliably Finn Thain
2019-06-02 1:24 ` [PATCH 7/7] scsi: mac_scsi: Treat Last Byte Sent time-out as failure Finn Thain
2019-06-02 1:24 ` [PATCH 2/7] scsi: NCR5380: Always re-enable reselection interrupt Finn Thain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=666248afffd5a75c3259f06737ddcfb2b833b1f7.1559438652.git.fthain@telegraphics.com.au \
--to=fthain@telegraphics.com.au \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=schmitzmic@gmail.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox