From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 928FACD37BE for ; Mon, 11 May 2026 06:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ciVEneF3Qh8f1wr1k2uXvgD09Jme9v/azQpnKLjoB8g=; b=LvsD/7hva3dfHjMhrwxbyDjZIm x15zXbAE/tBGNA4+JqMYuAh96u47MOU+k0lnz3YiJUFLXgZ2aFa4ENdMUbd7O+qkadCO4HDa0i+Bq Fk7/thfOnGYiF8e+3Dw8DSxHWhRG7NL3kNrxWgcHGwMJceWe9tHCNumsWe+fTsJ71yUlys/pk3XRi iqgeNQDtsBPcYNEzZ98XnS2A66WNfNX0gI/d/ABUaoG3+jKtscZZI7BoIjsERfiEpcYQJbVXC0qu6 0fMZSzJ9qORgDxsX8XV9BPtrDFQusAA0w1wooFCRFRmbVN2Exb1V8oe8/PM+gvOmDWauulF+3RaeD n7ZTQ6/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wMJgo-0000000CQgc-1jVI; Mon, 11 May 2026 06:00:26 +0000 Received: from m16.mail.163.com ([220.197.31.3]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wMJgh-0000000CQan-3Qz1; Mon, 11 May 2026 06:00:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=ci VEneF3Qh8f1wr1k2uXvgD09Jme9v/azQpnKLjoB8g=; b=UqaKtZWj8XQB5l4ZDY rnoYcIWW1IqDdmCII/fiPzwLnE0mHKerC3nAYqnIFlYz638umzJRVY5fskiIQfld Xo2OqK4Hc6OITT/sfhSGpIa6yetipI+fDwJuPdObPxcOcWO3qkZesPEiERu0C8Mo BhCTkBqUCuawAgKBpJ/6bD2LY= Received: from Precision-7960.. (unknown []) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wDn9yk8cAFqPHQVAw--.46705S9; Mon, 11 May 2026 13:59:34 +0800 (CST) From: Hans Zhang <18255117159@163.com> To: bhelgaas@google.com, lpieralisi@kernel.org, kwilczynski@kernel.org, mani@kernel.org, vigneshr@ti.com, jingoohan1@gmail.com, thomas.petazzoni@bootlin.com, pali@kernel.org, ryder.lee@mediatek.com, claudiu.beznea.uj@bp.renesas.com, mpillai@cadence.com Cc: robh@kernel.org, s-vadapalli@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, claudiu.beznea@tuxon.dev, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Zhang <18255117159@163.com> Subject: [PATCH v3 7/7] PCI: rzg3s-host: Use common pci_host_common_link_train_delay() helper Date: Mon, 11 May 2026 13:59:23 +0800 Message-Id: <20260511055923.37117-8-18255117159@163.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260511055923.37117-1-18255117159@163.com> References: <20260511055923.37117-1-18255117159@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wDn9yk8cAFqPHQVAw--.46705S9 X-Coremail-Antispam: 1Uf129KBjvdXoW7JFy7uw17AFWrCFyDAry7KFg_yoWkArg_u3 47CF9rAw45Kr9IkF12v3ySvFyYya4Iqr1jga1rK3W3JayjyFnYywn7ZFs0yr15u3W7J342 vrykCa48Cr93CjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRK0eHPUUUUU== X-Originating-IP: [140.206.53.66] X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbCwwYIq2oBcEba-AAA3d X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260510_230020_242056_4F1B8D8B X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace the unconditional msleep(100) with the common helper pci_host_common_link_train_delay(). The helper only waits when max_link_speed > 2, as required by PCIe r6.0 sec 6.6.1. This avoids unnecessary delay for Gen1/Gen2 links while retaining the mandatory 100 ms for higher speeds. Signed-off-by: Hans Zhang <18255117159@163.com> --- drivers/pci/controller/pcie-rzg3s-host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-rzg3s-host.c b/drivers/pci/controller/pcie-rzg3s-host.c index d86e7516dcc2..66f687304c1c 100644 --- a/drivers/pci/controller/pcie-rzg3s-host.c +++ b/drivers/pci/controller/pcie-rzg3s-host.c @@ -35,6 +35,7 @@ #include #include +#include "pci-host-common.h" #include "../pci.h" /* AXI registers */ @@ -1663,7 +1664,7 @@ rzg3s_pcie_host_setup(struct rzg3s_pcie_host *host, if (ret) dev_info(dev, "Failed to set max link speed\n"); - msleep(PCIE_RESET_CONFIG_WAIT_MS); + pci_host_common_link_train_delay(host->max_link_speed); return 0; -- 2.34.1