Re: [PATCH] PNP support for i8042 driver

Adam Belay
2004-11-16T05:54:55Z

On Mon, Nov 15, 2004 at 11:52:16PM +0100, matthieu castet wrote:
> Hi,
>
> Dmitry Torokhov wrote:
> >On Mon, 15 Nov 2004 20:51:20 +0100, matthieu castet
> >>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).

They shouldn't be. PnP detection should occur before the system assumes the
location of a device. I realize that it can be difficult given the current
state of many drivers. Still, I think assuming information about a device,
especially if you consider how easy it is to get from ACPI etc., can be
potentially dangerous.

> >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.
> >
> And what happen if you use irq12 for an other stuff and you plug your
> mouse and try to use it. The motherboard hasn't desalocated the irq12
> for mouse, so there will be a big conflict...

I agree. Disabling the device is fine, but we _really_ should disable the
device with the BIOS before assuming a resource is free.

Thanks,
Adam