All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND Patch 0/4] gpu: drm: not merged missing of_node_put fix
@ 2016-07-15  3:17 Peter Chen
  2016-07-15  3:17 ` [RESEND Patch 1/4] gpu: drm: omapdrm: connector-dvi: add missing of_node_put after calling of_parse_phandle Peter Chen
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Peter Chen @ 2016-07-15  3:17 UTC (permalink / raw)
  To: airlied, daniel.vetter; +Cc: Peter Chen, dri-devel

Hi Daniel,

Below are the remaining fixes for missing of_node_put, which are
not applied by you or individual driver maintainers.

Peter Chen (4):
  gpu: drm: omapdrm: connector-dvi: add missing of_node_put after
    calling of_parse_phandle
  gpu: drm: omapdrm: dss-of: add missing of_node_put after calling
    of_parse_phandle
  gpu: drm: exynos_hdmi: add missing of_node_put after calling
    of_parse_phandle
  gpu: drm: arcpgu_drv: add missing of_node_put after calling
    of_parse_phandle

 drivers/gpu/drm/arc/arcpgu_drv.c                 | 1 +
 drivers/gpu/drm/exynos/exynos_hdmi.c             | 2 ++
 drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 1 +
 drivers/gpu/drm/omapdrm/dss/dss-of.c             | 7 ++++---
 4 files changed, 8 insertions(+), 3 deletions(-)

-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [RESEND Patch 1/4] gpu: drm: omapdrm: connector-dvi: add missing of_node_put after calling of_parse_phandle
  2016-07-15  3:17 [RESEND Patch 0/4] gpu: drm: not merged missing of_node_put fix Peter Chen
@ 2016-07-15  3:17 ` Peter Chen
  2016-07-15  3:17 ` [RESEND Patch 2/4] gpu: drm: omapdrm: dss-of: " Peter Chen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Peter Chen @ 2016-07-15  3:17 UTC (permalink / raw)
  To: airlied, daniel.vetter; +Cc: Peter Chen, Tomi Valkeinen, dri-devel

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/omapdrm/displays/connector-dvi.c b/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
index 75f7827..684b7ae 100644
--- a/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
+++ b/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
@@ -255,6 +255,7 @@ static int dvic_probe_of(struct platform_device *pdev)
 	adapter_node = of_parse_phandle(node, "ddc-i2c-bus", 0);
 	if (adapter_node) {
 		adapter = of_get_i2c_adapter_by_node(adapter_node);
+		of_node_put(adapter_node);
 		if (adapter == NULL) {
 			dev_err(&pdev->dev, "failed to parse ddc-i2c-bus\n");
 			omap_dss_put_device(ddata->in);
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [RESEND Patch 2/4] gpu: drm: omapdrm: dss-of: add missing of_node_put after calling of_parse_phandle
  2016-07-15  3:17 [RESEND Patch 0/4] gpu: drm: not merged missing of_node_put fix Peter Chen
  2016-07-15  3:17 ` [RESEND Patch 1/4] gpu: drm: omapdrm: connector-dvi: add missing of_node_put after calling of_parse_phandle Peter Chen
