Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17923819ybl; Thu, 2 Jan 2020 14:54:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwFNN9McLjlE85fGv7XJhultAN59PWB9hZGQsUmMOAJ62sob2cLnKs9dzTmFVnUcktNUYya X-Received: by 2002:a9d:2965:: with SMTP id d92mr89098367otb.175.1578005688246; Thu, 02 Jan 2020 14:54:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005688; cv=none; d=google.com; s=arc-20160816; b=rMiu43gsE7LCVBCRoAOuif+OXr7RI0Pwy3HSlA9W2PlRla88aDWx17abRv4TlYBYaf lhSVJispfD3pUpyuRPIabmo4xq1RA2MSadSqAagXUcZdztLyj94q/I9QTF+yQJYrkGOm hVa4jx1fQfT5VE+pRITuN9wnW1YCdQ3Drz2krp5Y8h1ePb3xYJhmfV4N1fEAyAqiWnA6 ZYt/ups6/Hi7biv+ciRt7EniAORaNy36yHSPDdUTc0g2g1kD+Y/xZrRgiFTVcO6mkIbq mgMnU8d0ZtCqrMogOmdmSHiGBtkcDVzBvtIDs8kMbWcJLdLh+/BqEcNhfs5Mgn01ogb9 5TIA== 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=Q/HAHKxKzpUzmaWW0JoIN1FjfEfwTArTEVZkGvW5QTM=; b=F7gZ1+t6lM0AgxTKhp+fWYT+ahbSo+/sJmEQifVHB6LMtaI8k1sCURCucd77g14PNu M3aM2V4sSmXNR1rsSl1J9jpwwYHXerOjMIprbua9l3eVoymZtLZSs2/k8t1AczPEqq4K mPqw9kr7+8b9l/n+tI9rVA8TbiFx/kpeHLWWxNqsF/0c1NdGUpIGk6jwnOUXr7bMmdYb O4kHlmarzBDqQeA6h4Y70SpYFJEOlvZq7NqXb9KMZ8Oyg+CI1PutNcp1rEi6QHJ6FODU yUaF0zrRTs18irsOl4h0WSImTWvG4JM3GlDWegFjNr9GbAFye6GMmLkyo9j6WIs/6DFp caIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="jdh/BiVg"; 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 d6si29177783otq.41.2020.01.02.14.54.36; Thu, 02 Jan 2020 14:54:48 -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="jdh/BiVg"; 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 S1728662AbgABWVr (ORCPT + 99 others); Thu, 2 Jan 2020 17:21:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:41194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729037AbgABWVm (ORCPT ); Thu, 2 Jan 2020 17:21:42 -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 41C4420863; Thu, 2 Jan 2020 22:21:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003701; bh=M5uc/v81DuSZATN2cUl2Qdb7TKwsn7SAGqthCt4e2JI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jdh/BiVgWZrJp9oMUOBjyp82EpkZ69qAzOQH2qdLBBzApRhH9o3NNgg5Wx5PjYdZ3 Gi0MwJA+k2BYd7TGWhUbXmruO8KfcksbpKYnZSCFQjj1jBD61A0+NbTQSgD++XhUAh N1+NA1Bq73//lGlZo61ow+tCzvHqm0SaUtdQcizA= 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 055/114] scsi: NCR5380: Add disconnect_mask module parameter Date: Thu, 2 Jan 2020 23:07:07 +0100 Message-Id: <20200102220034.604993039@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@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 0b7a223552d455bcfba6fb9cfc5eef2b5fce1491 ] Add a module parameter to inhibit disconnect/reselect for individual targets. This gains compatibility with Aztec PowerMonster SCSI/SATA adapters with buggy firmware. (No fix is available from the vendor.) Apparently these adapters pass-through the product/vendor of the attached SATA device. Since they can't be identified from the response to an INQUIRY command, a device blacklist flag won't work. Cc: Michael Schmitz Link: https://lore.kernel.org/r/993b17545990f31f9fa5a98202b51102a68e7594.1573875417.git.fthain@telegraphics.com.au Reviewed-and-tested-by: Michael Schmitz Signed-off-by: Finn Thain Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/NCR5380.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 8ec68dcc0cc4..95a3e3bf2b43 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -129,6 +129,9 @@ #define NCR5380_release_dma_irq(x) #endif +static unsigned int disconnect_mask = ~0; +module_param(disconnect_mask, int, 0444); + static int do_abort(struct Scsi_Host *); static void do_reset(struct Scsi_Host *); static void bus_reset_cleanup(struct Scsi_Host *); @@ -946,7 +949,8 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd) int err; bool ret = true; bool can_disconnect = instance->irq != NO_IRQ && - cmd->cmnd[0] != REQUEST_SENSE; + cmd->cmnd[0] != REQUEST_SENSE && + (disconnect_mask & BIT(scmd_id(cmd))); NCR5380_dprint(NDEBUG_ARBITRATION, instance); dsprintk(NDEBUG_ARBITRATION, instance, "starting arbitration, id = %d\n", -- 2.20.1