Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp226978imm; Tue, 18 Sep 2018 20:33:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbxX0tpfka+YQ7q9hui4IqoDLwqLp8HJUrT/u5jFhy9FyXIiPuBBf7pR12gDAvXKvmFzOUj X-Received: by 2002:a62:9c17:: with SMTP id f23-v6mr33799013pfe.209.1537328012770; Tue, 18 Sep 2018 20:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537328012; cv=none; d=google.com; s=arc-20160816; b=TX5YVxX8DuDOhHxSjQzcOBAngunW1S43fBOWmL0isw7dlo6EFFHhQQYw6SlMXMHnG6 NWW7DbVuOgezXauGOhV4Ch8erXWX3w6UBfkBUjapdsgcVBm1Tq72NHdhkUhprIiGb898 fvk7S1X1GFK8xTZ1dmGKX8ah29AVc7H0VikwdcWfHg3OHkUy4Hu2E3l40vlDY1K/fNux 26AQCSR8qhtfnJeUq1hmMIG41ERae9Q577VEiGvMakifac8e0cWMBvrR6xDEgw5fa6QI hcGmCvyIGPuXVjpoYAs4au3aF8i9XTFLJ+zRE5D3qtSsw6LQdmltiXxoLSvGGtrzzDHo pSRA== 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=Y/7+bZuphQLNsiexT9lN9LZFnwdxg/SjMobuW3cSlXI=; b=X4i2LEfPSsmX6x/8JqnDXd9rQKVneQqm9FVMxjb6saMZ415DGgx2H+FndQ5vNmR1IT VxPLT1YEFlfGAjQEB6GqfGTY2ADasiKXFneOarhFNk6Pm2XT43do9bMx6ltWfp7IwUBd ad8SQUL3p96Km9BUki0ddyo4WyvoZBOeEYlwt+up/6BUNuJ9trh7HPcX/1DKjx2SbcSL z0E3oaaFrV7SGdixvZBmT8469CP9CLGh3zyt/X3VaU1MpUtzxpsYyjjuhSqrjNUdVLtx hHZZZzolBQCLpomqTTLf6s/JTRUy0dmj6aIJnHpD9vHEK6L+rr6xBEyh0k+Yq1uoxt4l Do5Q== 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 m21-v6si22433978pgd.48.2018.09.18.20.33.12; Tue, 18 Sep 2018 20:33:32 -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 S1730824AbeISJIx (ORCPT + 99 others); Wed, 19 Sep 2018 05:08:53 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12185 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726019AbeISJIx (ORCPT ); Wed, 19 Sep 2018 05:08:53 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 12A21B70F316D; Wed, 19 Sep 2018 11:33:00 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.399.0; Wed, 19 Sep 2018 11:32:51 +0800 From: Jason Yan To: , CC: , , , , , , , , , , , Jason Yan , Ewan Milne , Tomas Henzl Subject: [PATCH v2 4/5] scsi: libsas: check the ata device status by ata_dev_enabled() Date: Wed, 19 Sep 2018 11:32:03 +0800 Message-ID: <20180919033204.11102-5-yanaijie@huawei.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180919033204.11102-1-yanaijie@huawei.com> References: <20180919033204.11102-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 --- 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