Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5586689ybp; Tue, 8 Oct 2019 05:24:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9jnf6NaPyjSFS8omd+3/ZycM2Uh0lIZDPChLfOYlcR18CroQcA/AOP0wtmiOMBZcgRnHG X-Received: by 2002:aa7:c897:: with SMTP id p23mr33700616eds.199.1570537493027; Tue, 08 Oct 2019 05:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570537493; cv=none; d=google.com; s=arc-20160816; b=NjyXA8XPISqwjcV3AFCalhJ9EqOLONFLZPUX9tsjnJmqENabTJlhvwLirwYqxrye9+ PBj7/eZVrfeNaDNXVqr17oh96oMTV4jZAxpBwexp+zdENRCR6c8Nnwzl4A8MW+gTalF8 dUGusnjhwbFBZY/KFhOMdVWg+qXX1cuZ4JtSPlvTd+90cbLbuoZ9bLatR5AgDQBfhsJj Z8TQC4k8SNaTB9+3ysS7KzhUhL9nc8YGvFFy2tNRv+c6/Xt5ScgcGDIcBH37nvkFiif2 9hm63xPGR2ub21882X7XmHUqX0JDjvtf++HavBldy4DfrrxDPd+DZ3scgSwczCGTJrVj n0hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=APEJ77UiGcTueBCfKODP+OW7yXVEtyJaEDWjWOgOw7U=; b=Qxx872bL9GRqnl0Zctr2YqL5Me3XNv4q/k/Xlp162Xj5YZdTYTxXMd5ZtN7GUVVX3h sxs7po+WNF5bRNrsdqLjxfzJeO7aRAkRQ6v9j67Ho+S1mFK/ouhWqnYJmfZCJggoyPHe IPP8d1ebSiexmAH14AoGrVp7lSrOXivbP5kAwZOCfPT3yhUc4EM6ODQp4feB+FPUiLK4 SkFhU6YXkkuFlfZFx/XpLu2ZMK3WRP4KTUy8RZ1livYBxJJ46np984TK3HcuOjwhiOte LpHzyCdyoJd2C+PgsyoqFJIIJYFrNvwlHdXPbdp3tvljwXIWf2H+QkKjidQ8digPHLSm y/kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ec21si8340432ejb.26.2019.10.08.05.24.29; Tue, 08 Oct 2019 05:24:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730541AbfJHMYU (ORCPT + 99 others); Tue, 8 Oct 2019 08:24:20 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:40292 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730249AbfJHMYU (ORCPT ); Tue, 8 Oct 2019 08:24:20 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id E340C80307; Tue, 8 Oct 2019 14:24:01 +0200 (CEST) Date: Tue, 8 Oct 2019 14:24:16 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Heiko Stuebner , Thierry Reding , Lorenzo Pieralisi , Andrew Murray , Shawn Lin , linux-rockchip@lists.infradead.org, Sasha Levin Subject: Re: [PATCH 4.19 061/106] PCI: rockchip: Propagate errors for optional regulators Message-ID: <20191008122416.GE608@amd> References: <20191006171124.641144086@linuxfoundation.org> <20191006171149.476262829@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Qz2CZ664xQdCRdPu" Content-Disposition: inline In-Reply-To: <20191006171149.476262829@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Qz2CZ664xQdCRdPu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun 2019-10-06 19:21:07, Greg Kroah-Hartman wrote: > From: Thierry Reding >=20 > [ Upstream commit 0e3ff0ac5f71bdb6be2a698de0ed0c7e6e738269 ] >=20 > regulator_get_optional() can fail for a number of reasons besides probe > deferral. It can for example return -ENOMEM if it runs out of memory as > it tries to allocate data structures. Propagating only -EPROBE_DEFER is > problematic because it results in these legitimately fatal errors being > treated as "regulator not specified in DT". >=20 > What we really want is to ignore the optional regulators only if they > have not been specified in DT. regulator_get_optional() returns -ENODEV > in this case, so that's the special case that we need to handle. So we > propagate all errors, except -ENODEV, so that real failures will still > cause the driver to fail probe. 61,62,63,64: Is this fixing any real bug? Why is it suitable for -stable? Pavel > +++ b/drivers/pci/controller/pcie-rockchip-host.c > @@ -608,29 +608,29 @@ static int rockchip_pcie_parse_host_dt(struct rockc= hip_pcie *rockchip) > =20 > rockchip->vpcie12v =3D devm_regulator_get_optional(dev, "vpcie12v"); > if (IS_ERR(rockchip->vpcie12v)) { > - if (PTR_ERR(rockchip->vpcie12v) =3D=3D -EPROBE_DEFER) > - return -EPROBE_DEFER; > + if (PTR_ERR(rockchip->vpcie12v) !=3D -ENODEV) > + return PTR_ERR(rockchip->vpcie12v); > dev_info(dev, "no vpcie12v regulator found\n"); > } > =20 > rockchip->vpcie3v3 =3D devm_regulator_get_optional(dev, "vpcie3v3"); > if (IS_ERR(rockchip->vpcie3v3)) { > - if (PTR_ERR(rockchip->vpcie3v3) =3D=3D -EPROBE_DEFER) > - return -EPROBE_DEFER; > + if (PTR_ERR(rockchip->vpcie3v3) !=3D -ENODEV) > + return PTR_ERR(rockchip->vpcie3v3); > dev_info(dev, "no vpcie3v3 regulator found\n"); > } > =20 > rockchip->vpcie1v8 =3D devm_regulator_get_optional(dev, "vpcie1v8"); > if (IS_ERR(rockchip->vpcie1v8)) { > - if (PTR_ERR(rockchip->vpcie1v8) =3D=3D -EPROBE_DEFER) > - return -EPROBE_DEFER; > + if (PTR_ERR(rockchip->vpcie1v8) !=3D -ENODEV) > + return PTR_ERR(rockchip->vpcie1v8); > dev_info(dev, "no vpcie1v8 regulator found\n"); > } > =20 > rockchip->vpcie0v9 =3D devm_regulator_get_optional(dev, "vpcie0v9"); > if (IS_ERR(rockchip->vpcie0v9)) { > - if (PTR_ERR(rockchip->vpcie0v9) =3D=3D -EPROBE_DEFER) > - return -EPROBE_DEFER; > + if (PTR_ERR(rockchip->vpcie0v9) !=3D -ENODEV) > + return PTR_ERR(rockchip->vpcie0v9); > dev_info(dev, "no vpcie0v9 regulator found\n"); > } > =20 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --Qz2CZ664xQdCRdPu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl2cf/AACgkQMOfwapXb+vJv3ACfRzDkFXlTi9tPJOxO6+xiSAgn z9oAnjZ9WXSOdp7sZSsix4hoHFpYHA7p =2wkE -----END PGP SIGNATURE----- --Qz2CZ664xQdCRdPu--