Re: [PATCH] PNP support for i8042 driver

Dmitry Torokhov
2004-11-15T20:29:06Z

On Mon, 15 Nov 2004 20:51:20 +0100, matthieu castet
<castet.matthieu@free.fr> wrote:
> Dmitry Torokhov wrote:
> > Is it possible to leave the device in enabled state or enable device
> > after unloading the driver with PNP?
> Yes you could do a very ugly hack : set pnp_can_disable(dev) to 0 before
> unregister. With that the device won't be disabled (no resource
> desalocation), but the device will be mark as not active in pnp layer.
>

I'd like to release resoures al well (interrupts only really, as ports are
always reserved by the system even before PNP is initialized).

> > All we need from PNP layer
> > for i8042 is to verify presence of the KBC, we don't need resource
> > management.The ports range is already marked as reserved, IRQ
> > will be requested if needed...
> >
> I don't agree at all :
> - the pci layer allow you to find the device like pnp layer, then you
> register resource with request_region or equivalent. Do we need to do
> the same for all pci drivers?

While PCI devices can be very flexible i8042 is extremely rigid. Its
resources are pretty much fixed and will not move. Its IO port region
is reserved by the kernel right off the bat and is not available to anyone
including PNP subsystem to ensure that nothing will touch it or bad
things might happen.

> - actually the resources are registered in the kernel, but not in the
> bios, why some strange bios can allow to use irq 12 to an other device
> if it isn't used ?

I think you need to make an effort to make a PCI device use IRQ12
but the idea is that if you don't have a mouse attached (but you do
have i8042) and you are short on free interrupts and your HW can
use IRQ12 for some other stuff let it have it. That is the reqson why
i8042 requests IRQ only when corresponding port is open. No mouse -
IRQ is free.

> - Do you save lot's of memory with __init/__initdata ? The pnp code is
> quite small.
>

Well it is not needed one i8042 has been initialized at all so why
keep it? Even if it saves 1K it is good enough.

--
Dmitry