Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1516821pxm; Thu, 24 Feb 2022 04:53:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlMsHOHIlJSfpoVfxm7inu8rc7Cc7VMcRIFXo+F8qn5P2J4bJ0iNtbRuCmkXeFZzPOFIy3 X-Received: by 2002:a17:906:a384:b0:6ce:c3f4:c59a with SMTP id k4-20020a170906a38400b006cec3f4c59amr2113838ejz.580.1645707234604; Thu, 24 Feb 2022 04:53:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645707234; cv=none; d=google.com; s=arc-20160816; b=vn3BffmiPW57vvtJf/PRY0ZF+vM2o2n9zKn0VvOVYlJBD+wwft1tZHqnraAafJkW8O ncZ6UbMewOOXen+Rx7L2r6/riBJyb4uKE2J3b1mccAj4Y3e+o70UQH5yLu/OfvpN3ewR SoJdA4hCF5an3IMzPccTtBBaWj4/+ipUrAy5GKSQh7j7NXTtneda8yxrwK5/wiQ8HYLX od+bE1ERBudbmUETF/ColgMoQy/7nkD0XYI8H4kO8AVR9QmKduTWTH61Kq/rWBWlp1o+ NgDI1rbHtx+ru1ZBP+3bMTGNLr6AZDytADl9SUuhbjzcLOM9jqg4Oai2Iy6bSXSzvIsw svWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=9EX09c2dywJwdtVDnijjPKL+u9w/AQnJSAmrfYfYhbU=; b=HRrP+X6vGdSOaMraR3pt0yaDZS4c9ABGd6sERl4Fd3lngPyIy2BdwMIIw4K37fyIzh cvOOD4npLY1XMuZQ94Mes+Fov5TjZaxvloFskqS8qjSTKTEP/ezBy0tkVdR63bza+148 +cNx0QBjrWICgQI6m6Y9uDsJJP/WQ7yFjm71TvuNyiQ4f0J3Olq96ttdt32G8ryPzT7c PBa4+rHUNP58YlmJ6ozB4wGLFEad5g27fvhVzJ+zReVD+nzrODtufIdEmLGPrbsOwA91 eFPUuaz6nZSzHVgBcMhNkS6sVRL0X6jb+PM2/Zzl1jY5OZ+6uV8Dr8srgy0utki2c7Fr r3sA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g16si1637752ejo.593.2022.02.24.04.53.30; Thu, 24 Feb 2022 04:53:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234168AbiBXL5k (ORCPT + 99 others); Thu, 24 Feb 2022 06:57:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233759AbiBXL5h (ORCPT ); Thu, 24 Feb 2022 06:57:37 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C63BF5371E; Thu, 24 Feb 2022 03:57:07 -0800 (PST) Received: from fraeml712-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4K4BFX1TvFz6H6s5; Thu, 24 Feb 2022 19:56:16 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml712-chm.china.huawei.com (10.206.15.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 24 Feb 2022 12:57:05 +0100 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 24 Feb 2022 11:57:03 +0000 From: John Garry To: , CC: , , , Xiang Chen , John Garry Subject: [PATCH 2/6] scsi: hisi_sas: Change hisi_sas_control_phy() phyup timeout Date: Thu, 24 Feb 2022 19:51:25 +0800 Message-ID: <1645703489-87194-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1645703489-87194-1-git-send-email-john.garry@huawei.com> References: <1645703489-87194-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen The time of phyup not only depends on the controller but also the type of disk connected. As an example, from experience, for some SATA disks the amount of time from reset/power-on to receive the D2H FIS for phyup can take upto and more than 10s sometimes. According to the specification of some SATA disks such as ST14000NM0018, the max time from power-on to ready is 30s. Based on this the current timeout of phyup at 2s which is not enough. So set the value as HISI_SAS_WAIT_PHYUP_TIMEOUT (30s) in hisi_sas_control_phy(). For v3 hw there is a pre-existing workaround for a HW bug, being that we issue a link reset when the OOB occurs but the phyup does not. The current phyup timeout is HISI_SAS_WAIT_PHYUP_TIMEOUT. So if this does occur from when issuing a phy enable or similar via hisi_sas_control_phy(), the subsequent HW workaround linkreset processing calls hisi_sas_control_phy(), but this will pend the original phy reset timing out, so it is safe. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 2 +- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index fe0c15bbfca9..99ceffad4bd9 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -91,7 +91,7 @@ #define HISI_SAS_PROT_MASK (HISI_SAS_DIF_PROT_MASK | HISI_SAS_DIX_PROT_MASK) -#define HISI_SAS_WAIT_PHYUP_TIMEOUT (20 * HZ) +#define HISI_SAS_WAIT_PHYUP_TIMEOUT (30 * HZ) #define HISI_SAS_CLEAR_ITCT_TIMEOUT (20 * HZ) struct hisi_hba; diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index efedfb3332c3..cd8ec851e760 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1201,7 +1201,8 @@ static int hisi_sas_control_phy(struct asd_sas_phy *sas_phy, enum phy_func func, goto out; } - if (sts && !wait_for_completion_timeout(&completion, 2 * HZ)) { + if (sts && !wait_for_completion_timeout(&completion, + HISI_SAS_WAIT_PHYUP_TIMEOUT)) { dev_warn(dev, "phy%d wait phyup timed out for func %d\n", phy_no, func); if (phy->in_reset) -- 2.26.2