From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E5A9C352AA for ; Wed, 2 Oct 2019 12:41:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30A9A20659 for ; Wed, 2 Oct 2019 12:41:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="O09fgROp"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="JPJGdfbH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30A9A20659 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HykX/Y5QE8ALQtoNBsT9pezuWcdPsWS/IMa6xTwovus=; b=O09fgROplgNnnA PQbQ4VPf3Qrdt8FxfxISpqmBgvdEZUW2FKl6b0rhLzL9rdblZ4BT+fjCGECcbmewZ5Kyl+pAsL5m7 CJYajyvYCx0cgAScLXKDBfwhM7+/1ZKkpzVYshw3IMfZgAX8KaG952LhCqie1vGg1XYq05a3cxQHb t0zOiH0qZK5rSU0mOG0M9EpPm378kiqPdYCPAMUXvCqUaYAQ5sOeG5ev1fTbw/mZUq+9Df6VN1/xO pZ1tOOCERqHQzgN3DUke9/XDrf8Xhj/TmaLZ5lMnrQZ7G5WJPfKdKwM536ApmlJqXPXfSBVesa2Qh Zivaj3TynxKAasn/B+6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFdwI-0006u5-DI; Wed, 02 Oct 2019 12:41:06 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFdw9-0006jZ-4J for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2019 12:40:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FqquIHC5oxBy8CfQu3Yph9eJsUVp9ZgWjyWHgpTSvkU=; b=JPJGdfbHXvOiVSxMPvS6nxMLB Wm6y7QlzB1iqVkXS0nqPlswbkaPjuAcZHOVasrZff8Z9COb4i53czP8CqWb/7uzGyt83bDGymojER Dm7l8DOwlJ4Pu8RYOOVMUh4B2zUMAyClkZsJsK4DFUTu9EYgYFOd8VXRo0OF5ChUy4WQTItrnNNfh /GrijJ1hKrd3B+7CJvM67b8JAIFIZkrBT2OOwId8GWq6E3Xf2Rjy5R+2C2hetdWNkoOvM5HIxdrA/ CMDKNmG/kWrgBrrnaxl25jGOsISEPhGkrduob+M0pfdDYvPURjy0H0CcGkylR06lXgW7q5tgirT4J r+vQFBsRw==; Received: from shell.armlinux.org.uk ([2002:4e20:1eda:1:5054:ff:fe00:4ec]:46680) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iFdvx-0000FD-EC; Wed, 02 Oct 2019 13:40:45 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1iFdvv-0000fy-Hs; Wed, 02 Oct 2019 13:40:43 +0100 Date: Wed, 2 Oct 2019 13:40:43 +0100 From: Russell King - ARM Linux admin To: Dinh Nguyen Subject: Re: [PATCHv2] ARM: drivers/amba: release the resource to allow for deferred probe Message-ID: <20191002124043.GR25745@shell.armlinux.org.uk> References: <20191002123349.23771-1-dinguyen@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191002123349.23771-1-dinguyen@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191002_054057_412377_FB2DE0C4 X-CRM114-Status: GOOD ( 18.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: p.zabel@pengutronix.de, linus.walleij@linaro.org, thor.thayer@linux.intel.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 02, 2019 at 07:33:49AM -0500, Dinh Nguyen wrote: > With commit "79bdcb202a35 ARM: 8906/1: drivers/amba: add reset control to > amba bus probe", the amba bus driver needs to be deferred probe because the > reset driver is probed later. However with a deferred probe, the call to > request_resource() in the driver returns -EBUSY. The reason is the driver > has not released the resource from the previous probe attempt. > > This patch fixes how we handle the condition of EPROBE_DEFER that is returned > from getting the reset controls. For this condition, the patch will jump > to err_release, which will release the resource. > > Fixes: 79bdcb202a35 ("ARM: 8906/1: drivers/amba: add reset control to > amba bus probe") > Signed-off-by: Dinh Nguyen > --- > v2: release the resource when of_reset_control_array_get_optional_shared() > returns EPROBE_DEFER > --- > drivers/amba/bus.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c > index f39f075abff9..1109437815eb 100644 > --- a/drivers/amba/bus.c > +++ b/drivers/amba/bus.c > @@ -409,9 +409,12 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent) > */ > rstc = of_reset_control_array_get_optional_shared(dev->dev.of_node); > if (IS_ERR(rstc)) { > - if (PTR_ERR(rstc) != -EPROBE_DEFER) > + ret = PTR_ERR(rstc); > + if (ret == -EPROBE_DEFER) > + goto err_release; > + else > dev_err(&dev->dev, "Can't get amba reset!\n"); > - return PTR_ERR(rstc); > + return ret; Still a negative. Remember in the comments to the previous patch I talked about ioremap(). Please read the code that you are modifying and carefully consider what needs to happen at this site to properly clean up on failure. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel