Re: PNP parallel&serial ports: module reload fails (2.6.11)?

Michael Tokarev
2005-06-09T21:08:26Z

Adam Belay wrote:
> On Thu, Jun 09, 2005 at 12:29:25AM +0400, Michael Tokarev wrote:
>
>>Adam Belay wrote:
>>[]
>>
>>>>>>[ it's in http://www.corpit.ru/mjt/hpml310.dsdt - apache ships it
>>>>>>as Content-Type: text/plain, for some reason. I grabbed iasl
>>>>>>and converted that stuff into .dsls, available at:
>>>>>>http://www.corpit.ru/mjt/hpml310.dsl and
>>>>>>http://www.corpit.ru/mjt/hpml150.dsl ]
[]
>>>1.) a complete dmesg after initial boot with the patch
>>>2.) kernel message output after "rmmod parport_pc" and "modprobe
>>>parport_pc" with the patch

Hello again. This whole conversation seems to be a bit...
slow, probably due to $TZ differences and the fact that
I can do experiments only at evenings, because the test
machine (and non-test one too) are busy during work hours.

Adam, I built 2.6.12-rc6 with your last patch, and tried it on
both ML150 and ML310 machines. And in both cases, the whole
thing worked.

Dmesg from HPML150:

[modprobe parport_pc]
parport: PnPBIOS parport detected.
parport0: PC-style at 0x378, irq 7 [PCSPP]
[rmmod parport_pc]
pnp: Device 00:07 disabled.
[modprobe parport_pc]
pnp: building resource template
pnp: encoding resources
pnp: attempting to fix irq flags
bug squashed - dma
pnp: setting resources
pnp: _SRS worked correctly
pnp: Device 00:07 activated.
parport: PnPBIOS parport detected.
parport0: PC-style at 0x378, irq 7 [PCSPP]

The same applies to 8250_pnp module:

[modprobe 8250_pnp]
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[rmmod 8250_pnp]
pnp: Device 00:06 disabled.
[modprobe 8250_pnp]
pnp: building resource template
pnp: encoding resources
pnp: attempting to fix irq flags
bug squashed - dma
pnp: setting resources
pnp: _SRS worked correctly
pnp: Device 00:06 activated.
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

And HP ML 310 box:

[modprobe parport_pc]
parport: PnPBIOS parport detected.
parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE]
[rmmod parport_pc]
pnp: Device 00:06 disabled.
[modprobe parport_pc]
pnp: building resource template
pnp: encoding resources
pnp: attempting to fix irq flags
pnp: setting resources
pnp: _SRS worked correctly
pnp: Device 00:06 activated.
parport: PnPBIOS parport detected.
parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE]

[modprobe 8250_pnp]
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[rmmod 8250_pnp]
pnp: Device 00:07 disabled.
pnp: Device 00:08 disabled.
[modprobe 8250_pnp]
pnp: building resource template
pnp: encoding resources
pnp: attempting to fix irq flags
pnp: setting resources
pnp: _SRS worked correctly
pnp: Device 00:07 activated.
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
pnp: building resource template
pnp: encoding resources
pnp: attempting to fix irq flags
pnp: setting resources
pnp: _SRS worked correctly
pnp: Device 00:08 activated.
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A

There are two questions still.

First of all, why disable the device on module unload?
If it was enabled initially, before any module has been
loaded, why it needs to be disabled, why not leave it
enabled and all, just like it has been before?

And this 8250 vs 8250_pnp (and 8250_pci etc, but
especially 8250_pnp as it is the most interesting one).
When loading 8250 alone (note that 8250_pnp depends
on 8250, so 8250 gets loaded first), it detects standard
serial port(s) just fine. 8250_pnp "redetects" them again
(see first `modprobe 8250_pnp' above: each ttySN line
gets repeated twice). But when unloading 8250_pnp, both
standard ttySNs are deactivated, even when 8250 is still
here. More, when unloading both 8250_pnp and 8250, and
loading *only* 8250 after that, no standard ports gets
detected until 8250_pnp will be loaded (as the devices
are disabled, and 8250_pnp re-enables them). Ie, this
whole stuff does not look right. Probably a nitpicking,
but a bit.. strange. Probably if 8250_pnp will stop
deactivating the devices (as per above), everything will
look ok here too. Or, maybe it's a good idea to just
combine 8250 and 8250_pnp modules (and maybe 8250_serial
too), esp, since the latter is very small anyway ?

Thank you!

/mjt