[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hMQJQ0Z-H2OLaeCdT+-MW_eSWmg7saVzkpDqJ-=i3DnQ@mail.gmail.com>
Date: Wed, 11 Jul 2018 12:59:37 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Tomasz Figa <tfiga@...omium.org>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Vivek Gautam <vivek.gautam@...eaurora.org>,
"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 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.
Powered by blists - more mailing lists