Re: [PATCH 01/18] char: moxa: call disable_pci_device() ifpci_probe() failed

From: Dan Carpenter
Date: Sat Aug 07 2010 - 15:09:30 EST


On Sat, Aug 07, 2010 at 10:02:52PM +0400, Vasiliy Kulikov wrote:
>
> The thing is not in that pci_enable_device() is nestable, but in that
> some buggy non-mainline drivers may not use PCI api, but use
> request_*(). In this case PCI bus doesn't see this driver and tries to
> call mainline driver probe(). It sees that resources are already
> grabbed. The only reason can be another driver that rules this device
> (or our kernel is crazy). As we are robust driver we don't want to break
> this buggy third party driver :-)
>

What Jeff Garzik was saying in those days if two people called
pci_enable_device() it wasn't a problem, but if one person then called
pci_disable_device() the other person who still wanted it enabled was
screwed. That model was "*first* person out of the building lock the
door."

That was half a decade ago though. The fix that Jeff proposed wasn't
really a good one because there is no way people would get that right.
None of that applies any more. These days we just call enable when we
want it enabled and disable when we are done. All the dependencies are
handled for us.

In fact, if we try to use the old hacks and work arounds, that will cause
bugs in the new code...

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/