2020-06-04 18:38:54

by Yu Kuai

[permalink] [raw]
Subject: [PATCH] ARM: imx6: add missing put_device() call in imx6q_suspend_init()

if of_find_device_by_node() succeed, imx6q_suspend_init() doesn't have a
corresponding put_device(). Thus add a jump target to fix the exception
handling for this function implementation.

Signed-off-by: yu kuai <[email protected]>
---
arch/arm/mach-imx/pm-imx6.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index dd34dff13762..40c74b4c4d73 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -493,14 +493,14 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
if (!ocram_pool) {
pr_warn("%s: ocram pool unavailable!\n", __func__);
ret = -ENODEV;
- goto put_node;
+ goto put_device;
}

ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE);
if (!ocram_base) {
pr_warn("%s: unable to alloc ocram!\n", __func__);
ret = -ENOMEM;
- goto put_node;
+ goto put_device;
}

ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
@@ -523,7 +523,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat);
if (ret) {
pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret);
- goto put_node;
+ goto put_device;
}

ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat);
@@ -570,7 +570,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
&imx6_suspend,
MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info));

- goto put_node;
+ goto put_device;

pl310_cache_map_failed:
iounmap(pm_info->gpc_base.vbase);
@@ -580,6 +580,8 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
iounmap(pm_info->src_base.vbase);
src_map_failed:
iounmap(pm_info->mmdc_base.vbase);
+put_device:
+ put_device(&pdev->dev);
put_node:
of_node_put(node);

--
2.25.4


2020-06-04 22:26:13

by Markus Elfring

[permalink] [raw]
Subject: Re: [PATCH] ARM: imx6: add missing put_device() call in imx6q_suspend_init()

> if of_find_device_by_node() succeed, imx6q_suspend_init() doesn't have a
> corresponding put_device(). Thus add a jump target to fix the exception
> handling for this function implementation.

Do you find a previous update suggestion useful?

ARM: imx6: Add missing put_device() call in imx6q_suspend_init()
https://lore.kernel.org/linux-arm-kernel/[email protected]/
https://lore.kernel.org/patchwork/patch/1151158/
https://lkml.org/lkml/2019/11/9/125

Regards,
Markus

2020-06-05 09:11:12

by Yu Kuai

[permalink] [raw]
Subject: Re: [PATCH] ARM: imx6: add missing put_device() call in imx6q_suspend_init()

On 2020/6/5 3:07, Markus Elfring wrote:
>> if of_find_device_by_node() succeed, imx6q_suspend_init() doesn't have a
>> corresponding put_device(). Thus add a jump target to fix the exception
>> handling for this function implementation.
>
> Do you find a previous update suggestion useful?
>
> ARM: imx6: Add missing put_device() call in imx6q_suspend_init()
> https://lore.kernel.org/linux-arm-kernel/[email protected]/
> https://lore.kernel.org/patchwork/patch/1151158/
> https://lkml.org/lkml/2019/11/9/125

Hi, Markus

It is useful indeed. Although I didn't run cocci script, since it can
produce too many false result which is hard to filter out.

BTW, I see you haver done the work already, I guess I won't send any
patches related to 'missing put_device after of_find_device_by_node()'.
Any idea why these pathes didn't get applied ?

Best regards,
Yu Kuai




2020-06-05 10:18:12

by Markus Elfring

[permalink] [raw]
Subject: Re: ARM: imx6: add missing put_device() call in imx6q_suspend_init()

>> Do you find a previous update suggestion useful?
>>
>> ARM: imx6: Add missing put_device() call in imx6q_suspend_init()
>> https://lore.kernel.org/linux-arm-kernel/[email protected]/
>> https://lore.kernel.org/patchwork/patch/1151158/
>> https://lkml.org/lkml/2019/11/9/125

> It is useful indeed.

Thanks for your positive feedback.


> Although I didn't run cocci script, since it can produce too many false result
> which is hard to filter out.

Would you like to clarify any corresponding software analysis options?


> BTW, I see you haver done the work already, I guess I won't send any patches
> related to 'missing put_device after of_find_device_by_node()'.

You may continue also with contributions in such a direction.
I would like to point out that other developers occasionally got into the mood
to improve implementation details in similar ways already.


> Any idea why these pathes didn't get applied ?

I can make assumptions about the reasons for the possibly questionable handling
of such patches.

Regards,
Markus

2020-06-23 07:35:09

by Shawn Guo

[permalink] [raw]
Subject: Re: ARM: imx6: add missing put_device() call in imx6q_suspend_init()

