Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1776028ybi; Sat, 8 Jun 2019 18:31:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeuIR1Irqj0M97zb5QyC3+qV6k2FRAcUYr0to4Mip2th8SPOa+s76+kS8NZfFrwlFeE2aA X-Received: by 2002:a62:b503:: with SMTP id y3mr65006761pfe.4.1560043868426; Sat, 08 Jun 2019 18:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560043868; cv=none; d=google.com; s=arc-20160816; b=LCPkErmToX9UEiM2wolbsCbrPm1W/kULzkztzXsCbfxe2vNrT0HUobi76OUM6uQNU7 lmMhzJMwZvPQvARN2krhsZt5X5Hec98cw/kih8moWVhq4a2NoP83Px0u6njJHEXQyOxg nHjfIUR/V04FcAEnB9K2ClgpmtTbT8MjEZviKxIWoMcxpE8WGftPtXOhM3aOM/sCnMiV VL1ZaE9klcMRohiDIcXV6+NDdGtsBWU54zkeT08kJoAjaw6ICA9bO/l0NU2JEoqIgYiT +iFBj+sDAbC14qPbRHcsgmNywBEcTQr0QLhDylENVbzIHVTvsCd9tsx83ClYXuu8iDHI 6cyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:from:references:in-reply-to :message-id:cc:to; bh=rgaLr21hSkD4BxkNcj8oQ/n2QbsHHM3JREHNsdw6fhc=; b=txvA3TMd1hz9LjlxfB7VmU8CbrFbJ5Cg+CGV95bS/JpsfkY2whTHKv8LjLM4Z9weNU rFtiL0j0+2OWEZCYxUS8WLfyeE1SgHBAxEDMntNSucA7/lJdeC3HMfWdCjsAV/9Wo5xz GZYGg+2y9otrtJTVBOCGcLF9jmD+LaHPAOfXJbMfcukC/h66HxEnSINzhExXI9t3PtQG Z99d+effDzomlFLwYou7XXkkuT+BG65UkrcU/L8zlwb5kRZyr2XbhGeKE8r+KQu/oaFo QyuBr0PMZdY+/tdhv/+IhlCq4EM6erFNET0WmU1r5l/QplDQmpGXZU69q8/nTq8lsvKP /kPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b20si5852109pgb.12.2019.06.08.18.30.19; Sat, 08 Jun 2019 18:31:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728108AbfFIB1A (ORCPT + 99 others); Sat, 8 Jun 2019 21:27:00 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:59996 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727878AbfFIB0p (ORCPT ); Sat, 8 Jun 2019 21:26:45 -0400 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 0D0C527ACE; Sat, 8 Jun 2019 21:26:43 -0400 (EDT) To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: "Michael Schmitz" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: <825f9cc5f8887f0d32274442ea7b21449b48f27c.1560043151.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH v2 7/7] scsi: mac_scsi: Treat Last Byte Sent time-out as failure Date: Sun, 09 Jun 2019 11:19:11 +1000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A system bus error during a PDMA send operation can result in bytes being lost. Theoretically that could cause the target to remain in DATA OUT phase and the initiator (expecting a phase change) would time-out waiting for the Last Byte Sent flag. Should that happen, fail the transfer so the core driver will stop using PDMA with this target. Cc: Michael Schmitz Tested-by: Stan Johnson Signed-off-by: Finn Thain --- drivers/scsi/mac_scsi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c index 8fbec1768bbf..658a719cfcba 100644 --- a/drivers/scsi/mac_scsi.c +++ b/drivers/scsi/mac_scsi.c @@ -360,9 +360,12 @@ static inline int macscsi_pwrite(struct NCR5380_hostdata *hostdata, if (hostdata->pdma_residual == 0) { if (NCR5380_poll_politely(hostdata, TARGET_COMMAND_REG, TCR_LAST_BYTE_SENT, - TCR_LAST_BYTE_SENT, HZ / 64) < 0) + TCR_LAST_BYTE_SENT, + HZ / 64) < 0) { scmd_printk(KERN_ERR, hostdata->connected, "%s: Last Byte Sent timeout\n", __func__); + result = -1; + } goto out; } -- 2.21.0