Skip to contentSkip to conversation

net, fixed phy: make BUSID configurable

PATCH In review Heiko Schocher 2 participants 3 messages Dec 4, 2011 – Dec 5, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net, fixed phy: make BUSID configurable

Cc Vitaly Bordug <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Jeff Garzik <[email protected]>
Cc Wolfgang Denk <[email protected]>
---
 drivers/net/phy/Kconfig |    5 +++++
 drivers/net/phy/fixed.c |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)
drivers/net/phy/Kconfig +5 -0
index bb88e12..bed4bdd 100644
@@ -101,6 +101,11 @@ config FIXED_PHY
 
 	  Currently tested with mpc866ads and mpc8349e-mitx.
 
+config FIXED_PHY_ID
+	int "BUS ID for fixed Bus/PHY emulation"
+	depends on FIXED_PHY
+	default "0"
+
 config MDIO_BITBANG
 	tristate "Support for bitbanged MDIO buses"
 	help
drivers/net/phy/fixed.c +1 -1
index 1fa4d73..5c77478 100644
@@ -220,7 +220,7 @@ static int __init fixed_mdio_bus_init(void)
 		goto err_mdiobus_reg;
 	}
 
-	snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "0");
+	snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "%d", CONFIG_FIXED_PHY_ID);
 	fmb->mii_bus->name = "Fixed MDIO Bus";
 	fmb->mii_bus->priv = fmb;
 	fmb->mii_bus->parent = &pdev->dev;
Signature · 1 line
1.7.6.4
maintainer
#1 lore raw

From: Heiko Schocher <[email protected]>
Date: Sun, 4 Dec 2011 10:37:24 +0100

Quoted 1 line

Give me a break.

You can't submit a change like this with essentially an empty commit message.

Why in the world does this ever need to be configurable? Are there alternative (and much better) ways to deal with whatever problem this patch solves?

You've presented no information about why you need to make this change, and more importantly why no viable alternatives exist to solve your problem.

#2 lore raw

Hello David,

Quoted 9 lines · David Miller

From: Heiko Schocher <[email protected]>
Date: Sun, 4 Dec 2011 10:37:24 +0100

Quoted 1 line

Give me a break.

You can't submit a change like this with essentially an empty commit message.

Uh, yes, sorry!

Quoted 7 lines

Why in the world does this ever need to be configurable? Are there alternative (and much better) ways to deal with whatever problem this patch solves?

You've presented no information about why you need to make this change, and more importantly why no viable alternatives exist to solve your problem.

On a am1808 based board porting to current kernel, I have connected a KSZ8864RMN switch and using the drivers/net/ethernet/ti/davinci_emac.c driver. To the switch I have always 100/FULL connection and so I decided to use the fixed PHY driver. But the busid 0 is used from the drivers/net/ethernet/ti/davinci_emac.c driver, and the fixed PHY driver is fix at busid 0 ...

Looking in the drivers/net/ethernet/ti/davinci_emac.c in emac_dev_open() there is the possibility if no priv->phy_id is defined through plattform code, to use a fixed 100/FULL speed and duplex settings ... which would fix my needs ...

But code did not reach this, because first a:

        if (!priv->phy_id) {
                struct device *phy;

                phy = bus_find_device(&mdio_bus_type, NULL, NULL,
                                      match_first_device);
                if (phy)
                        priv->phy_id = dev_name(phy);
        }

is checked ... maybe it is better to fix this here by removing this "if (!priv->phy_id) {" and do not use the fixed PHY driver?

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany