From patchwork Thu Jun 30 16:22:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 71261 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp481546qgy; Thu, 30 Jun 2016 09:26:54 -0700 (PDT) X-Received: by 10.98.13.81 with SMTP id v78mr23175947pfi.91.1467304014924; Thu, 30 Jun 2016 09:26:54 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id fd8si5045497pac.265.2016.06.30.09.26.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2016 09:26:54 -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 1bIemk-00073y-H7; Thu, 30 Jun 2016 16:25:50 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIejw-0002XU-C6 for linux-arm-kernel@bombadil.infradead.org; Thu, 30 Jun 2016 16:22:56 +0000 Received: from mail-it0-x22d.google.com ([2607:f8b0:4001:c0b::22d]) by merlin.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIejv-0004kq-58 for linux-arm-kernel@lists.infradead.org; Thu, 30 Jun 2016 16:22:55 +0000 Received: by mail-it0-x22d.google.com with SMTP id g127so4446665ith.1 for ; Thu, 30 Jun 2016 09:22:35 -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=TurxxDhBDYDTbMqmwOHSynjH9MoV9b836Tr9NfARN+wlof+NKKCGDYL0kPJzysdgAk EygzTcwh8EWyAj76yS5JxV2fbZ9zQ6Fz7qSDkOM7u0p2EwC3/LH522ZS03526BnHCT0e pbKT2S49OHkBGHzZGAyLUklDPUC5EL8qaN7e0= 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=j1oU0W5ctv5hA3IJYN6VGCohD470awBgfCEaliI8t1cD6rrDh5mLlNVddUHqmXSSnH McuLHGo1CVinCUfFGY+0LB70f2JT21o5ZnhdNAbeTax2hBMs20vYce8/18LV+zLarSjb 0ejWoSFRq0wzMwn7eqz+MnbQ45EO10tGWJZhLSF4wNUBHegQc809aW9BQ4XLhOCbGRh3 WRrMHI2bIiczX//GzqL6AEbBDWA9rzegwgCJ8wQKbMVTREr+e0CxzRy+kKsG2dHUBEV0 3Qa8LR7cK4fFnGpsAjFX1iiI7ijXbNUehHxJ1fsKm5/FUcLX9+Jt5I4W8cpr7yLjRbjx PmzQ== X-Gm-Message-State: ALyK8tIi7/SU/lmGmjzxNvqGrLKYw8giJ48fEGPit1YyKdg1/S/Uv2vcDaM6NDw+eF9OqilB X-Received: by 10.36.137.3 with SMTP id s3mr8657951itd.93.1467303754319; Thu, 30 Jun 2016 09:22:34 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m203sm4209375iom.21.2016.06.30.09.22.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jun 2016 09:22:33 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 13/13] coresight: add PM runtime calls to coresight_simple_func() Date: Thu, 30 Jun 2016 10:22:19 -0600 Message-Id: <1467303739-12543-14-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467303739-12543-1-git-send-email-mathieu.poirier@linaro.org> References: <1467303739-12543-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160630_122255_232003_7562E3AC X-CRM114-Status: GOOD ( 13.14 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.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:22d 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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)