2006-09-18 20:01:37

by linas

[permalink] [raw]
Subject: [PATCH] please include in 2.6.18: e100 disable device on PCI error


Hi,

Please apply the following one-liner patch to
what will become the stable 2.6.18. This patch is
low-risk because it affects only the PCI error
recovery code, which dosn't run on most platforms
(in particular, isn't invoked on current x86/ia64).

This patch was originally sent on 29 June 2006
to fix a bug that showed up in an -mm build.
The code from -mm made it into mainline, but
this patch did not, and so we're unhappy. :-(

Here's the original patch description:

A recent patch in -mm3 titled
gregkh-pci-pci-don-t-enable-device-if-already-enabled.patch
causes pci_enable_device() to be a no-op if the kernel thinks
that the device is already enabled. This change breaks the
PCI error recovery mechanism in the e100 device driver, since,
after PCI slot reset, the card is no longer enabled. This is
a trivial fix for this problem. Tested.

Signed-off-by: Linas Vepstas <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Auke Kok <[email protected]>

----
drivers/net/e100.c | 1 +
1 file changed, 1 insertion(+)

Index: linux-2.6.18-rc7-git1/drivers/net/e100.c
===================================================================
--- linux-2.6.18-rc7-git1.orig/drivers/net/e100.c 2006-09-18 14:21:49.000000000 -0500
+++ linux-2.6.18-rc7-git1/drivers/net/e100.c 2006-09-18 14:24:50.000000000 -0500
@@ -2799,6 +2799,7 @@ static pci_ers_result_t e100_io_error_de
/* Detach; put netif into state similar to hotplug unplug. */
netif_poll_enable(netdev);
netif_device_detach(netdev);
+ pci_disable_device(pdev);

/* Request a slot reset. */
return PCI_ERS_RESULT_NEED_RESET;


2006-09-18 20:21:51

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] please include in 2.6.18: e100 disable device on PCI error

On Mon, 18 Sep 2006 15:01:22 -0500
[email protected] (Linas Vepstas) wrote:

>
> Hi,
>
> Please apply the following one-liner patch to
> what will become the stable 2.6.18. This patch is
> low-risk because it affects only the PCI error
> recovery code, which dosn't run on most platforms
> (in particular, isn't invoked on current x86/ia64).
>
> This patch was originally sent on 29 June 2006
> to fix a bug that showed up in an -mm build.
> The code from -mm made it into mainline, but
> this patch did not, and so we're unhappy. :-(
>
> Here's the original patch description:
>
> A recent patch in -mm3 titled
> gregkh-pci-pci-don-t-enable-device-if-already-enabled.patch
> causes pci_enable_device() to be a no-op if the kernel thinks
> that the device is already enabled. This change breaks the
> PCI error recovery mechanism in the e100 device driver, since,
> after PCI slot reset, the card is no longer enabled. This is
> a trivial fix for this problem. Tested.
>
> Signed-off-by: Linas Vepstas <[email protected]>
> Signed-off-by: Andrew Morton <[email protected]>
> Signed-off-by: Auke Kok <[email protected]>
>
> ----
> drivers/net/e100.c | 1 +
> 1 file changed, 1 insertion(+)
>
> Index: linux-2.6.18-rc7-git1/drivers/net/e100.c
> ===================================================================
> --- linux-2.6.18-rc7-git1.orig/drivers/net/e100.c 2006-09-18 14:21:49.000000000 -0500
> +++ linux-2.6.18-rc7-git1/drivers/net/e100.c 2006-09-18 14:24:50.000000000 -0500
> @@ -2799,6 +2799,7 @@ static pci_ers_result_t e100_io_error_de
> /* Detach; put netif into state similar to hotplug unplug. */
> netif_poll_enable(netdev);
> netif_device_detach(netdev);
> + pci_disable_device(pdev);
>
> /* Request a slot reset. */
> return PCI_ERS_RESULT_NEED_RESET;

hm. I don't have this patch queued, but I _do_ have an equivalent patch
for e1000 queued; what's up with that? Nobody seems to have paid much
attention to the e1000 fix.

If we can gather the appropriate acks quickly then I expect we can get both
of these into 2.6.18.

2006-09-18 20:53:41

by Kok, Auke

[permalink] [raw]
Subject: Re: [PATCH] please include in 2.6.18: e100 disable device on PCI error

Andrew Morton wrote:
> On Mon, 18 Sep 2006 15:01:22 -0500
> [email protected] (Linas Vepstas) wrote:
>
>> Hi,
>>
>> Please apply the following one-liner patch to
>> what will become the stable 2.6.18. This patch is
>> low-risk because it affects only the PCI error
>> recovery code, which dosn't run on most platforms
>> (in particular, isn't invoked on current x86/ia64).
>>
>> This patch was originally sent on 29 June 2006
>> to fix a bug that showed up in an -mm build.
>> The code from -mm made it into mainline, but
>> this patch did not, and so we're unhappy. :-(
>>
>> Here's the original patch description:
>>
>> A recent patch in -mm3 titled
>> gregkh-pci-pci-don-t-enable-device-if-already-enabled.patch
>> causes pci_enable_device() to be a no-op if the kernel thinks
>> that the device is already enabled. This change breaks the
>> PCI error recovery mechanism in the e100 device driver, since,
>> after PCI slot reset, the card is no longer enabled. This is
>> a trivial fix for this problem. Tested.
>>
>> Signed-off-by: Linas Vepstas <[email protected]>
>> Signed-off-by: Andrew Morton <[email protected]>
>> Signed-off-by: Auke Kok <[email protected]>
>>
>> ----
>> drivers/net/e100.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> Index: linux-2.6.18-rc7-git1/drivers/net/e100.c
>> ===================================================================
>> --- linux-2.6.18-rc7-git1.orig/drivers/net/e100.c 2006-09-18 14:21:49.000000000 -0500
>> +++ linux-2.6.18-rc7-git1/drivers/net/e100.c 2006-09-18 14:24:50.000000000 -0500
>> @@ -2799,6 +2799,7 @@ static pci_ers_result_t e100_io_error_de
>> /* Detach; put netif into state similar to hotplug unplug. */
>> netif_poll_enable(netdev);
>> netif_device_detach(netdev);
>> + pci_disable_device(pdev);
>>
>> /* Request a slot reset. */
>> return PCI_ERS_RESULT_NEED_RESET;
>
> hm. I don't have this patch queued, but I _do_ have an equivalent patch
> for e1000 queued; what's up with that? Nobody seems to have paid much
> attention to the e1000 fix.
>
> If we can gather the appropriate acks quickly then I expect we can get both
> of these into 2.6.18.

Ack! for both, of course.

I'm unsure what happened here, as I have this patch in my local tree. I suspect
that it got merged into jeff's #upstream only somehow.

Auke

2006-09-18 21:09:48

by linas

[permalink] [raw]
Subject: Re: [PATCH] please include in 2.6.18: e100 disable device on PCI error


It seems our mails crossed.

On Mon, Sep 18, 2006 at 01:21:02PM -0700, Andrew Morton wrote:
>
> hm. I don't have this patch queued, but I _do_ have an equivalent patch
> for e1000 queued; what's up with that? Nobody seems to have paid much
> attention to the e1000 fix.

I spotted the e100 patch in your "broken-out" patches earlier today,
as a part of "git-netdev-all.patch" (where it had the right changelog
and old acks)

> If we can gather the appropriate acks quickly then I expect we can get both
> of these into 2.6.18.

That would be great! Thanks.

--linas