Thread (1 message) 1 message, 1 author, 2016-08-09

Re: [PATCH] [v7] net: emac: emac gigabit ethernet controller driver

From: Timur Tabi <hidden>
Date: 2016-08-09 19:34:00
Also in: linux-arm-msm, netdev

Timur Tabi wrote:
I used to work on PowerPC, so I respect making things work for both
endians.  However, even I think that this is overkill for my driver.
First, there's no way this driver will ever be used on a big-endian
system.  Second, I'm pretty sure there are lots of places that would
need cpu_to_le32() in order to make this driver big-endian compatible.
It would be a huge mess.

#define TPD_BUFFER_ADDR_H_SET(tpd, val)    BITS_SET((tpd)->word[3], 18,
30, val)

This macros sets specific bits based on the definition of the register.
  I could change it to this:

#define TPD_BUFFER_ADDR_H_SET(tpd, val) BITS_SET((tpd)->word[3], 18, 30,
cpu_to_le32(val))

But I honestly don't see what good that will do.  There are still
thousands of other places that assume little-endian.
Ok, so I took another look at this, and even though I still think that 
it's useless, it seems to be much less difficult to implement than I 
initially thought.

I think all I need to do is to modify the BITS_GET() and BITS_SET() 
macros in emac-mac.h, as well as any of the RRD_xxx and TPD_xxx macros 
that do not use BITS_GET() or BITS_SET().  This is a minor change which 
I will implement in v8 of the patch.

Every other hardware access uses readl/writel, which is already endian-safe.

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help