Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1336084pxb; Tue, 26 Oct 2021 07:14:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFHoJBvxzBacOF2+tfoSsIZbgHLbXcdN6jcf4JDhOJEg/l4ou5xkYPRgz7oKu13uacPC0b X-Received: by 2002:a62:bd03:0:b0:47b:e033:d52b with SMTP id a3-20020a62bd03000000b0047be033d52bmr20412628pff.20.1635257675853; Tue, 26 Oct 2021 07:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635257675; cv=none; d=google.com; s=arc-20160816; b=gTIm0UeME0RHucyK3Oytv69upezZAlltc7bSIr7WsruuqjSVv4tT5n0+7OdXb9Blit xiZZ7vKCEanzS7b5+GxS+9FxwcAy2bWbAXI/7OWWIX6y1IxzcyPttKaWaLUVWFW59dps xvpA+m8RBdVQGeyCJifs3PLS94aifjQlS5ebZrnD7CFHW9A4QCTNYEJkqS6XlO8OaOvc JU5NkZV0YRFVra7uSyW6UbJeALBSNKlvav0OswXLH4GzwLJY8afad9pi7NGANF0uurf7 wVXiT7+mCwIiHpXzz6tRCEyez4ovEJFlG0cM4zCrziDX9pq3rNrI62VUbWBmFuugBPCa O4vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JroZUbbtdOmlR2T74b1150CWHp925NQxujHQw5h0EfE=; b=afaXVPn2io2LVoUajmYwgjg6FFiuO4YGvpaPU21ktSQ/LDCDBawrNAzrNQWlJQx0Y6 69+52nmPiRx9bjOFOOxLjYTsjAZEq42UBUtVvsE2gHvuueIRqv/GVIyYkLg5OHfct8ef hCE31In4BFxuvLlAjhRcY2pJPZu2zfPfHYgngGcUqYqZKuo6rVuGoEILQliaq7hhD5Sf zlLtU0kvWC967PZt2+EHhLofTeMHUir9+8MC2J5rmFjdkm4k3DTIptbWOGlgofCK93AS J4vynDZw3Gh5u2puhZArd+AbB/xPqvCweqhye+8e77d8X/+8ddyXWiXUVJlBcsSqUTZi NdSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c0nDHmUZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id on12si1215318pjb.40.2021.10.26.07.14.22; Tue, 26 Oct 2021 07:14:35 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c0nDHmUZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234934AbhJZLAn (ORCPT + 99 others); Tue, 26 Oct 2021 07:00:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:60906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232840AbhJZLAm (ORCPT ); Tue, 26 Oct 2021 07:00:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 10A8F60C4A; Tue, 26 Oct 2021 10:58:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635245899; bh=VJI5lKGLCEnHTM2XKYq5kpokq1eyOKv3nZvB6oSX6iI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c0nDHmUZYJu1sh0KaumGV8/WwXUe2hnA6se9sTtEb2P/q1ZBrxQC/citRv//6N7J5 5ZZxXaklOn8vawrgdtxvw31SWmCmMsm7zSVYLqaiG+5unri3xlhPioZxMHGkZKKEN7 9FtyqSOjYtFzSQQRbpYRf00gsSiWKRKxSdtUqK0G301JRPiBsvZNg/1q1V/oLaDA6e PrQG2QJX1l0VC9u6PYHbDd81vXLUf4Qc1HKn/U7IL50qmS8MxAFkYdt6FBPlHksWhu 4Z9j0CU53oJeBkDVfJatFxBoOFYjB6XkxSdQyBs8DHbatbg4kuF38OQw0O8/dXy/sj 0V2bhGfhzsUrw== Date: Tue, 26 Oct 2021 11:58:14 +0100 From: Mark Brown To: Richard Zhu Cc: Francesco Dolcini , "l.stach@pengutronix.de" , "bhelgaas@google.com" , "lorenzo.pieralisi@arm.com" , "jingoohan1@gmail.com" , "linux-pci@vger.kernel.org" , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "kernel@pengutronix.de" Subject: Re: [PATCH v3 3/7] PCI: imx6: Fix the regulator dump when link never came up Message-ID: References: <1634886750-13861-1-git-send-email-hongxing.zhu@nxp.com> <1634886750-13861-4-git-send-email-hongxing.zhu@nxp.com> <20211025111312.GA31419@francesco-nb.int.toradex.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CM9V7cdtbJ/epuLB" Content-Disposition: inline In-Reply-To: X-Cookie: Times approximate. Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --CM9V7cdtbJ/epuLB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 26, 2021 at 02:18:18AM +0000, Richard Zhu wrote: > > I should probably also say that the check for the regulator looks buggy= as well, > > regulators should only be optional if they can be physically absent whi= ch does > > not seem likely for PCI devices. If the driver is not doing something = to > > reconfigure the hardware to account for a missing supply this is genera= lly a big > > warning sign. > >=20 > > I really don't understand why regulator support is so frequently proble= matic > > for PCI controllers. :( > [Richard Zhu] Hi Mark: > The _enabled check is used because that this regulator is optional in the= HW design. > To make the codes clean and aligned on different HW boards, the _enabled = check is added. I would be really surprised to see PCI hardware that was able to support a supply being physically absent, and this use of _is_enabled() is quite simply not how any of this is supposed to work in the regulator API even for regulators that can be optional. > The root cause is that the error return is not handled properly by the co= ntroller driver. > I.MX PCIe controller doesn't support the Hot-Plug, and it would return -1= 10 error > when PCIe link never came up. Thus, the _probe would be failed in the end. > The clocks/regulator usage balance should be considered by i.MX PCIe cont= roller, that's all. > It's not a general case, and the problem is not caused by the regulator s= upport. Perhaps it's not causing problems in this design but if the supply is ever shared with anything else then the software will run into trouble. There will also be problems with the error handling on a system where the regulator needs to be controlled. Please fix your mail client to word wrap within paragraphs at something substantially less than 80 columns. Doing this makes your messages much easier to read and reply to. --CM9V7cdtbJ/epuLB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmF330UACgkQJNaLcl1U h9A2rAf/TXfjNuS1ZmCvM9JPsvkTyS9t0JH1Y8KuUtNmbOh51YbCBVZ8o/toaYJ8 3VZy5Ptw8l/2KnbYlSEaFFGbiJpIcVkOw6Qo7nKSnArIMJIB/uM+Jb/1YRnXXdF5 SE+AIC+vPcUPWSGQsljXr1jttE954+U6sCO6QhWlRWjIP7O+sxpL+7v6uw3SBpYp 9HEJF3oeXJMRqkhyC4YKZ1emojKPHT3sVWUaQyRDRQD3m+7QjLGIWJ+JNB/gEcXv 2r8yXKuijwOmrTP7niPOLXez48txft/1ojj8Fb6bbaHlPlQp9c3kWgO6/RoCAwf9 8lqP9o/zPqn8jhq+wb4DCHrE5hOi5w== =f1Cl -----END PGP SIGNATURE----- --CM9V7cdtbJ/epuLB--