[PATCH] [v2] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode

2020-07-28 Thread Dinghao Liu
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

Re: Re: [PATCH] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode

2020-07-27 Thread dinghao . liu
> 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

Re: Re: [PATCH] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode

2020-07-27 Thread dinghao . liu
> > 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.

Re: Re: [PATCH] octeontx2-af: Fix use of uninitialized pointer bmap

2020-07-24 Thread dinghao . liu
> 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

[PATCH] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode

2020-07-24 Thread Dinghao Liu
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

[PATCH] octeontx2-af: Fix use of uninitialized pointer bmap

2020-07-24 Thread Dinghao Liu
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

[PATCH] [v3] PCI: rcar: Fix runtime PM imbalance on error

2020-07-09 Thread Dinghao Liu
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

Re: Re: [PATCH] [v2] PCI: rcar: Fix runtime PM imbalance on error

2020-07-09 Thread dinghao . liu
> 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

[PATCH] [v2] PCI: qcom: Fix runtime PM imbalance on error

2020-07-06 Thread Dinghao Liu
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

Re: Re: [PATCH] PCI: qcom: fix runtime pm imbalance on error

2020-07-06 Thread dinghao . liu
> > 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 > > --- > >

[PATCH] [v3] media: venus: core: Fix runtime PM imbalance in venus_probe

2020-06-27 Thread 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

Re: Re: [PATCH] [v2] media: venus: core: Fix runtime PM imbalance in venus_probe

2020-06-27 Thread dinghao . liu
> > Could you reword this and add it to the patch description. > Fine. I will fix this in the next version of patch. Regards, Dinghao

Re: Re: [PATCH] [v2] media: venus: core: Fix runtime PM imbalance in venus_probe

2020-06-25 Thread dinghao . liu
> 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

[PATCH] [v5] dmaengine: tegra210-adma: Fix runtime PM imbalance on error

2020-06-24 Thread Dinghao Liu
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

[PATCH] [v2] media: venus: core: Fix runtime PM imbalance in venus_probe

2020-06-24 Thread Dinghao Liu
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

Re: Re: [PATCH] media: venus: core: Fix runtime PM imbalance in venus_probe

2020-06-24 Thread dinghao . liu
> > 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

Re: Re: [PATCH] media: venus: vdec: Fix runtime PM imbalance in vdec_open

2020-06-24 Thread dinghao . liu
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

[PATCH] crypto: sun8i-ce - Fix runtime PM imbalance in sun8i_ce_cipher_init

2020-06-21 Thread Dinghao Liu
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

[PATCH] i2c: sprd: Fix runtime PM imbalance on error

2020-06-21 Thread Dinghao Liu
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

[PATCH] [v4] dmaengine: tegra210-adma: Fix runtime PM imbalance on error

2020-06-20 Thread Dinghao Liu
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

Re: Re: [PATCH] [v3] dmaengine: tegra210-adma: Fix runtime PM imbalance on error

2020-06-20 Thread dinghao . liu
> >> > >> 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

Re: Re: [PATCH] [v3] dmaengine: tegra210-adma: Fix runtime PM imbalance on error

2020-06-18 Thread dinghao . liu
> > Why noidle? > _noidle is enough for fixing this bug. _sync may suspend the device beyond expectation. Regards, Dinghao

[PATCH] [v3] dmaengine: tegra210-adma: Fix runtime PM imbalance on error

2020-06-18 Thread Dinghao Liu
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

Re: Re: [PATCH] [v3] i2c: imx-lpi2c: Fix runtime PM imbalance on error

2020-06-14 Thread dinghao . liu
> > 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

Re: Re: [PATCH] media: platform: sti: hva: Fix runtime PM imbalance on error

2020-06-08 Thread dinghao . liu
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().

[PATCH] [v2] media: vsp1: Fix runtime PM imbalance on error

2020-06-07 Thread Dinghao Liu
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

