river - part 4")
Co-developed-by: Dan Carpenter
Signed-off-by: Dan Carpenter
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Move the initialization after 'else' statement.
Refine commit message.
---
drivers/staging/rtl8188eu/core/rtw_mlme.c | 4 +++-
1 file changed, 3 insert
> I review things in the order that they appear in my inbox so I hadn't
> seen Greg and Larry's comments. You've now stumbled into an area of
> politics where you have conflicting reviews... :P Fortunately, we're
> all of us reasonable people.
>
> I think your patch is correct in that it is
>
> Yes, in this routine, it would be possible for authmode to not be set;
> however,
> later code only compares it to either _WPA_IE_ID_ or _WPA2_IE_ID_. It is
> never
> used in a way that an unset value could make the program flow be different by
> arbitrarily setting the value to zero.
> From: Dinghao Liu
> Date: Fri, 24 Jul 2020 16:06:57 +0800
>
> > If req->ctype does not match any of NIX_AQ_CTYPE_CQ,
> > NIX_AQ_CTYPE_SQ or NIX_AQ_CTYPE_RQ, pointer bmap will remain
> > uninitialized and be accessed in test_bit(), which can lead
> > to kern
The variable authmode will keep uninitialized if neither if
statements used to initialize this variable are not triggered.
Then authmode may contain a garbage value and influence the
execution flow of this function.
Fix this by initializing it to zero.
Signed-off-by: Dinghao Liu
---
drivers
If req->ctype does not match any of NIX_AQ_CTYPE_CQ,
NIX_AQ_CTYPE_SQ or NIX_AQ_CTYPE_RQ, pointer bmap will remain
uninitialized and be accessed in test_bit(), which can lead
to kernal crash.
Fix this by returning an error code if this case is triggered.
Signed-off-by: Dinghao Liu
---
driv
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Remove unnecessary 'err_pm_put' label.
Refine commit message.
v3: - Add Fixes tag.
Rebase the patch on top of the latest kernel.
---
drivers/pci/controller/pcie-rcar-host.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/d
> On Sun, Jun 07, 2020 at 05:31:33PM +0800, Dinghao Liu wrote:
> > pm_runtime_get_sync() increments the runtime PM usage counter even
> > the call returns an error code. Thus a corresponding decrement is
> > needed on the error handling path to keep the counter balanced
pm_runtime_get_sync() increments the runtime PM usage counter even
it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Remove redundant brackets.
---
drivers/pci/controller/dwc
> > pm_runtime_get_sync() increments the runtime PM usage counter even
> > it returns an error code. Thus a pairing decrement is needed on
> > the error handling path to keep the counter balanced.
> >
> > Signed-off-by: Dinghao Liu
> > ---
> >
() after 'err_runtime_disable'
label. But in this case, the error path after pm_runtime_put_sync()
will decrease PM usage counter twice. Thus add an extra
pm_runtime_get_noresume() in this path to balance PM counter.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Add pm_runtime_get_noresume
>
> Could you reword this and add it to the patch description.
>
Fine. I will fix this in the next version of patch.
Regards,
Dinghao
> Hi Dinghao,
>
> On 6/24/20 9:30 AM, Dinghao Liu wrote:
> > pm_runtime_get_sync() increments the runtime PM usage counter even
> > when it returns an error code. Thus a pairing decrement is needed on
> > the error handling path to keep the counter balanced. For
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Merge two patches that fix runtime PM imbalance
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced. For other error
paths after this call, things are the same.
Signed-off-by: Dinghao Liu
---
Changelog:
v2
>
> Could you just reorder error labels below instead of releasing
> everything here?
Thank you for your advice! I'll fix this in the next version of patch.
Regards,
Dinghao
Hi Stanimir,
>
> This patch is not applicable anymore after [1].
>
> [1] 63342afea65e ("media: venus: vdec: Use pmruntime autosuspend")
>
Since pm_runtime_get_sync() has been removed from vdec_open(),
this patch is no longer needed.
Regards,
Dinghao
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a corresponding decrement is
needed on the error handling path to keep the counter balanced.
Fix this by adding the missed function call.
Signed-off-by: Dinghao Liu
---
drivers/crypto
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a corresponding decrement is
needed on the error handling path to keep the counter balanced.
Fix this by adding the missed function call.
Signed-off-by: Dinghao Liu
---
drivers/i2c/busses
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
v2: - Merge two patches that fix runtime PM imbalance
> >>
> >> Why noidle?
> >>
> >
> > _noidle is enough for fixing this bug. _sync may suspend
> > the device beyond expectation.
>
> In that case, then the other instance you are fixing with this patch is
> not correct.
>
Fine. I will fix this soon.
Regards,
Dinghao
>
> Why noidle?
>
_noidle is enough for fixing this bug. _sync may suspend
the device beyond expectation.
Regards,
Dinghao
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Merge two patches that fix runtime PM imbalance
>
> Can you point me to a discussion where it was decided that this is a
> proper fix? I'd think we rather should fix pm_runtime_get_sync() but
> maybe there are technical reasons against it.
>
There is a discussion here:
https://lkml.org/lkml/2020/5/20/1100
There are many use cases that
Hi Hans,
> err_pm:
> pm_runtime_put(dev);
>
> Shouldn't that be pm_runtime_put_sync()?
>
> I'm not pm expert, but it does look odd.
>
I checked the implementation of these two APIs before
and found they were exactly the same. So I think it's
fine to keep using pm_runtime_put().
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Fix the imbalance in vsp1_device_get().
Use
>
> The vsp1_probe() function has a struct vsp1_device whose dev field is
> populated by the time it needs to call pm_runtime_get_sync() and
> pm_runtime_get_put(), so I think you can use vsp1_device_get() and
> vsp1_device_put() as drop-in replacements without changing the
> parameters to these
Hi Laurent,
> >
> > I wonder how many bugs we have today, and how many bugs will keep
> > appearing in the future, due to this historical design mistake :-(
> >
Good question. It's hard to say if this is a design mistake (some use
of this API does not check its return value and expects it
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a corresponding decrement is
needed on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Remove unnecessary 'err_pm_put' label
> >
> > err_pm_put:
>
> You might want to remove this label too.
Thank you for pointing out this! I will fix this in the
next version of patch.
> On Tue, Jun 02, 2020 at 01:10:34PM +0200, Markus Elfring wrote:
> > > The original patch was basically fine.
> >
> > I propose to reconsider the interpretation of the software situation once
> > more.
> >
> > * Should the allocated clock object be kept usable even after
> > a successful
me pm support")
Co-developed-by: Markus Elfring
Signed-off-by: Markus Elfring
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use pm_runtime_put_noidle() instead of
pm_runtime_put_autosuspend().
v3: - Refine commit message.
---
drivers/i2c/busses/i2c-imx-lpi2c.c | 4 +++-
1 file
> > If there's *any* error, it'll check the pointer, if it's non-NULL,
> > it'll call the destructor. If kzalloc() fails, the pointer will be
> > NULL, there's no double-free bug. *every* subdev is written this way
> > to avoid duplicating cleanup logic.
> Actually, gm20b_clk_new_speedo0() may
Hi Ben,
> > When gk20a_clk_ctor() returns an error code, pointer "clk"
> > should be released. It's the same when gm20b_clk_new()
> > returns from elsewhere following this call.
> This shouldn't be necessary. If a subdev constructor fails, and
> returns a pointer, the core will call the
> > If gk20a_clk_ctor() never returns such an error code,
> > we may need not to release this clock object.
>
> Would you like to achieve complete exception handling
> also for this function implementation?
>
It seems that it's possible to get -ENOMEM from gk20a_clk_ctor().
The call chain is as
> > I just found that clk is referenced by pclk in this function. When clk is
> > freed,
> > pclk will be allocated in gm20b_clk_new_speedo0(). Thus we should not
> > release clk
> > in this function and there is no bug here.
>
> Can there be a need to release a clock object after a failed
>
> > For security, I will release this pointer only on error paths in this
> > function.
>
> Do you tend to release objects (which are referenced by pointers)?
>
I just found that clk is referenced by pclk in this function. When clk is
freed,
pclk will be allocated in
>
> > It's the same when gm20b_clk_new() returns from elsewhere following this
> > call.
>
> I suggest to reconsider the interpretation of the software situation once
> more.
> Can it be that the allocated clock object should be kept usable even after
> a successful return from this function?
Hi, Markus,
> * How do you think about to replace the word “pairing” by “corresponding”?
>
> * Will it be helpful to add an imperative wording?
>
>
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use pm_runtime_put_noidle() instead
When gk20a_clk_ctor() returns an error code, pointer "clk"
should be released. It's the same when gm20b_clk_new()
returns from elsewhere following this call.
Signed-off-by: Dinghao Liu
---
drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c | 8
1 file changed, 4 insertions(+), 4
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
sound/soc/img/img-i2s-out.c | 8 ++--
1 file changed, 6 insertions
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use pm_runtime_put_noidle() instead
> On Wed, May 20, 2020 at 12:45:56PM -0400, st...@rowland.harvard.edu wrote:
> > On Wed, May 20, 2020 at 03:42:17PM +, Sverdlin, Alexander (Nokia -
> > DE/Ulm) wrote:
> > > Hello Dinghao,
> > >
> > > On Wed, 2020-05-20 at 21:29 +0800, Ding
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
sound/soc/img/img-spdif-out.c | 4 +++-
1 file changed, 3 insertions
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
sound/soc/img/img-spdif-in.c | 4 +++-
1 file changed, 3 insertions(+), 1
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
sound/soc/codecs/wm8962.c | 2 ++
1 file changed, 2 insertions(+)
diff
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use pm_runtime_put_noidle() instead
>
> this change doesn't seem quite right, if you look the code below there
> is no PM imbalance, is there?
>
> int sst_pm_runtime_put(struct intel_sst_drv *sst_drv)
> {
> int ret;
>
> pm_runtime_mark_last_busy(sst_drv->dev);
> ret = pm_runtime_put_autosuspend(sst_drv->dev);
>
> Overall, there are several other calls to pm_runtime_get_sync within this
> driver, would you like to fix them all at once ?
>
Sure, I will send a new patch to merge them all.
> On Thu, May 21, 2020 at 03:05:07PM +0800, Dinghao Liu wrote:
> > pm_runtime_get_sync() increme
code, there will be two PM usgae counter decrements.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Change 3 goto targets from "power_off" to
"disabel_pm". Remove unused lable "power_off".
Move 3 PM runtime related calls to the end of
the function.
> Hi,
>
> On 22/05/20 10:23 am, Dinghao Liu wrote:
> > When devm_clk_get() returns an error code, a pairing
> > runtime PM usage counter decrement is needed to keep
> > the counter balanced.
> >
> > Signed-off-by: Dinghao Liu
> > ---
>
> Thank
> What about just moving the pm_runtime_put() until the end
> of the initialization? Right before return 0;
> Then we can keep this nice goto exits as they are.
>
> Maybe move all these three:
>
> pm_runtime_set_autosuspend_delay(>dev,
>
Hi, Linus
> On Sun, May 24, 2020 at 4:51 AM Dinghao Liu wrote:
>
> > When devm_regmap_init_i2c() returns an error code, a pairing
> > runtime PM usage counter decrement is needed to keep the
> > counter balanced. For error paths after ak8974_set_power(),
> > ak
When coda_firmware_request() returns an error code,
a pairing runtime PM usage counter decrement is needed
to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Remove changes to coda_remove(), which is incorrect.
---
drivers/media/platform/coda/coda-common.c | 2 ++
1
> Hi Dinghao,
>
> thank you for the patch! The first part is fine, but I think the second
> part is not necessary, see below:
>
> On Sat, May 23, 2020 at 06:03:32PM +0800, Dinghao Liu wrote:
> > When coda_firmware_request() returns an error code,
> > a pairing runt
pm_runtime_get_sync() increments the runtime PM usage counter even
it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use pm_runtime_put_noidle() rather than
> On Wed, May 20, 2020 at 10:01 AM Dinghao Liu wrote:
> >
> > pm_runtime_get_sync() increments the runtime PM usage counter even
> > it returns an error code. Thus a pairing decrement is needed on
> > the error handling path to keep the counter balanced.
> &g
When clk_set_parent() returns an error code, a pairing
runtime PM usage counter increment is needed to keep the
counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Fix this in a cleaner way.
---
sound/soc/ti/omap-mcbsp.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions
>
>
> On 25/05/2020 10.22, Dinghao Liu wrote:
> > When clk_set_parent() returns an error code, a pairing
> > runtime PM usage counter increment is needed to keep the
> > counter balanced.
> >
> > Signed-off-by: Dinghao Liu
> > ---
> > sou
When v4l2_async_register_subdev_sensor_common() returns
an error code, a pairing runtime PM usage counter
decrement is needed to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use pm_runtime_put_noidle() insead of
pm_runtime_put_autosuspend().
---
drivers
> Hi Dinghao,
>
> Thanks for the patch.
>
> On Fri, May 22, 2020 at 05:03:13PM +0800, Dinghao Liu wrote:
> > When v4l2_async_register_subdev_sensor_common() returns
> > an error code, a pairing runtime PM usage counter
> > decrement is needed to keep the coun
When clk_set_parent() returns an error code, a pairing
runtime PM usage counter increment is needed to keep the
counter balanced.
Signed-off-by: Dinghao Liu
---
sound/soc/ti/omap-mcbsp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
sound/soc/codecs/tas2552.c | 1 +
1 file changed, 1 insertion(+)
diff
When sst_load_fw() returns an error code, a pairing runtime
PM usage counter decrement is needed to keep the counter
balanced.
Signed-off-by: Dinghao Liu
---
sound/soc/intel/atom/sst/sst_drv_interface.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/intel/atom/sst
code, a pairing runtime PM usage counter decrement is needed
to keep the counter balanced. For error paths after this call,
things are the same.
Signed-off-by: Dinghao Liu
---
drivers/dma/stm32-dmamux.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/stm32
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced. For other error
paths after this call, things are the same.
Signed-off-by: Dinghao Liu
---
drivers/media
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/media/platform/qcom/venus/venc.c | 3 +--
1 file changed, 1
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/media/platform/exynos4-is/fimc-isp-video.c | 1 +
1 file changed
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced. For all error
paths after pm_runtime_get_sync(), things are the same.
Signed-off-by: Dinghao Liu
code, we don't need such a decrement because there is already
one before this call. Things are the same for other error paths
after it.
Signed-off-by: Dinghao Liu
---
drivers/iio/magnetometer/ak8974.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/iio
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced. For all error
paths after pm_runtime_get_sync(), things are the same.
Signed-off-by: Dinghao Liu
When drm_dev_init() returns an error code, a pairing
runtime PM usage counter decrement is needed to keep
the counter balanced. For error paths after this call,
things are the same.
Signed-off-by: Dinghao Liu
---
drivers/gpu/drm/i915/selftests/mock_gem_device.c | 1 +
1 file changed, 1
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Also, call pm_runtime_disable() when pm_runtime_get_sync() returns
an error code.
Signed-off-by: Dinghao
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/spi/spi-fsl-lpspi.c | 6 --
1 file changed, 4 insertions(+), 2
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use pm_runtime_put_noidle() instead of pm_runtime_put
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use pm_runtime_put_noidle() instead of pm_runtime_put
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use pm_runtime_put_noidle() instead of pm_runtime_put
> On Sat, May 23, 2020 at 2:32 PM wrote:
> >
> > > On Fri, May 22, 2020 at 6:20 PM Andy Shevchenko
> > > wrote:
> > > > On Fri, May 22, 2020 at 10:46 AM wrote:
>
> ...
>
> > I also checked many other implementation of probe in drivers.
> > It seems that using pm_runtime_put() is ok.
>
> In
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/media/platform/vsp1/vsp1_drv.c | 4 +++-
1 file changed, 3
When platform_get_resource() returns an error code, a
pairing runtime PM usage counter decrement is needed
to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/media/platform/davinci/vpif.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/platform/davinci/vpif.c
> On Fri, May 22, 2020 at 6:20 PM Andy Shevchenko
> wrote:
> > On Fri, May 22, 2020 at 10:46 AM wrote:
>
> ...
>
> > Moreover, consider below case
> >
> > CPU1: ...somewhere in the code...
> > pm_runtime_get() // with success!
> > ...see below...
> > pm_runtime_put()
> >
> > CPU2: ...on
> Hi, Dinghao
>
> > Thank you for your advice! Moving original pm_runtime_put_sync() to after
> > "out" label will influence an error path branched from
> > ups_bsg_verify_query_size(). So I think changing "goto out" to "break" is a
> > good
> > idea. But in this case we may execute an extra
> >
-off-by: Dinghao Liu
---
drivers/media/platform/coda/coda-common.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/coda/coda-common.c
b/drivers/media/platform/coda/coda-common.c
index d0d093dd8f7c..550e9a1266da 100644
--- a/drivers/media/platform/coda/coda-common.c
Remove runtime PM usage counter decrement when the
increment function has not been called to keep the
counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/smsc/smsc911x.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/smsc
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/media/platform/qcom/camss/camss-csid.c | 4 +++-
1 file changed, 3
-by: Dinghao Liu
---
Changelog:
v2: - Add a new label "err_pm" to balance refcount.
Remove 3 calls to pm_runtime_disable().
Move pm_runtime_put() from the front of
input_register_device() to the back.
---
drivers/extcon/extcon-arizona.c | 17 +
1 file
> On Fri, May 22, 2020 at 07:07:31PM +0800, Dinghao Liu wrote:
> > When arizona_request_irq() returns an error code, a
> > pairing runtime PM usage counter decrement is needed
> > to keep the counter balanced. For error paths after
> > this function, things are th
The caller expects panfrost_job_hw_submit() to increase
runtime PM usage counter. The refcount decrement on the
error branch of WARN_ON() will break the counter balance
and needs to be removed.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Remove refcount decrement on the error path
> Indeed, I'll post a proper patch for that later - I just spotted it
> while looking at the code.
>
> Thanks,
>
> Steve
>
> > Regards,
> > Dinghao
> >
> >
> >> On 20/05/2020 12:05, Dinghao Liu wrote:
> >>> pm_runtime_get_sync()
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Merge two patches that fix runtime PM imbalance
>
> On 22/05/2020 11:57, dinghao@zju.edu.cn wrote:
> >>
> >> On 22/05/2020 08:58, Dinghao Liu wrote:
> >>> pm_runtime_get_sync() increments the runtime PM usage counter even
> >>> when it returns an error code. Thus a pairing decrement is
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/media/platform/qcom/venus/vdec.c | 3 +--
1 file changed, 1
When arizona_request_irq() returns an error code, a
pairing runtime PM usage counter decrement is needed
to keep the counter balanced. For error paths after
this function, things are the same.
Signed-off-by: Dinghao Liu
---
drivers/extcon/extcon-arizona.c | 1 +
1 file changed, 1 insertion
>
> On 22/05/2020 08:58, Dinghao Liu wrote:
> > pm_runtime_get_sync() increments the runtime PM usage counter even
> > when it returns an error code. Thus a pairing decrement is needed on
> > the error handling path to keep the counter balanced.
> >
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/dma/sh/usb-dmac.c | 2 +-
1 file changed, 1 insertion(+), 1
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/mtd/nand/raw/omap_elm.c | 1 +
1 file changed, 1 insertion
There is no reason that the failure of __gpmi_enable_clk()
could lead to PM usage counter decrement.
Signed-off-by: Dinghao Liu
---
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
b
-by: Dinghao Liu
---
drivers/mtd/spi-nor/controllers/cadence-quadspi.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/mtd/spi-nor/controllers/cadence-quadspi.c
b/drivers/mtd/spi-nor/controllers/cadence-quadspi.c
index 494dcab4..eabdf01e0d08 100644
--- a/drivers/mtd/spi-nor
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 4 +++-
1 file changed, 3
201 - 300 of 381 matches
Mail list logo