From: Florian Fainelli Date: Thu, 8 Jan 2009 19:01:58 +0000 (-0800) Subject: r6040: check PHY status when bringing interface up X-Git-Tag: v3.12-rc1~16343^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84314bf92265bccea601ed75ec93944e1a36dd81;p=kernel%2Fkernel-generic.git r6040: check PHY status when bringing interface up This patch makes the driver properly initialize the PHY status if not correctly set by the bootloader/BIOS. It prevents some boards to bring up the link on boot. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller --- diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index 92b14c8..7ac6fed 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c @@ -1121,6 +1121,10 @@ static int __devinit r6040_init_one(struct pci_dev *pdev, err = -EIO; goto err_out_free_res; } + /* If PHY status change register is still set to zero it means the + * bootloader didn't initialize it */ + if (ioread16(ioaddr + PHY_CC) == 0) + iowrite16(0x9f07, ioaddr + PHY_CC); /* Init system & device */ lp->base = ioaddr;