From patchwork Mon Sep 24 15:06:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 147364 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp836520lji; Mon, 24 Sep 2018 08:09:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV62HPHGvkDtQ8PMBmRvtgV2jdGrzGKPmLrnCpdDNyRT/lKQQB6eEAO14PfzgX+BjFUJvkrs6 X-Received: by 2002:a63:3207:: with SMTP id y7-v6mr9973661pgy.101.1537801790902; Mon, 24 Sep 2018 08:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537801790; cv=none; d=google.com; s=arc-20160816; b=rt/LUoluuB9DDIcqY2fcl/n9bDH2NKEgk0Qhb81JlkoDgutv0/GDNG64h2+zha0sS5 HkxCze7EGUwXzpnntOvB2BX4aabnFRvn6QOnl9eb4676emJWmuFB5uFGIqRPJO+uCyLs iRoaHnisY7iYlaAKuLEAc8OBAYYrT3uAOdl3KXq+7ACp6LRwlyqykbxitqoICNc6cfu/ Gjx+wd5gwd40WHgZTvk+UzpItTbp1FUAzWf4mPd8QH+el0XtCaUSA0qnMsxD/bb3pKNK Prer1lNDR+OnECS1bhtawWLsuf9wP513EXN2mZgskWTdqjEc9/tjNyLHTzAcazJ/27Gj Ia8w== 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=pSHZ/+suklDIb4G0cpNo3EIK2ARAKPMi4Hf7CpEvhNM=; b=iWU3aan2bgsrliKD1Xngq/QHFAuEaq/H7l8wRMChDbGAC2lqec2deaeeFWsDgwPbsM Qp6JmFAfvRuD9yuUg7b4s7hB+FJsAIdi00ky1bHtN665QfqN7N9xn6Ad5H/YQiLQKpDi JDzXnSEBgXMalEsrNYLwajADrIGifC2o6yhEy2mjLlTegjuQ5W2OBWZW2Wfncpdt9of9 nQaF1mvl/V7ZiqdduK55y+5cQvKmJUPBXwfcMCHGi3GCAyhXEDRq8RjQA1L5++yp0C45 ILWSPrfyDQ7sbjxL5Hco4T94k+rt48fKS6lqRJnIvv8Sl7OT0CF6PkiddXSbDNbJvn4C WjCQ== 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 e10-v6si36469377pfc.51.2018.09.24.08.09.50; Mon, 24 Sep 2018 08:09:50 -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 S2387514AbeIXVMZ (ORCPT + 32 others); Mon, 24 Sep 2018 17:12:25 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12686 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733045AbeIXVMX (ORCPT ); Mon, 24 Sep 2018 17:12:23 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 0BB3C9241E8AE; Mon, 24 Sep 2018 23:09:39 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.399.0; Mon, 24 Sep 2018 23:09:31 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , "John Garry" Subject: [PATCH 1/7] scsi: hisi_sas: Feed back linkrate(max/min) when re-attached Date: Mon, 24 Sep 2018 23:06:28 +0800 Message-ID: <1537801594-207139-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1537801594-207139-1-git-send-email-john.garry@huawei.com> References: <1537801594-207139-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 From: Luo Jiaxing At directly attached situation, if the user modifies the sysfs interface of maximum_linkrate and minimum_linkrate to renegotiate the linkrate between SAS controller and target, the value of both files mentioned above should have change to user setting after renegotiate is over, but it remain unchanged. To fix this bug, maximum_linkrate and minimum_linkrate will be directly fed back to relevant sas_phy structure. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index a4e2e6a..ba6fb535 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -904,6 +904,9 @@ static void hisi_sas_phy_set_linkrate(struct hisi_hba *hisi_hba, int phy_no, _r.maximum_linkrate = max; _r.minimum_linkrate = min; + sas_phy->phy->maximum_linkrate = max; + sas_phy->phy->minimum_linkrate = min; + hisi_hba->hw->phy_disable(hisi_hba, phy_no); msleep(100); hisi_hba->hw->phy_set_linkrate(hisi_hba, phy_no, &_r);