Re: test12-pre6

From: Johannes Erdfelt (jerdfelt@valinux.com)
Date: Wed Dec 06 2000 - 18:10:06 EST


On Wed, Dec 06, 2000, Miles Lane <miles@megapathdsl.net> wrote:
> Hmm. Your patch doesn't test whether pci_enable_device(dev)
> was successful, does it?

Umm, it does. If pci_enable_device wasn't successful, it returns -ENODEV.

Your patch below calls pci_set_master if enabling the device fails and
then ignores the device.

Is that what you meant?

JE

> I think what you want is:
>
> diff -u --new-file drivers/usb/uhci.c~ drivers/usb/uhci.c
> --- drivers/usb/uhci.c~ Tue Dec 5 23:55:38 2000
> +++ drivers/usb/uhci.c Wed Dec 6 14:50:00 2000
> @@ -2380,8 +2380,10 @@
> /* disable legacy emulation */
> pci_write_config_word(dev, USBLEGSUP, 0);
>
> -
> if (pci_enable_device(dev) < 0)
> +
> if (pci_enable_device(dev) < 0) {
> +
> pci_set_master(dev);
> return -ENODEV;
> +
> }
>
> if (!dev->irq) {
> err("found UHCI device with no IRQ assigned. check BIOS settings!");
> diff -u --new-file drivers/usb/usb-uhci.c~ drivers/usb/usb-uhci.c
> --- drivers/usb/usb-uhci.c~ Tue Dec 5 23:55:38 2000
> +++ drivers/usb/usb-uhci.c Wed Dec 6 14:50:09 2000
> @@ -2939,8 +2939,10 @@
> {
> int i;
>
> -
> if (pci_enable_device(dev) < 0)
> +
> if (pci_enable_device(dev) < 0) {
> +
> pci_set_master(dev);
> return -ENODEV;
> +
> }
>
> /* Search for the IO base address.. */
> for (i = 0; i < 6; i++) {
> diff -u --new-file drivers/usb/usb-ohci.c# drivers/usb/usb-ohci.c
> --- drivers/usb/usb-ohci.c# Wed Dec 6 14:56:12 2000
> +++ drivers/usb/usb-ohci.c Wed Dec 6 14:49:34 2000
> @@ -2320,8 +2320,10 @@
> unsigned long mem_resource, mem_len;
> void *mem_base;
>
> -
> if (pci_enable_device(dev) < 0)
> +
> if (pci_enable_device(dev) < 0) {
> +
> pci_set_master(dev);
> return -ENODEV;
> +
> }
>
> /* we read its hardware registers as memory */
> mem_resource = pci_resource_start(dev, 0);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Dec 07 2000 - 21:00:16 EST