Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9936349ybi; Wed, 24 Jul 2019 12:38:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxa8gbDbLLgIGaHSULmVhbqZJFROkUYx9tXeK1MDIg9ILAVji44+9uq9YK+y97rTFh+Imn X-Received: by 2002:a17:902:1e9:: with SMTP id b96mr88012528plb.277.1563997110875; Wed, 24 Jul 2019 12:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563997110; cv=none; d=google.com; s=arc-20160816; b=BVbBexesdyElSf0PbaZBTq5ZiftgaEToyPmxa1Jp1974aG/WTMFai/afu3ozvllBL0 XfX6Ttys9yt+3rWd1OzS1zwlTODgn3ZaX/W+t+1iW9OGRUrb3ye4/9yyH1SHw2z+rSz9 PmfeeDvf7IZSq8dlUXzmLFArI/eKeSPVkPc7avnD7W7g2LTZlanaxbE8LxB9f/uhCSA2 bVNa4jNXLAmxAWYrxHL6SzQwRYFC4/dO/qVIK+iRG0jR5c1Z4I4xklwSSXiU1+CGPuY8 gF44nDrbcj3k4w6G+GtNEEyOG4/o4jHyDjgEjyJZ2ynbxaCOfrxvrZqzMbsICks/Ul5h rGvQ== 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=iSSaURAkNRgNV1bryqNs48FsNa2x35Ayga69Viaph3A=; b=OVVxFukoMlcZ4VJei8bIaZaVq3ZXqc15VemsviSi4CmP6n6ePhFwjjnzsnW8Mye5Ku H7v3tHPKtgYIx8cPY8GsdrsQB0WmyCYnzf8cLib0WzLzjakrJjZG6nyR+jf0NnNaJ5AV Jme0A9b/LfC+Ln6KUVOMl6a+Al1+mk9+on8EqdDbCcTnmRXORzMnSXzOWDXy08qwJWJH WPY0UnPnMKR7sOZ1J+5MnDEq2xIc8Vr6a6kJCoyLCyVlTCY4iWYC1lZSr8O++3l4TU6q sGK0H5Zn0e81lN4kUGc+w/MDDEEETLxK92iUCeL+mQxbWJVlj/iIbXWjEB45e+9yV7lI +qyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SLaFwUTc; 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 g17si13523302plo.406.2019.07.24.12.38.16; Wed, 24 Jul 2019 12:38:30 -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=SLaFwUTc; 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 S2388919AbfGXTfu (ORCPT + 99 others); Wed, 24 Jul 2019 15:35:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:34016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388884AbfGXTft (ORCPT ); Wed, 24 Jul 2019 15:35:49 -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 B556A21951; Wed, 24 Jul 2019 19:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996948; bh=61i0o/cbhrmmFoEpZj1dE59plEfYxzY8AsKUoGE7LV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SLaFwUTcbk06LtTuBbRsQP7yTtSBg7dcnGekvFGHp64DkxIqcw39vrF9ZXPHZfwyD A0CFd0uoZwVcRqBYBKqzA23SGsabi07LFQk/HN8BeJL6aFiGJYRTrzIlqmWmFZh7Iw d8L3kD4Bq4VNujSMUKUd7z/i/F57/tuZxcptRQgI= 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.2 254/413] scsi: NCR5380: Handle PDMA failure reliably Date: Wed, 24 Jul 2019 21:19:05 +0200 Message-Id: <20190724191754.077822287@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 @@ -1761,10 +1761,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