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]
Date: Thu, 22 Feb 2024 10:15:51 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Suzuki K Poulose <suzuki.poulose@....com>,
 linux-arm-kernel@...ts.infradead.org
Cc: Lorenzo Pieralisi <lpieralisi@...nel.org>,
 Sudeep Holla <sudeep.holla@....com>, Mike Leach <mike.leach@...aro.org>,
 James Clark <james.clark@....com>,
 Maxime Coquelin <mcoquelin.stm32@...il.com>,
 Alexandre Torgue <alexandre.torgue@...s.st.com>, linux-acpi@...r.kernel.org,
 linux-kernel@...r.kernel.org, coresight@...ts.linaro.org,
 linux-stm32@...md-mailman.stormreply.com, Hanjun Guo <guohanjun@...wei.com>,
 "Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>,
 Leo Yan <leo.yan@...aro.org>
Subject: Re: [PATCH V4 01/11] coresight: etm4x: Fix unbalanced
 pm_runtime_enable()



On 2/15/24 16:34, Suzuki K Poulose wrote:
> On 23/01/2024 05:45, Anshuman Khandual wrote:
>> There is an unbalanced pm_runtime_enable() in etm4_probe_platform_dev()
>> when etm4_probe() fails. This problem can be observed via the coresight
>> etm4 module's (load -> unload -> load) sequence when etm4_probe() fails
>> in etm4_probe_platform_dev().
>>
>> [   63.379943] coresight-etm4x 7040000.etm: Unbalanced pm_runtime_enable!
>> [   63.393630] coresight-etm4x 7140000.etm: Unbalanced pm_runtime_enable!
>> [   63.407455] coresight-etm4x 7240000.etm: Unbalanced pm_runtime_enable!
>> [   63.420983] coresight-etm4x 7340000.etm: Unbalanced pm_runtime_enable!
>> [   63.420999] coresight-etm4x 7440000.etm: Unbalanced pm_runtime_enable!
>> [   63.441209] coresight-etm4x 7540000.etm: Unbalanced pm_runtime_enable!
>> [   63.454689] coresight-etm4x 7640000.etm: Unbalanced pm_runtime_enable!
>> [   63.474982] coresight-etm4x 7740000.etm: Unbalanced pm_runtime_enable!
>>
>> This fixes the above problem - with an explicit pm_runtime_disable() call
>> when etm4_probe() fails during etm4_probe_platform_dev().
> 
> Fixes: 5214b563588e ("coresight: etm4x: Add support for sysreg only devices"

Sure, will add this 'Fixes' tag here.

> 
>>
>> Cc: Lorenzo Pieralisi <lpieralisi@...nel.org>
>> Cc: Hanjun Guo <guohanjun@...wei.com>
>> Cc: Sudeep Holla <sudeep.holla@....com>
>> Cc: "Rafael J. Wysocki" <rafael@...nel.org>
>> Cc: Len Brown <lenb@...nel.org>
>> Cc: Suzuki K Poulose <suzuki.poulose@....com>
>> Cc: Mike Leach <mike.leach@...aro.org>
>> Cc: James Clark <james.clark@....com>
>> Cc: Leo Yan <leo.yan@...aro.org>
>> Cc: linux-acpi@...r.kernel.org
>> Cc: linux-arm-kernel@...ts.infradead.org
>> Cc: linux-kernel@...r.kernel.org
>> Cc: coresight@...ts.linaro.org
>> Signed-off-by: Anshuman Khandual <anshuman.khandual@....com>
>> ---
>> Changes in V4:
>>
>> - New patch in the series
>>
>>   drivers/hwtracing/coresight/coresight-etm4x-core.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
>> index ce1995a2827f..7c693b45ac05 100644
>> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
>> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
>> @@ -2217,6 +2217,9 @@ static int etm4_probe_platform_dev(struct platform_device *pdev)
>>       ret = etm4_probe(&pdev->dev);
>>         pm_runtime_put(&pdev->dev);
>> +    if (ret)
>> +        pm_runtime_disable(&pdev->dev);
>> +
>>       return ret;
>>   }
>>   
> 
> Looks good to me. I have glanced through the other platform device driver code in coresight subsystem and they all seem to be safe, except
> for Ultrasoc-smb, which doesn't do any power managment. It may be, because it is only supported on an ACPI system.

Understood.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