linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ata: pata_macio: add of_node_put()
@ 2018-11-21 13:04 ` Yangtao Li
  2018-11-21 15:24   ` Sergei Shtylyov
  2018-12-20 17:03   ` Bartlomiej Zolnierkiewicz
  0 siblings, 2 replies; 9+ messages in thread
From: Yangtao Li @ 2018-11-21 13:04 UTC (permalink / raw)
  To: b.zolnierkie, axboe; +Cc: linux-ide, linux-kernel, Yangtao Li

of_find_node_by_path() acquires a reference to the node
returned by it and that reference needs to be dropped by its caller.
bl_idle_init() doesn't do that, so fix it.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/ata/pata_macio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
index 9588e685d994..8cc9c429ad95 100644
--- a/drivers/ata/pata_macio.c
+++ b/drivers/ata/pata_macio.c
@@ -483,6 +483,8 @@ static int pata_macio_cable_detect(struct ata_port *ap)
 		struct device_node *root = of_find_node_by_path("/");
 		const char *model = of_get_property(root, "model", NULL);
 
+		of_node_put(root);
+
 		if (cable && !strncmp(cable, "80-", 3)) {
 			/* Some drives fail to detect 80c cable in PowerBook
 			 * These machine use proprietary short IDE cable
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] ata: pata_macio: add of_node_put()
  2018-11-21 13:04 ` [PATCH] ata: pata_macio: add of_node_put() Yangtao Li
@ 2018-11-21 15:24   ` Sergei Shtylyov
  2018-11-21 15:31     ` Frank Lee
  2018-12-20 17:03   ` Bartlomiej Zolnierkiewicz
  1 sibling, 1 reply; 9+ messages in thread
From: Sergei Shtylyov @ 2018-11-21 15:24 UTC (permalink / raw)
  To: Yangtao Li, b.zolnierkie, axboe; +Cc: linux-ide, linux-kernel

Hello!

On 11/21/2018 04:04 PM, Yangtao Li wrote:

> of_find_node_by_path() acquires a reference to the node
> returned by it and that reference needs to be dropped by its caller.
> bl_idle_init() doesn't do that, so fix it.

   I thought we're inside pata_macio_cable_detect()?

> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  drivers/ata/pata_macio.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
> index 9588e685d994..8cc9c429ad95 100644
> --- a/drivers/ata/pata_macio.c
> +++ b/drivers/ata/pata_macio.c
> @@ -483,6 +483,8 @@ static int pata_macio_cable_detect(struct ata_port *ap)
>  		struct device_node *root = of_find_node_by_path("/");
>  		const char *model = of_get_property(root, "model", NULL);
>  
> +		of_node_put(root);
> +
>  		if (cable && !strncmp(cable, "80-", 3)) {
>  			/* Some drives fail to detect 80c cable in PowerBook
>  			 * These machine use proprietary short IDE cable

MBR, Sergei

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ata: pata_macio: add of_node_put()
  2018-11-21 15:24   ` Sergei Shtylyov
@ 2018-11-21 15:31     ` Frank Lee
  2018-11-21 15:33       ` Frank Lee
  0 siblings, 1 reply; 9+ messages in thread
From: Frank Lee @ 2018-11-21 15:31 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: b.zolnierkie, axboe, linux-ide, linux-kernel

On Wed, Nov 21, 2018 at 11:24 PM Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
>
> Hello!
>
> On 11/21/2018 04:04 PM, Yangtao Li wrote:
>
> > of_find_node_by_path() acquires a reference to the node
> > returned by it and that reference needs to be dropped by its caller.
> > bl_idle_init() doesn't do that, so fix it.
>
>    I thought we're inside pata_macio_cable_detect()?
Hi Sergei:

What do you mean?
Why not release the refcount of root?

Yours,
    Yangtao
