* error returns of pm_runtime_get()
@ 2014-09-05 12:43 Oliver Neukum
2014-09-05 23:42 ` Rafael J. Wysocki
0 siblings, 1 reply; 5+ messages in thread
From: Oliver Neukum @ 2014-09-05 12:43 UTC (permalink / raw)
To: linux-pm; +Cc: Rafael J. Wysocki, Alan Stern
Hi,
looking through multiple drivers it seems to me that a great majority
is returning the error returns of pm_runtime_get() to user space.
They come quite directly from rpm_resume(). So we are led to return
things like -EACCESS or -EINVAL from system calls like open()
where they have no place.
So it seems to me like we should filter more or less like this:
-EBUSY -> -EBUSY
-ENOMEM -> -ENOMEM
-EINPROGRES -> -EAGAIN
any other error -> -EIO
And it would be best to retain the current name of pm_runtime_get()
and introduce a version with unfiltered error codes.
What do you think?
Regards
Oliver
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: error returns of pm_runtime_get()
2014-09-05 12:43 error returns of pm_runtime_get() Oliver Neukum
@ 2014-09-05 23:42 ` Rafael J. Wysocki
2014-09-10 13:04 ` Oliver Neukum
0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2014-09-05 23:42 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-pm, Rafael J. Wysocki, Alan Stern
On Friday, September 05, 2014 02:43:36 PM Oliver Neukum wrote:
>
> Hi,
>
> looking through multiple drivers it seems to me that a great majority
> is returning the error returns of pm_runtime_get() to user space.
> They come quite directly from rpm_resume(). So we are led to return
> things like -EACCESS or -EINVAL from system calls like open()
> where they have no place.
Aren't those driver bugs?
> So it seems to me like we should filter more or less like this:
>
> -EBUSY -> -EBUSY
> -ENOMEM -> -ENOMEM
> -EINPROGRES -> -EAGAIN
> any other error -> -EIO
>
> And it would be best to retain the current name of pm_runtime_get()
> and introduce a version with unfiltered error codes.
> What do you think?
It doesn't sound right to me. I may be tired at the moment, but I'm not sure
what the point would be.
Rafael
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: error returns of pm_runtime_get()
2014-09-05 23:42 ` Rafael J. Wysocki
@ 2014-09-10 13:04 ` Oliver Neukum
2014-09-11 0:03 ` Rafael J. Wysocki
0 siblings, 1 reply; 5+ messages in thread
From: Oliver Neukum @ 2014-09-10 13:04 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-pm, Rafael J. Wysocki, Alan Stern
On Sat, 2014-09-06 at 01:42 +0200, Rafael J. Wysocki wrote:
> On Friday, September 05, 2014 02:43:36 PM Oliver Neukum wrote:
> >
> > Hi,
> >
> > looking through multiple drivers it seems to me that a great majority
> > is returning the error returns of pm_runtime_get() to user space.
> > They come quite directly from rpm_resume(). So we are led to return
> > things like -EACCESS or -EINVAL from system calls like open()
> > where they have no place.
>
> Aren't those driver bugs?
Sure, but almost all drivers using runtime PM are affected.
> > So it seems to me like we should filter more or less like this:
> >
> > -EBUSY -> -EBUSY
> > -ENOMEM -> -ENOMEM
> > -EINPROGRES -> -EAGAIN
> > any other error -> -EIO
> >
> > And it would be best to retain the current name of pm_runtime_get()
> > and introduce a version with unfiltered error codes.
> > What do you think?
>
> It doesn't sound right to me. I may be tired at the moment, but I'm not sure
> what the point would be.
The alternative is to make a conversion helper and to go through all
drivers. Not nice, but if necessary I'll do it.
But we cannot just return things like -EACCESS for internal reasons
while the file permissions are good.
Regards
Oliver
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: error returns of pm_runtime_get()
2014-09-10 13:04 ` Oliver Neukum
@ 2014-09-11 0:03 ` Rafael J. Wysocki
2014-09-11 13:27 ` Oliver Neukum
0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2014-09-11 0:03 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-pm, Rafael J. Wysocki, Alan Stern
On Wednesday, September 10, 2014 03:04:30 PM Oliver Neukum wrote:
> On Sat, 2014-09-06 at 01:42 +0200, Rafael J. Wysocki wrote:
> > On Friday, September 05, 2014 02:43:36 PM Oliver Neukum wrote:
> > >
> > > Hi,
> > >
> > > looking through multiple drivers it seems to me that a great majority
> > > is returning the error returns of pm_runtime_get() to user space.
> > > They come quite directly from rpm_resume(). So we are led to return
> > > things like -EACCESS or -EINVAL from system calls like open()
> > > where they have no place.
> >
> > Aren't those driver bugs?
>
> Sure, but almost all drivers using runtime PM are affected.
Well, what can I say?
> > > So it seems to me like we should filter more or less like this:
> > >
> > > -EBUSY -> -EBUSY
> > > -ENOMEM -> -ENOMEM
> > > -EINPROGRES -> -EAGAIN
> > > any other error -> -EIO
> > >
> > > And it would be best to retain the current name of pm_runtime_get()
> > > and introduce a version with unfiltered error codes.
> > > What do you think?
> >
> > It doesn't sound right to me. I may be tired at the moment, but I'm not sure
> > what the point would be.
>
> The alternative is to make a conversion helper and to go through all
> drivers. Not nice, but if necessary I'll do it.
I honestly would prefer that.
> But we cannot just return things like -EACCESS for internal reasons
> while the file permissions are good.
Sure.
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-09-11 13:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-05 12:43 error returns of pm_runtime_get() Oliver Neukum
2014-09-05 23:42 ` Rafael J. Wysocki
2014-09-10 13:04 ` Oliver Neukum
2014-09-11 0:03 ` Rafael J. Wysocki
2014-09-11 13:27 ` Oliver Neukum
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).