From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Jassi Brar <jaswinder.singh@linaro.org>
Cc: mythripk@ti.com, linux-omap@vger.kernel.org,
linux-fbdev@vger.kernel.org, andy.green@linaro.org,
n-dechesne@ti.com
Subject: Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state
Date: Wed, 27 Jun 2012 05:58:03 +0000 [thread overview]
Message-ID: <1340776683.1972.41.camel@lappyti> (raw)
In-Reply-To: <CAJe_ZheovnRsJ6opMPkMxwjLSv-OKBPCHu5rsAX_KNz1mb64ZQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2212 bytes --]
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_runtime_enabled()), but handle
> > it. In some rare cases it could be ok to get -EACCES, but that's a
> > special case, not standard.
> >
> You are mixing up generic concepts with what we have in omapdss.
> Believe me, I do understand it's bad to proceed without caring for
> returned _errors_.
> The way omapdss is organized -EACCESS is _not_ an error, it just
> denotes PM is disabled on the device and that DISPC is in RPM_ACTIVE
> is backed by the fact that HDMI always hold a reference between
> resume-suspend and DISPC goes to suspend last and resume first.
I'm not arguing that your solution would not work with the omapdss code
we have now, and presuming the underlying frameworks work fine. But I
want omapdss to have code that works also in the future, when other
parts of omapdss change.
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.
When we call, for example, dispc_runtime_get(), we normally expect that
runtime PM is enabled, and it 1) "gets" it, increasing the use count,
and 2) makes sure the HW is enabled so it can be used. Your patch breaks
both of these if runtime PM is disabled.
Sure, in the current omapdss neither is a breaking problem, because 1)
the matching dispc_runtime_put() is called also with runtime PM
disabled, and thus we don't decrease the use count, and 2) the HW
happens to be already enabled. But that's just by "luck", and tomorrow
omapdss could be different.
If, for some reason, we need to call dispc_runtime_get/put during
suspend, the caller should either 1) realize that we're suspending,
runtime PM is disabled, but the HW is anyway enabled, and thus skip
calling both get and put, or 2) call both get and put, but handle the
-EACCES, understanding what it means and knowing the HW is anyway
enabled.
Tomi
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-06-27 5:58 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-23 8:18 [PATCH] OMAPDSS: Check if RPM enabled before trying to change state jaswinder.singh
2012-06-25 6:20 ` Tomi Valkeinen
2012-06-25 8:53 ` Jassi Brar
2012-06-25 9:30 ` Tomi Valkeinen
2012-06-25 12:39 ` Jassi Brar
2012-06-25 12:41 ` Tomi Valkeinen
2012-06-25 13:43 ` Jassi Brar
2012-06-25 13:49 ` Tomi Valkeinen
2012-06-25 17:18 ` Jassi Brar
2012-06-26 7:19 ` Tomi Valkeinen
2012-06-26 8:44 ` Jassi Brar
2012-06-26 8:40 ` Andy Green
2012-06-26 9:07 ` Tomi Valkeinen
2012-06-26 10:09 ` Jassi Brar
2012-06-26 12:03 ` Tomi Valkeinen
2012-06-26 14:52 ` Jassi Brar
2012-06-26 15:08 ` Tomi Valkeinen
2012-06-26 15:21 ` Jassi Brar
2012-06-26 15:11 ` Tomi Valkeinen
2012-06-26 17:13 ` Jassi Brar
2012-06-26 18:44 ` Tomi Valkeinen
2012-06-27 4:54 ` Jassi Brar
2012-06-27 5:58 ` Tomi Valkeinen [this message]
2012-06-27 7:53 ` Jassi Brar
2012-06-27 8:13 ` Tomi Valkeinen
2012-06-27 14:56 ` Jassi Brar
2012-06-28 6:41 ` Tomi Valkeinen
2012-06-28 7:58 ` Jassi Brar
2012-06-28 7:58 ` Tomi Valkeinen
2012-06-25 12:05 ` Grazvydas Ignotas
2012-06-25 12:30 ` Tomi Valkeinen
2012-06-25 12:54 ` Rajendra Nayak
2012-06-25 12:50 ` Tomi Valkeinen
2012-06-26 4:55 ` Rajendra Nayak
2012-06-26 13:02 ` Grazvydas Ignotas
2012-06-26 14:34 ` Alan Stern
2012-06-26 15:01 ` Tomi Valkeinen
2012-06-26 15:11 ` Alan Stern
2012-06-25 12:45 ` Jassi Brar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1340776683.1972.41.camel@lappyti \
--to=tomi.valkeinen@ti.com \
--cc=andy.green@linaro.org \
--cc=jaswinder.singh@linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mythripk@ti.com \
--cc=n-dechesne@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).