WSL2-Linux-Kernel/include/linux/soc
Arnd Bergmann 8990777914 netcp: try to reduce type confusion in descriptors
The netcp driver produces tons of warnings when CONFIG_LPAE is enabled
on ARM:

drivers/net/ethernet/ti/netcp_core.c: In function 'netcp_tx_map_skb':
drivers/net/ethernet/ti/netcp_core.c:1084:13: warning: passing argument 1 of 'set_words' from incompatible pointer type [-Wincompatible-pointer-types]

This is the result of trying to pass a pointer to a dma_addr_t to
a function that expects a u32 pointer to copy that into a DMA descriptor.

Looking at that code in more detail to fix the warnings, I see multiple
related problems:

* The conversion functions are not endian-safe, as the DMA descriptors
  are almost certainly fixed-endian, but the CPU is not.

* On 64-bit machines, passing a pointer through a u32 variable is a
  bug, accessing an indirect pointer as a u32 pointer even more so.

* The handling of epib and psdata mixes native-endian and device-endian
  data.

In this patch, I try to sort out the types for most accesses here,
adding le32_to_cpu/cpu_to_le32 where appropriate, and passing pointers
through two 32-bit words in the descriptor padding, to make it plausible
that the driver does the right thing if compiled for big-endian or
64-bit systems.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-11 19:34:39 -05:00
..
brcmstb soc: brcmstb: Add Bus Interface Unit control setup 2015-10-09 13:42:16 -07:00
dove ARM: dove: create a proper PMU driver for power domains, PMU IRQs and resets 2015-08-05 18:36:49 +02:00
mediatek soc: mediatek: Add infracfg misc driver support 2015-07-06 18:36:31 +02:00
qcom soc: qcom: Make qcom_smem_get() return a pointer 2015-10-14 14:51:20 -05:00
sunxi drivers: soc: sunxi: Introduce SoC driver to map SRAMs 2015-06-01 17:57:34 +02:00
ti netcp: try to reduce type confusion in descriptors 2015-12-11 19:34:39 -05:00