Re: [PATCH] Support for PCI Express reset type in EEH
From: Linas Vepstas <linasvepstas@gmail.com>
Date: 2009-07-23 14:44:38
2009/7/15 Mike Mason [off-list ref]:
By default, EEH does what's known as a "hot reset" during error recovery =
of
a PCI Express device. =C2=A0We've found a case where the device needs a "fundamental reset" to recover properly. =C2=A0The current PCI error reco=
very and
EEH frameworks do not support this distinction. The attached patch (courtesy of Richard Lary) adds a bit field to pci_dev that indicates whether the device requires a fundamental reset during err=
or
recovery. =C2=A0This bit can be checked by EEH to determine which reset t=
ype is
required. This patch supersedes the previously submitted patch that implemented a reset type callback. Please review and let me know of any concerns.
I like this patch a *lot* better .. it is vastly simpler, more direct.
quoted hunk ↗ jump to hunk
diff -uNrp a/include/linux/pci.h b/include/linux/pci.h--- a/include/linux/pci.h =C2=A0 =C2=A0 =C2=A0 2009-07-13 14:25:37.000000=
000 -0700
quoted hunk ↗ jump to hunk
+++ b/include/linux/pci.h =C2=A0 =C2=A0 =C2=A0 2009-07-15 10:25:37.000000=
000 -0700
quoted hunk ↗ jump to hunk
@@ -273,6 +273,7 @@ struct pci_dev {=C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int =C2=A0 =C2=A0ari_enabled:1; =C2=
=A0/* ARI forwarding */
=C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int =C2=A0 =C2=A0is_managed:1; =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int =C2=A0 =C2=A0is_pcie:1; + =C2=A0 =C2=A0 =C2=A0 unsigned int =C2=A0 =C2=A0fndmntl_rst_rqd:1; /* De=
v requires fundamental reset
*/ =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int =C2=A0 =C2=A0state_saved:1; =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int =C2=A0 =C2=A0is_physfn:1; =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int =C2=A0 =C2=A0is_virtfn:1;
As Ben points out, the name is awkward. How about needs_freset ? Since this affects the entire pci subsystem, it should be documented properly. The "pci error recovery" subsystem was designed to be usable in other architectures, and so the error recovery docs should take at least a paragraph to describe what this flag means, and when its supposed to be used. Providing the docs patch together with the pci.h patch *only* would probably simplify acceptance by the PCI community. --linas