Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6585086imu; Wed, 30 Jan 2019 18:15:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN78inQ8JdIemoq3CLDG+xdYNHRCqT3OB6pWEzt4I8nHR/fqqA5KdLXLYiZAV8hBOChGMfrX X-Received: by 2002:a62:c613:: with SMTP id m19mr33241338pfg.207.1548900933034; Wed, 30 Jan 2019 18:15:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548900933; cv=none; d=google.com; s=arc-20160816; b=c7irrhKDhUKcXc5TQbLNkIrqsauHdkwSmdoHC3kT1UDUxgmkThmS/6lOad7TJ6T9Ds YH8bFpFb9rp1wejb1aeauFZXa4gvd94Sz0CO44lKK9gQaYK9Zxt4K7zp832k9/tRPSUH 0q8IxxCiyKeJConnt8lM2wK5KG9OyW2XyJCLr8RUpJ874QFMewA3/+14Rc9SxS9nMEKd RG8bueNudKRyp1t7xVSJo259NeWIeE5h/Xg0OX8LhN7A7iHoeW9TG7Ryl+Dh1CVOvOsP p8oavSD+wLV+Me3O9woSMOKH4jdy7Hhz464cze4PV9fUg4dq5qxJuc6ebCuDH7HC6Ofl 1Lrw== 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; bh=M2hCRMqj1xKZ+JtEl2DdSZ9jx94vRyFlARE4+WXXqZQ=; b=Rz0ybQy6jgxJX5PJUToNUBfNv8v4DgMUhKLyHBonm7o56RovxnF5sS2gAf80wzRY6h X2EZY7Xnw4GDVD2TScVcDobiJqzWlchDmfUNwH6JDcKcO7fW8SX/OWrpM3BQls5oVtZl s5HOAlx4VrMIsXsd4KbI/vjpJ+BMcqWly/WC70vOahCkMkiKyLnCWInkDePB6xU5MY0w xFTTd5Ev6Hx4JmZ6T7wigzPgcDWuGPc5WPfQjUqDVZNwHQk6Xjdd75NbN5T2v/bNQM0J KGWdYwWsDUq3xmw/os98TQmQKyR/zc/IxmHIAcYwmY8dJ6YLOnmZPhLwp7OUTHuntkQB hffA== 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 4si3275902pff.161.2019.01.30.18.15.18; Wed, 30 Jan 2019 18:15:33 -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; 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 S1729865AbfAaCNT (ORCPT + 99 others); Wed, 30 Jan 2019 21:13:19 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:58112 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725535AbfAaCNT (ORCPT ); Wed, 30 Jan 2019 21:13:19 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id C77A5ABD00C1C6F8D9BB; Thu, 31 Jan 2019 10:13:16 +0800 (CST) Received: from [127.0.0.1] (10.177.96.203) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.408.0; Thu, 31 Jan 2019 10:13:10 +0800 Subject: Re: [PATCH v2 6/7] scsi: libsas: reset the phy address if discover failed To: John Garry , , References: <20190130082412.9357-1-yanaijie@huawei.com> <20190130082412.9357-7-yanaijie@huawei.com> CC: , , , , , , , , , , , , Xiaofei Tan , Ewan Milne , Tomas Henzl From: Jason Yan Message-ID: <5C5259B4.10005@huawei.com> Date: Thu, 31 Jan 2019 10:13:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.96.203] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/1/31 1:36, John Garry wrote: > On 30/01/2019 08:24, Jason Yan wrote: >> When we failed to discover the device, the phy address is still kept >> in ex_phy. So when the next time we revalidate this phy the >> address and device type is the same, it will be considered as flutter >> and will not be discovered again. So the device will not be brought up. >> >> Fix this by reset the phy address to the initial value. Then >> in the next revalidation the device will be discovered agian. > > Why fail to discover the device? I wonder in which scenario you have > seen this, such that it is worth rediscovery. > The test guys have seen this for several times, especially after LLDD changed the logic of lldd_dev_found and may return error now. >> >> Tested-by: Chen Liangfei >> Signed-off-by: Jason Yan >> CC: Xiaofei Tan >> CC: John Garry >> CC: Johannes Thumshirn >> CC: Ewan Milne >> CC: Christoph Hellwig >> CC: Tomas Henzl >> CC: Dan Williams >> CC: Hannes Reinecke >> --- >> drivers/scsi/libsas/sas_expander.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/drivers/scsi/libsas/sas_expander.c >> b/drivers/scsi/libsas/sas_expander.c >> index 6e56ebdc2148..e781941a7088 100644 >> --- a/drivers/scsi/libsas/sas_expander.c >> +++ b/drivers/scsi/libsas/sas_expander.c >> @@ -1100,6 +1100,13 @@ static int sas_ex_discover_dev(struct >> domain_device *dev, int phy_id) >> i, SAS_ADDR(ex->ex_phy[i].attached_sas_addr)); >> } >> } >> + } else { >> + /* if we failed to discover this device, we have to >> + * reset the expander phy attached address so that we >> + * will not treat the phy as flutter in the next >> + * revalidation >> + */ >> + memset(ex_phy->attached_sas_addr, 0, SAS_ADDR_SIZE); >> } >> >> return res; >> > > > > . >