mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Michael Schmitz <schmitzmic@gmail.com>,
	Ondrej Zary <linux@rainbow-software.org>,
	<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v3 05/12] scsi/ncr5380: Increase register polling limit
Date: Mon, 10 Oct 2016 00:46:52 -0400 (EDT)	[thread overview]
Message-ID: <aee781fefa4fa431cc9664675715ae9c7fcd72ef.1476051962.git.fthain@telegraphics.com.au> (raw)
In-Reply-To: <cover.1476051961.git.fthain@telegraphics.com.au>

If NCR5380_poll_politely() is called under irq lock, the polling time
limit is clamped to avoid a spike in interrupt latency. When not under
irq lock, the same polling time limit acts as the worst case delay
between schedule() calls.

During PDMA (under irq lock) I've found that the 10 ms time limit is
sometimes too short, and leads to the error message,
sd 0:0:0:0: [sda] tag#1 macscsi_pread: !REQ and !ACK

This particular target identifies itself as a QUANTUM DAYTONA514S. It
seems to be slower to assert ACK than the other targets I've tested.
This patch solves the problem by increasing the polling timeout.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
---
When irqs are disabled, this change will make no difference unless the
driver or target happens to suffer from timeout errors. In the irqs
enabled case, this patch may delay the next call to schedule() by an
additional 5 ms (in all 5380 drivers). Normally that would only happen
for a target selection timeout during a SCSI bus scan, which should not
bother anyone too much.
---
 drivers/scsi/NCR5380.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h
index cbb29d6..f0eea44 100644
--- a/drivers/scsi/NCR5380.h
+++ b/drivers/scsi/NCR5380.h
@@ -253,7 +253,7 @@ struct NCR5380_cmd {
 #define NCR5380_PIO_CHUNK_SIZE		256
 
 /* Time limit (ms) to poll registers when IRQs are disabled, e.g. during PDMA */
-#define NCR5380_REG_POLL_TIME		10
+#define NCR5380_REG_POLL_TIME		15
 
 static inline struct scsi_cmnd *NCR5380_to_scmd(struct NCR5380_cmd *ncmd_ptr)
 {
-- 
2.7.3

  parent reply	other threads:[~2016-10-10  4:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10  4:46 [PATCH v3 00/12] Fixes, cleanup and g_NCR5380_mmio/g_NCR5380 merger Finn Thain
2016-10-10  4:46 ` [PATCH v3 02/12] scsi/cumana_1: Remove unused cumanascsi_setup() function Finn Thain
2016-10-10  9:11   ` Russell King - ARM Linux
2016-10-10  4:46 ` [PATCH v3 04/12] scsi/ncr5380: Simplify register polling limit Finn Thain
2016-10-10  4:46 ` Finn Thain [this message]
2016-10-10  4:46 ` [PATCH v3 03/12] scsi/atari_scsi: Make device register accessors re-entrant Finn Thain
2016-10-10  4:46 ` [PATCH v3 01/12] scsi/g_NCR5380: Merge g_NCR5380 and g_NCR5380_mmio drivers Finn Thain
2016-10-10  4:46 ` [PATCH v3 09/12] scsi/ncr5380: Pass hostdata pointer to register polling routines Finn Thain
2016-10-10  4:46 ` [PATCH v3 06/12] scsi/ncr5380: Improve hostdata struct member alignment and cache-ability Finn Thain
2016-10-10  4:46 ` [PATCH v3 08/12] scsi/ncr5380: Use correct types for device register accessors Finn Thain
2016-10-10  9:13   ` Russell King - ARM Linux
2016-10-10  4:46 ` [PATCH v3 10/12] scsi/ncr5380: Expedite register polling Finn Thain
2016-10-10  9:17   ` Russell King - ARM Linux
2016-10-10 22:57     ` Finn Thain
2016-10-10  4:46 ` [PATCH v3 11/12] scsi/ncr5380: Use correct types for DMA routines Finn Thain
2016-10-10  9:15   ` Russell King - ARM Linux
2016-10-10  4:46 ` [PATCH v3 07/12] scsi/ncr5380: Store IO ports and addresses in host private data Finn Thain
2016-10-10  9:19   ` Russell King - ARM Linux
2016-10-10  4:46 ` [PATCH v3 12/12] scsi/ncr5380: Suppress unhelpful "interrupt without IRQ bit" message 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=aee781fefa4fa431cc9664675715ae9c7fcd72ef.1476051962.git.fthain@telegraphics.com.au \
    --to=fthain@telegraphics.com.au \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@rainbow-software.org \
    --cc=martin.petersen@oracle.com \
    --cc=schmitzmic@gmail.com \
    /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

all inboxes | Powered by JetHome®