summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/xilinx/ll_temac.h
diff options
context:
space:
mode:
authorEsben Haabendal <esben@geanix.com>2019-04-30 10:17:54 +0300
committerDavid S. Miller <davem@davemloft.net>2019-05-01 21:33:30 +0300
commitf14f5c11f051ca4a41e65017d94408e5e702ba9d (patch)
tree9a878c0d2a90b3910be030d69f79c58ce147c04e /drivers/net/ethernet/xilinx/ll_temac.h
parent2c02c37e9d99aa9b57453cb3ca3044461b193c19 (diff)
downloadlinux-f14f5c11f051ca4a41e65017d94408e5e702ba9d.tar.xz
net: ll_temac: Support indirect_mutex share within TEMAC IP
Indirect register access goes through a DCR bus bridge, which allows only one outstanding transaction. And to make matters worse, each TEMAC IP block contains two Ethernet interfaces, and although they seem to have separate registers for indirect access, they actually share the registers. Or to be more specific, MSW, LSW and CTL registers are physically shared between Ethernet interfaces in same TEMAC IP, with RDY register being (almost) specificic to the Ethernet interface. The 0x10000 bit in RDY reflects combined bus ready state though. So we need to take care to synchronize not only within a single device, but also between devices in same TEMAC IP. This commit allows to do that with legacy platform devices. For OF devices, the xlnx,compound parent of the temac node should be used to find siblings, and setup a shared indirect_mutex between them. I will leave this work to somebody else, as I don't have hardware to test that. No regression is introduced by that, as before this commit using two Ethernet interfaces in same TEMAC block is simply broken. Signed-off-by: Esben Haabendal <esben@geanix.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/xilinx/ll_temac.h')
-rw-r--r--drivers/net/ethernet/xilinx/ll_temac.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/xilinx/ll_temac.h b/drivers/net/ethernet/xilinx/ll_temac.h
index 23d8dd5330f8..990f9ed151b2 100644
--- a/drivers/net/ethernet/xilinx/ll_temac.h
+++ b/drivers/net/ethernet/xilinx/ll_temac.h
@@ -358,7 +358,10 @@ struct temac_local {
struct sk_buff **rx_skb;
spinlock_t rx_lock;
- struct mutex indirect_mutex;
+ /* For synchronization of indirect register access. Must be
+ * shared mutex between interfaces in same TEMAC block.
+ */
+ struct mutex *indirect_mutex;
u32 options; /* Current options word */
int last_link;
unsigned int temac_features;