Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10409500ybi; Wed, 24 Jul 2019 22:42:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtCorrO4sxMEmhIvtdO55uNQZHfKfzmWiwVq31+cHtlhGG51q/g4+J2M2VEwen5mi5pb3r X-Received: by 2002:a17:902:8d92:: with SMTP id v18mr90442496plo.211.1564033343520; Wed, 24 Jul 2019 22:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564033343; cv=none; d=google.com; s=arc-20160816; b=yciVC27rrkME6noUZ2zbC5NRRqtkldv0sk9qklkyaA0mj+jAwXUQpdIRwQdONzzC0w pjZjCHr/cIN5xmISGniaIDaaRCtOhC8wICGXErI2F/YBvTrdn9NPJAiEFzWf0aO4fCO1 LgOnkMsP4h+kt0vJj93ape9GvO7Jar4Xec0C4n86kyiLXDV3IsQw6DvGa/EpqD/2G4pn wKVaNQoVNvpE4VThVYmACnf+FZhkgr6oJNW42lMCVkuUpwrUddjZREE26AXgLq2DjT7G 1T21pyAFThH6AbmV5qd0PmYjSx+129Oqsyq1db2tOp2Ufja/BXt0EOGB1ZoJCDFBuUZT FYXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IBOCFTP3C56RHppAnTv7QyxQM8UWG+TUr9sNUsuuqdc=; b=flNIq26fWSHQfleH9d2m7zAicZ1ZX2c3bOueLeaGS/bqMjQKhYqpx9NivTv9nRCgUV WMChRQuFT4teO0e7PhVqORNVoYwNrtxWAgFlhsHXvZUp5vI7ou6KUl/IVQc23GyNHAT4 ccfuoCyPOuj55FoHCq/Av6flqEiLnwLuygrSZOz9gTCqxOt+zQ5gGkg9E/KhYjnN7b+A xZLnbJE5h0azC73DjPlzY8McAiAraSFYNEfIiMYIWNQW0kT3xw131CKHMQrZUXzzCOr/ NFu5suk/tjSofZTxJiHu3fCw0P4P2u/4I+ZdWFCyTGerz0ataa2WcKVOJVjH8zZ2+u7+ RwnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FW2kas+1; 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 x9si18136544pfi.211.2019.07.24.22.42.08; Wed, 24 Jul 2019 22:42:23 -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; dkim=pass header.i=@kernel.org header.s=default header.b=FW2kas+1; 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 S2392586AbfGXUPN (ORCPT + 99 others); Wed, 24 Jul 2019 16:15:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:37070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404303AbfGXTyO (ORCPT ); Wed, 24 Jul 2019 15:54:14 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC6782147A; Wed, 24 Jul 2019 19:54:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563998054; bh=Gsj2tchzelCs7ctNMH0LBAgPG6rXairyn0i7xTigSAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FW2kas+1h02Y/G9T+pCVVLpCWPUt2+yztBl0hhK1jkCBZdNfnzikD+RR996c/BH5q 7DptY+2san/1v3LJwqO7nZmR9+KKdHgaybd/InHJgh+qY1Sf3cGL3vxFwcp81bjBgH zh1z8D/TopGFXMyHZ+3o31XQpnlyPn+CFaklX0V0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Schmitz , Finn Thain , Stan Johnson , "Martin K. Petersen" Subject: [PATCH 5.1 230/371] scsi: NCR5380: Handle PDMA failure reliably Date: Wed, 24 Jul 2019 21:19:42 +0200 Message-Id: <20190724191741.754419611@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191724.382593077@linuxfoundation.org> References: <20190724191724.382593077@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Finn Thain commit f9dfed1c785734b95b08d67600e05d2092508ab0 upstream. A PDMA error is handled in the core driver by setting the device's 'borken' flag and aborting the command. Unfortunately, do_abort() is not dependable. Perform a SCSI bus reset instead, to make sure that the command fails and gets retried. Cc: Michael Schmitz Cc: stable@vger.kernel.org # v4.20+ Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Finn Thain Tested-by: Stan Johnson Tested-by: Michael Schmitz Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/NCR5380.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -1762,10 +1762,8 @@ static void NCR5380_information_transfer scmd_printk(KERN_INFO, cmd, "switching to slow handshake\n"); cmd->device->borken = 1; - sink = 1; - do_abort(instance); - cmd->result = DID_ERROR << 16; - /* XXX - need to source or sink data here, as appropriate */ + do_reset(instance); + bus_reset_cleanup(instance); } } else { /* Transfer a small chunk so that the