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: <1bc641d5-a5d0-e459-57cf-07b6b7e055f4@codeaurora.org>
Date:   Wed, 11 Jul 2018 17:00:14 +0530
From:   Vivek Gautam <vivek.gautam@...eaurora.org>
To:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Tomasz Figa <tfiga@...omium.org>
Cc:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        "list@....net:IOMMU DRIVERS" <iommu@...ts.linux-foundation.org>,
        Joerg Roedel <joro@...tes.org>, joro@...tes.org,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Robin Murphy <robin.murphy@....com>,
        Will Deacon <will.deacon@....com>,
        "list@....net:IOMMU DRIVERS" <iommu@...ts.linux-foundation.org>,
        Joerg Roedel <joro@...tes.org>,
        iommu@...ts.linux-foundation.org,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Alex Williamson <alex.williamson@...hat.com>,
        Rob Clark <robdclark@...il.com>,
        Linux PM <linux-pm@...r.kernel.org>,
        freedreno <freedreno@...ts.freedesktop.org>,
        Stephen Boyd <sboyd@...nel.org>,
        Sricharan R <sricharan@...eaurora.org>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Archit Taneja <architt@...eaurora.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        jcrouse@...eaurora.org
Subject: Re: [PATCH v12 2/4] iommu/arm-smmu: Invoke pm_runtime during probe,
 add/remove device



On 7/11/2018 4:29 PM, Rafael J. Wysocki wrote:
> On Wed, Jul 11, 2018 at 12:05 PM, Tomasz Figa <tfiga@...omium.org> wrote:
>> Hi Rafael,
>>
>> Thanks for review.
>>
>> On Wed, Jul 11, 2018 at 6:53 PM Rafael J. Wysocki <rjw@...ysocki.net> wrote:
>>> On Sunday, July 8, 2018 7:34:11 PM CEST Vivek Gautam wrote:
>>>> From: Sricharan R <sricharan@...eaurora.org>
>>>>
>>>> The smmu device probe/remove and add/remove master device callbacks
>>>> gets called when the smmu is not linked to its master, that is without
>>>> the context of the master device. So calling runtime apis in those places
>>>> separately.
>>>>
>>>> Signed-off-by: Sricharan R <sricharan@...eaurora.org>
>>>> [vivek: Cleanup pm runtime calls]
>>>> Signed-off-by: Vivek Gautam <vivek.gautam@...eaurora.org>
>>>> Reviewed-by: Tomasz Figa <tfiga@...omium.org>
>>>> ---
>>>>
>>>>   - Change since v11
>>>>     * Replaced pm_runtime_disable() with pm_runtime_force_suspend()
>>>>       to avoid warning about " Unpreparing enabled clock".
>>>>       Full warning text mentioned in cover patch.
>>>>
>>>>   drivers/iommu/arm-smmu.c | 92 +++++++++++++++++++++++++++++++++++++++++++-----
>>>>   1 file changed, 84 insertions(+), 8 deletions(-)
>>>>
>>>> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
>>>> index a01d0dde21dd..09265e206e2d 100644
>>>> --- a/drivers/iommu/arm-smmu.c
>>>> +++ b/drivers/iommu/arm-smmu.c
>>>> @@ -268,6 +268,20 @@ static struct arm_smmu_option_prop arm_smmu_options[] = {
>>>>        { 0, NULL},
>>>>   };
>>>>
>>>> +static inline int arm_smmu_rpm_get(struct arm_smmu_device *smmu)
>>>> +{
>>>> +     if (pm_runtime_enabled(smmu->dev))
>>> Why do you need the pm_runtime_enabled() checks here and below?
>>>
>>> pm_runtime_get_sync() and pm_runtime_put() should work just fine if
>>> runtime PM is not enabled.
>> Because pm_runtime_get_sync() acquires a spin lock, even if only for
>> the short time of checking if runtime PM is enabled and SMMU driver
>> maintainers didn't want any spin locks in certain IOMMU API code paths
>> on hardware implementations that don't need runtime PM, while we still
>> need to be able to control runtime PM there on hardware
>> implementations that need so.
> OK, so it is an optimization.  It would be good to put a comment in
> there to that effect.

Yea, actually there's a comment placed in arm_smmu_device_probe()
  where the runtime PM is conditionally enabled.
I can add comments for these wrappers too if you would like.

Thanks & Regards
Vivek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