linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Matt Sealey <matt@genesi-usa.com>
Cc: ppc-dev <linuxppc-dev@ozlabs.org>, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 1/2] pseries: device node status can be "ok" or "okay"
Date: Fri, 10 Aug 2007 22:17:12 +0200	[thread overview]
Message-ID: <3dac7a58ee7157ef97379a0d05274262@kernel.crashing.org> (raw)
In-Reply-To: <46BCBB2C.2040408@genesi-usa.com>

>>> 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

      reply	other threads:[~2007-08-10 20:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-09 23:27 [PATCH 1/2] pseries: device node status can be "ok" or "okay" Linas Vepstas
2007-08-09 23:28 ` [PATCH 2/2] pseries: remove dead eeh video code Linas Vepstas
2007-08-10 18:06 ` [PATCH 1/2] pseries: device node status can be "ok" or "okay" Segher Boessenkool
2007-08-10 19:23   ` Matt Sealey
2007-08-10 20:17     ` Segher Boessenkool [this message]

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=3dac7a58ee7157ef97379a0d05274262@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=matt@genesi-usa.com \
    --cc=paulus@samba.org \
    /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;
as well as URLs for NNTP newsgroup(s).