Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp776291ybc; Sat, 16 Nov 2019 08:29:38 -0800 (PST) X-Google-Smtp-Source: APXvYqz15dy787TELIqxN99hqOQnJmyvwlStT0y8hIbFEymVUMfBZ3prPf8ukm1yhIfxUROwuDq/ X-Received: by 2002:a7b:c088:: with SMTP id r8mr18584910wmh.24.1573921778279; Sat, 16 Nov 2019 08:29:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921778; cv=none; d=google.com; s=arc-20160816; b=WX9OhWcyapoBb6axuU8Sl+Aldq8Eami676rOT78FpzUBZE9UdxseukwELt8P2vcoPN P/4pvnnepUYwAWIs16r+L4RZ1umIrawVQpfGxK6j/Rwa7Ra76WDgFjRvuoPqaCoNj+9K gaJ/BBlA2hAxTJ2bsZkBQAFpTAM8NVlswJBZiKK+UZ36MDdHKBOwTNr6K8CEDLCwa+8A FXexsGkzO2OlfqPeh43YUl9EJPrZ6MJ2wL1gIezbjnvbXfhLFqcI3HriTzOsKWJ4aI8B BTY+qw5uTmjIiBgBhRE36nFWIJc/Wn9X7CLmguymUZaTvgfNe5479k402rtB5aOk4RfM 3/dw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Nvj4ygp94yMtIqM6UD5LmJvLB+KfKurZJZv3u/2ZZI8=; b=lM7lHZMDk5K0dBZnBwVJ59bLlt6ZaSlqYhr6mK+n4Ds345jrAYr/Pmm7eXWuCPyRAY RSJgiaK4YVgyyCYWcKfHRwznd4UjnXTigW2pGYEdRm5IiYBwiBInMq6s41Nfszi+OuiY hXVVJFlFzNz9SDcYOKQ/+vwHce8gr+lt1raI+OvdoZq9g6pch9iXcuMuYNIYJZJAUylh rd6WtZhoAdmSXl1NM0acu26hb2ZTQEcKAa4GopRTh/+OY5djPLo9TRvmnKpCYgYL9bPC vzRGnqJGnvG8wbnWNujRCJmobwnh5P4iT3clCP4Xsc8RFUrCL797yrFNDmWf2Loxm3nY NUPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KUeqWWM4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t27si6779559edd.304.2019.11.16.08.29.13; Sat, 16 Nov 2019 08:29:38 -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=KUeqWWM4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728056AbfKPPl4 (ORCPT + 99 others); Sat, 16 Nov 2019 10:41:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:45176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728024AbfKPPlv (ORCPT ); Sat, 16 Nov 2019 10:41:51 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B7BCB20833; Sat, 16 Nov 2019 15:41:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573918911; bh=6eykspN3cd2v1dC2FZs8AixH9I5Z7C5N1now7YBSKs8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KUeqWWM4PIyauU9lugAMBZBc8zKZUlUvpUEeZ2EaBuhZ9JVDEBEecmvxhsZOYj0Eh wWugueQxrCb67UMzCT0bLC4wENwx0olqdC53UevRAPBjEttpY0bV/3eGARe2FunanK iaV1FpCqkQGMnjPrEOPR8ny3yFNU8dgCZ5c8BaZI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luo Jiaxing , John Garry , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 034/237] scsi: hisi_sas: Feed back linkrate(max/min) when re-attached Date: Sat, 16 Nov 2019 10:37:49 -0500 Message-Id: <20191116154113.7417-34-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luo Jiaxing [ Upstream commit 5a54691f874ab29ec82f08bc6936866a3ccdaa91 ] 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 remains 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 Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index fd9d82c9033de..e9747379384b2 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -906,6 +906,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); -- 2.20.1