[PATCH] Fix ucc_geth MII master selection

Subsystems: networking drivers, the rest

STALE6747d

2 messages, 1 author, 2008-02-15 · open the first message on its own page

[PATCH] Fix ucc_geth MII master selection

From: Joakim Tjernlund <hidden>
Date: 2008-02-14 17:11:22

Remove bogus UCC regs range test and correct
off by one error in call to ucc_set_qe_mux_mii_mng()

Signed-off-by: Joakim Tjernlund <redacted>
---

I am not 100% sure this is the correct fix, please ACK or NACK

 drivers/net/ucc_geth_mii.c |   26 +++++++++++---------------
 1 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 6c257b8..472d5a1 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -200,21 +200,17 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma
 		if (err)
 			goto bus_register_fail;
 
-		/* if our mdio regs fall within this UCC regs range */
-		if ((res.start >= tempres.start) &&
-		    (res.end <= tempres.end)) {
-			/* set this UCC to be the MII master */
-			const u32 *id = of_get_property(tempnp, "device-id", NULL);
-			if (id == NULL)
-				goto bus_register_fail;
-
-			ucc_set_qe_mux_mii_mng(*id - 1);
-
-			/* assign the TBI an address which won't
-			 * conflict with the PHYs */
-			out_be32(&regs->utbipar, UTBIPAR_INIT_TBIPA);
-			break;
-		}
+		/* set this UCC to be the MII master */
+		const u32 *id = of_get_property(tempnp, "device-id", NULL);
+		if (id == NULL)
+			goto bus_register_fail;
+
+		ucc_set_qe_mux_mii_mng(*id);
+
+		/* assign the TBI an address which won't
+		 * conflict with the PHYs */
+		out_be32(&regs->utbipar, UTBIPAR_INIT_TBIPA);
+		break;
 	}
 
 	err = mdiobus_register(new_bus);
-- 
1.5.3.8

Re: [PATCH] Fix ucc_geth MII master selection

From: Joakim Tjernlund <hidden>
Date: 2008-02-15 10:10:01

On Thu, 2008-02-14 at 18:11 +0100, Joakim Tjernlund wrote:
quoted hunk
Remove bogus UCC regs range test and correct
off by one error in call to ucc_set_qe_mux_mii_mng()

Signed-off-by: Joakim Tjernlund <redacted>
---

I am not 100% sure this is the correct fix, please ACK or NACK

 drivers/net/ucc_geth_mii.c |   26 +++++++++++---------------
 1 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 6c257b8..472d5a1 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -200,21 +200,17 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma
 		if (err)
 			goto bus_register_fail;
 
-		/* if our mdio regs fall within this UCC regs range */
-		if ((res.start >= tempres.start) &&
-		    (res.end <= tempres.end)) {
-			/* set this UCC to be the MII master */
-			const u32 *id = of_get_property(tempnp, "device-id", NULL);
-			if (id == NULL)
-				goto bus_register_fail;
-
-			ucc_set_qe_mux_mii_mng(*id - 1);
-
-			/* assign the TBI an address which won't
-			 * conflict with the PHYs */
-			out_be32(&regs->utbipar, UTBIPAR_INIT_TBIPA);
-			break;
-		}
+		/* set this UCC to be the MII master */
+		const u32 *id = of_get_property(tempnp, "device-id", NULL);
+		if (id == NULL)
+			goto bus_register_fail;
+
+		ucc_set_qe_mux_mii_mng(*id);
+
+		/* assign the TBI an address which won't
+		 * conflict with the PHYs */
+		out_be32(&regs->utbipar, UTBIPAR_INIT_TBIPA);
+		break;
 	}
 
 	err = mdiobus_register(new_bus);
This patch is crap, turns out that ucc_set_qe_mux_mii_mng(2) always
works even if UCC3 isn't used at all. I can't figured out why not 1 
or 3 works.

 Jocke
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help