Skip to contentSkip to conversation

Fix default phy selection after initialization

PATCH New Daniele Venzano 1 participant 1 message Mar 9, 2005

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

PATCH 1/1 Fix default phy selection after initialization

Previous patch correct only 99% of the time, the default phy can change during normal operation, but the mii_info struct wosn't updated.
With the attached patch it is (to be applied on top of previous).

For the locking issue it seems that not only sis900_timer is affected. Mii access is scattered all over the driver without locking, so I think there is need of a lot more work.

drivers/net/sis900.c +2 -2
Index: sis900.c
===================================================================
@@ -514,8 +514,6 @@ static int __devinit sis900_probe(struct
 		goto err_out_unregister;
 	}
 
-	sis_priv->mii_info.phy_id = sis_priv->cur_phy;
-
 	/* save our host bridge revision */
 	dev = pci_get_device(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_630, NULL);
 	if (dev) {
@@ -725,6 +723,8 @@ static u16 sis900_default_phy(struct net
 					net_dev->name,sis_priv->cur_phy);
 	}
 	
+	sis_priv->mii_info.phy_id = sis_priv->cur_phy;
+
 	status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL);
 	status &= (~MII_CNTL_ISOLATE);