From patchwork Tue Oct 1 21:40:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinh Nguyen X-Patchwork-Id: 11169765 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E2FC14DB for ; Tue, 1 Oct 2019 21:40:42 +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 341E321920 for ; Tue, 1 Oct 2019 21:40:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iIUAmsPT"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="H6yDzxYi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 341E321920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=7nqCM8yftzx4V9zwb7d77+kqkiHR0QRCSElctSICq/0=; b=iIUAmsPTB8C+pe d9pDVGAN2jWPhuQZhCmXkn+sngeNjM1DVgympOWQtPCi1TDUALA3kEEe0u0Jdeb7TqKQWNqm7rqUl NaoRIYV9F703PbRaB4DV/iGiI6zSfgWx3I/soxJ2CZR8U9BgNJWOiAEdglWrqLmdzUsELoGUc4C9U HVzXtKphAld8ifCUNkAYCcCkSIaw5Hu3cH/huInMf3l3s6luYml5btBuofO3cuyHB/gXd8bYlDqu5 6sIzWgfGpMLGvnuPZ2cRfN188CgvMiSExvgij+pr/4NWWd9rVroujxmeYb35KmN4cjAe2PMb01BtV hZ/q/Y0ZyRiuA56zU8oA==; 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 1iFPsu-00082Y-JR; Tue, 01 Oct 2019 21:40:40 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFPsr-000827-WC for linux-arm-kernel@lists.infradead.org; Tue, 01 Oct 2019 21:40:39 +0000 Received: from localhost.localdomain (cpe-70-114-128-244.austin.res.rr.com [70.114.128.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63B0021855; Tue, 1 Oct 2019 21:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569966037; bh=EXOOfmyP72S6DF4GjcNc343Kct+Ec+psa0RkkWegYg8=; h=From:To:Cc:Subject:Date:From; b=H6yDzxYiIrz42md3od0CYGxSqQx7lSzoEfsymyaa+JYKVjmCENfiWBLZnlf/1grQT MWgbYWJVRkRRKqYWD/g0xkm5GA6SzrTJz2PFQmN/6XGKZXXul4F0Dihq2llPSob87U RBQK5eElaBFzxadA/etQIIPNxFJF5pg+/kCYoOSY= From: Dinh Nguyen To: linux@armlinux.org.uk Subject: [PATCH] ARM: drivers/amba: release the resource to allow for deferred probe Date: Tue, 1 Oct 2019 16:40:26 -0500 Message-Id: <20191001214026.21718-1-dinguyen@kernel.org> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191001_144038_054987_9F35C06C X-CRM114-Status: GOOD ( 11.26 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender 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: thor.thayer@linux.intel.com, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, dinguyen@kernel.org, p.zabel@pengutronix.de, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 than the amba bus. 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 releases the resource when amba_device_try_add() returns -EPROBE_DEFER. This allows the deferred probe to continue. Fixes: 79bdcb202a35 ("ARM: 8906/1: drivers/amba: add reset control to amba bus probe") Signed-off-by: Dinh Nguyen --- drivers/amba/bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index f39f075abff9..f246b847c991 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -535,6 +535,7 @@ int amba_device_add(struct amba_device *dev, struct resource *parent) if (ret == -EPROBE_DEFER) { struct deferred_device *ddev; + release_resource(&dev->res); ddev = kmalloc(sizeof(*ddev), GFP_KERNEL); if (!ddev)