Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311993
b: refs/heads/master
c: b93984c
h: refs/heads/master
i:
  311991: a3f5b2b
v: v3
  • Loading branch information
David Daney authored and David S. Miller committed Jul 9, 2012
1 parent bf5a998 commit d5a500a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4e41649434cd6db2e69783130cba81886dac97f
refs/heads/master: b93984c9afacd4fe32b785d52a93660d91202b10
10 changes: 8 additions & 2 deletions trunk/drivers/net/phy/mdio-mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ static int mdio_mux_read(struct mii_bus *bus, int phy_id, int regnum)
struct mdio_mux_parent_bus *pb = cb->parent;
int r;

mutex_lock(&pb->mii_bus->mdio_lock);
/* In theory multiple mdio_mux could be stacked, thus creating
* more than a single level of nesting. But in practice,
* SINGLE_DEPTH_NESTING will cover the vast majority of use
* cases. We use it, instead of trying to handle the general
* case.
*/
mutex_lock_nested(&pb->mii_bus->mdio_lock, SINGLE_DEPTH_NESTING);
r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data);
if (r)
goto out;
Expand All @@ -71,7 +77,7 @@ static int mdio_mux_write(struct mii_bus *bus, int phy_id,

int r;

mutex_lock(&pb->mii_bus->mdio_lock);
mutex_lock_nested(&pb->mii_bus->mdio_lock, SINGLE_DEPTH_NESTING);
r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data);
if (r)
goto out;
Expand Down

0 comments on commit d5a500a

Please sign in to comment.