Re: [PATCH v2] net: fec: make driver endian-safe
From: Greg Ungerer <hidden>
Date: 2016-01-25 01:01:32
Hi Johannes, On 25/01/16 01:52, Johannes Berg wrote:
The driver treats the device descriptors as CPU-endian, which appears to be correct with the default endianness on both ARM (typically LE) and PowerPC (typically BE) SoCs, indicating that the hardware block is generated differently. Add endianness annotations and byteswaps as necessary. It's not clear that the ifdef there really is correct and shouldn't just be #ifdef CONFIG_ARM, but I also can't test on anything but the i.MX6 HummingBoard where this gets it working with a BE kernel. Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
I tested this on a ColdFire (5208) target that uses this driver. Simple testing showed it working with no problems. The ColdFire SoC processors use a version of the FEC hardware module, and they always run big-endian. Regards Greg
--- drivers/net/ethernet/freescale/Makefile | 3 + drivers/net/ethernet/freescale/fec.h | 40 ++++++--- drivers/net/ethernet/freescale/fec_main.c | 130 ++++++++++++++++-------------- 3 files changed, 101 insertions(+), 72 deletions(-)