@ 2016-07-15  3:17 ` Peter Chen
  2016-08-11  9:21   ` Tomi Valkeinen
  2016-07-15  3:17 ` [RESEND Patch 3/4] gpu: drm: exynos_hdmi: " Peter Chen
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Peter Chen @ 2016-07-15  3:17 UTC (permalink / raw)
  To: airlied, daniel.vetter; +Cc: Peter Chen, Tomi Valkeinen, dri-devel

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/gpu/drm/omapdrm/dss/dss-of.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss-of.c b/drivers/gpu/drm/omapdrm/dss/dss-of.c
index dfd4e96..e256d87 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss-of.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss-of.c
@@ -125,15 +125,16 @@ u32 dss_of_port_get_port_number(struct device_node *port)
 
 static struct device_node *omapdss_of_get_remote_port(const struct device_node *node)
 {
-	struct device_node *np;
+	struct device_node *np, *np_parent;
 
 	np = of_parse_phandle(node, "remote-endpoint", 0);
 	if (!np)
 		return NULL;
 
-	np = of_get_next_parent(np);
+	np_parent = of_get_next_parent(np);
+	of_node_put(np);
 
-	return np;
+	return np_parent;
 }
 
 struct device_node *
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [RESEND Patch 3/4] gpu: drm: exynos_hdmi: add missing of_node_put after calling of_parse_phandle
  2016-07-15  3:17 [RESEND Patch 0/4] gpu: drm: not merged missing of_node_put fix Peter Chen
  2016-07-15  3:17 ` [RESEND Patch 1/4] gpu: drm: omapdrm: connector-dvi: add missing of_node_put after calling of_parse_phandle Peter Chen
  2016-07-15  3:17 ` [RESEND Patch 2/4] gpu: drm: omapdrm: dss-of: " Peter Chen
@ 2016-07-15  3:17 ` Peter Chen
  2016-07-15  3:17 ` [RESEND Patch 4/4] gpu: drm: arcpgu_drv: " Peter Chen
  2016-07-15 12:51 ` [RESEND Patch 0/4] gpu: drm: not merged missing of_node_put fix Sean Paul
  4 siblings, 0 replies; 9+ messages in thread
From: Peter Chen @ 2016-07-15  3:17 UTC (permalink / raw)
  To: airlied, daniel.vetter
  Cc: Peter Chen, Kyungmin Park, Seung-Woo Kim, dri-devel

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 1625d7c..2275efe 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1820,6 +1820,7 @@ static int hdmi_probe(struct platform_device *pdev)
 		DRM_ERROR("Failed to find ddc node in device tree\n");
 		return -ENODEV;
 	}
+	of_node_put(dev->of_node);
 
 out_get_ddc_adpt:
 	hdata->ddc_adpt = of_find_i2c_adapter_by_node(ddc_node);
@@ -1838,6 +1839,7 @@ out_get_ddc_adpt:
 		ret = -ENODEV;
 		goto err_ddc;
 	}
