2000-11-20 00:05:10

by Tim Waugh

[permalink] [raw]
Subject: 2.4.0-test11-pre7: isapnp hang

Reading from port 0x313 (my ISA NE2000 is at 0x300-0x31f) hangs my
machine dead. Unfortunately, reading from that port is exactly what
the isapnp code does on boot, if compiled into the kernel.

Is it the network card's fault (probably), or is there a less invasive
probe that isapnp could use (unlikely, I guess)?

Tim.
*/


Attachments:
(No filename) (325.00 B)
(No filename) (232.00 B)
Download all attachments

2000-11-20 00:38:54

by Alan Cox

[permalink] [raw]
Subject: Re: 2.4.0-test11-pre7: isapnp hang

> Reading from port 0x313 (my ISA NE2000 is at 0x300-0x31f) hangs my
> machine dead. Unfortunately, reading from that port is exactly what
> the isapnp code does on boot, if compiled into the kernel.
>
> Is it the network card's fault (probably), or is there a less invasive
> probe that isapnp could use (unlikely, I guess)?


That shouldnt be possible - we are supposed to start at 0x203 and skip the
problem area.


static int isapnp_next_rdp(void)
{
int rdp = isapnp_rdp;
while (rdp <= 0x3ff) {
if (!check_region(rdp, 1)) {
isapnp_rdp = rdp;
return 0;
}
rdp += RDP_STEP;
/*
* We cannot use NE2000 probe spaces for ISAPnP or we
* will lock up machines.
*/
if(rdp >= 0x280 && rdp <= 0x380)
continue;
}
return -1;
}

If you can find out why that port is being touched I'd like to know

2000-11-20 00:49:25

by Alan Cox

[permalink] [raw]
Subject: Re: 2.4.0-test11-pre7: isapnp hang

> > Is it the network card's fault (probably), or is there a less invasive
> > probe that isapnp could use (unlikely, I guess)?
>
>
> That shouldnt be possible - we are supposed to start at 0x203 and skip the
> problem area.

And a quick read of the code I pasted instead of just pasting suggests instead
we should be using the patch below. Question however is who stole port 0x279
which is the normal port to use. It shouldnt be lp since lp is supposed to
init after pnp.

--- drivers/pnp/isapnp.c.old Tue Oct 31 20:29:59 2000
+++ drivers/pnp/isapnp.c Sun Nov 19 23:43:15 2000
@@ -270,17 +270,16 @@
{
int rdp = isapnp_rdp;
while (rdp <= 0x3ff) {
- if (!check_region(rdp, 1)) {
- isapnp_rdp = rdp;
- return 0;
- }
- rdp += RDP_STEP;
/*
* We cannot use NE2000 probe spaces for ISAPnP or we
* will lock up machines.
*/
- if(rdp >= 0x280 && rdp <= 0x380)
- continue;
+ if ((rdp < 0x280 || rdp > 0x380) && !check_region(rdp, 1))
+ {
+ isapnp_rdp = rdp;
+ return 0;
+ }
+ rdp += RDP_STEP;
}
return -1;
}

2000-11-20 01:03:21

by H. Peter Anvin

[permalink] [raw]
Subject: Re: 2.4.0-test11-pre7: isapnp hang

Followup to: <[email protected]>
By author: Tim Waugh <[email protected]>
In newsgroup: linux.dev.kernel
>
> Reading from port 0x313 (my ISA NE2000 is at 0x300-0x31f) hangs my
> machine dead. Unfortunately, reading from that port is exactly what
> the isapnp code does on boot, if compiled into the kernel.
>
> Is it the network card's fault (probably), or is there a less invasive
> probe that isapnp could use (unlikely, I guess)?
>

Try reserving ports 0x300-0x31f on the kernel command line
("reserve=0x300,0x20").

I'm surprised isapnp uses a port in such a commonly used range,
though.

-hpa
--
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt

2000-11-20 01:37:13

by Alan Cox

[permalink] [raw]
Subject: Re: 2.4.0-test11-pre7: isapnp hang

> Try reserving ports 0x300-0x31f on the kernel command line
> ("reserve=0x300,0x20").
>
> I'm surprised isapnp uses a port in such a commonly used range,
> though.

It seems to be a combination of two bugs. The one I posted a patch for and
something odd that is taking port 0x279 before the pnp probe is run, which
suggests a link order issue. Although in truth _nobody_ should be claing
that anyway

2000-11-20 01:53:07

by H. Peter Anvin

[permalink] [raw]
Subject: Re: 2.4.0-test11-pre7: isapnp hang

Followup to: <[email protected]>
By author: Alan Cox <[email protected]>
In newsgroup: linux.dev.kernel
>
> > Try reserving ports 0x300-0x31f on the kernel command line
> > ("reserve=0x300,0x20").
> >
> > I'm surprised isapnp uses a port in such a commonly used range,
> > though.
>
> It seems to be a combination of two bugs. The one I posted a patch for and
> something odd that is taking port 0x279 before the pnp probe is run, which
> suggests a link order issue. Although in truth _nobody_ should be claing
> that anyway
>

It seems to me that it would be better to initialize all the (non-PnP)
ISA cards first, and have them claim their preferred ranges. Now you
can pick the PnP isolate port out of what is left, and also have a
much better idea of what is available.

-hpa
--
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt

2000-11-20 09:54:01

by Tim Waugh

[permalink] [raw]
Subject: Re: 2.4.0-test11-pre7: isapnp hang

On Mon, Nov 20, 2000 at 12:19:43AM +0000, Alan Cox wrote:

> And a quick read of the code I pasted instead of just pasting
> suggests instead we should be using the patch below. Question
> however is who stole port 0x279 which is the normal port to use. It
> shouldnt be lp since lp is supposed to init after pnp.

Your patch fixes the problem (of course). lp is not compiled into the
kernel (nor is parport), and after boot /proc/ioports shows:

[...]
01f0-01f7 : ide0
02e8-02ef : serial(auto)
[...]

Tim.
*/

2000-11-20 13:16:00

by Alan Cox

[permalink] [raw]
Subject: Re: 2.4.0-test11-pre7: isapnp hang

> It seems to me that it would be better to initialize all the (non-PnP)
> ISA cards first, and have them claim their preferred ranges. Now you
> can pick the PnP isolate port out of what is left, and also have a
> much better idea of what is available.

Post 2.4 only. It means re-architecting all the ISA probes so that they don't
mix the PnP and non PnP probes. I suspect implementing a copy of the PCI
hot swap API would be the simplest