On Fri, Jun 05, 2020 at 12:15:32PM +0200, Markus Elfring wrote:
> >> Do you find a previous update suggestion useful?
> >>
> >> ARM: imx6: Add missing put_device() call in imx6q_suspend_init()
> >> https://lore.kernel.org/linux-arm-kernel/[email protected]/
> >> https://lore.kernel.org/patchwork/patch/1151158/
> >> https://lkml.org/lkml/2019/11/9/125
> …
> > It is useful indeed.
>
> Thanks for your positive feedback.
>
>
> > Although I didn't run cocci script, since it can produce too many false result
> > which is hard to filter out.
>
> Would you like to clarify any corresponding software analysis options?
>
>
> > BTW, I see you haver done the work already, I guess I won't send any patches
> > related to 'missing put_device after of_find_device_by_node()'.
>
> You may continue also with contributions in such a direction.
> I would like to point out that other developers occasionally got into the mood
> to improve implementation details in similar ways already.
>
>
> > Any idea why these pathes didn't get applied ?
>
> I can make assumptions about the reasons for the possibly questionable handling
> of such patches.

Markus,

Could you resend it to my kernel.org address?

Shawn

2020-06-23 07:52:11

by Markus Elfring

[permalink] [raw]
Subject: Re: ARM: imx6: add missing put_device() call in imx6q_suspend_init()

>>>> Do you find a previous update suggestion useful?
>>>>
>>>> ARM: imx6: Add missing put_device() call in imx6q_suspend_init()
>>>> https://lore.kernel.org/linux-arm-kernel/[email protected]/
>>>> https://lore.kernel.org/patchwork/patch/1151158/
>>>> https://lkml.org/lkml/2019/11/9/125
>> …
>>> It is useful indeed.

>>> Any idea why these pathes didn't get applied ?
>>
>> I can make assumptions about the reasons for the possibly questionable handling
>> of such patches.
>
> Markus,
>
> Could you resend it to my kernel.org address?

You can get relevant information from the referenced message archive interfaces,
can't you?

Regards,
Markus

2020-06-23 11:06:54

by Shawn Guo

[permalink] [raw]
Subject: Re: ARM: imx6: add missing put_device() call in imx6q_suspend_init()

On Tue, Jun 23, 2020 at 09:48:52AM +0200, Markus Elfring wrote:
> >>>> Do you find a previous update suggestion useful?
> >>>>
> >>>> ARM: imx6: Add missing put_device() call in imx6q_suspend_init()
> >>>> https://lore.kernel.org/linux-arm-kernel/[email protected]/
> >>>> https://lore.kernel.org/patchwork/patch/1151158/
> >>>> https://lkml.org/lkml/2019/11/9/125
> >> …
> >>> It is useful indeed.
> …
> >>> Any idea why these pathes didn't get applied ?
> >>
> >> I can make assumptions about the reasons for the possibly questionable handling
> >> of such patches.
> >
> > Markus,
> >
> > Could you resend it to my kernel.org address?
>
> You can get relevant information from the referenced message archive interfaces,
> can't you?

Well, I'm asking you to resend to make sure the following:

- Use correct maintainer mailbox address.
- You still care about the patch.
- The patch applies to v5.8-rc.

Shawn

2020-06-23 12:03:39

by Markus Elfring

[permalink] [raw]
Subject: Re: ARM: imx6: add missing put_device() call in imx6q_suspend_init()

>>>>>> Do you find a previous update suggestion useful?
>>>>>>
>>>>>> ARM: imx6: Add missing put_device() call in imx6q_suspend_init()
>>>>>> https://lore.kernel.org/linux-arm-kernel/[email protected]/
>>>>>> https://lore.kernel.org/patchwork/patch/1151158/
>>>>>> https://lkml.org/lkml/2019/11/9/125

>> You can get relevant information from the referenced message archive interfaces,
>> can't you?
>
> Well, I'm asking you to resend to make sure the following:
>
> - Use correct maintainer mailbox address.

Were the selected message recipients appropriate at 2019-11-09?


> - You still care about the patch.

Partly, yes.


> - The patch applies to v5.8-rc.

Would you like to try it out if my proposal is still valid?

Does the change approach by Yu Kuai supersede it?

Regards,
Markus

2020-06-23 12:11:51

by Shawn Guo

[permalink] [raw]
Subject: Re: ARM: imx6: add missing put_device() call in imx6q_suspend_init()

On Tue, Jun 23, 2020 at 02:00:09PM +0200, Markus Elfring wrote:
> >>>>>> Do you find a previous update suggestion useful?
> >>>>>>
> >>>>>> ARM: imx6: Add missing put_device() call in imx6q_suspend_init()
> >>>>>> https://lore.kernel.org/linux-arm-kernel/[email protected]/
> >>>>>> https://lore.kernel.org/patchwork/patch/1151158/
> >>>>>> https://lkml.org/lkml/2019/11/9/125
> …
> >> You can get relevant information from the referenced message archive interfaces,
> >> can't you?
> >
> > Well, I'm asking you to resend to make sure the following:
> >
> > - Use correct maintainer mailbox address.
>
> Were the selected message recipients appropriate at 2019-11-09?

At least, my mailbox was not.

