From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: error returns of pm_runtime_get() Date: Thu, 11 Sep 2014 02:03:21 +0200 Message-ID: <2871114.Byp9HpPsJ7@vostro.rjw.lan> References: <1409921016.9532.15.camel@linux-fkkt.site> <3017868.AFCp3kOadE@vostro.rjw.lan> <1410354270.12706.22.camel@linux-fkkt.site> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7Bit Return-path: Received: from v094114.home.net.pl ([79.96.170.134]:60623 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751190AbaIJXnw (ORCPT ); Wed, 10 Sep 2014 19:43:52 -0400 In-Reply-To: <1410354270.12706.22.camel@linux-fkkt.site> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Oliver Neukum Cc: linux-pm@vger.kernel.org, "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.