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: <CAMz4kuLVFc3YuSue8AQ8brjj+bDq-k-fOTRp_3M4xV1O=aYhgg@mail.gmail.com>
Date:   Wed, 27 Jun 2018 10:17:21 +0800
From:   Baolin Wang <baolin.wang@...aro.org>
To:     Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     Ohad Ben-Cohen <ohad@...ery.com>, Mark Brown <broonie@...nel.org>,
        linux-spi@...r.kernel.org, linux-remoteproc@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 6/8] hwspinlock: sprd: Use devm_hwspin_lock_register()

On 27 June 2018 at 04:51, Bjorn Andersson <bjorn.andersson@...aro.org> wrote:
> On Fri 22 Jun 01:09 PDT 2018, Baolin Wang wrote:
>
>> Use devm_hwspin_lock_register() to register the hwlock controller to
>> avoid unregistering the device explicitly.
>>
>> Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
>> ---
>>  drivers/hwspinlock/sprd_hwspinlock.c |    6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c
>> index dc42bf5..ba5daf6 100644
>> --- a/drivers/hwspinlock/sprd_hwspinlock.c
>> +++ b/drivers/hwspinlock/sprd_hwspinlock.c
>> @@ -120,8 +120,9 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev)
>>       platform_set_drvdata(pdev, sprd_hwlock);
>>       pm_runtime_enable(&pdev->dev);
>>
>> -     ret = hwspin_lock_register(&sprd_hwlock->bank, &pdev->dev,
>> -                                &sprd_hwspinlock_ops, 0, SPRD_HWLOCKS_NUM);
>> +     ret = devm_hwspin_lock_register(&pdev->dev, &sprd_hwlock->bank,
>> +                                     &sprd_hwspinlock_ops, 0,
>> +                                     SPRD_HWLOCKS_NUM);
>>       if (ret) {
>>               pm_runtime_disable(&pdev->dev);
>>               clk_disable_unprepare(sprd_hwlock->clk);
>> @@ -135,7 +136,6 @@ static int sprd_hwspinlock_remove(struct platform_device *pdev)
>>  {
>>       struct sprd_hwspinlock_dev *sprd_hwlock = platform_get_drvdata(pdev);
>>
>> -     hwspin_lock_unregister(&sprd_hwlock->bank);
>
> Until the hwspinlock is unregistered it's possible for clients to issue
> operations on it, so disabling power and clocks before that seems bad.

Yes, you are right. So may be register some additional actions with devm
core to call the clock disable as appropriate. Thanks.

-- 
Baolin.wang
Best Regards

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