Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11788525pjo; Thu, 2 Jan 2020 14:17:50 -0800 (PST) X-Google-Smtp-Source: APXvYqwX19pJbIeNn03WZ3XGMkoUgbKdDvjL/lTgYVnV2aYfsLoJlwcs3zmg2OzB/ENL00vQ7fMR X-Received: by 2002:a9d:75c5:: with SMTP id c5mr95242890otl.172.1578003470210; Thu, 02 Jan 2020 14:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003470; cv=none; d=google.com; s=arc-20160816; b=dkYTeSZ/pcfGjgwH3QAIImSDnB67ls0GRmD8npCeIp+xxWniUAes3IXZnxfMp9fPLz q7l8jWZTB3iVMgjKseTmz6/3A6bGUm4axH/iylTb5S8exHlTPzIkh6Q6fkzOUIbU4kNq Q1jv1fAxsg39qAEDAzh3+R61KFzylopnw5Hl9EOQaoTTe0Q+rcKdIRC9DimT47VGFj+s YVg0Je1Wg1ORBz9X7APM4BpkvE/++NkGrdD0ylXVhNWYPoDxsYPeK749a13ux9KaCWHv 5CKXpUE/jmIHO4J5POqYJPTyMAC/NYoW1OYU4A7wfWC9/oyTA1qmKn1sAzdeBX9F3cTw 8S8Q== 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=WcJiZUHSKMITlUE7JfWbrrPhYZZgBwA7sTz9H3IyFqQ=; b=WmH8QPZ20ltm90mzO9fHiKfov83tgNRtEiF9kZ1IL9JFNjAhFZL+RZPR9N8IqBJc8i rHJv9bVMJo4mePjB9PKrU4Jl4rVTjxXzYeMcTeocACJuDLn0U5If8K4rBWNXQEpft82v xk2abvlC1i+zPFqvx0LkEjO8vhHZmwiZnem37OksJjOowaa14iCwHcKSmAVNhXQnzWNi dBs9EmC0f5NB5/xmO0XSYKkq8wcefcNmMZ8k1av5PsRjPYN5cXBthrJKBehm2kah/xfp HyYzQHvTaKp9grauV17X7Nj5ME3AXxFUCdwuy6By99iteuPQZ6y4bIghW9JLxvwsymEB 3mMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GSxB4ljY; 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 l2si24820570oti.303.2020.01.02.14.17.37; Thu, 02 Jan 2020 14:17:50 -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=GSxB4ljY; 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 S1728095AbgABWPe (ORCPT + 99 others); Thu, 2 Jan 2020 17:15:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:56502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728079AbgABWPa (ORCPT ); Thu, 2 Jan 2020 17:15:30 -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 D27022253D; Thu, 2 Jan 2020 22:15:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003330; bh=pVH6vZUHOHmuRy5b9/9ywEGujaMn0AGPx/PiZP3z584=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GSxB4ljYcV6B1hfOIJ21Bt/eEpWemR9ce3DvMgdIe70eIyfz5bKZcb25CSCJBA9nU /bQuCCgamjKvex7sBuKNLTFvxbbB3reZaOfy7vpGgowfLY2nFVP8RLlfNZMk9H4+6z 1PrLlnDBYCLgDyxFAA1+bv2xEomUI2m+JpWEdREk= 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 5.4 090/191] scsi: NCR5380: Add disconnect_mask module parameter Date: Thu, 2 Jan 2020 23:06:12 +0100 Message-Id: <20200102215839.589228403@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@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 536426f25e86..d4401c768a0c 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 *); @@ -954,7 +957,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