>
>
> > - You still care about the patch.
>
> Partly, yes.
>
>
> > - The patch applies to v5.8-rc.
>
> Would you like to try it out if my proposal is still valid?
>
> Does the change approach by Yu Kuai supersede it?

2020-06-23 12:16:28

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH] ARM: imx6: add missing put_device() call in imx6q_suspend_init()

On Thu, Jun 04, 2020 at 08:54:49PM +0800, yu kuai wrote:
> if of_find_device_by_node() succeed, imx6q_suspend_init() doesn't have a
> corresponding put_device(). Thus add a jump target to fix the exception
> handling for this function implementation.
>
> Signed-off-by: yu kuai <[email protected]>

Applied, thanks.

2020-06-23 12:32:02

by Markus Elfring

[permalink] [raw]
Subject: Re: ARM: imx6: add missing put_device() call in imx6q_suspend_init()

>>>>>>>> ARM: imx6: Add missing put_device() call in imx6q_suspend_init()
>>>>>>>> https://lore.kernel.org/linux-arm-kernel/[email protected]/
>>>>>>>> https://lore.kernel.org/patchwork/patch/1151158/
>>>>>>>> https://lkml.org/lkml/2019/11/9/125

>>> - The patch applies to v5.8-rc.
>>
>> Would you like to try it out if my proposal is still valid?

Are you going to compare the published patches any further?


>> Does the change approach by Yu Kuai supersede it?

Which patch variant will be integrated finally?

Regards,
Markus

2020-06-23 12:39:00

by Shawn Guo

[permalink] [raw]
Subject: Re: ARM: imx6: add missing put_device() call in imx6q_suspend_init()

On Tue, Jun 23, 2020 at 8:29 PM Markus Elfring <[email protected]> wrote:
>
> >>>>>>>> ARM: imx6: Add missing put_device() call in imx6q_suspend_init()
> >>>>>>>> https://lore.kernel.org/linux-arm-kernel/[email protected]/
> >>>>>>>> https://lore.kernel.org/patchwork/patch/1151158/
> >>>>>>>> https://lkml.org/lkml/2019/11/9/125
> …
> >>> - The patch applies to v5.8-rc.
> >>
> >> Would you like to try it out if my proposal is still valid?
>
> Are you going to compare the published patches any further?
>
>
> >> Does the change approach by Yu Kuai supersede it?
>
> Which patch variant will be integrated finally?

Just picked up Yu Kuai's patch.

Shawn

2020-06-23 12:48:49

by Yu Kuai

[permalink] [raw]
Subject: Re: [PATCH] ARM: imx6: add missing put_device() call in imx6q_suspend_init()


On 2020/6/23 20:11, Shawn Guo wrote:
> On Thu, Jun 04, 2020 at 08:54:49PM +0800, yu kuai wrote:
>> if of_find_device_by_node() succeed, imx6q_suspend_init() doesn't have a
>> corresponding put_device(). Thus add a jump target to fix the exception
>> handling for this function implementation.
>>
>> Signed-off-by: yu kuai <[email protected]>
>
> Applied, thanks.

Hi, Shawn

How about this patch: https://lkml.org/lkml/2020/6/4/428
The patch fix the similar issure.

Thanks!
Yu Kuai


2020-06-23 14:39:00

by Markus Elfring

[permalink] [raw]
Subject: Re: ARM: imx6: add missing put_device() call in imx6q_suspend_init()

>>>>>>>>>> ARM: imx6: Add missing put_device() call in imx6q_suspend_init()
>>>>>>>>>> https://lore.kernel.org/linux-arm-kernel/[email protected]/
>>>>>>>>>> https://lore.kernel.org/patchwork/patch/1151158/
>>>>>>>>>> https://lkml.org/lkml/2019/11/9/125

>> Are you going to compare the published patches any further?
>>
>>
>>>> Does the change approach by Yu Kuai supersede it?
>>
>> Which patch variant will be integrated finally?
>
> Just picked up Yu Kuai's patch.

Did you adjust any details?
https://lkml.org/lkml/2020/6/23/542
https://lore.kernel.org/patchwork/comment/1457270/

With which delay will a corresponding commit be published?
https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git/log/arch/arm/mach-imx/pm-imx6.c

Regards,
Markus

2020-06-24 14:29:55

by Markus Elfring

[permalink] [raw]
Subject: Re: ARM: imx6: add missing put_device() call in imx6q_suspend_init()

>> Are you going to compare the published patches any further?

>> Which patch variant will be integrated finally?
>
> Just picked up Yu Kuai's patch.

Is it interesting anyhow that you committed a change description
which contained a typo (on 2020-06-23 20:11:30 +0800)?
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/arch/arm/mach-imx/pm-imx6.c?id=0f92519843a05e97b58c6076edb23d747e8be262

Would it have been helpful to add the tag “Fixes”?

Regards,
Markus