Re: [PATCH] I/O space write barrier

From: Jesse Barnes
Date: Thu Oct 21 2004 - 22:23:03 EST


On Thursday, October 21, 2004 8:01 pm, Grant Grundler wrote:
> > +<programlisting>
> > + sp->flags |= SRB_SENT;
> > + ha->actthreads++;
> > + WRT_REG_WORD(&amp;reg->mailbox4, ha->req_ring_index);
> > +
> > + /*
> > + * A Memory Mapped I/O Write Barrier is needed to ensure that
> > this write + * of the request queue in register is ordered ahead
> > of writes issued + * after this one by other CPUs. Access to the
> > register is protected + * by the host_lock. Without the mmiowb,
> > however, it is possible for + * this CPU to release the host lock,
> > another CPU acquire the host lock, + * and write to the request
> > queue in, and have the second write make it + * to the chip first.
> > + */
> > + mmiowb(); /* posted write ordering */
> > +</programlisting>
>
> This is the example code I'd like to see replaced with your
> synthetic example above.

Ok, that makes sense. I'd like to update the documentation with a separate
patch though, if that's ok with you. I think Greg had some ideas about other
things to cover as well. Greg?

Thanks,
Jesse
-
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/