From patchwork Fri Apr 12 08:57:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 162100 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp364800jan; Fri, 12 Apr 2019 01:58:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqouIYIHUHmsr0lzN16AwWYdkH1qmphAbA5kcIWbig1clef0zOqyqf6h0uq6LsBw6LBVAg X-Received: by 2002:a17:902:1c9:: with SMTP id b67mr34242035plb.158.1555059517389; Fri, 12 Apr 2019 01:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555059517; cv=none; d=google.com; s=arc-20160816; b=hKYH5DagyQQPTYP+yz9HLyN0thLoAa8YBnYols982sOTuB0XMjWkGBOvDWHolHf7i6 v/xc7UjlwOL9YBAmsx8AHRoV6pVt5Dj4JwDYs0RyNdVpM8bJJH1ANSG8qYNpqR+nS5ih JcY6rFbdVGlL2WB3Y5p6UjgIeHMJ9p/oFZzpQYmdTO1ZeqwXA+ag3toUkKzVYAHisHRJ vFQl6J2ympd34XWEPQbambQ1kyAp2sOCgVBeEWJ5mRAyEpjcr0nCCTZaCkWIyZqUknmz 0b2tSYIeOa7aDTZIYa2kLG5N2gBTGFRaB2Deu8LqVRxAAYNj69Fja4L50+705WTSOj6F 5ZOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=CS8aGAg5fQ+Si49IVyEPxghsgYAwmqcBIeRi4FeMocg=; b=nsOikFLDG5SYyh75iKPGtktrADi7MQR3Uwy8uFnq5GS4MYmNrB9TaRyOtzFczhbmwn 7bUzByo/Rc8JqIJHH0dYv6D1PHyl/nnzAZyGjaKwxwwIrDW+4va7snPq8/nI1hkoITjm 6Yjy/RwJlLX1Gg4WwqWKgnJmLnAqy3XcOwUIQXR9nyRTfopY9S3ThrqjcX+7avDxvYFZ MvX0S7Hli4cm3JGpflYd9mTLTwt0mk9r3lqT7uXoE+cM9Df6uPxfB8NqD8sPmDH8QPsU dil66GqZHVjvNLJq4dj2OSL71zQ2UEo0qweTshskZhdyNgbPmVivrKD8uUleO8rY9JpB 3Gag== ARC-Authentication-Results: i=1; mx.google.com; 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 70si7955696plc.88.2019.04.12.01.58.37; Fri, 12 Apr 2019 01:58:37 -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; 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 S1727776AbfDLI6g (ORCPT + 31 others); Fri, 12 Apr 2019 04:58:36 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6737 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727276AbfDLI6d (ORCPT ); Fri, 12 Apr 2019 04:58:33 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id C2D68F58CF30741F09EE; Fri, 12 Apr 2019 16:58:24 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Fri, 12 Apr 2019 16:58:15 +0800 From: John Garry To: , CC: , , , , , , John Garry Subject: [PATCH 2/6] scsi: libsas: Try to retain programmed min linkrate for SATA min pathway unmatch fixing Date: Fri, 12 Apr 2019 16:57:53 +0800 Message-ID: <1555059478-36224-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1555059478-36224-1-git-send-email-john.garry@huawei.com> References: <1555059478-36224-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently for fixing the linkrate matching during discovery such that the linkrate of a SATA PHY does not exceed min pathway to initiator, we set the SATA PHY programmed min linkrate to the same value as the programmed max linkrate. This is unnecessary, and we should be able to keep the same programmed min linkrate if it is already lower than this new max programmed linkrate. This patch makes that change. In effect, this will not make much difference since we generally will negotiate a linkrate at the programmed max linkrate, and the programmed min linkrate will have no impact. Signed-off-by: John Garry --- drivers/scsi/libsas/sas_expander.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 93f297199d4c..dfdf3c94d326 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -826,9 +826,14 @@ static struct domain_device *sas_ex_discover_end_dev( #ifdef CONFIG_SCSI_SAS_ATA if ((phy->attached_tproto & SAS_PROTOCOL_STP) || phy->attached_sata_dev) { if (child->linkrate > parent->min_linkrate) { + struct sas_phy *cphy = child->phy; + enum sas_linkrate min_prate = cphy->minimum_linkrate, + parent_min_lrate = parent->min_linkrate, + min_linkrate = (min_prate > parent_min_lrate) ? + parent_min_lrate : 0; struct sas_phy_linkrates rates = { .maximum_linkrate = parent->min_linkrate, - .minimum_linkrate = parent->min_linkrate, + .minimum_linkrate = min_linkrate, }; int ret;