Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp413016imm; Fri, 1 Jun 2018 03:14:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKoWmmGGo58tdy1ijWIVsVdArZ/qHyhjjjVeL4gMm19hygpxObDbU7egRe2TH5HrAhE1H4h X-Received: by 2002:a63:2f04:: with SMTP id v4-v6mr8352005pgv.33.1527848086565; Fri, 01 Jun 2018 03:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527848086; cv=none; d=google.com; s=arc-20160816; b=w+QThNI10nltuFJDwHEs7/BX58Ew7WnnIx9AByxjmFqrxb2wKCsAQGuqatjFZFsTuB p4H+nXVwfbL7QvX1b8z4zBHWE+hIYqCHZ5wFlQ0rHgjsmuF3nhBiRv+YGRqRO6eoP9KY jLFRSAZyDxpqZeCOwb4AzQIEVbujgZ95GCj2R5iyWXl+Nb1lIIesyuEmxLBCJS38TOFj 3aqWaubzLflf4wiYYmc3FYOTFfirIIb0Q3H49+/qqeC4+lcy2+bYgISR40Q/MwBbva5W 3OlMuelqggr0v0rDYstIn2CLXxbqKRvekbNLOuOyj0o5EHE1oKsLoJzF1Sd4C3jC1JJy 6diQ== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=yWgaCdTtShLzxTyEPKLSRZcP3hSfaAufG8EBuS5olGo=; b=lQp0nLNEqteaWDAWAaNncxwRlTN3U0Mpse7nJojVSVDgUbUysthUrb0pLIgPSbo4R6 DsMnmSgDdxuqFsiU0QzvSLs4Q2/kpJ0SqMOlZ5ymi8zRQz/h8eXlxDjQMtAWvFn5oqu0 +ifoc8wix7JGDBgPLAFYL2j2MOBEaEl8lWDMfnUN9jz4cxp/aktPH8PKAKcOlDlF/eGU eWm+mu8/nsXQN6jNjvB7w/11D83dwZDCiyG7T55Mhnl+wqxJsmwHdaSpX/ykA12z05OE HaGfN5wtduIOjHFuann+TwEunmSykv42Gs3eP8ciG3zN3RDnGgjzSYv+zl+TjCrwiHUj 6YmQ== 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 z80-v6si39716490pfi.7.2018.06.01.03.14.31; Fri, 01 Jun 2018 03:14:46 -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 S1751166AbeFAKOA (ORCPT + 99 others); Fri, 1 Jun 2018 06:14:00 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:46885 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750790AbeFAKN5 (ORCPT ); Fri, 1 Jun 2018 06:13:57 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 780B2463DB3DB; Fri, 1 Jun 2018 18:13:54 +0800 (CST) Received: from [127.0.0.1] (10.202.227.238) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.382.0; Fri, 1 Jun 2018 18:13:48 +0800 Subject: Re: [PATCH 8/8] scsi: libsas: support SATA phy link rate unmatch the pathway To: Jason Yan , , References: <20180529022309.21071-1-yanaijie@huawei.com> <20180529022309.21071-9-yanaijie@huawei.com> <5B109FA8.9010402@huawei.com> CC: , , , , , , , , , , , , chenqilin , Ewan Milne , Tomas Henzl From: John Garry Message-ID: <6c2486cc-54d2-3a6e-c448-c1b77d0dcdd4@huawei.com> Date: Fri, 1 Jun 2018 11:13:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <5B109FA8.9010402@huawei.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.238] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/06/2018 02:21, Jason Yan wrote: > > > On 2018/6/1 0:05, John Garry wrote: >> On 29/05/2018 03:23, Jason Yan wrote: >>> If a SATA disk attached to a expander phy and it's linkrate is greater >>> than the expander host phy's linkrate, the disk will failed to discover. >>> The topology is like below: >>> >>> +----------+ +----------+ >>> | | | | >>> | |-- 3.0 G --| |-- 6.0 G -- SAS disk >>> | | | | >>> | |-- 3.0 G --| |-- 6.0 G -- SAS disk >>> |initiator | | | >>> | device |-- 3.0 G --| Expander |-- 6.0 G -- SAS disk >>> | | | | >>> | |-- 3.0 G --| |-- 6.0 G -- SATA disk -->failed >>> to connect >>> | | | | >>> | | | |-- 6.0 G -- SATA disk -->failed >>> to connect >>> | | | | >>> +----------+ +----------+ >>> >>> And when we check the sas protocal spec, this scenario is described as >>> this: >>> >>> 7.13 Rate matching >>> ...... >>> If an expander phy attached to a SATA phy is using a physical link rate >>> greater than the maximum connection rate supported by the pathway from >>> an STP initiator port, a management application client should use the >>> SMP PHY CONTROL function (see 10.4.3.10) to set the PROGRAMMED MAXIMUM >>> PHYSICAL LINK RATE field of the expander phy to the maximum connection >>> rate supported by the pathway from that STP initiator port. >>> >>> In order to support this scenario, checking the SATA disk's linkrate >>> to see if it is greater than any phy's linkrate it may pass through. >>> Remember the minimum linkrate of the pathway and set the SATA phy >>> linkrate to it using the SMP PHY CONTROL function. >> >> As we (re)discover the tree, can we keep track of the min pathway to the >> root PHY dynamically (per expander), and then take action for any SATA >> devices attached which have a negotiated linkrate greater (than the >> expanders min pathway)? This would be an alternate to your approach of >> finishing discovery and then checking the min pathway as a whole new >> step. >> > > Seems better, I will have a try to see if it works. Thanks. Fine, it seems the tricky part here is to figure out when to issue the linkrate change request.