Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp637378pxb; Tue, 5 Apr 2022 16:50:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLiCuM6lBcPPwNNtTU0PrU7IN9Y490Obv/g3QeMtyCEKzKYl2OV7KWmZrX0KU7OoShOGBt X-Received: by 2002:a17:903:2488:b0:153:8f59:8c03 with SMTP id p8-20020a170903248800b001538f598c03mr6047397plw.54.1649202640347; Tue, 05 Apr 2022 16:50:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649202640; cv=none; d=google.com; s=arc-20160816; b=KyHyDCifjqf/gfv6w8cck6jRT7sCrnxYEEKLIxNezKkHc+PTvi2mbvtuHjO5ckI19E Mrq4eaERswYpk71/KIuB3QgxMeSqOE0d+hn9j3BS44sP3JzxVAzIRe4KUAFBz7rIeDWm Z+lskpz/qLScEmhRSk0ubWnlSkV5qG451+KUgHQMtdt4aR/wNwUo4WdmXJuIw+4j/8w5 XUq7A7B5H37OFib62V5zxUvQ5Ql5ZQwYQIcA7am3415h8B/G7aZQUHNiQ9orI8ceCqw9 /jSgtFFYZ4sWMBbMJ9MWOIu8ogTyC+IvLzcuQ4FRgv/3E0/g/BteUEkovSPT77YPWlGK PWkg== 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=Pn1SxA8HgHQGjcj0zIGP2sTYx4/2neQkz+UxkbDuu4xJGMy7v91FkbNMP0QNGehGjI RSeynsykxLXjJqC3QMQAlLNuagTmhKmsZzXj4mULAYC2zBdh9mZ6PfWcVgTyEryIPadw wfFtx06ym4mgSucYLirlGeeSfnwjPAPjzO+wZPjWeiGrvnjLa60t/IE5YgSQyFGsW1Ca faRtYW8TvAxoLlDSLiWyDAc12vjDoIbqcjeARWrxb2P1QdDKJm1Vy0bRMpze+aMDXvNa 9eKY934+vL+RKseVXxV7Ru6pjDipzV+xfYhk0OkmJmoc3jJ4tViSardKMokiTvSmGenH aBKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dgNUj+Hk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k10-20020a170902ce0a00b00153c3f96abesi13907878plg.137.2022.04.05.16.50.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:50:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dgNUj+Hk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F23CD1960A4; Tue, 5 Apr 2022 16:34:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240212AbiDEMEr (ORCPT + 99 others); Tue, 5 Apr 2022 08:04:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244148AbiDEIvn (ORCPT ); Tue, 5 Apr 2022 04:51:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE780D3AC1; Tue, 5 Apr 2022 01:40:26 -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 C8EC86154A; Tue, 5 Apr 2022 08:39:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D757DC385A4; Tue, 5 Apr 2022 08:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147994; bh=zRmSmzz9vDRdCW6CbMwaehqfUXppBLkYD3vwE3+vKG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dgNUj+HkMMGLJY1wM4aPdBqUb9LS6Udng9+3pEe+/eeEkb/ufActWOngP0Pq4sWb2 mMPv0QVUsq4fh/9vLwawQFghT6fO0641ddAWs6nMv0Uvm7frdPxguhQQZfmG0ExdNG 5ZzR1EPmOukj9WHLgULGydyWyiwDRV8ENcvvS0Ts= 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.16 0197/1017] PCI: imx6: Allow to probe when dw_pcie_wait_for_link() fails Date: Tue, 5 Apr 2022 09:18:30 +0200 Message-Id: <20220405070400.095326941@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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"); }