From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932566AbcF3Phu (ORCPT ); Thu, 30 Jun 2016 11:37:50 -0400 Received: from foss.arm.com ([217.140.101.70]:34201 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932516AbcF3Phk (ORCPT ); Thu, 30 Jun 2016 11:37:40 -0400 Subject: Re: [PATCH V2] coresight: add PM runtime calls to coresight_simple_func() To: Mathieu Poirier , linux-arm-kernel@lists.infradead.org References: <1466780963-21396-1-git-send-email-mathieu.poirier@linaro.org> Cc: Sudeep Holla , linux-kernel@vger.kernel.org From: Sudeep Holla Organization: ARM Message-ID: <57753CBC.7070905@arm.com> Date: Thu, 30 Jun 2016 16:37:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <1466780963-21396-1-git-send-email-mathieu.poirier@linaro.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/06/16 16:09, Mathieu Poirier wrote: > 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 > --- > Change from V1: > - Fix erroneous return point in the macro. > Reviewed-by: Sudeep Holla > drivers/hwtracing/coresight/coresight-priv.h | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > 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) > >