From nobody Tue Feb 10 05:42:03 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07E8D43C059; Tue, 20 Jan 2026 17:47:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768931267; cv=none; b=Ln2qVT5fXcbjTnkH0CGYuazE8Oj0egyoVHKw3ZiL3iLpf8+kpY8i5NcsC7Vv9Tupep5qqmi+sqdGo/gTNM9AeYafsim6HsID7G8h23HyVWo1Aj1hHFcac+OnypjoU5mt5dSGIWMPUyv96G1LF8pt8XYNTYRjZsWFzl6hwFC4v8c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768931267; c=relaxed/simple; bh=zyCyFEEucX1UpG1LV+i4l3xIDB6N/nLsFMA+4IFCJ2M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RNuO2z+fNxmIvHzOT78FDkujLflxAIeUOnD8EEfztG3lmKI0s8L5lVl7aQGKebxoWQiHDwZ298EJ38lHS6RHfQFH0rxLAnTYHa1zmraQvZQAQoj/J7cGy3Yr5LYHb4KW9gSAtK0rLgZ3xjWfIO5oCgTgJmvft6/iBUkLMwMfNIY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P/jsnfDG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P/jsnfDG" Received: by smtp.kernel.org (Postfix) with ESMTPS id A0543C2BCB5; Tue, 20 Jan 2026 17:47:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768931266; bh=zyCyFEEucX1UpG1LV+i4l3xIDB6N/nLsFMA+4IFCJ2M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=P/jsnfDGsnenrYZ4mnHSxguJEGu9F0LAkdR68NKuwE7F11XjsKc3OrMJWpE8UldJ8 xvckve1/6N6TYyFdMozQvxe2fuOfwxk2mk8o+RoC6nIo5t3yFJHIMNih7Sw2CyPUcW +y6qp73RGZuKjZHYO7AXNyaVzGBHLUN/P245++gKmOSey7e6yqBZ2SPzBnBVQp7W7n qGmu3PH0ytvnylmB4g/quE8yed1OG7/IavxXHZmAyjybdYmgXHpWNxySfKxwgAZcPc cDAtIY6Kvrs9P/C5+TWSN/cFpIPR1MQpWEayR7YIy8IxYi+KTXf0sH+D/01MdzBHai xYGtyEEWlAM6w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98EA7CA5FBD; Tue, 20 Jan 2026 17:47:46 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 20 Jan 2026 23:17:44 +0530 Subject: [PATCH v4 5/5] PCI: dwc: Fail dw_pcie_host_init() if dw_pcie_wait_for_link() returns -ETIMEDOUT Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260120-pci-dwc-suspend-rework-v4-5-2f32d5082549@oss.qualcomm.com> References: <20260120-pci-dwc-suspend-rework-v4-0-2f32d5082549@oss.qualcomm.com> In-Reply-To: <20260120-pci-dwc-suspend-rework-v4-0-2f32d5082549@oss.qualcomm.com> To: Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, vincent.guittot@linaro.org, zhangsenchuan@eswincomputing.com, Shawn Lin , Niklas Cassel , Richard Zhu , Manivannan Sadhasivam X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1459; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=qQ9TgqyVy5+ZTMoD8oCUDVOXgBhw/z7F/8O2CrsfxGk=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpb7/ApmJnuN5uPTosvZeuM/G6OR1nnq7vDyZvz i8+w4UuP3KJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaW+/wAAKCRBVnxHm/pHO 9do2B/4iXc3dd2qBrw5IsFyIssJUCFEvU7mpL7O8sXt23kvxu57GexIV5okRsT3/prQX11SZVQq jkkNZkfQ3aJStFEcIrBEWeI39UjAnDhAhYf3Zx/uKXq7eGvTzLBkN1OLEKHD8y2i6k3Exiz0vA6 ByA+pK+IuGVrV6eCAKfrpyjm/hL/HklwePmncueNp1SuKHH1X6PU0sr04ZwfjriGk4nhT2eQPa9 TPuPmKWjN4pgjsL8wZyePT+qcB18cNJx/K98qJq97H66NjY7QPYYizLY3ElS5pB0tqnIdagD15Q laDIpfBoa3v9NVGsd/2gHGl0hjDXjlqHHZr/gqjM5iZeGcW7 X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam The dw_pcie_wait_for_link() API now distinguishes link failures more precisely: -ENODEV: Device not found on the bus. -EIO: Device found but inactive. -ETIMEDOUT: Link failed to come up. Out of these three errors, only -ETIMEDOUT represents a definitive link failure since it signals that something is wrong with the link. For the other two errors, there is a possibility that the link might come up later. So fail dw_pcie_host_init() if -ETIMEDOUT is returned and skip the failure otherwise. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Niklas Cassel --- drivers/pci/controller/dwc/pcie-designware-host.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pc= i/controller/dwc/pcie-designware-host.c index fad0cbedefbc..a72406ef7e26 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -675,8 +675,13 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) goto err_remove_edma; } =20 - /* Ignore errors, the link may come up later */ - dw_pcie_wait_for_link(pci); + /* + * Only fail on timeout error. Other errors indicate the device may + * become available later, so continue without failing. + */ + ret =3D dw_pcie_wait_for_link(pci); + if (ret =3D=3D -ETIMEDOUT) + goto err_stop_link; =20 ret =3D pci_host_probe(bridge); if (ret) --=20 2.51.0