All of lore.kernel.org
 help / color / mirror / Atom feed
* of_reserved_mem_device_init_by_idx() returns -EINVAL if "memory-region" is missing
@ 2016-06-16 16:47 ` Alexey Brodkin
  0 siblings, 0 replies; 6+ messages in thread
From: Alexey Brodkin @ 2016-06-16 16:47 UTC (permalink / raw)
  To: linux-snps-arc

Hi Marek,

We used to use?of_reserved_mem_device_init() in such a context in GPU drivers:
-------------------->8-------------------
	/* Get the optional framebuffer memory resource */
	ret = of_reserved_mem_device_init(drm->dev);
	if (ret && ret != -ENODEV)
		return ret;
-------------------->8-------------------

The point is we may have a dedicated reserved memory area or may not have (depends on a particular .dts).
Our expectation is if reserved memory area is missing then of_reserved_mem_device_init()
just returns -ENODEV and it used to work like this.

Now with your commit?59ce4039727e "of: reserved_mem: add support for using more than one region for given device"
behavior is different.?of_reserved_mem_device_init_by_idx() has this:
-------------------->8-------------------
	target = of_parse_phandle(np, "memory-region", idx);
	if (!target)
		return -EINVAL;
-------------------->8-------------------

So I'm wondering which part should be fixed:
?1)?of_reserved_mem itself or
?2) users of of_reserved_mem_device_init()

Any thoughts?

Regards,
Alexey

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

* of_reserved_mem_device_init_by_idx() returns -EINVAL if "memory-region" is missing
@ 2016-06-16 16:47 ` Alexey Brodkin
  0 siblings, 0 replies; 6+ messages in thread
From: Alexey Brodkin @ 2016-06-16 16:47 UTC (permalink / raw)
  To: m.szyprowski@samsung.com
  Cc: robh@kernel.org, s.nawrocki@samsung.com, airlied@linux.ie,
	Liviu.Dudau@arm.com, dri-devel@lists.freedesktop.org,
	daniel@ffwll.ch, linux-snps-arc@lists.infradead.org

Hi Marek,

We used to use of_reserved_mem_device_init() in such a context in GPU drivers:
-------------------->8-------------------
	/* Get the optional framebuffer memory resource */
	ret = of_reserved_mem_device_init(drm->dev);
	if (ret && ret != -ENODEV)
		return ret;
-------------------->8-------------------

The point is we may have a dedicated reserved memory area or may not have (depends on a particular .dts).
Our expectation is if reserved memory area is missing then of_reserved_mem_device_init()
just returns -ENODEV and it used to work like this.

Now with your commit 59ce4039727e "of: reserved_mem: add support for using more than one region for given device"
behavior is different. of_reserved_mem_device_init_by_idx() has this:
-------------------->8-------------------
	target = of_parse_phandle(np, "memory-region", idx);
	if (!target)
		return -EINVAL;
-------------------->8-------------------

So I'm wondering which part should be fixed:
 1) of_reserved_mem itself or
 2) users of of_reserved_mem_device_init()

Any thoughts?

Regards,
Alexey
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* of_reserved_mem_device_init_by_idx() returns -EINVAL if "memory-region" is missing
  2016-06-16 16:47 ` Alexey Brodkin
@ 2016-06-17  5:28   ` Marek Szyprowski
  -1 siblings, 0 replies; 6+ messages in thread
From: Marek Szyprowski @ 2016-06-17  5:28 UTC (permalink / raw)
  To: linux-snps-arc

Hi Alexey


