From: Ben Hutchings <bhutchings@solarflare.com>
To: Breno Leitao <leitao@linux.vnet.ibm.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux PCI <linux-pci@vger.kernel.org>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
linux-net-drivers@solarflare.com
Subject: Re: PCI: pci_restore_state() is returning 0 when it fails
Date: Mon, 16 Nov 2009 14:49:34 +0000 [thread overview]
Message-ID: <1258382974.2841.23.camel@achroite.uk.solarflarecom.com> (raw)
In-Reply-To: <4B015E0C.9030904@linux.vnet.ibm.com>
On Mon, 2009-11-16 at 12:13 -0200, Breno Leitao wrote:
> Hi Rafael,
>
> Rafael J. Wysocki wrote:
> > On Friday 13 November 2009, Breno Leitao wrote:
> >> Actually pci_restore_state() is returning 0 if the restore process
> >> fails, instead of a error value.
> >>
> >> If it fails, I believe that it should return -EPERM, once that
> >> it is an invalid operation and probably pci_save_state() wasn't
> >> called.
> >
> > I believe this patch will break a number of things.
> Well, I checked it, and found that there are around 10 places that
> really verify the return value for this function, and almost all of them
> do the correct thing, and the patch doesn't seem to break any of them
> except a specific case in the drivers/net/sfc/falcon.c file, that contains:
[...]
> That's because the code is calling pci_restore_state() twice without calling
> pci_save_state() in the middle.
> Since this seems to be the only place that will be broken, and the fix is
> trivial, I believe that the patch can be applied smoothly.
[...]
This code supports two similar PCI devices, one of which has a second
function that is not truly independent. For that chip it saves and
restores both functions' config space. So far as I know, there are no
cases where it fails to match save and restore.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2009-11-16 14:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 17:05 Breno Leitao
2009-11-13 20:08 ` Rafael J. Wysocki
2009-11-16 14:13 ` Breno Leitao
2009-11-16 14:49 ` Ben Hutchings [this message]
2009-11-23 12:38 ` Breno Leitao
2009-11-23 19:29 ` Rafael J. Wysocki
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=1258382974.2841.23.camel@achroite.uk.solarflarecom.com \
--to=bhutchings@solarflare.com \
--cc=jbarnes@virtuousgeek.org \
--cc=leitao@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net-drivers@solarflare.com \
--cc=linux-pci@vger.kernel.org \
--cc=rjw@sisk.pl \
/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
all inboxes | Powered by JetHome®