From patchwork Wed Nov 25 12:58:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 57299 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2720624lbb; Wed, 25 Nov 2015 04:58:19 -0800 (PST) X-Received: by 10.66.100.226 with SMTP id fb2mr50964301pab.16.1448456299831; Wed, 25 Nov 2015 04:58:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sj4si1064304pac.228.2015.11.25.04.58.19; Wed, 25 Nov 2015 04:58:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752300AbbKYM6T (ORCPT + 4 others); Wed, 25 Nov 2015 07:58:19 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:63031 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751895AbbKYM6S (ORCPT ); Wed, 25 Nov 2015 07:58:18 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NYD004YAG14SXB0@mailout2.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 25 Nov 2015 12:58:16 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-15-5655b0684c75 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 96.1F.21385.860B5565; Wed, 25 Nov 2015 12:58:16 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NYD00AKCG111H90@eusync2.samsung.com>; Wed, 25 Nov 2015 12:58:16 +0000 (GMT) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marek Szyprowski , Russell King - ARM Linux , Kukjin Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 1/2] drivers: amba: properly handle devices with power domains Date: Wed, 25 Nov 2015 13:58:09 +0100 Message-id: <1448456289-31960-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1448456127-31842-1-git-send-email-m.szyprowski@samsung.com> References: <1448456127-31842-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprELMWRmVeSWpSXmKPExsVy+t/xK7oZG0LDDD73aFlsnLGe1eL1C0OL /sevmS02Pb7GajHj/D4mi9uXeS3WHrnL7sDu0dLcw+axaVUnm8fmJfUefVtWMXp83iQXwBrF ZZOSmpNZllqkb5fAlTF36Ua2gk/sFVfmn2VtYFzN1sXIySEhYCLxuu8EO4QtJnHh3nqgOBeH kMBSRonOV69YIJwmJokJ39aBdbAJGEp0ve0Cs0UEvCUmn/nLDlLELPCGUWLH4y0sIAlhAT+J ZQdbWEFsFgFViXP734HZvAIeEk3NzUwQ6+Qk/r9cAWZzCnhKfLz8EaxXCKim/fB7lgmMvAsY GVYxiqaWJhcUJ6XnGukVJ+YWl+al6yXn525ihITU1x2MS49ZHWIU4GBU4uF98SQkTIg1say4 MvcQowQHs5II7+/a0DAh3pTEyqrUovz4otKc1OJDjNIcLErivDN3vQ8REkhPLEnNTk0tSC2C yTJxcEo1MF6sYfE3mf/1uHgov0Cqep3Ul/4ChX9lNUL3vWVdtm12cBdd9u/Y+xtbc33fvDu+ aP4bu7O9pac/HLt79knm/S6D658fJd51XpFewzm9l+Nxzw3JfezcPvJRImcfXd55fprU/v/7 za//udDyz/zMFEfPp28/F8rPSa/y/Fgbry35jPPAhW5ehzglluKMREMt5qLiRACABW8wJQIA AA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org To read pid/cid registers, the probed device need to be properly turned on. When it is inside a power domain, the bus code should ensure that the given power domain is enabled before trying to access device's registers. Signed-off-by: Marek Szyprowski --- drivers/amba/bus.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 1.9.2 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index f009936..25715cb 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -373,6 +373,12 @@ int amba_device_add(struct amba_device *dev, struct resource *parent) goto err_release; } + ret = dev_pm_domain_attach(&dev->dev, true); + if (ret) { + iounmap(tmp); + goto err_release; + } + ret = amba_get_enable_pclk(dev); if (ret == 0) { u32 pid, cid; @@ -398,6 +404,7 @@ int amba_device_add(struct amba_device *dev, struct resource *parent) } iounmap(tmp); + dev_pm_domain_detach(&dev->dev, true); if (ret) goto err_release;