[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B0A8245.6020506@linux.vnet.ibm.com>
Date: Mon, 23 Nov 2009 10:38:29 -0200
From: Breno Leitao <leitao@...ux.vnet.ibm.com>
To: "Rafael J. Wysocki" <rjw@...k.pl>
CC: Ben Hutchings <bhutchings@...arflare.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux PCI <linux-pci@...r.kernel.org>,
Jesse Barnes <jbarnes@...tuousgeek.org>,
linux-net-drivers@...arflare.com
Subject: Re: PCI: pci_restore_state() is returning 0 when it fails
Hi Rafael,
I didn't hear back after the analysis that there is no regression
after this patch. Did you have a chance to think about this patch ?
Thanks
Breno
Ben Hutchings wrote:
> 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.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists