[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57AA3028.2080506@codeaurora.org>
Date: Tue, 9 Aug 2016 14:34:00 -0500
From: Timur Tabi <timur@...eaurora.org>
To: Lino Sanfilippo <LinoSanfilippo@....de>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-msm@...r.kernel.org,
sdharia@...eaurora.org, shankerd@...eaurora.org,
vikrams@...eaurora.org, cov@...eaurora.org, gavidov@...eaurora.org,
robh+dt@...nel.org, andrew@...n.ch, bjorn.andersson@...aro.org,
mlangsdo@...hat.com, jcm@...hat.com, agross@...eaurora.org,
davem@...emloft.net, f.fainelli@...il.com
Subject: Re: [PATCH] [v7] net: emac: emac gigabit ethernet controller driver
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.
Powered by blists - more mailing lists