Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp239806oof; Mon, 24 Sep 2018 19:44:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV62l0xklnYAuKjT0n2r13pXF6Cjs4FjrSuVezhB45oGtomDLYvJWClYYRwajUjp8Nl1iL+RZ X-Received: by 2002:a63:334c:: with SMTP id z73-v6mr1278850pgz.220.1537843469797; Mon, 24 Sep 2018 19:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537843469; cv=none; d=google.com; s=arc-20160816; b=MoAG5kziMCUBiX5/2x5a33z6SeFLEaQY1jn63zxT7Ocd+PjsleVTLNvlddyWdxU420 ScMVf1yzfIlJhpMGj9jk81wVrHTj/UmkTG41NOLZYdxOih1N1rWoWQZgFNViorLq7JZ6 /QdVyEhffFQvkBatJjuMDblfh3uWsdHYtcuS06F5MDNAtFFCegkn34VoNQXLAJOttNgW K+OAEoFjOcW6EOwnYnnri4E+Eeq+BHZHfZAA04EOSZ5dh4MDODYgWb7tY6pSIADT0z8H niQK/rFMEJt9km1nVwsY0eB0yQpzolqJiTCYdgMvnh7Oc9Lxz18cAnRKQm0Lpx+kF4m5 3d1Q== 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=5xuFc04ouEWUL3LX0fQj74Hn1RouS+mW/kohXlhhgso=; b=M8HmeqIbqTkpWb57RHKkJ7tRBMlLyrTOsu0icZ8t+4oEr3mnVGmUPbARPZOX0xWfPx 3XXz1TD1IuxX29O+s7k3Sp5cnCnW85x8mNpsl3PYRj+GqUwCxslE4u7DsBOr5koLmLyS X69a0qq9FAxnOsp2drJaqh++0j+Npi4j1ptR976t63wt6OSJWdAjU8YP3gjkob01mOS4 4vyhn1jRJIWuM+vaP15jxNckiOiy322+bBq4/WP+SsyGWLv+Z8OaYqRmirr78iXVwvY5 NqWBmqMtLLdBFdMb/Juvfs/vdeotMFNX2l0j4KxJouOhumBbuCoX8M9I4A1TBz/jj/Vz zCeA== 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 t67-v6si997928pfd.364.2018.09.24.19.44.14; Mon, 24 Sep 2018 19:44:29 -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 S1728199AbeIYIsr (ORCPT + 99 others); Tue, 25 Sep 2018 04:48:47 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:53470 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728126AbeIYIsq (ORCPT ); Tue, 25 Sep 2018 04:48:46 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 45734E61B7F09; Tue, 25 Sep 2018 10:43:27 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.399.0; Tue, 25 Sep 2018 10:43:19 +0800 From: Jason Yan To: , CC: , , , , , , , , , , , Jason Yan , Ewan Milne , Tomas Henzl Subject: [PATCH v3 4/5] scsi: libsas: check the ata device status by ata_dev_enabled() Date: Tue, 25 Sep 2018 10:56:53 +0800 Message-ID: <20180925025654.44053-5-yanaijie@huawei.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180925025654.44053-1-yanaijie@huawei.com> References: <20180925025654.44053-1-yanaijie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 skipped ATA_DEV_UNKNOWN. This will make libsas think the ata device 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 CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke Reviewed-by: John Garry Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- 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))) sas_fail_probe(dev, __func__, -ENODEV); } -- 2.14.4