Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-28 Thread Tomi Valkeinen
On Thu, 2012-06-28 at 13:16 +0530, Jassi Brar wrote: > On 28 June 2012 12:11, Tomi Valkeinen wrote: > > On Wed, 2012-06-27 at 20:23 +0530, Jassi Brar wrote: > >> On 27 June 2012 13:43, Tomi Valkeinen wrote: > >> > > >> > I don't like it at all that omapdss disables and enables the panels in > >>

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-28 Thread Jassi Brar
On 28 June 2012 12:11, Tomi Valkeinen wrote: > On Wed, 2012-06-27 at 20:23 +0530, Jassi Brar wrote: >> On 27 June 2012 13:43, Tomi Valkeinen wrote: >> > >> > I don't like it at all that omapdss disables and enables the panels in >> > omapdss's suspend/resume hooks. But I'm not sure how this shoul

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-27 Thread Tomi Valkeinen
On Wed, 2012-06-27 at 20:23 +0530, Jassi Brar wrote: > On 27 June 2012 13:43, Tomi Valkeinen wrote: > > > > I don't like it at all that omapdss disables and enables the panels in > > omapdss's suspend/resume hooks. But I'm not sure how this should work... > > Should panel drivers each have their o

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-27 Thread Jassi Brar
On 27 June 2012 13:43, Tomi Valkeinen wrote: > > I don't like it at all that omapdss disables and enables the panels in > omapdss's suspend/resume hooks. But I'm not sure how this should work... > Should panel drivers each have their own suspend/resume hooks, and > handle it themselves? Or should

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-27 Thread Tomi Valkeinen
On Wed, 2012-06-27 at 13:11 +0530, Jassi Brar wrote: > On 27 June 2012 11:28, Tomi Valkeinen wrote: > > > > It doesn't matter how omapdss is organized, -EACCES _is_ an error. It > > tells us that something unexpected happened, and we should react to it > > somehow. > > > $ git show 5025ce070 > E

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-27 Thread Jassi Brar
On 27 June 2012 11:28, Tomi Valkeinen wrote: > > It doesn't matter how omapdss is organized, -EACCES _is_ an error. It > tells us that something unexpected happened, and we should react to it > somehow. > $ git show 5025ce070 Exactly how omapdss is organised is the reason -EBUSY isn't an error t

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Tomi Valkeinen
On Wed, 2012-06-27 at 10:12 +0530, Jassi Brar wrote: > > True. But the HW could also be in disabled state. And that would lead to > > a crash when accessing the registers. > > > > It is not a fatal error if pm_runtime_get returns -EACCES, but we sure > > shouldn't ignore it (or avoid it with pm_ru

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Jassi Brar
On 27 June 2012 00:14, Tomi Valkeinen wrote: > On Tue, 2012-06-26 at 22:31 +0530, Jassi Brar wrote: >> >> > But if pm_runtime_get_sync() returns an error, it means the HW has not >> > been resumed successfully, and is not operational, >> > >> Not always. The HW could be in RPM_ACTIVE state while P

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Tomi Valkeinen
On Tue, 2012-06-26 at 22:31 +0530, Jassi Brar wrote: > While I think your patch is simpler and achieve the same, I also think > your fears about this patch are unfounded. Perhaps. But I do get a bad feeling from your patch, and I don't like when that happens =). What I fear with changes like you

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Jassi Brar
On 26 June 2012 20:41, Tomi Valkeinen wrote: > On Tue, 2012-06-26 at 20:39 +0530, Jassi Brar wrote: >> On 26 June 2012 20:38, Tomi Valkeinen wrote: >> > On Tue, 2012-06-26 at 20:19 +0530, Jassi Brar wrote: >> >> On 26 June 2012 17:33, Tomi Valkeinen wrote: >> >> > On Tue, 2012-06-26 at 15:27 +05

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Tomi Valkeinen
On Tue, 2012-06-26 at 20:39 +0530, Jassi Brar wrote: > On 26 June 2012 20:38, Tomi Valkeinen wrote: > > On Tue, 2012-06-26 at 20:19 +0530, Jassi Brar wrote: > >> On 26 June 2012 17:33, Tomi Valkeinen wrote: > >> > On Tue, 2012-06-26 at 15:27 +0530, Jassi Brar wrote: > >> > > >> >> Seems similar,

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Alan Stern
On Tue, 26 Jun 2012, Tomi Valkeinen wrote: > > Failure to suspend a device should not be regarded as particularly bad, > > because it doesn't affect the device's functionality. That's true even > > when CONFIG_RUNTIME_PM is enabled. > > This makes sense. So if CONFIG_RUNTIME_PM=n, using pm_run

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Jassi Brar
On 26 June 2012 20:38, Tomi Valkeinen wrote: > On Tue, 2012-06-26 at 20:19 +0530, Jassi Brar wrote: >> On 26 June 2012 17:33, Tomi Valkeinen wrote: >> > On Tue, 2012-06-26 at 15:27 +0530, Jassi Brar wrote: >> > >> >> Seems similar, but I only tested OMAP4 HDMI. >> > >> > Would something like this

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Tomi Valkeinen
On Tue, 2012-06-26 at 20:19 +0530, Jassi Brar wrote: > On 26 June 2012 17:33, Tomi Valkeinen wrote: > > On Tue, 2012-06-26 at 15:27 +0530, Jassi Brar wrote: > > > >> Seems similar, but I only tested OMAP4 HDMI. > > > > Would something like this one below work for you? It fixes the issues on > > my

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Tomi Valkeinen
On Tue, 2012-06-26 at 10:34 -0400, Alan Stern wrote: > On Tue, 26 Jun 2012, Grazvydas Ignotas wrote: > > > CCing some PM people, maybe they can comment? > > > > On Tue, Jun 26, 2012 at 7:51 AM, Rajendra Nayak wrote: > > > On Monday 25 June 2012 06:20 PM, Tomi Valkeinen wrote: > > >> > > >> Do yo

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Jassi Brar
On 26 June 2012 17:33, Tomi Valkeinen wrote: > On Tue, 2012-06-26 at 15:27 +0530, Jassi Brar wrote: > >> Seems similar, but I only tested OMAP4 HDMI. > > Would something like this one below work for you? It fixes the issues on > my overo board. > I think this should work too (I will get to test it

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Alan Stern
On Tue, 26 Jun 2012, Grazvydas Ignotas wrote: > CCing some PM people, maybe they can comment? > > On Tue, Jun 26, 2012 at 7:51 AM, Rajendra Nayak wrote: > > On Monday 25 June 2012 06:20 PM, Tomi Valkeinen wrote: > >> > >> Do you know how the drivers should handle CONFIG_PM_RUNTIME=n? > >> Are th

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Grazvydas Ignotas
CCing some PM people, maybe they can comment? On Tue, Jun 26, 2012 at 7:51 AM, Rajendra Nayak wrote: > On Monday 25 June 2012 06:20 PM, Tomi Valkeinen wrote: >> >> Do you know how the drivers should handle CONFIG_PM_RUNTIME=n? >> Are they supposed to handle the error values returned by runtime PM

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Tomi Valkeinen
On Tue, 2012-06-26 at 15:27 +0530, Jassi Brar wrote: > Seems similar, but I only tested OMAP4 HDMI. Would something like this one below work for you? It fixes the issues on my overo board. Instead of using omapdss device's suspend/resume callbacks, this one uses PM notifier calls which happen be

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Jassi Brar
On 26 June 2012 14:37, Tomi Valkeinen wrote: > On Tue, 2012-06-26 at 14:02 +0530, Jassi Brar wrote: > >> Something non-omapdss in vanilla breaks suspend/resume. > > I was able to reproduce (probably) the same issue with omap3 overo. Does > this looks familiar: > > [ 2267.140197] [ cut

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Andy Green
On 06/26/12 16:32, the mail apparently from Jassi Brar included: On 26 June 2012 12:49, Tomi Valkeinen wrote: On Mon, 2012-06-25 at 22:36 +0530, Jassi Brar wrote: Normally if the driver does dispc_runtime_get() and dispc_read_reg(), the first call will enable the HW so the reg read works.

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Tomi Valkeinen
On Tue, 2012-06-26 at 14:02 +0530, Jassi Brar wrote: > Something non-omapdss in vanilla breaks suspend/resume. I was able to reproduce (probably) the same issue with omap3 overo. Does this looks familiar: [ 2267.140197] [ cut here ] [ 2267.145172] WARNING: at drivers/vide

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Jassi Brar
On 26 June 2012 12:49, Tomi Valkeinen wrote: > On Mon, 2012-06-25 at 22:36 +0530, Jassi Brar wrote: >> > >> > Normally if the driver does dispc_runtime_get() and dispc_read_reg(), >> > the first call will enable the HW so the reg read works. >> > >> > But if the pm_runtime is disabled, say, durin

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-26 Thread Tomi Valkeinen
On Mon, 2012-06-25 at 22:36 +0530, Jassi Brar wrote: > On 25 June 2012 19:19, Tomi Valkeinen wrote: > > On Mon, 2012-06-25 at 19:01 +0530, Jassi Brar wrote: > > >> > /* this accesses a register, but the HW is disabled? */ > >> > dispc_read_reg(FOO); > >> > > >> the H/W is already always enab

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Rajendra Nayak
On Monday 25 June 2012 06:20 PM, Tomi Valkeinen wrote: On Mon, 2012-06-25 at 18:12 +0530, Rajendra Nayak wrote: On Monday 25 June 2012 06:00 PM, Tomi Valkeinen wrote: On Mon, 2012-06-25 at 15:05 +0300, Grazvydas Ignotas wrote: On Mon, Jun 25, 2012 at 9:20 AM, Tomi Valkeinen wrote: On Sat, 2

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Jassi Brar
On 25 June 2012 19:19, Tomi Valkeinen wrote: > On Mon, 2012-06-25 at 19:01 +0530, Jassi Brar wrote: >> > /* this accesses a register, but the HW is disabled? */ >> > dispc_read_reg(FOO); >> > >> the H/W is already always enabled if CONFIG_PM_RUNTIME is not defined. >> >> If CONFIG_PM_RUNTIME

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Tomi Valkeinen
On Mon, 2012-06-25 at 19:01 +0530, Jassi Brar wrote: > On 25 June 2012 18:11, Tomi Valkeinen wrote: > > On Mon, 2012-06-25 at 17:57 +0530, Jassi Brar wrote: > >> On 25 June 2012 15:00, Tomi Valkeinen wrote: > > > >> > The driver needs to enable the HW and the call to pm_runtime_get() is > >> > sk

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Jassi Brar
On 25 June 2012 18:11, Tomi Valkeinen wrote: > On Mon, 2012-06-25 at 17:57 +0530, Jassi Brar wrote: >> On 25 June 2012 15:00, Tomi Valkeinen wrote: > >> > The driver needs to enable the HW and the call to pm_runtime_get() is >> > skipped. Won't this lead to crash as the DSS registers are accessed

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Tomi Valkeinen
On Mon, 2012-06-25 at 18:12 +0530, Rajendra Nayak wrote: > On Monday 25 June 2012 06:00 PM, Tomi Valkeinen wrote: > > On Mon, 2012-06-25 at 15:05 +0300, Grazvydas Ignotas wrote: > >> On Mon, Jun 25, 2012 at 9:20 AM, Tomi Valkeinen > >> wrote: > >>> On Sat, 2012-06-23 at 13:36 +0530, jaswinder.si.

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Rajendra Nayak
On Monday 25 June 2012 06:00 PM, Tomi Valkeinen wrote: On Mon, 2012-06-25 at 15:05 +0300, Grazvydas Ignotas wrote: On Mon, Jun 25, 2012 at 9:20 AM, Tomi Valkeinen wrote: On Sat, 2012-06-23 at 13:36 +0530, jaswinder.si...@linaro.org wrote: Currenlty HDMI fails to come up in the suspend-resu

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Tomi Valkeinen
On Mon, 2012-06-25 at 17:57 +0530, Jassi Brar wrote: > On 25 June 2012 15:00, Tomi Valkeinen wrote: > > The driver needs to enable the HW and the call to pm_runtime_get() is > > skipped. Won't this lead to crash as the DSS registers are accessed > > without the HW in enabled state? > > > Hmm...

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Jassi Brar
On 25 June 2012 17:35, Grazvydas Ignotas wrote: > On Mon, Jun 25, 2012 at 9:20 AM, Tomi Valkeinen wrote: >> On Sat, 2012-06-23 at 13:36 +0530, jaswinder.si...@linaro.org wrote: >>> >>>  Currenlty HDMI fails to come up in the suspend-resume path. >>> This patch helps that real-world scenario. >> >

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Tomi Valkeinen
On Mon, 2012-06-25 at 15:05 +0300, Grazvydas Ignotas wrote: > On Mon, Jun 25, 2012 at 9:20 AM, Tomi Valkeinen wrote: > > On Sat, 2012-06-23 at 13:36 +0530, jaswinder.si...@linaro.org wrote: > >> > >> Currenlty HDMI fails to come up in the suspend-resume path. > >> This patch helps that real-world

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Jassi Brar
On 25 June 2012 15:00, Tomi Valkeinen wrote: > On Mon, 2012-06-25 at 14:19 +0530, Jassi Brar wrote: >> On 25 June 2012 11:50, Tomi Valkeinen wrote: >> > On Sat, 2012-06-23 at 13:36 +0530, jaswinder.si...@linaro.org wrote: >> >> >>  Currenlty HDMI fails to come up in the suspend-resume path.

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Grazvydas Ignotas
On Mon, Jun 25, 2012 at 9:20 AM, Tomi Valkeinen wrote: > On Sat, 2012-06-23 at 13:36 +0530, jaswinder.si...@linaro.org wrote: >> >> Currenlty HDMI fails to come up in the suspend-resume path. >> This patch helps that real-world scenario. > > What is the problem there? It'd be good to explain the

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Tomi Valkeinen
On Mon, 2012-06-25 at 14:19 +0530, Jassi Brar wrote: > On 25 June 2012 11:50, Tomi Valkeinen wrote: > > On Sat, 2012-06-23 at 13:36 +0530, jaswinder.si...@linaro.org wrote: > > >> Currenlty HDMI fails to come up in the suspend-resume path. > >> This patch helps that real-world scenario. > >

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-25 Thread Jassi Brar
On 25 June 2012 11:50, Tomi Valkeinen wrote: > On Sat, 2012-06-23 at 13:36 +0530, jaswinder.si...@linaro.org wrote: >>  Currenlty HDMI fails to come up in the suspend-resume path. >> This patch helps that real-world scenario. > > What is the problem there? It'd be good to explain the problem

Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-24 Thread Tomi Valkeinen
On Sat, 2012-06-23 at 13:36 +0530, jaswinder.si...@linaro.org wrote: > From: Jassi Brar > > If the runtime PM of the device is disabled (for example in resume from > suspend path), it doesn't make sense to attempt pm_runtime_get/put, esp > when their return values affect the control flow path. T

[PATCH] OMAPDSS: Check if RPM enabled before trying to change state

2012-06-23 Thread jaswinder . singh
From: Jassi Brar If the runtime PM of the device is disabled (for example in resume from suspend path), it doesn't make sense to attempt pm_runtime_get/put, esp when their return values affect the control flow path. Signed-off-by: Jassi Brar --- Currenlty HDMI fails to come up in the suspend-