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: 7699061 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 536E69F2E9 for ; Wed, 25 Nov 2015 12:58:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70CEA208D8 for ; Wed, 25 Nov 2015 12:58:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D7AB208EA for ; Wed, 25 Nov 2015 12:58:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752300AbbKYM6T (ORCPT ); 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 X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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;