Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp198287imm; Tue, 18 Sep 2018 19:55:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZVOW45TqbJGEOxGJOXIACk4I0EAg7Lk0IOprxhHmRBkh9fRL1MG/9/TzQ2k+JPC1Tinzht X-Received: by 2002:a65:4b88:: with SMTP id t8-v6mr30487224pgq.239.1537325727574; Tue, 18 Sep 2018 19:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537325727; cv=none; d=google.com; s=arc-20160816; b=uu2BcWxwu77Htow8uXhNEzmBVBB94cQOiFMRks44lnKHMmAH8dlmG7iU+NwZ4aSnJT llki1atLQ6oHD5V1jMj93benvV9G3HME1rUPMJWJGlezfhg3jWMgugg/C+Tfcsjg1OGd WhdR6ELxzhpw0h/Ml86k/DeUahFQYdbSokXQypeyLaqK+mXPZaMWCaDv8av3IlTE6RO5 +jmJGzE5yDs4ZmjJSdYltClRAl3K+KtMno7jjBTuipccujAEIYYzX1ZXwRMsoR4cR5/O sMsHQVLhZdxzRxEWX0eHxNtteDxmNqQqfMwdjgVie9kJXUE8sccmvEc62nJI1YaI3OB0 7l6g== 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=TZzZE3u5GmFfqyNm2YcVXtGTjBZhCGRNpXsfoMX4368=; b=A+bF+Gtyn5rnTD0QTCOoQTzK2pMcQC71XEcreXGOl7nVCNNQn69cSZmO55/0/CJzFM xD2sByRYZ93wMwmAscZMxVyFEYyw4f9kFq2AcdxbqEUwIoo0ozmL+pPt3dWaXBTFLFLA 00x9nc3Ta9RTO/ivZT30pZRFuA1tkh+ZxB32hZqNEnFKI2lw4tnIR3hPOCeR4ZJZeDS1 c2FwNxPs/9WQtuFxa6hS6t8Wq1D0j5qlSQ0rjU5h8fTtSg46IW+DFCIxRv20M7nQ1kuO yPPjt86qDNFcS3ThYM2Z31Xdjb/Z/fG3C9CyoTA+7fsY4EyLOuGqa69NnUkrzeeimAt9 4S0w== 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 p9-v6si22895161pll.298.2018.09.18.19.55.12; Tue, 18 Sep 2018 19:55:27 -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 S1730543AbeISIaY (ORCPT + 99 others); Wed, 19 Sep 2018 04:30:24 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12615 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725778AbeISIaY (ORCPT ); Wed, 19 Sep 2018 04:30:24 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [10.3.19.211]) by Forcepoint Email with ESMTP id 1ED6A7257FD8A; Wed, 19 Sep 2018 10:54:38 +0800 (CST) Received: from [127.0.0.1] (10.177.96.203) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.399.0; Wed, 19 Sep 2018 10:54:33 +0800 Subject: Re: [PATCH 4/5] scsi: libsas: check the ata device status by ata_dev_enabled() To: John Garry , , References: <20180912082946.34814-1-yanaijie@huawei.com> <20180912082946.34814-5-yanaijie@huawei.com> <57f8b9fb-3a5b-fda6-5e3c-af23524431f4@huawei.com> CC: , , , , , , , , , , Ewan Milne , Tomas Henzl , From: Jason Yan Message-ID: <5BA1BA68.2050900@huawei.com> Date: Wed, 19 Sep 2018 10:54:32 +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: <57f8b9fb-3a5b-fda6-5e3c-af23524431f4@huawei.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.96.203] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/9/18 21:54, John Garry wrote: > + > > On 12/09/2018 09:29, Jason Yan wrote: >> When ata device IDENTIFY failed, the ata device status is >> ATA_DEV_UNKNOWN. The libata reported like: >> >> [113518.620433] ata5.00: qc timeout (cmd 0xec) >> [113518.653646] ata5.00: failed to IDENTIFY (I/O error, err_mask=0x4) >> >> But libsas verifies the device status by ata_dev_disabled(), which >> skiped ATA_DEV_UNKNOWN. This will make libsas think the ata device > > /s/skiped/skipped/ > OK, thanks. >> probing succeed the device cannot be actually brought up. And even the >> new bcast of this device will be considered as flutter and will not >> probe this device again. >> >> Change ata_dev_disabled() to !ata_dev_enabled() so that libsas can >> deal with this if the ata device probe failed. New bcasts can let us >> try to probe the device again and bring it up if it is fine to >> IDENTIFY. >> >> Tested-by: Zhou Yupeng >> Signed-off-by: Jason Yan > > Reviewed-by: John Garry > >> 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_ata.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/scsi/libsas/sas_ata.c >> b/drivers/scsi/libsas/sas_ata.c >> index 64a958a99f6a..4f6cdf53e913 100644 >> --- a/drivers/scsi/libsas/sas_ata.c >> +++ b/drivers/scsi/libsas/sas_ata.c >> @@ -654,7 +654,7 @@ void sas_probe_sata(struct asd_sas_port *port) >> /* if libata could not bring the link up, don't surface >> * the device >> */ >> - if (ata_dev_disabled(sas_to_ata_dev(dev))) >> + if (!ata_dev_enabled(sas_to_ata_dev(dev))) > > I do wonder if ata_dev_disabled() needs to be updated to cover > ATA_DEV_UNKNOWN also or even instead of this change? > We cannot do this now because this will make the ata eh process wrong. >> sas_fail_probe(dev, __func__, -ENODEV); >> } >> >> > > > > . >