Skip to content

Commit

Permalink
net: ll_temac: Prepare indirect register access for multicast support
Browse files Browse the repository at this point in the history
With .ndo_set_rx_mode/temac_set_multicast_list() being called in atomic
context (holding addr_list_lock), and temac_set_multicast_list() needing
to access temac indirect registers, the mutex used to synchronize indirect
register is a no-no.

Replace it with a spinlock, and avoid sleeping in
temac_indirect_busywait().

To avoid excessive holding of the lock, which is now a spinlock, the
temac_device_reset() function is changed to only hold the lock for short
periods.  With timeouts, it could be holding the spinlock for more than
2 seconds.

Signed-off-by: Esben Haabendal <esben@geanix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Esben Haabendal authored and David S. Miller committed May 23, 2019
1 parent ddc0bf3 commit 1bd33bf
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 89 deletions.
5 changes: 3 additions & 2 deletions drivers/net/ethernet/xilinx/ll_temac.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ struct temac_local {
/* For synchronization of indirect register access. Must be
* shared mutex between interfaces in same TEMAC block.
*/
struct mutex *indirect_mutex;
spinlock_t *indirect_lock;
u32 options; /* Current options word */
int last_link;
unsigned int temac_features;
Expand All @@ -388,8 +388,9 @@ struct temac_local {
/* xilinx_temac.c */
int temac_indirect_busywait(struct temac_local *lp);
u32 temac_indirect_in32(struct temac_local *lp, int reg);
u32 temac_indirect_in32_locked(struct temac_local *lp, int reg);
void temac_indirect_out32(struct temac_local *lp, int reg, u32 value);

void temac_indirect_out32_locked(struct temac_local *lp, int reg, u32 value);

/* xilinx_temac_mdio.c */
int temac_mdio_setup(struct temac_local *lp, struct platform_device *pdev);
Expand Down
Loading

0 comments on commit 1bd33bf

Please sign in to comment.