Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936507AbcJFXnO (ORCPT ); Thu, 6 Oct 2016 19:43:14 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:46004 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756099AbcJFXlL (ORCPT ); Thu, 6 Oct 2016 19:41:11 -0400 To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: Michael Schmitz , Ondrej Zary , , Message-Id: <2e8231c09bebeeb5dba831064b4acc02392ea7b9.1475791899.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH v2 05/12] scsi/ncr5380: Increase register polling limit Date: Thu, 6 Oct 2016 19:41:07 -0400 (EDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1653 Lines: 41 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 Reviewed-by: Hannes Reinecke --- 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