|
@@ -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;
|
|
struct mdio_mux_parent_bus *pb = cb->parent;
|
|
int r;
|
|
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);
|
|
r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data);
|
|
if (r)
|
|
if (r)
|
|
goto out;
|
|
goto out;
|
|
@@ -71,7 +77,7 @@ static int mdio_mux_write(struct mii_bus *bus, int phy_id,
|
|
|
|
|
|
int r;
|
|
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);
|
|
r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data);
|
|
if (r)
|
|
if (r)
|
|
goto out;
|
|
goto out;
|