>
> > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> > ---
> >  drivers/ata/pata_macio.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
> > index 9588e685d994..8cc9c429ad95 100644
> > --- a/drivers/ata/pata_macio.c
> > +++ b/drivers/ata/pata_macio.c
> > @@ -483,6 +483,8 @@ static int pata_macio_cable_detect(struct ata_port *ap)
> >               struct device_node *root = of_find_node_by_path("/");
> >               const char *model = of_get_property(root, "model", NULL);
> >
> > +             of_node_put(root);
> > +
> >               if (cable && !strncmp(cable, "80-", 3)) {
> >                       /* Some drives fail to detect 80c cable in PowerBook
> >                        * These machine use proprietary short IDE cable
>
> MBR, Sergei

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ata: pata_macio: add of_node_put()
  2018-11-21 15:31     ` Frank Lee
@ 2018-11-21 15:33       ` Frank Lee
  2018-11-22  8:36         ` Sergei Shtylyov
  0 siblings, 1 reply; 9+ messages in thread
From: Frank Lee @ 2018-11-21 15:33 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: b.zolnierkie, axboe, linux-ide, linux-kernel

On Wed, Nov 21, 2018 at 11:31 PM Frank Lee <tiny.windzz@gmail.com> wrote:
>
> On Wed, Nov 21, 2018 at 11:24 PM Sergei Shtylyov
> <sergei.shtylyov@cogentembedded.com> wrote:
> >
> > Hello!
> >
> > On 11/21/2018 04:04 PM, Yangtao Li wrote:
> >
> > > of_find_node_by_path() acquires a reference to the node
> > > returned by it and that reference needs to be dropped by its caller.
> > > bl_idle_init() doesn't do that, so fix it.
> >
> >    I thought we're inside pata_macio_cable_detect()?
Hi Sergei:

Yeah,this is a typo.
Need me to resend a patch?

Thanks,
Yangtao
> Hi Sergei:
>
> What do you mean?
> Why not release the refcount of root?
>
> Yours,
>     Yangtao
> >
> > > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> > > ---
> > >  drivers/ata/pata_macio.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
> > > index 9588e685d994..8cc9c429ad95 100644
> > > --- a/drivers/ata/pata_macio.c
> > > +++ b/drivers/ata/pata_macio.c
> > > @@ -483,6 +483,8 @@ static int pata_macio_cable_detect(struct ata_port *ap)
> > >               struct device_node *root = of_find_node_by_path("/");
> > >               const char *model = of_get_property(root, "model", NULL);
> > >
> > > +             of_node_put(root);
> > > +
> > >               if (cable && !strncmp(cable, "80-", 3)) {
> > >                       /* Some drives fail to detect 80c cable in PowerBook
> > >                        * These machine use proprietary short IDE cable
> >
> > MBR, Sergei

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ata: pata_macio: add of_node_put()
  2018-11-21 15:33       ` Frank Lee
@ 2018-11-22  8:36         ` Sergei Shtylyov
  0 siblings, 0 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2018-11-22  8:36 UTC (permalink / raw)
  To: Frank Lee; +Cc: b.zolnierkie, axboe, linux-ide, linux-kernel

On 21.11.2018 18:33, Frank Lee wrote:

>>>> of_find_node_by_path() acquires a reference to the node
>>>> returned by it and that reference needs to be dropped by its caller.
>>>> bl_idle_init() doesn't do that, so fix it.
>>>
>>>     I thought we're inside pata_macio_cable_detect()?
> Hi Sergei:
> 
> Yeah,this is a typo.
> Need me to resend a patch?

    This is more of a question for the libata maintainers (but I would resend).

> Thanks,
> Yangtao

MBR, Sergei

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ata: pata_macio: add of_node_put()
  2018-11-21 13:04 ` [PATCH] ata: pata_macio: add of_node_put() Yangtao Li
  2018-11-21 15:24   ` Sergei Shtylyov
@ 2018-12-20 17:03   ` Bartlomiej Zolnierkiewicz
  2018-12-20 18:01     ` Jens Axboe
  1 sibling, 1 reply; 9+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-12-20 17:03 UTC (permalink / raw)
  To: Yangtao Li, axboe; +Cc: linux-ide, linux-kernel


On 11/21/2018 02:04 PM, Yangtao Li wrote:
> of_find_node_by_path() acquires a reference to the node
> returned by it and that reference needs to be dropped by its caller.
> bl_idle_init() doesn't do that, so fix it.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>

Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

>  drivers/ata/pata_macio.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
> index 9588e685d994..8cc9c429ad95 100644
> --- a/drivers/ata/pata_macio.c
> +++ b/drivers/ata/pata_macio.c
> @@ -483,6 +483,8 @@ static int pata_macio_cable_detect(struct ata_port *ap)
>  		struct device_node *root = of_find_node_by_path("/");
>  		const char *model = of_get_property(root, "model", NULL);
>  
> +		of_node_put(root);
> +
>  		if (cable && !strncmp(cable, "80-", 3)) {
>  			/* Some drives fail to detect 80c cable in PowerBook
>  			 * These machine use proprietary short IDE cable
> 

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ata: pata_macio: add of_node_put()
  2018-12-20 17:03   ` Bartlomiej Zolnierkiewicz
@ 2018-12-20 18:01     ` Jens Axboe
  2018-12-21  1:09       ` Frank Lee
  0 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2018-12-20 18:01 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Yangtao Li; +Cc: linux-ide, linux-kernel

On 12/20/18 10:03 AM, Bartlomiej Zolnierkiewicz wrote:
> 
> On 11/21/2018 02:04 PM, Yangtao Li wrote:
>> of_find_node_by_path() acquires a reference to the node
>> returned by it and that reference needs to be dropped by its caller.
>> bl_idle_init() doesn't do that, so fix it.
>>
>> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> 
> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Yangtao, were you going to resend this one?

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ata: pata_macio: add of_node_put()
  2018-12-20 18:01     ` Jens Axboe
@ 2018-12-21  1:09       ` Frank Lee
  2018-12-21 14:11         ` Jens Axboe
  0 siblings, 1 reply; 9+ messages in thread
From: Frank Lee @ 2018-12-21  1:09 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Bartlomiej Zolnierkiewicz, linux-ide, Linux Kernel Mailing List

On Fri, Dec 21, 2018 at 2:01 AM Jens Axboe <axboe@kernel.dk> wrote:
>
> On 12/20/18 10:03 AM, Bartlomiej Zolnierkiewicz wrote:
> >
> > On 11/21/2018 02:04 PM, Yangtao Li wrote:
> >> of_find_node_by_path() acquires a reference to the node
> >> returned by it and that reference needs to be dropped by its caller.
> >> bl_idle_init() doesn't do that, so fix it.
> >>
> >> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> >
> > Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>
> Yangtao, were you going to resend this one?
Actually,I've rensent the v2 at  Nov 22.And  I just changed the changelog.
Can you pick it up?

Thanks,
Yangtao

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ata: pata_macio: add of_node_put()
  2018-12-21  1:09       ` Frank Lee
@ 2018-12-21 14:11         ` Jens Axboe
  0 siblings, 0 replies; 9+ messages in thread
From: Jens Axboe @ 2018-12-21 14:11 UTC (permalink / raw)
  To: Frank Lee; +Cc: Bartlomiej Zolnierkiewicz, linux-ide, Linux Kernel Mailing List

On 12/20/18 6:09 PM, Frank Lee wrote:
> On Fri, Dec 21, 2018 at 2:01 AM Jens Axboe <axboe@kernel.dk> wrote:
>>
>> On 12/20/18 10:03 AM, Bartlomiej Zolnierkiewicz wrote:
>>>
>>> On 11/21/2018 02:04 PM, Yangtao Li wrote:
>>>> of_find_node_by_path() acquires a reference to the node
>>>> returned by it and that reference needs to be dropped by its caller.
>>>> bl_idle_init() doesn't do that, so fix it.
>>>>
>>>> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
>>>
>>> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>>
>> Yangtao, were you going to resend this one?
> Actually,I've rensent the v2 at  Nov 22.And  I just changed the changelog.
> Can you pick it up?

I missed that, sorry. I'll pick it up.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-12-21 14:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20181121130510epcas3p4498edc67a02f61a6aa8e55efa9349681@epcas3p4.samsung.com>
2018-11-21 13:04 ` [PATCH] ata: pata_macio: add of_node_put() Yangtao Li
2018-11-21 15:24   ` Sergei Shtylyov
2018-11-21 15:31     ` Frank Lee
2018-11-21 15:33       ` Frank Lee
2018-11-22  8:36         ` Sergei Shtylyov
2018-12-20 17:03   ` Bartlomiej Zolnierkiewicz
2018-12-20 18:01     ` Jens Axboe
2018-12-21  1:09       ` Frank Lee
2018-12-21 14:11         ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).