public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: torvalds@transmeta.com (Linus Torvalds)
To: linux-kernel@vger.kernel.org
Subject: Re: simple pnp bios io resources bug makes  system unusable
Date: 2 Jul 2003 17:20:21 GMT	[thread overview]
Message-ID: <1057166421.141082@palladium.transmeta.com> (raw)
In-Reply-To: 20030701223050.GA19402@neo.rr.com

In article <20030701223050.GA19402@neo.rr.com>,
Adam Belay  <ambx1@neo.rr.com> wrote:
>
>The pnpbios is reserving the complete range of every possible
>io port.  This causes device activation to fail for every device
>that needs an io port because that resource will always appear
>busy.

No, I don't think that's what it is doing at all. Quite the reverse, in
fact.

Look:

>On Mon, Jun 30, 2003 at 11:38:17PM -0400, CarlosRomero wrote:
>> 
>> cat /sys/devices/pnp0/00\:0c/resources
>> io 0x00000000-0xffffffff

This means that "io" was zero, but more importantly, it means that "len"
was zero too.

>> fixup: check for null io base, other devices are now able to initialize.
>
>Unfortunatly it's not quite that simple.

It _is_ that simple, but the code should check for "len" being zero, ie
the fix looks like it should be just a simple

	if (!len)
		return;

and that should fix it.

>Below are two examples that both use a base of 0 in a valid way.

Yes, and clearly they don't have "len == 0".

>Currently I'm leaning toward this logic...
>if we have any of the following situations
>- 0x00000000 for base and 0xffffffff for end
>- 0x00000000 for base and 0x00000000 for end
>- 0xffffffff for base and 0xffffffff for end
>then the resource range can be considered disabled.

I would suggest:

 - "len == 0"		=>  obviously disabled (both IO and memory)
 - "end < base"		=>  obviously disabled due to overflow crap
 - "end >= 0x10003"	=>  IO disabled (yeah, non-x86 can have IO above
			    that range in PCI, but I think it's undefined
			    behaviour)

all three should be cases of "obviously we can't validly have such a
resource", and the "len == 0" case should trivially fix the case that
CarlosRomero saw.

			Linus

  reply	other threads:[~2003-07-02 17:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-01  3:38 simple pnp bios io resources bug makes system unusable CarlosRomero
2003-07-01 22:30 ` Adam Belay
2003-07-02 17:20   ` Linus Torvalds [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-07-01  5:54 CarlosRomero
2003-07-01 22:37 ` Adam Belay
2003-07-01  7:30 Shawn Starr
2003-07-01 21:33 Shawn Starr

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=1057166421.141082@palladium.transmeta.com \
    --to=torvalds@transmeta.com \
    --cc=linux-kernel@vger.kernel.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