From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claudiu Manoil Date: Thu, 3 Oct 2013 16:36:59 +0300 Subject: [U-Boot] [PATCH 7/9] net: tsec: Use portable types and accessors for BDs In-Reply-To: <1380752101.12932.127.camel@snotra.buserror.net> References: <1380534287-4569-1-git-send-email-claudiu.manoil@freescale.com> <1380534287-4569-8-git-send-email-claudiu.manoil@freescale.com> <1380583367.24959.551.camel@snotra.buserror.net> <524AB42C.7060404@freescale.com> <1380653401.10618.19.camel@snotra.buserror.net> <524C2AC6.1070202@freescale.com> <1380752101.12932.127.camel@snotra.buserror.net> Message-ID: <524D72FB.6090204@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/3/2013 1:15 AM, Scott Wood wrote: [snip] > > Yeah, it doesn't help when both types of accesses show up when searching > for the ring, and accessors exist with both possible argument orderings. > Especially when a driver has custom accessors. > > It's OK to use explicit synchronization rather than I/O accessors, if > you're careful to ensure that it's correct. > > It looks like drivers/net/fec_mxc.c in U-Boot is an example that uses > I/O accessors on ring data, e.g.: > > writew(length, &fec->tbd_base[fec->tbd_index].data_length); > Hi Scott, I sent a v2 for this patch (the next 2 patches in the series are not affected by this one): http://patchwork.ozlabs.org/patch/280285/ In this version I dropped the macro usage and used I/O accessors for the ring data, as discussed. This approach does not require the explicit __beNN type for the BD fields, it also removes the need to declare the BD structures as "volatile" and it's safer because in_be()/ out_be() enforce HW sync. Thanks, Claudiu