It seems that some versions of firmware will report a device
node status as the string "okay". As we are not expecting this
string, the device node will be ignored by the EEH subsystem.
Which means EEH will not be enabled.
When EEH is not enabled, PCI errors will be converted into
Machine Check exceptions, and we'll have a very unhappy system.
Signed-off-by: Linas Vepstas <redacted>
----
Paul,
This is a bug with serious reprecussions ... but appearently
affects only a few systems, so far. I've never seen it before.
Your pick as to whether to jam this into 2.6.23 or wait until
later.
--linas
arch/powerpc/platforms/pseries/eeh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6.22-git2/arch/powerpc/platforms/pseries/eeh.c
===================================================================
@@ -955,7 +955,7 @@ static void *early_enable_eeh(struct devpdn->eeh_freeze_count=0;pdn->eeh_false_positives=0;-if(status&&strcmp(status,"ok")!=0)+if(status&&strncmp(status,"ok",2)!=0)returnNULL;/* ignore devices with bad status *//* Ignore bad nodes. */
Remove dead code, and a misleading comment about EEH checking
for video devices. The removed code is a left-over from the
olden days where there was concern over how video devices
worked in Linux. We are never going to go that way again,
so kill this.
Signed-off-by: Linas Vepstas <redacted>
----
arch/powerpc/platforms/pseries/eeh.c | 17 -----------------
1 file changed, 17 deletions(-)
Index: linux-2.6.22-git2/arch/powerpc/platforms/pseries/eeh.c
===================================================================
@@ -969,23 +969,6 @@ static void *early_enable_eeh(struct dev}pdn->class_code=*class_code;-/*-*Nowdecideifwearegoingto"Disable"EEHchecking-*forthisdevice.WestillrunwiththeEEHhardwareactive,-*butwewon'tbecheckingforff's.Thismeansadriver-*couldreturnbaddata(verybad!),aninterrupthandlercould-*hangwaitingonstatusbitsthatwon'tchange,etc.-*Butthereareafewcaseslikedisplaydevicesthatmakesense.-*/-enable=1;/* i.e. we will do checking */-#if 0-if((*class_code>>16)==PCI_BASE_CLASS_DISPLAY)-enable=0;-#endif--if(!enable)-pdn->eeh_mode|=EEH_MODE_NOCHECK;-/* Ok... see if this device supports EEH. Some do, some don't,*andtheonlywaytofindoutistocheckeachandeveryone.*/regs=of_get_property(dn,"reg",NULL);
It seems that some versions of firmware will report a device
node status as the string "okay". As we are not expecting this
string, the device node will be ignored by the EEH subsystem.
Which means EEH will not be enabled.
When EEH is not enabled, PCI errors will be converted into
Machine Check exceptions, and we'll have a very unhappy system.
- if (status && strcmp(status, "ok") != 0)
+ if (status && strncmp(status, "ok", 2) != 0)
return NULL; /* ignore devices with bad status */
Shouldn't you check for the two literal strings, instead of
only matching the common prefix? Seems safer.
Segher
From: Matt Sealey <hidden> Date: 2007-08-10 19:22:13
Segher Boessenkool wrote:
quoted
It seems that some versions of firmware will report a device
node status as the string "okay". As we are not expecting this
string, the device node will be ignored by the EEH subsystem.
Which means EEH will not be enabled.
When EEH is not enabled, PCI errors will be converted into
Machine Check exceptions, and we'll have a very unhappy system.
quoted
- if (status && strcmp(status, "ok") != 0)
+ if (status && strncmp(status, "ok", 2) != 0)
return NULL; /* ignore devices with bad status */
Shouldn't you check for the two literal strings, instead of
only matching the common prefix? Seems safer.
What are the chances that the status string is "oklahoma" or
"okeechobee" or "okinawa"?
--
Matt Sealey [off-list ref]
Genesi, Manager, Developer Relations
It seems that some versions of firmware will report a device
node status as the string "okay". As we are not expecting this
string, the device node will be ignored by the EEH subsystem.
Which means EEH will not be enabled.
When EEH is not enabled, PCI errors will be converted into
Machine Check exceptions, and we'll have a very unhappy system.
- if (status && strcmp(status, "ok") != 0)
+ if (status && strncmp(status, "ok", 2) != 0)
return NULL; /* ignore devices with bad status */
Shouldn't you check for the two literal strings, instead of
only matching the common prefix? Seems safer.
What are the chances that the status string is "oklahoma" or
"okeechobee" or "okinawa"?
What does it matter what the chances are? The code is either
correct or not ;-)
Besides, that's only part of the problem -- what if the
property is empty, or contains an empty string only, or
a single non-zero byte?
Segher