Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp657354pxb; Tue, 5 Apr 2022 17:35:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTYniMxxq0Z03dEH3iXRUca2sd9zNL16PccChUc2Sz+EuiKTYhQjY8S0gnhgglJN/fYlb8 X-Received: by 2002:a63:3f8f:0:b0:386:3116:a1f3 with SMTP id m137-20020a633f8f000000b003863116a1f3mr4921480pga.136.1649205326127; Tue, 05 Apr 2022 17:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649205326; cv=none; d=google.com; s=arc-20160816; b=X1Ea1dA0fV5s3sugSIS0opLbl4UI/aJZ3GCB1sJsptB+GlkYB2ex3n9rZntq0pKZ5P K1ysatk/KF4rytTnUTD0BoUfxpLWug1Z2q7KxSjo1OPS+oAMCZNSrRFB1wTtpZIDqhRC oQ3RBF6QF0ReNlGoeZ1w5A8Y8x7+VgNMtWjLm+ppM0+k8HWQBRpVJPF47UApcJKp8PD+ HJh6Xjx8IuQg7nwa+l24xs+U9Hu/RVQihPnUFlrLuz+XK8C7kjsn3DKrHh+oUCfKZtWN I3q+KrKV+4VYGKEj3WdsEapXBcaxjrkR7p2TUyJK38Iy6Reg0UX5fscxBOU5sk312yOG GBdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8I553UtfishIVgq0vs4VhbROY44WATNaIRqejYgG4QA=; b=O03rRWw/nWl+5gDX6Id71gSMlmEc+xPx4siRUVzxlT5Ogte/ENswe1VKCFStRm4iMr FapSQPLmfeqY7ZxqaxVtrV9d+JTVzviwN/KLD93uKbJN0n7nTf7fqQE/9ls/1NMKcYFh UHHAGZ/hOaEfw0x42xYuq3SJ0Tx+5KCO7+djTJPP9stz8JRMwci0By1NRIeP4V6JUH9k he0tDDq+bfKgnBEMzQPy1KUjlK1Rt9bN4p2M40axa8jxHGEZiS9H/qKxhRwisvf+o4Ey oaders+ftUShUeVKCoH/QNi9vA7/XI90yLXEsJ3/WEJ0WFrv73SU7TnKHMHTMWn7MoNV OFew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gXNlzMfK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 4-20020a631244000000b003816043f01asi14136046pgs.527.2022.04.05.17.35.11; Tue, 05 Apr 2022 17:35:26 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gXNlzMfK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244696AbiDEOx7 (ORCPT + 99 others); Tue, 5 Apr 2022 10:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244528AbiDEJl1 (ORCPT ); Tue, 5 Apr 2022 05:41:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0885BB935; Tue, 5 Apr 2022 02:26:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5C9C161684; Tue, 5 Apr 2022 09:26:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BCC9C385A2; Tue, 5 Apr 2022 09:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150799; bh=zRmSmzz9vDRdCW6CbMwaehqfUXppBLkYD3vwE3+vKG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gXNlzMfKcT+wDUA5zvKnf+K9XprpbdnDNLz8d+KnUo7bS2g72x08q6xJdxfwd1GRf cEt4dhswI8caf0gbCYvn2PU3ZvdCRgTL0BYPAcnBduISwIhwwx43sz/1haHH+Ww56v fWqQZHyo5JFz02ipFUx2SLaGJ/7gOjgNZUz70Das= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabio Estevam , Lorenzo Pieralisi , Rob Herring , Richard Zhu Subject: [PATCH 5.15 186/913] PCI: imx6: Allow to probe when dw_pcie_wait_for_link() fails Date: Tue, 5 Apr 2022 09:20:48 +0200 Message-Id: <20220405070345.431700530@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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: Fabio Estevam commit f81f095e87715e198471f4653952fe5e3f824874 upstream. The intention of commit 886a9c134755 ("PCI: dwc: Move link handling into common code") was to standardize the behavior of link down as explained in its commit log: "The behavior for a link down was inconsistent as some drivers would fail probe in that case while others succeed. Let's standardize this to succeed as there are usecases where devices (and the link) appear later even without hotplug. For example, a reconfigured FPGA device." The pci-imx6 still fails to probe when the link is not present, which causes the following warning: imx6q-pcie 8ffc000.pcie: Phy link never came up imx6q-pcie: probe of 8ffc000.pcie failed with error -110 ------------[ cut here ]------------ WARNING: CPU: 0 PID: 30 at drivers/regulator/core.c:2257 _regulator_put.part.0+0x1b8/0x1dc Modules linked in: CPU: 0 PID: 30 Comm: kworker/u2:2 Not tainted 5.15.0-next-20211103 #1 Hardware name: Freescale i.MX6 SoloX (Device Tree) Workqueue: events_unbound async_run_entry_fn [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack_lvl+0x58/0x70) [] (dump_stack_lvl) from [] (__warn+0xd4/0x154) [] (__warn) from [] (warn_slowpath_fmt+0x74/0xa8) [] (warn_slowpath_fmt) from [] (_regulator_put.part.0+0x1b8/0x1dc) [] (_regulator_put.part.0) from [] (regulator_put+0x2c/0x3c) [] (regulator_put) from [] (release_nodes+0x50/0x178) Fix this problem by ignoring the dw_pcie_wait_for_link() error like it is done on the other dwc drivers. Tested on imx6sx-sdb and imx6q-sabresd boards. Link: https://lore.kernel.org/r/20220106103645.2790803-1-festevam@gmail.com Fixes: 886a9c134755 ("PCI: dwc: Move link handling into common code") Signed-off-by: Fabio Estevam Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Reviewed-by: Richard Zhu Cc: Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/dwc/pci-imx6.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -779,9 +779,7 @@ static int imx6_pcie_start_link(struct d /* Start LTSSM. */ imx6_pcie_ltssm_enable(dev); - ret = dw_pcie_wait_for_link(pci); - if (ret) - goto err_reset_phy; + dw_pcie_wait_for_link(pci); if (pci->link_gen == 2) { /* Allow Gen2 mode after the link is up. */ @@ -817,11 +815,7 @@ static int imx6_pcie_start_link(struct d } /* Make sure link training is finished as well! */ - ret = dw_pcie_wait_for_link(pci); - if (ret) { - dev_err(dev, "Failed to bring link up!\n"); - goto err_reset_phy; - } + dw_pcie_wait_for_link(pci); } else { dev_info(dev, "Link: Gen2 disabled\n"); }