+	of_node_put(dev->of_node);
 
 out_get_phy_port:
 	if (hdata->drv_data->is_apb_phy) {
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [RESEND Patch 4/4] gpu: drm: arcpgu_drv: add missing of_node_put after calling of_parse_phandle
  2016-07-15  3:17 [RESEND Patch 0/4] gpu: drm: not merged missing of_node_put fix Peter Chen
                   ` (2 preceding siblings ...)
  2016-07-15  3:17 ` [RESEND Patch 3/4] gpu: drm: exynos_hdmi: " Peter Chen
@ 2016-07-15  3:17 ` Peter Chen
  2016-07-15 12:51 ` [RESEND Patch 0/4] gpu: drm: not merged missing of_node_put fix Sean Paul
  4 siblings, 0 replies; 9+ messages in thread
From: Peter Chen @ 2016-07-15  3:17 UTC (permalink / raw)
  To: airlied, daniel.vetter; +Cc: Peter Chen, Alexey Brodkin, dri-devel

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Cc: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/gpu/drm/arc/arcpgu_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index ccbdadb..0226ec0 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -127,6 +127,7 @@ static int arcpgu_load(struct drm_device *drm)
 	encoder_node = of_parse_phandle(drm->dev->of_node, "encoder-slave", 0);
 	if (encoder_node) {
 		ret = arcpgu_drm_hdmi_init(drm, encoder_node);
+		of_node_put(encoder_node);
 		if (ret < 0)
 			return ret;
 	} else {
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [RESEND Patch 0/4] gpu: drm: not merged missing of_node_put fix
  2016-07-15  3:17 [RESEND Patch 0/4] gpu: drm: not merged missing of_node_put fix Peter Chen
                   ` (3 preceding siblings ...)
  2016-07-15  3:17 ` [RESEND Patch 4/4] gpu: drm: arcpgu_drv: " Peter Chen
@ 2016-07-15 12:51 ` Sean Paul
  4 siblings, 0 replies; 9+ messages in thread
From: Sean Paul @ 2016-07-15 12:51 UTC (permalink / raw)
  To: Peter Chen; +Cc: Daniel Vetter, dri-devel

On Thu, Jul 14, 2016 at 11:17 PM, Peter Chen <peter.chen@nxp.com> wrote:
> Hi Daniel,
>
> Below are the remaining fixes for missing of_node_put, which are
> not applied by you or individual driver maintainers.
>
> Peter Chen (4):
>   gpu: drm: omapdrm: connector-dvi: add missing of_node_put after
>     calling of_parse_phandle
>   gpu: drm: omapdrm: dss-of: add missing of_node_put after calling
>     of_parse_phandle
>   gpu: drm: exynos_hdmi: add missing of_node_put after calling
>     of_parse_phandle
>   gpu: drm: arcpgu_drv: add missing of_node_put after calling
>     of_parse_phandle
>
>  drivers/gpu/drm/arc/arcpgu_drv.c                 | 1 +
>  drivers/gpu/drm/exynos/exynos_hdmi.c             | 2 ++
>  drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 1 +
>  drivers/gpu/drm/omapdrm/dss/dss-of.c             | 7 ++++---
>  4 files changed, 8 insertions(+), 3 deletions(-)


Applied to drm-misc.

>
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [RESEND Patch 2/4] gpu: drm: omapdrm: dss-of: add missing of_node_put after calling of_parse_phandle
  2016-07-15  3:17 ` [RESEND Patch 2/4] gpu: drm: omapdrm: dss-of: " Peter Chen
@ 2016-08-11  9:21   ` Tomi Valkeinen
  2016-08-11  9:44     ` Peter Chen
  0 siblings, 1 reply; 9+ messages in thread
From: Tomi Valkeinen @ 2016-08-11  9:21 UTC (permalink / raw)
  To: Peter Chen, airlied, daniel.vetter; +Cc: dri-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 1300 bytes --]

Hi,

On 15/07/16 06:17, Peter Chen wrote:
> of_node_put needs to be called when the device node which is got
> from of_parse_phandle has finished using.
> 
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Signed-off-by: Peter Chen <peter.chen@nxp.com>
> ---
>  drivers/gpu/drm/omapdrm/dss/dss-of.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dss-of.c b/drivers/gpu/drm/omapdrm/dss/dss-of.c
> index dfd4e96..e256d87 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dss-of.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dss-of.c
> @@ -125,15 +125,16 @@ u32 dss_of_port_get_port_number(struct device_node *port)
>  
>  static struct device_node *omapdss_of_get_remote_port(const struct device_node *node)
>  {
> -	struct device_node *np;
> +	struct device_node *np, *np_parent;
>  
>  	np = of_parse_phandle(node, "remote-endpoint", 0);
>  	if (!np)
>  		return NULL;
>  
> -	np = of_get_next_parent(np);
> +	np_parent = of_get_next_parent(np);
> +	of_node_put(np);
>  
> -	return np;
> +	return np_parent;
>  }

The doc for of_get_next_parent() says:

"This is like of_get_parent() except that it drops the
refcount on the passed node, making it suitable for iterating".

So this patch breaks omapdrm.

 Tomi


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* RE: [RESEND Patch 2/4] gpu: drm: omapdrm: dss-of: add missing of_node_put after calling of_parse_phandle
  2016-08-11  9:21   ` Tomi Valkeinen
@ 2016-08-11  9:44     ` Peter Chen
  2016-08-11 10:50       ` Daniel Vetter
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Chen @ 2016-08-11  9:44 UTC (permalink / raw)
  To: Tomi Valkeinen, airlied, daniel.vetter; +Cc: dri-devel


 
>On 15/07/16 06:17, Peter Chen wrote:
>> of_node_put needs to be called when the device node which is got from
>> of_parse_phandle has finished using.
>>
>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> Signed-off-by: Peter Chen <peter.chen@nxp.com>
>> ---
>>  drivers/gpu/drm/omapdrm/dss/dss-of.c | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/dss/dss-of.c
>> b/drivers/gpu/drm/omapdrm/dss/dss-of.c
>> index dfd4e96..e256d87 100644
>> --- a/drivers/gpu/drm/omapdrm/dss/dss-of.c
>> +++ b/drivers/gpu/drm/omapdrm/dss/dss-of.c
>> @@ -125,15 +125,16 @@ u32 dss_of_port_get_port_number(struct
>> device_node *port)
>>
>>  static struct device_node *omapdss_of_get_remote_port(const struct
>> device_node *node)  {
>> -	struct device_node *np;
>> +	struct device_node *np, *np_parent;
>>
>>  	np = of_parse_phandle(node, "remote-endpoint", 0);
>>  	if (!np)
>>  		return NULL;
>>
>> -	np = of_get_next_parent(np);
>> +	np_parent = of_get_next_parent(np);
>> +	of_node_put(np);
>>
>> -	return np;
>> +	return np_parent;
>>  }
>
>The doc for of_get_next_parent() says:
>
>"This is like of_get_parent() except that it drops the refcount on the passed node,
>making it suitable for iterating".
>

It is my careless, thanks for pointing it.

Peter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [RESEND Patch 2/4] gpu: drm: omapdrm: dss-of: add missing of_node_put after calling of_parse_phandle
  2016-08-11  9:44     ` Peter Chen
@ 2016-08-11 10:50       ` Daniel Vetter
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2016-08-11 10:50 UTC (permalink / raw)
  To: Peter Chen; +Cc: daniel.vetter, Tomi Valkeinen, dri-devel

On Thu, Aug 11, 2016 at 09:44:55AM +0000, Peter Chen wrote:
> 
>  
> >On 15/07/16 06:17, Peter Chen wrote:
> >> of_node_put needs to be called when the device node which is got from
> >> of_parse_phandle has finished using.
> >>
> >> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> >> Signed-off-by: Peter Chen <peter.chen@nxp.com>
> >> ---
> >>  drivers/gpu/drm/omapdrm/dss/dss-of.c | 7 ++++---
> >>  1 file changed, 4 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/omapdrm/dss/dss-of.c
> >> b/drivers/gpu/drm/omapdrm/dss/dss-of.c
> >> index dfd4e96..e256d87 100644
> >> --- a/drivers/gpu/drm/omapdrm/dss/dss-of.c
> >> +++ b/drivers/gpu/drm/omapdrm/dss/dss-of.c
> >> @@ -125,15 +125,16 @@ u32 dss_of_port_get_port_number(struct
> >> device_node *port)
> >>
> >>  static struct device_node *omapdss_of_get_remote_port(const struct
> >> device_node *node)  {
> >> -	struct device_node *np;
> >> +	struct device_node *np, *np_parent;
> >>
> >>  	np = of_parse_phandle(node, "remote-endpoint", 0);
> >>  	if (!np)
> >>  		return NULL;
> >>
> >> -	np = of_get_next_parent(np);
> >> +	np_parent = of_get_next_parent(np);
> >> +	of_node_put(np);
> >>
> >> -	return np;
> >> +	return np_parent;
> >>  }
> >
> >The doc for of_get_next_parent() says:
> >
> >"This is like of_get_parent() except that it drops the refcount on the passed node,
> >making it suitable for iterating".
> >
> 
> It is my careless, thanks for pointing it.

Since it's already replied, should we just revert, or is a fixup patch
better?
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-08-11 10:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15  3:17 [RESEND Patch 0/4] gpu: drm: not merged missing of_node_put fix Peter Chen
2016-07-15  3:17 ` [RESEND Patch 1/4] gpu: drm: omapdrm: connector-dvi: add missing of_node_put after calling of_parse_phandle Peter Chen
2016-07-15  3:17 ` [RESEND Patch 2/4] gpu: drm: omapdrm: dss-of: " Peter Chen
2016-08-11  9:21   ` Tomi Valkeinen
2016-08-11  9:44     ` Peter Chen
2016-08-11 10:50       ` Daniel Vetter
2016-07-15  3:17 ` [RESEND Patch 3/4] gpu: drm: exynos_hdmi: " Peter Chen
2016-07-15  3:17 ` [RESEND Patch 4/4] gpu: drm: arcpgu_drv: " Peter Chen
2016-07-15 12:51 ` [RESEND Patch 0/4] gpu: drm: not merged missing of_node_put fix Sean Paul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.