Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2524408ybi; Sat, 1 Jun 2019 18:32:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1EThhK6vEnx93c9ojCWcMmd0LcrVnJt6lf2ZV8njHXZdp8ne9lv/s6ttqYCdk5ulXzWx0 X-Received: by 2002:a17:90a:a10f:: with SMTP id s15mr20853073pjp.30.1559439130740; Sat, 01 Jun 2019 18:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559439130; cv=none; d=google.com; s=arc-20160816; b=rkMuUj+p5gnPFLmWW1hL+go00a8IFpibJuoc5JehzgskbFHXukGrVn8ukf3gEdbFYB 90UohCMAiA3HzZYTyCgJxnN7aVtPoZ1nlI5JPxH+2tm0HATxA0j3zid6UPJ8BQHq16gI IWFW/SJV05BDJVZSanYLzmhonmK0Pu1c6eu7obrU85CgkxlqARKENA6U718Eku3Z49TL /rIN6rhTTU2QzB1zSNWA/7t7mhq1dyv9F4yqT3wbJGX1GufSB1OVn7M/wJF1N86jv3lL D/3N8mUWeTQd+qysTkXT78eqGAZ3+dWDSrk9UscuWVNoWLjSmccx6dkLVQF34gZeOlMI 9NEQ== 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=DeaNII5Eem21v1JR9kNjQ0W9FG3g977LBvtOezWLm5Y=; b=zKZBQxSHoO689REp0zAHuDcR97XPELgTE52KM8xBiGG4eKR42mSuLgqVGjVZKM4mOI nhgwWfA+Yr4fANHDkBSHjNnjhpPpz2wEUkwkqsu42kPTy6hysqHrDAxbSdtkRoGJdDF4 Au+hQ/XNzwrGN1lzQrcfwEEIHC9qno4Pmqb48CAngOzzFKeoIJgxtV/peHbar+6giyp+ pXXogGkbemMIrwnLxPmAmz1Getbvnj+UxhslFMvQGSgPGyAni2faefhpU0jpRKJbYfNz /H734TXYme7FJIvOxHnPmvnUOSqXGG54tZ0SDBLREN3JXpPB8EV7Sbq2UmsCwHW/ep9L 0EyQ== 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 bg17si12631144pjb.75.2019.06.01.18.31.55; Sat, 01 Jun 2019 18:32:10 -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 S1726984AbfFBB31 (ORCPT + 99 others); Sat, 1 Jun 2019 21:29:27 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:34666 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726809AbfFBB3K (ORCPT ); Sat, 1 Jun 2019 21:29:10 -0400 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 39E0827F23; Sat, 1 Jun 2019 21:29:07 -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: <6249ead35826f734592db83d7073c6247d6af793.1559438652.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH 7/7] scsi: mac_scsi: Treat Last Byte Sent time-out as failure Date: Sun, 02 Jun 2019 11:24:12 +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 2e503f06ac99..68d4665112b5 100644 --- a/drivers/scsi/mac_scsi.c +++ b/drivers/scsi/mac_scsi.c @@ -188,9 +188,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