Re: [BK PATCH] USB update for 2.6.3

From: Linus Torvalds
Date: Fri Feb 20 2004 - 01:59:34 EST




On Fri, 20 Feb 2004, Benjamin Herrenschmidt wrote:
>
> > Well, we do. The pcibios_xxx routines get called for all PCI devices
> > during discovery, and that's when you'd fill them in.
>
> But what about USB or FireWire devices ? In theory, I'd like to see
> the driver for those not have to bother about beeing hosted by a PCI
> device or whatever else (there are typically non-PCI OHCI USBs on
> embedded platform, faking a pci_dev is becoming painful).

Well, a USB device can't actually do DMA, so .. (it's only the USB _host_
that does DMA, and while those aren't always PCI, they normally are).

Basically, we only care about host devices, since anything else is going
to be talked to through a driver and is thus not even platform-dependent
any more. See what I'm saying?

So we'd only have hust buses here: either PCI or ISA or something like
that (NuBus, VME, EISA, Microchannel.. You get the idea).

And host buses - pretty much by definition - are scanned by the host. So
all those buses tend to have host fixups. In the case of PCI, it's the
"pcibios_xxx()" macros that are the host fixups. Most other buses tend to
be _so_ host-centric that they don't have anything _but_ the host
environment (ie things like the embedded buses used by ARM chips etc).

> So it would actually make sense to be able to pass whatever struct
> device we are on, and have a real inheritance of the DMA functions
> going down the bus, don't you think ?

Only for devices on host buses.

> > No no. That wouldn't work AT ALL, since the whole point is that you need
> > to know what the device is - ie you need to fill in the information when
> > you get the "struct pci_dev *" (because different buses would most likely
> > have different behaviour, and could have different requirements for DMA
> > mapping etc).
>
> And ? Where is the problem ? By default, you inherit from the parent
> and that's just fine.

Yes, as long as you set up the "root" of the bus, and then just inherit
the pointer, you should be ok and not need to do anything further. I
agree.

(And btw, yes, it all booted, so PPC64 is happy again. I pushed out the
one-liner fix).

Linus
-
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/