On 2016-06-16 18:47, Alexey Brodkin wrote:
> Hi Marek,
>
> We used to use of_reserved_mem_device_init() in such a context in GPU drivers:
> -------------------->8-------------------
> 	/* Get the optional framebuffer memory resource */
> 	ret = of_reserved_mem_device_init(drm->dev);
> 	if (ret && ret != -ENODEV)
> 		return ret;
> -------------------->8-------------------
>
> The point is we may have a dedicated reserved memory area or may not have (depends on a particular .dts).
> Our expectation is if reserved memory area is missing then of_reserved_mem_device_init()
> just returns -ENODEV and it used to work like this.
>
> Now with your commit 59ce4039727e "of: reserved_mem: add support for using more than one region for given device"
> behavior is different. of_reserved_mem_device_init_by_idx() has this:
> -------------------->8-------------------
> 	target = of_parse_phandle(np, "memory-region", idx);
> 	if (!target)
> 		return -EINVAL;
> -------------------->8-------------------
>
> So I'm wondering which part should be fixed:
>   1) of_reserved_mem itself or
>   2) users of of_reserved_mem_device_init()
>
> Any thoughts?

This was my fault. The fix is already queued to linux-next, see commit
9f5a802b1d51dc80a27d828a5f7dcc8ec4a72f03 ("[media] of: reserved_mem: restore
old behavior when no region is defined"),
http://www.spinics.net/lists/linux-media/msg100972.html

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

* Re: of_reserved_mem_device_init_by_idx() returns -EINVAL if "memory-region" is missing
@ 2016-06-17  5:28   ` Marek Szyprowski
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Szyprowski @ 2016-06-17  5:28 UTC (permalink / raw)
  To: Alexey Brodkin
  Cc: s.nawrocki@samsung.com, Liviu.Dudau@arm.com,
	dri-devel@lists.freedesktop.org,
	linux-snps-arc@lists.infradead.org

Hi Alexey


On 2016-06-16 18:47, Alexey Brodkin wrote:
> Hi Marek,
>
> We used to use of_reserved_mem_device_init() in such a context in GPU drivers:
> -------------------->8-------------------
> 	/* Get the optional framebuffer memory resource */
> 	ret = of_reserved_mem_device_init(drm->dev);
> 	if (ret && ret != -ENODEV)
> 		return ret;
> -------------------->8-------------------
>
> The point is we may have a dedicated reserved memory area or may not have (depends on a particular .dts).
> Our expectation is if reserved memory area is missing then of_reserved_mem_device_init()
> just returns -ENODEV and it used to work like this.
>
> Now with your commit 59ce4039727e "of: reserved_mem: add support for using more than one region for given device"
> behavior is different. of_reserved_mem_device_init_by_idx() has this:
> -------------------->8-------------------
> 	target = of_parse_phandle(np, "memory-region", idx);
> 	if (!target)
> 		return -EINVAL;
> -------------------->8-------------------
>
> So I'm wondering which part should be fixed:
>   1) of_reserved_mem itself or
>   2) users of of_reserved_mem_device_init()
>
> Any thoughts?

This was my fault. The fix is already queued to linux-next, see commit
9f5a802b1d51dc80a27d828a5f7dcc8ec4a72f03 ("[media] of: reserved_mem: restore
old behavior when no region is defined"),
http://www.spinics.net/lists/linux-media/msg100972.html

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

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

* of_reserved_mem_device_init_by_idx() returns -EINVAL if "memory-region" is missing
  2016-06-17  5:28   ` Marek Szyprowski
@ 2016-06-17  6:47     ` Alexey Brodkin
  -1 siblings, 0 replies; 6+ messages in thread
From: Alexey Brodkin @ 2016-06-17  6:47 UTC (permalink / raw)
  To: linux-snps-arc

Hi Marek,

On Fri, 2016-06-17@07:28 +0200, Marek Szyprowski wrote:
> Hi Alexey
> 
> 
> On 2016-06-16 18:47, Alexey Brodkin wrote:
> > 
> > Hi Marek,
> > 
> > We used to use of_reserved_mem_device_init() in such a context in GPU drivers:
> > -------------------->8-------------------
> > 	/* Get the optional framebuffer memory resource */
> > 	ret = of_reserved_mem_device_init(drm->dev);
> > 	if (ret && ret != -ENODEV)
> > 		return ret;
> > -------------------->8-------------------
> > 
> > The point is we may have a dedicated reserved memory area or may not have (depends on a particular .dts).
> > Our expectation is if reserved memory area is missing then of_reserved_mem_device_init()
> > just returns -ENODEV and it used to work like this.
> > 
> > Now with your commit 59ce4039727e "of: reserved_mem: add support for using more than one region for given device"
> > behavior is different. of_reserved_mem_device_init_by_idx() has this:
> > -------------------->8-------------------
> > 	target = of_parse_phandle(np, "memory-region", idx);
> > 	if (!target)
> > 		return -EINVAL;
> > -------------------->8-------------------
> > 
> > So I'm wondering which part should be fixed:
> > ? 1) of_reserved_mem itself or
> > ? 2) users of of_reserved_mem_device_init()
> > 
> > Any thoughts?
> 
> This was my fault. The fix is already queued to linux-next, see commit
> 9f5a802b1d51dc80a27d828a5f7dcc8ec4a72f03 ("[media] of: reserved_mem: restore
> old behavior when no region is defined"),
> http://www.spinics.net/lists/linux-media/msg100972.html
> 

Indeed with mentioned fix GPU driver now works again!
Sorry for the noise and thank you for fixing it that fast.

Regards,
Alexey

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

* Re: of_reserved_mem_device_init_by_idx() returns -EINVAL if "memory-region" is missing
@ 2016-06-17  6:47     ` Alexey Brodkin
  0 siblings, 0 replies; 6+ messages in thread
From: Alexey Brodkin @ 2016-06-17  6:47 UTC (permalink / raw)
  To: m.szyprowski@samsung.com
  Cc: robh@kernel.org, s.nawrocki@samsung.com, airlied@linux.ie,
	Liviu.Dudau@arm.com, dri-devel@lists.freedesktop.org,
	daniel@ffwll.ch, linux-snps-arc@lists.infradead.org

Hi Marek,

On Fri, 2016-06-17 at 07:28 +0200, Marek Szyprowski wrote:
> Hi Alexey
> 
> 
> On 2016-06-16 18:47, Alexey Brodkin wrote:
> > 
> > Hi Marek,
> > 
> > We used to use of_reserved_mem_device_init() in such a context in GPU drivers:
> > -------------------->8-------------------
> > 	/* Get the optional framebuffer memory resource */
> > 	ret = of_reserved_mem_device_init(drm->dev);
> > 	if (ret && ret != -ENODEV)
> > 		return ret;
> > -------------------->8-------------------
> > 
> > The point is we may have a dedicated reserved memory area or may not have (depends on a particular .dts).
> > Our expectation is if reserved memory area is missing then of_reserved_mem_device_init()
> > just returns -ENODEV and it used to work like this.
> > 
> > Now with your commit 59ce4039727e "of: reserved_mem: add support for using more than one region for given device"
> > behavior is different. of_reserved_mem_device_init_by_idx() has this:
> > -------------------->8-------------------
> > 	target = of_parse_phandle(np, "memory-region", idx);
> > 	if (!target)
> > 		return -EINVAL;
> > -------------------->8-------------------
> > 
> > So I'm wondering which part should be fixed:
> >   1) of_reserved_mem itself or
> >   2) users of of_reserved_mem_device_init()
> > 
> > Any thoughts?
> 
> This was my fault. The fix is already queued to linux-next, see commit
> 9f5a802b1d51dc80a27d828a5f7dcc8ec4a72f03 ("[media] of: reserved_mem: restore
> old behavior when no region is defined"),
> http://www.spinics.net/lists/linux-media/msg100972.html
> 

Indeed with mentioned fix GPU driver now works again!
Sorry for the noise and thank you for fixing it that fast.

Regards,
Alexey
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

end of thread, other threads:[~2016-06-17  6:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 16:47 of_reserved_mem_device_init_by_idx() returns -EINVAL if "memory-region" is missing Alexey Brodkin
2016-06-16 16:47 ` Alexey Brodkin
2016-06-17  5:28 ` Marek Szyprowski
2016-06-17  5:28   ` Marek Szyprowski
2016-06-17  6:47   ` Alexey Brodkin
2016-06-17  6:47     ` Alexey Brodkin

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.