Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1536686pxb; Sun, 12 Sep 2021 23:07:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu3oujP55T5EdSNdJz4LBuVnZe3JVrG9Z7rcc4IVzmA23ybV8s6vTyXtiK42HAE0+U5WMS X-Received: by 2002:a17:906:50d:: with SMTP id j13mr4550283eja.58.1631513278512; Sun, 12 Sep 2021 23:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631513278; cv=none; d=google.com; s=arc-20160816; b=fBANlXv/zlAOBf4mAJhuFdlNFd7WyPyhkQ8r6H6Mag00bWJIhsSSw4g/3el/osXqVw bWGhBDtyHZs/DFrKWOO6wMCL73SqOhC83qWEnNsp6NUeR291CSeRzz8954lEKTtDqBqj 5DexVGvTB7KDh6E+kO8V3jo2gbYQdN9Zc2fLDEe9EE69+PAvOWdG/kJgjf7D57kpehCv i1buIsbCI2qIujwSxHNkOFt3+7/KTu40gwXpxmkA/G/cifcz3jgAuexggqvlvynXyQkM NBZ8ilxYEnATccSmHQIOc7VxyBTyALXCJAFcgLBKSvqxUL8C76fv9gnaILS5JY1LKAHq 45pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=OwMCCO1FoWDxa3IQwnaVP3an2Wh8BXzgFsdyhKnfwig=; b=vROJH9qEFzSsF/IOa94WpsgxsoqYd3Eq9zBI2DwFpgYd4KjmEHRvkt37+86PSU1JOn rklF1owdiRIkxsXFXlaOGiwFJ1gPCluWvPNXFllKKSh6h2GFjGGUNWNCfqlxcBGQg3Yl SfKfBqDqbxC5tHmbtc0JppERCrTtwusXTqY4s9lcNTXzVXME9a915pT4ZX+qUl9+s4Oe LxR3FIaPIgAoRq/Lre2ZNVsaUGwu0HrcH6Kujw5F2Kl8azl3lrvHGfr04HfLsI6MU/uK qXtWTIpgnTSqDzqj0c/7772uD7NoHDgZ78MgdeQN0kIWXCLdMxsVpmepYZI8owpb3txb 11Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p16si6431621edq.563.2021.09.12.23.07.35; Sun, 12 Sep 2021 23:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237403AbhIMGFo (ORCPT + 99 others); Mon, 13 Sep 2021 02:05:44 -0400 Received: from inva021.nxp.com ([92.121.34.21]:42174 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237279AbhIMGFi (ORCPT ); Mon, 13 Sep 2021 02:05:38 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0BB702028BA; Mon, 13 Sep 2021 08:04:22 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C839020206D; Mon, 13 Sep 2021 08:04:21 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 74A25183AD27; Mon, 13 Sep 2021 14:04:20 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, lorenzo.pieralisi@arm.com Cc: linux-pci@vger.kernel.org, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Richard Zhu Subject: [PATCH v2 3/5] PCI: imx6: Fix the regulator dump when link never came up Date: Mon, 13 Sep 2021 13:41:08 +0800 Message-Id: <1631511670-30164-4-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631511670-30164-1-git-send-email-hongxing.zhu@nxp.com> References: <1631511670-30164-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When PCIe PHY link never came up and vpcie regulator is present, there would be following dump when try to put the regulator. Disable this regulator to fix this dump when link never came up. imx6q-pcie 33800000.pcie: Phy link never came up imx6q-pcie: probe of 33800000.pcie failed with error -110 ------------[ cut here ]------------ WARNING: CPU: 3 PID: 119 at drivers/regulator/core.c:2256 _regulator_put.part.0+0x14c/0x158 Modules linked in: CPU: 3 PID: 119 Comm: kworker/u8:2 Not tainted 5.13.0-rc7-next-20210625-94710-ge4e92b2588a3 #10 Hardware name: FSL i.MX8MM EVK board (DT) Workqueue: events_unbound async_run_entry_fn pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--) pc : _regulator_put.part.0+0x14c/0x158 lr : regulator_put+0x34/0x48 sp : ffff8000122ebb30 x29: ffff8000122ebb30 x28: ffff800011be7000 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000000 x24: ffff00000025f2bc x23: ffff00000025f2c0 x22: ffff00000025f010 x21: ffff8000122ebc18 x20: ffff800011e3fa60 x19: ffff00000375fd80 x18: 0000000000000010 x17: 000000040044ffff x16: 00400032b5503510 x15: 0000000000000108 x14: ffff0000003cc938 x13: 00000000ffffffea x12: 0000000000000000 x11: 0000000000000000 x10: ffff80001076ba88 x9 : ffff80001076a540 x8 : ffff00000025f2c0 x7 : ffff0000001f4450 x6 : ffff000000176cd8 x5 : ffff000003857880 x4 : 0000000000000000 x3 : ffff800011e3fe30 x2 : ffff0000003cc4c0 x1 : 0000000000000000 x0 : 0000000000000001 Call trace: _regulator_put.part.0+0x14c/0x158 regulator_put+0x34/0x48 devm_regulator_release+0x10/0x18 release_nodes+0x38/0x60 devres_release_all+0x88/0xd0 really_probe+0xd0/0x2e8 __driver_probe_device+0x74/0xd8 driver_probe_device+0x7c/0x108 __device_attach_driver+0x8c/0xd0 bus_for_each_drv+0x74/0xc0 __device_attach_async_helper+0xb4/0xd8 async_run_entry_fn+0x30/0x100 process_one_work+0x19c/0x320 worker_thread+0x48/0x418 kthread+0x14c/0x158 ret_from_fork+0x10/0x18 ---[ end trace 3664ca4a50ce849b ]--- Signed-off-by: Richard Zhu --- drivers/pci/controller/dwc/pci-imx6.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index d3479f646c4f..1729a77caffd 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -853,6 +853,8 @@ static int imx6_pcie_start_link(struct dw_pcie *pci) dw_pcie_readl_dbi(pci, PCIE_PORT_DEBUG0), dw_pcie_readl_dbi(pci, PCIE_PORT_DEBUG1)); imx6_pcie_reset_phy(imx6_pcie); + if (imx6_pcie->vpcie && regulator_is_enabled(imx6_pcie->vpcie) > 0) + regulator_disable(imx6_pcie->vpcie); return ret; } -- 2.25.1