[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20191001163922.14735-57-sashal@kernel.org>
Date: Tue, 1 Oct 2019 12:39:07 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Marek Vasut <marex@...x.de>, Andrew Lunn <andrew@...n.ch>,
"David S . Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
George McCollister <george.mccollister@...il.com>,
Tristram Ha <Tristram.Ha@...rochip.com>,
Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
Woojung Huh <woojung.huh@...rochip.com>,
Sasha Levin <sashal@...nel.org>, netdev@...r.kernel.org
Subject: [PATCH AUTOSEL 5.3 57/71] net: dsa: microchip: Always set regmap stride to 1
From: Marek Vasut <marex@...x.de>
[ Upstream commit a3aa6e65beebf3780026753ebf39db19f4c92990 ]
The regmap stride is set to 1 for regmap describing 8bit registers already.
However, for 16/32/64bit registers, the stride is 2/4/8 respectively. This
is not correct, as the switch protocol supports unaligned register reads
and writes and the KSZ87xx even uses such unaligned register accesses to
read e.g. MIB counter.
This patch fixes MIB counter access on KSZ87xx.
Signed-off-by: Marek Vasut <marex@...x.de>
Cc: Andrew Lunn <andrew@...n.ch>
Cc: David S. Miller <davem@...emloft.net>
Cc: Florian Fainelli <f.fainelli@...il.com>
Cc: George McCollister <george.mccollister@...il.com>
Cc: Tristram Ha <Tristram.Ha@...rochip.com>
Cc: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
Cc: Woojung Huh <woojung.huh@...rochip.com>
Fixes: 46558d601cb6 ("net: dsa: microchip: Initial SPI regmap support")
Fixes: 255b59ad0db2 ("net: dsa: microchip: Factor out regmap config generation into common header")
Reviewed-by: George McCollister <george.mccollister@...il.com>
Tested-by: George McCollister <george.mccollister@...il.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/net/dsa/microchip/ksz_common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
index 72ec250b95408..823f544add0a3 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -130,7 +130,7 @@ static inline void ksz_pwrite32(struct ksz_device *dev, int port, int offset,
{ \
.name = #width, \
.val_bits = (width), \
- .reg_stride = (width) / 8, \
+ .reg_stride = 1, \
.reg_bits = (regbits) + (regalign), \
.pad_bits = (regpad), \
.max_register = BIT(regbits) - 1, \
--
2.20.1
Powered by blists - more mailing lists