From patchwork Fri Jun 17 17:41:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 70369 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp398498qgy; Fri, 17 Jun 2016 10:41:54 -0700 (PDT) X-Received: by 10.107.150.81 with SMTP id y78mr5217593iod.23.1466185314566; Fri, 17 Jun 2016 10:41:54 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l190si5462480pfc.53.2016.06.17.10.41.54; Fri, 17 Jun 2016 10:41:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754110AbcFQRlw (ORCPT + 30 others); Fri, 17 Jun 2016 13:41:52 -0400 Received: from mail-io0-f179.google.com ([209.85.223.179]:36599 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752843AbcFQRlv (ORCPT ); Fri, 17 Jun 2016 13:41:51 -0400 Received: by mail-io0-f179.google.com with SMTP id n127so83488536iof.3 for ; Fri, 17 Jun 2016 10:41:50 -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; bh=RZr19DJqSJcWA21rqxAW4VBUnNqovogSWyIRIu6kMzo=; b=kZk9TZOPRBx7MwpM6TyPA1fMndqYE+jLf+VpKvScYtQf4RQpC/SwRBAl8EzdfOcIsP vQ0/F7H95Gi9SMA35OzyYb4YvafzaZxZSdu4tv1/XsywCoMUtwR+U3pWwHZo/SUFDrPK ZyngZ8Ib5N4xq0xNFzpLVgMSdHFByfwrMWkxo= 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; bh=RZr19DJqSJcWA21rqxAW4VBUnNqovogSWyIRIu6kMzo=; b=MHg/9BDDKmTXiaQ49XaJQR4UKj7Iu1iKh6fCUr00yMyNWoMblZNmZu33vw5DjN+1uX vUuq8Da/Rvl5PlQ3h6lL+LmuaA2b76J0DYCky1pEqi+7zGa17n/JEGlp5MSwTGHN28iU HE9Xbnxl7f/Y3smH6L+/nsGgbQ6RZAth+RWxYtAsa0sHZFjuganNE39DTY2wNfumSvrN htwOdgJmq8dMPgxuXcI2NkQP28jl3NfKnnBXN8LVGvvjjI5r7ycOITNnyMgd6iQe4Yb4 spdQGPBLgvXhvVOUEX5QWR4wMqyXho0BJh+0vXHBpdKvSp+xu2YI5EWnbNqu82UmxZAi I3EQ== X-Gm-Message-State: ALyK8tLUhzXkpaNVFnOz++kD8CfyDdENXdtF+fAKhK6bmeLZh3ZPjm9Fa+yLWXhjxQba6mjh X-Received: by 10.107.62.4 with SMTP id l4mr5145100ioa.185.1466185309645; Fri, 17 Jun 2016 10:41:49 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id n63sm7949702ion.5.2016.06.17.10.41.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Jun 2016 10:41:49 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] coresight: add PM runtime calls to coresight_simple_func() Date: Fri, 17 Jun 2016 11:41:47 -0600 Message-Id: <1466185307-19539-1-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- drivers/hwtracing/coresight/coresight-priv.h | 3 +++ 1 file changed, 3 insertions(+) -- 2.5.0 diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index ad975c58080d..b047241e7496 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,10 @@ static ssize_t name##_show(struct device *_dev, \ struct device_attribute *attr, char *buf) \ { \ type *drvdata = dev_get_drvdata(_dev->parent); \ + pm_runtime_get_sync(_dev->parent); \ return scnprintf(buf, PAGE_SIZE, "0x%x\n", \ readl_relaxed(drvdata->base + offset)); \ + pm_runtime_put_sync(_dev->parent); \ } \ static DEVICE_ATTR_RO(name)