Re: Re: Re: [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe

2020-06-07 Thread dinghao . liu
> > 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

Re: Re: [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe

2020-06-07 Thread dinghao . liu
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

[PATCH] [v2] PCI: rcar: Fix runtime PM imbalance on error

2020-06-07 Thread Dinghao Liu
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

Re: Re: [PATCH] PCI: rcar: fix runtime pm imbalance on error

2020-06-07 Thread dinghao . liu
> > > > 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.

Re: Re: [PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()

2020-06-02 Thread dinghao . liu
> 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

[PATCH] [v3] i2c: imx-lpi2c: Fix runtime PM imbalance on error

2020-06-01 Thread Dinghao Liu
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

Re: Re: Re: [PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new

2020-05-31 Thread dinghao . liu
> > 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

Re: Re: [PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new

2020-05-31 Thread dinghao . liu
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

Re: Re: drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()

2020-05-31 Thread dinghao . liu
> > 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

Re: Re: drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()

2020-05-31 Thread dinghao . liu
> > 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

Re: Re: drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()

2020-05-31 Thread dinghao . liu
> > > 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

Re: Re: [PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()

2020-05-31 Thread dinghao . liu
> > > 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?

Re: Re: [PATCH v2] i2c: imx-lpi2c: Fix runtime PM imbalance on error in lpi2c_imx_master_enable()

2020-05-31 Thread dinghao . liu
Hi, Markus, > * How do you think about to replace the word “pairing” by “corresponding”? > > * Will it be helpful to add an imperative wording? > >

[PATCH] [v2] i2c: imx-lpi2c: Fix runtime PM imbalance on error

2020-05-30 Thread Dinghao Liu
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

[PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new

2020-05-29 Thread Dinghao Liu
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

[PATCH] ASoC: img-i2s-out: Fix runtime PM imbalance on error

2020-05-28 Thread Dinghao Liu
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

[PATCH] [v2] hwrng: ks-sa - Fix runtime PM imbalance on error

2020-05-28 Thread Dinghao Liu
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

Re: Re: [PATCH] hwrng: ks-sa - fix runtime pm imbalance on error

2020-05-28 Thread dinghao . liu
> 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

[PATCH] ASoC: img-spdif-out: Fix runtime PM imbalance on error

2020-05-27 Thread Dinghao Liu
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

[PATCH] ASoC: img-spdif-in: Fix runtime PM imbalance on error

2020-05-27 Thread Dinghao Liu
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

[PATCH] ASoC: wm8962: Fix runtime PM imbalance on error

2020-05-26 Thread Dinghao Liu
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

[PATCH] [v2] i2c: stm32f7: Fix runtime PM imbalance on error

2020-05-26 Thread Dinghao Liu
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

Re: Re: [PATCH] ASoC: Intel: sst: Fix runtime PM imbalance in sst_power_control

2020-05-26 Thread dinghao . liu
> > 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); >

Re: Re: [PATCH] i2c: stm32f7: Fix runtime PM imbalance in stm32f7_i2c_reg_slave

2020-05-26 Thread dinghao . liu
> 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

[PATCH] [v2] iio: magnetometer: ak8974: Fix runtime PM imbalance on error

2020-05-26 Thread Dinghao Liu
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.

Re: Re: [PATCH] scsi: ufs: Fix runtime PM imbalance on error

2020-05-26 Thread dinghao . liu
> 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

Re: Re: Re: [PATCH] iio: magnetometer: ak8974: Fix runtime PM imbalance on error

2020-05-26 Thread dinghao . liu
> 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, >

Re: Re: [PATCH] iio: magnetometer: ak8974: Fix runtime PM imbalance on error

2020-05-25 Thread dinghao . liu
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

[PATCH] [v2] media: coda: Fix runtime PM imbalance in coda_probe

2020-05-25 Thread Dinghao Liu
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

Re: Re: [PATCH] media: coda: Fix runtime PM imbalance in coda_probe

2020-05-25 Thread dinghao . liu
> 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

[PATCH] [v2] power: supply: bq24190_charger: Fix runtime PM imbalance on error

2020-05-25 Thread Dinghao Liu
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

Re: Re: [PATCH] power: supply: bq24190_charger: fix runtime pm imbalance

2020-05-25 Thread dinghao . liu
> 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

[PATCH] [v2] ASoC: ti: Fix runtime PM imbalance in omap2_mcbsp_set_clks_src

2020-05-25 Thread Dinghao Liu
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

Re: Re: [PATCH] ASoC: ti: Fix runtime PM imbalance in omap2_mcbsp_set_clks_src

2020-05-25 Thread dinghao . liu
> > > 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

[PATCH] [v2] media: smiapp: Fix runtime PM imbalance on error

2020-05-25 Thread Dinghao Liu
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

Re: Re: [PATCH] media: smiapp: Fix runtime PM imbalance on error

2020-05-25 Thread dinghao . liu
> 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

[PATCH] ASoC: ti: Fix runtime PM imbalance in omap2_mcbsp_set_clks_src

2020-05-25 Thread Dinghao Liu
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

[PATCH] ASoC: tas2552: Fix runtime PM imbalance in tas2552_component_probe

2020-05-25 Thread Dinghao Liu
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

[PATCH] ASoC: Intel: sst: Fix runtime PM imbalance in sst_power_control

2020-05-25 Thread Dinghao Liu
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

[PATCH] dmaengine: stm32-dmamux: Fix runtime PM imbalance on error

2020-05-24 Thread Dinghao Liu
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

[PATCH] media: venus: core: Fix runtime PM imbalance in venus_probe

2020-05-23 Thread Dinghao Liu
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

[PATCH] media: venus: venc: Fix runtime PM imbalance in venc_open

2020-05-23 Thread Dinghao Liu
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

[PATCH] media: exynos4-is: Fix runtime PM imbalance in isp_video_open

2020-05-23 Thread Dinghao Liu
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

[PATCH] media: exynos4-is: Fix runtime PM imbalance in fimc_is_probe

2020-05-23 Thread Dinghao Liu
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

[PATCH] iio: magnetometer: ak8974: Fix runtime PM imbalance on error

2020-05-23 Thread 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

[PATCH] drm/panfrost: Fix runtime PM imbalance in panfrost_perfcnt_enable_locked

2020-05-23 Thread Dinghao Liu
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

[PATCH] drm/i915/selftests: Fix runtime PM imbalance on error

2020-05-23 Thread 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

[PATCH] dmaengine: rcar-dmac: Fix runtime PM imbalance on error

2020-05-23 Thread Dinghao Liu
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

[PATCH] spi: spi-fsl-lpspi: Fix runtime PM imbalance on error

2020-05-23 Thread Dinghao Liu
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

[PATCH] [v2] spi: tegra114: Fix runtime PM imbalance on error

2020-05-23 Thread Dinghao Liu
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

[PATCH] [v2] spi: tegra20-sflash: Fix runtime PM imbalance on error

2020-05-23 Thread Dinghao Liu
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

[PATCH] [v2] spi: tegra20-slink: Fix runtime PM imbalance on error

2020-05-23 Thread Dinghao Liu
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

Re: Re: Re: Re: [PATCH] spi: tegra20-slink: Fix runtime PM imbalance on error

2020-05-23 Thread dinghao . liu
> 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

[PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe

2020-05-23 Thread Dinghao Liu
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

[PATCH] media: vpif: Fix runtime PM imbalance in vpif_probe

2020-05-23 Thread Dinghao Liu
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

Re: Re: Re: [PATCH] spi: tegra20-slink: Fix runtime PM imbalance on error

2020-05-23 Thread dinghao . liu
> 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

Re: RE: RE: [EXT] [PATCH] scsi: ufs-bsg: Fix runtime PM imbalance on error

2020-05-23 Thread dinghao . liu
> 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 > >

[PATCH] media: coda: Fix runtime PM imbalance in coda_probe

2020-05-23 Thread Dinghao Liu
-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

[PATCH] net: smsc911x: Fix runtime PM imbalance on error

2020-05-23 Thread Dinghao Liu
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

[PATCH] media: camss: csid: Fix runtime PM imbalance in csid_set_power

2020-05-23 Thread Dinghao Liu
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

[PATCH] [v2] extcon: arizona: Fix runtime PM imbalance on error

2020-05-23 Thread Dinghao Liu
-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

Re: Re: [PATCH] extcon: arizona: Fix runtime PM imbalance on error

2020-05-22 Thread dinghao . liu
> 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

[PATCH] [v2] drm/panfrost: Fix runtime PM imbalance on error

2020-05-22 Thread Dinghao Liu
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

Re: Re: [PATCH] drm/panfrost: fix runtime pm imbalance on error

2020-05-22 Thread dinghao . liu
> 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()

[PATCH] [v2] dmaengine: tegra210-adma: Fix runtime PM imbalance on error

2020-05-22 Thread Dinghao Liu
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

Re: Re: [PATCH] dmaengine: tegra210-adma: Fix runtime PM imbalance on error

2020-05-22 Thread dinghao . liu
> > 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

[PATCH] media: venus: vdec: Fix runtime PM imbalance in vdec_open

2020-05-22 Thread Dinghao Liu
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

[PATCH] extcon: arizona: Fix runtime PM imbalance on error

2020-05-22 Thread Dinghao Liu
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

Re: Re: [PATCH] dmaengine: tegra210-adma: Fix runtime PM imbalance on error

2020-05-22 Thread dinghao . liu
> > 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. > >

[PATCH] dmaengine: sh: usb-dmac: Fix runtime PM imbalance on error

2020-05-22 Thread Dinghao Liu
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

[PATCH] mtd: rawnand: Fix runtime PM imbalance on error

2020-05-22 Thread Dinghao Liu
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

[PATCH] mtd: rawnand: gpmi: Fix runtime PM imbalance in gpmi_nand_probe

2020-05-22 Thread Dinghao Liu
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

[PATCH] mtd: spi-nor: Fix runtime PM imbalance in cqspi_probe

2020-05-22 Thread Dinghao Liu
-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

[PATCH] mtd: rawnand: gpmi: Fix runtime PM imbalance on error

2020-05-22 Thread Dinghao Liu
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

<    1   2   3   4   >