Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp178512ybc; Mon, 18 Nov 2019 22:52:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwhRs+/TQEdUFWI5tg/X7z3xVxwFeRWwifQHzFpMxeJ5wJmYf4k5Yw7Yk/XqhATBYyDgoJr X-Received: by 2002:a17:907:2122:: with SMTP id qo2mr33128531ejb.12.1574146360314; Mon, 18 Nov 2019 22:52:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574146360; cv=none; d=google.com; s=arc-20160816; b=TTw2vmHGFPCYDThSLcwCPOxKasE8OC/1FVgj+t65oc6waaReOxAoy4RTb7lMwkN0sI 9aV34mqvCAA0CcfT42/YYOwHDkKunsUeZom3TTiq27X2hBzeLdAPlASrbdMoQY4vrhyD Z+ahj+WSTBKTwVDdyedEP1W55/bas/cwk30w3rtNl6X+T4phpfXJlxGQoi2RHWheztY/ AjF/6n8Jf1R4hm0/cSFFkt2zKzTaNBbPNhW+oCOQXdtXpQzMCQwipzv7PVWA/+yxvZRx GFIH8AH8n4YwzePcICld3cd0mfhjFU2pk3yTmxnQuZJEVDMJ1S3KqsCTy7pGJTa7hUis 8mIw== 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=1JoN9mfr5aldz2CL36uWTkdjFZ4zH+F54+SqPv8znIA=; b=X4MWz/MNiuOhmErcp0sxq2jpJ4d/aWvRjkAR3OCbFlO30DT5ZSRXuThLOacDXaxr/e AriHNOmXTdWyq2ZZts1mFYRjsnl/LP5sc3rT9dBNFA5Eoc/sNvgtfn+XEo6+h/fv59nc nIWryugCJgvClgaOzNzkScNB13Oyj/4/3vwjkIw3mia6j5WWoBqSSjI0fY18VlIRiXJv ktcp9LQW+cISpQ9QBXyyy4Pq6EzzPMGSvcP9cOjFBrzT2MUj1Rac8RzcQ1a7I3jFfgo5 EeJL54rx9vDZVTyA3yE/EDG6+V3m1O2h60TYJNKOvtV9iUYLEMq2//6Q3Vfw+5eSYqHH QNSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B6ogc4w7; 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 a9si16274768edm.231.2019.11.18.22.52.16; Mon, 18 Nov 2019 22:52:40 -0800 (PST) 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=B6ogc4w7; 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 S1730748AbfKSFn2 (ORCPT + 99 others); Tue, 19 Nov 2019 00:43:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:38304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730740AbfKSFn0 (ORCPT ); Tue, 19 Nov 2019 00:43:26 -0500 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 3FDC122309; Tue, 19 Nov 2019 05:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574142205; bh=h74CyComC6k5V4ED1SOpCza5IBa+Ykwmr9amfdKUrkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B6ogc4w7af8HiCdAyRbm1fVV3gEm0j7AVpVPDxcZWB1VWikTjnwW9WvNXlFC7v7Xv s2jGIhbb4LsDiEiLhoo+TibRBHfSiMwugENgmqG4Mn/9hOo7jRhYXi4GkgyegaA7oK 0DeMaAE0rhx//UmeEHIqzzs45KD0klLRjbzPkB6M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Schmitz , Finn Thain , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 401/422] scsi: NCR5380: Withhold disconnect privilege for REQUEST SENSE Date: Tue, 19 Nov 2019 06:19:58 +0100 Message-Id: <20191119051425.132924551@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191119051400.261610025@linuxfoundation.org> References: <20191119051400.261610025@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 [ Upstream commit 7c8ed783c2faa1e3f741844ffac41340338ea0f4 ] This is mostly needed because an AztecMonster II target has been observed disconnecting REQUEST SENSE commands and then failing to reselect properly. Suggested-by: Michael Schmitz Tested-by: Michael Schmitz Signed-off-by: Finn Thain Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/NCR5380.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index d600d3e94ba4a..144bb0c2b3064 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -938,6 +938,8 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd) int len; int err; bool ret = true; + bool can_disconnect = instance->irq != NO_IRQ && + cmd->cmnd[0] != REQUEST_SENSE; NCR5380_dprint(NDEBUG_ARBITRATION, instance); dsprintk(NDEBUG_ARBITRATION, instance, "starting arbitration, id = %d\n", @@ -1157,7 +1159,7 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd) dsprintk(NDEBUG_SELECTION, instance, "target %d selected, going into MESSAGE OUT phase.\n", scmd_id(cmd)); - tmp[0] = IDENTIFY(((instance->irq == NO_IRQ) ? 0 : 1), cmd->device->lun); + tmp[0] = IDENTIFY(can_disconnect, cmd->device->lun); len = 1; data = tmp; -- 2.20.1