Skip to content

Commit f325937

Browse files
hkallweitdavem330
authored andcommitted
r8169: check that Realtek PHY driver module is loaded
Some users complained about problems with r8169 and it turned out that the generic PHY driver was used instead instead of the dedicated one. In all cases reason was that r8169.ko was in initramfs, but realtek.ko not. Manually adding realtek.ko to initramfs fixed the issues. Root cause seems to be that tools like dracut and genkernel don't consider softdeps. Add a check for loaded Realtek PHY driver module and provide the user with a hint if it's not loaded. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0247743 commit f325937

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6825,6 +6825,15 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
68256825
int chipset, region;
68266826
int jumbo_max, rc;
68276827

6828+
/* Some tools for creating an initramfs don't consider softdeps, then
6829+
* r8169.ko may be in initramfs, but realtek.ko not. Then the generic
6830+
* PHY driver is used that doesn't work with most chip versions.
6831+
*/
6832+
if (!driver_find("RTL8201CP Ethernet", &mdio_bus_type)) {
6833+
dev_err(&pdev->dev, "realtek.ko not loaded, maybe it needs to be added to initramfs?\n");
6834+
return -ENOENT;
6835+
}
6836+
68286837
dev = devm_alloc_etherdev(&pdev->dev, sizeof (*tp));
68296838
if (!dev)
68306839
return -ENOMEM;

0 commit comments

Comments
 (0)