Re: [linux-usb-devel] pegasus + MediaGX: Oops in khubd, the continuing story?

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Fri May 04 2001 - 16:53:04 EST


> The Oops'es are mostly in the khubd process, but they sometimes appear in other
> programs (insmod, ifconfig). They always lead to an immedate panic, and nothing

I suspect the ohci driver currently. I've been reviewing it a little and it
is full of code written by someone who does not know about pci write posting.

Specifically

        writel(value, pciaddr)

is a queued operation. So

        writel(value, foo)
        delay
        real(foo)

might not do the writel into the delay is over or during it. PCI makes
guarantees that

- writes will go out in order and will be merged only if prefetchable set
- multiple writes to the same addr will remain multiple writes
- reads will not complete until the writes do

This applies in both directions - bus mastering nasties abound notably

        writel(STOP, reg->dmactrl)
        kfree(buffer)

is dangerous

        You have to do

        writel(STOP, reg->dmactrl);
                        [posted]
        readl(reg->dmactrl)
                        [read forces write, read reply will follow any DMA
                         pending the other way]

I've not attempted to fix it yet

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



This archive was generated by hypermail 2b29 : Mon May 07 2001 - 21:00:21 EST