Re: [linux-usb-devel] PATCH: (as326) Add mb() during initialization of UHCI controller

From: Herbert Xu
Date: Thu Jun 24 2004 - 18:42:21 EST


On Thu, Jun 24, 2004 at 10:26:06AM -0400, Alan Stern wrote:
> > > ===== drivers/usb/host/uhci-hcd.c 1.115 vs edited =====
> > > --- 1.115/drivers/usb/host/uhci-hcd.c Wed Jun 23 12:10:07 2004
> > > +++ edited/drivers/usb/host/uhci-hcd.c Wed Jun 23 12:30:05 2004
> > > @@ -2261,6 +2261,11 @@
> > > uhci->fl->frame[i] = cpu_to_le32(uhci->skelqh[irq]->dma_handle);
> > > }
> > >
> > > + /*
> > > + * Some architectures require a full mb() to enforce completion of
> > > + * the memory writes above before the I/O transfers in start_hc().
> > > + */
> > > + mb();
> > > start_hc(uhci);
> > >
> > > init_stall_timer(hcd);
> >
> > Any reason why a wmb() is not sufficient?
>
> See http://marc.theaimsgroup.com/?l=linux-usb-devel&m=108759528909973&w=2

Well I think this is something that we should document.

The question is what is the appropriate mechanism for synchronising
a direct write to DMA coherent memory and a subsequent writel().

include/asm-ppc/system.h says that mb() should be used, while
include/asm-ppc64/system.h says that wmb() should be and is used by
many drivers.

So which is it? Or perhaps we need something else?

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
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/