kernel_samsung_a53x/drivers/net/ethernet/stmicro/stmmac
Simon Horman 4e35d4a08d net: stmmac: Correct byte order of perfect_match
[ Upstream commit e9dbebae2e3c338122716914fe105458f41e3a4a ]

The perfect_match parameter of the update_vlan_hash operation is __le16,
and is correctly converted from host byte-order in the lone caller,
stmmac_vlan_update().

However, the implementations of this caller, dwxgmac2_update_vlan_hash()
and dwxgmac2_update_vlan_hash(), both treat this parameter as host byte
order, using the following pattern:

	u32 value = ...
	...
	writel(value | perfect_match, ...);

This is not correct because both:
1) value is host byte order; and
2) writel expects a host byte order value as it's first argument

I believe that this will break on big endian systems. And I expect it
has gone unnoticed by only being exercised on little endian systems.

The approach taken by this patch is to update the callback, and it's
caller to simply use a host byte order value.

Flagged by Sparse.
Compile tested only.

Fixes: c7ab0b8088d7 ("net: stmmac: Fallback to VLAN Perfect filtering if HASH is not available")
Signed-off-by: Simon Horman <horms@kernel.org>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:20:17 +01:00
..
altr_tse_pcs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
altr_tse_pcs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
chain_mode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
common.h net: stmmac: xgmac: fix handling of DPP safety error for DMA channels 2024-11-18 12:13:24 +01:00
descs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
descs_com.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac-anarion.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-dwc-qos-eth.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-generic.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-imx.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-intel-plat.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-intel.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac-intel.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac-ipq806x.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-lpc18xx.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-mediatek.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-meson.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-meson8b.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-oxnas.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-qcom-ethqos.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-rk.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-socfpga.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-sti.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-stm32.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-sun8i.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac-sunxi.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dwmac4.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac4_core.c net: stmmac: Correct byte order of perfect_match 2024-11-23 23:20:17 +01:00
dwmac4_descs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac4_descs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac4_dma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac4_dma.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac4_lib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac5.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac5.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac100.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac100_core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac100_dma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac1000.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac1000_core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac1000_dma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac_dma.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwmac_lib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwxgmac2.h net: stmmac: xgmac: fix a typo of register name in DPP safety handling 2024-11-18 12:13:27 +01:00
dwxgmac2_core.c net: stmmac: Correct byte order of perfect_match 2024-11-23 23:20:17 +01:00
dwxgmac2_descs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwxgmac2_dma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwxlgmac2.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
enh_desc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hwif.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hwif.h net: stmmac: Correct byte order of perfect_match 2024-11-23 23:20:17 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmc_core.c net: stmmac: xgmac: Disable FPE MMC interrupts 2024-11-18 12:11:11 +01:00
norm_desc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ring_mode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stmmac.h Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
stmmac_ethtool.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stmmac_hwtstamp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stmmac_main.c net: stmmac: Correct byte order of perfect_match 2024-11-23 23:20:17 +01:00
stmmac_mdio.c net: stmmac: Handle disabled MDIO busses from devicetree 2024-11-18 12:11:49 +01:00
stmmac_pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stmmac_pcs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stmmac_platform.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
stmmac_platform.h Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
stmmac_ptp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stmmac_ptp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stmmac_selftests.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stmmac_tc.c net: stmmac: No need to calculate speed divider when offload is disabled 2024-11-19 14:19:08 +01:00