From patchwork Thu Aug 25 21:19:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 74745 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1048199qga; Thu, 25 Aug 2016 14:23:24 -0700 (PDT) X-Received: by 10.98.103.214 with SMTP id t83mr20204140pfj.158.1472160204449; Thu, 25 Aug 2016 14:23:24 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id aa1si1422979pad.208.2016.08.25.14.23.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Aug 2016 14:23:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bd26S-0000Kg-2R; Thu, 25 Aug 2016 21:22:24 +0000 Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bd24B-0006Jy-5L for linux-arm-kernel@lists.infradead.org; Thu, 25 Aug 2016 21:20:04 +0000 Received: by mail-it0-x236.google.com with SMTP id e63so35653859ith.1 for ; Thu, 25 Aug 2016 14:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RkOde8LwC4rd6kWWLG2ituLC4nZRNFhnnTpi6BEGgg4=; b=Jr7h8JZiSqdvZOdIGIb/5QovOSIXvXpYWJYMBpfC68+dikys7zun7n/zMdITQ12RTI AGqdXPUdPhcp747eqHGF7W7vyhAUkrU1AXG9kCYIhiXZpmaXIPIp9ec+HzDH/7h0NyT+ +elUs7JdKkdigJcfMzQ+p2a4yIY+qMmXp0Xv8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RkOde8LwC4rd6kWWLG2ituLC4nZRNFhnnTpi6BEGgg4=; b=dDj9sy/gRBsvl4uMNrHdzUoqFUOquP/7rbrqACDJtNYymzu/XcAS7mB9vHU6xOXWw4 rIzF7WQoISoMbqAWuaWEbmD/itrvgRM6q2MjGUB8O4aKjkMRR7i/I2g22likdx6PVAd9 QGltBtjxyB9VUPUnevJqwW+lbXMgGY+G7mkEKEmdm4AIgnawVfLY7HMlf1fXKWoqFA8E NHw4tzrK93WZPbHXYvIqjYs1FcylpbhSy89WxGQGpR+yRFO2qGT754Y4Jz4nIzOmBBc1 o4KqsfUKyAGujXI1vZvBdgzBkQqJ5/BRx6MVZDcoq+cvSHd7Y3IrnlwUj4qJiJBqDbMg +X7Q== X-Gm-Message-State: AEkoousrmbx+Z0MIyT9xKHPL33Aq+PQUzmg5SFLmgCMtwkaxbQVeJpBPv2PG//FMNDCKIUMx X-Received: by 10.107.20.206 with SMTP id 197mr14098258iou.103.1472159982192; Thu, 25 Aug 2016 14:19:42 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id o5sm14506120ith.20.2016.08.25.14.19.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Aug 2016 14:19:41 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 12/28] coresight: add PM runtime calls to coresight_simple_func() Date: Thu, 25 Aug 2016 15:19:02 -0600 Message-Id: <1472159958-5981-13-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472159958-5981-1-git-send-email-mathieu.poirier@linaro.org> References: <1472159958-5981-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160825_142003_403441_88C4C9C3 X-CRM114-Status: GOOD ( 12.49 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:4001:c0b:0:0:0:236 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org It is mandatory to enable a coresight block's power domain before trying to access management registers. Otherwise the transaction simply stalls, leading to a system hang. Signed-off-by: Mathieu Poirier Reviewed-by: Sudeep Holla --- drivers/hwtracing/coresight/coresight-priv.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index ad975c58080d..decfd52b5dc3 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -16,6 +16,7 @@ #include #include #include +#include /* * Coresight management registers (0xf00-0xfcc) @@ -42,8 +43,11 @@ static ssize_t name##_show(struct device *_dev, \ struct device_attribute *attr, char *buf) \ { \ type *drvdata = dev_get_drvdata(_dev->parent); \ - return scnprintf(buf, PAGE_SIZE, "0x%x\n", \ - readl_relaxed(drvdata->base + offset)); \ + u32 val; \ + pm_runtime_get_sync(_dev->parent); \ + val = readl_relaxed(drvdata->base + offset); \ + pm_runtime_put_sync(_dev->parent); \ + return scnprintf(buf, PAGE_SIZE, "0x%x\n", val); \ } \ static DEVICE_ATTR_RO(name)