lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d6bedd7-37b3-ff2d-51b1-7fd4d2f7024a@arm.com>
Date:   Wed, 4 Nov 2020 10:54:01 +0000
From:   Suzuki K Poulose <suzuki.poulose@....com>
To:     Mathieu Poirier <mathieu.poirier@...aro.org>
Cc:     linux-arm-kernel@...ts.infradead.org, mike.leach@...aro.org,
        coresight@...ts.linaro.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 10/26] coresight: Convert claim/disclaim operations to
 use access wrappers

On 11/3/20 6:36 PM, Mathieu Poirier wrote:
> On Wed, Oct 28, 2020 at 10:09:29PM +0000, Suzuki K Poulose wrote:
>> Convert the generic CLAIM tag management APIs to use the
>> device access layer abstraction.
>>
>> Cc: Mathieu Poirier <mathieu.poirier@...aro.org>
>> Cc: Mike Leach <mike.leach@...aro.org>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
>> ---
>>   drivers/hwtracing/coresight/coresight-catu.c  |  6 +-
>>   drivers/hwtracing/coresight/coresight-core.c  | 66 +++++++++++--------
>>   .../hwtracing/coresight/coresight-cti-core.c  | 17 +++--
>>   drivers/hwtracing/coresight/coresight-etb10.c |  4 +-
>>   .../coresight/coresight-etm3x-core.c          |  8 ++-
>>   .../coresight/coresight-etm4x-core.c          |  4 +-
>>   .../hwtracing/coresight/coresight-funnel.c    |  6 +-
>>   .../coresight/coresight-replicator.c          | 16 +++--
>>   .../hwtracing/coresight/coresight-tmc-etf.c   | 10 +--
>>   .../hwtracing/coresight/coresight-tmc-etr.c   |  4 +-
>>   include/linux/coresight.h                     | 16 ++---
>>   11 files changed, 95 insertions(+), 62 deletions(-)
>>

>>   }
>>   
>> -static inline void coresight_set_claim_tags(void __iomem *base)
>> +static inline void coresight_set_claim_tags(struct coresight_device *csdev)
>>   {
>> -	writel_relaxed(CORESIGHT_CLAIM_SELF_HOSTED, base + CORESIGHT_CLAIMSET);
>> +	csdev_access_relaxed_write32(&csdev->access, CORESIGHT_CLAIM_SELF_HOSTED,
>> +				  CORESIGHT_CLAIMSET);
> 
> Indentation
> 
>>   	isb();
>>   }
>>   
>> -static inline void coresight_clear_claim_tags(void __iomem *base)
>> +static inline void coresight_clear_claim_tags(struct coresight_device *csdev)
>>   {
>> -	writel_relaxed(CORESIGHT_CLAIM_SELF_HOSTED, base + CORESIGHT_CLAIMCLR);
>> +	csdev_access_relaxed_write32(&csdev->access, CORESIGHT_CLAIM_SELF_HOSTED,
>> +				  CORESIGHT_CLAIMCLR);
> 
> Indentation
> 
>>   	isb();
>>   }
>>   


>> diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
>> index fcf25740116c..e35d79e74e30 100644
>> --- a/drivers/hwtracing/coresight/coresight-replicator.c
>> +++ b/drivers/hwtracing/coresight/coresight-replicator.c
>> @@ -45,12 +45,18 @@ struct replicator_drvdata {
>>   
>>   static void dynamic_replicator_reset(struct replicator_drvdata *drvdata)
>>   {
>> +	struct coresight_device *csdev = drvdata->csdev;
>>   	CS_UNLOCK(drvdata->base);
>>   
>> -	if (!coresight_claim_device_unlocked(drvdata->base)) {
>> +	if (WARN_ON(!csdev))
>> +		return;
> 
> I don't see a need for this check. Function replicator_reset() is called from
> probe() where the validity of drvdata->csdev is checked just before.
> 

Correct. We only needed drvdata->base earlier, which was fine. But we
now need csdev for the reset. That check was added to make sure that
we don't break the guarantee. I could take that down.

Cheers
Suzuki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