All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] r8169: check that Realtek PHY driver module is loaded
@ 2019-12-13 15:53 Heiner Kallweit
  2019-12-17  0:00 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2019-12-13 15:53 UTC (permalink / raw)
  To: Realtek linux nic maintainers, David Miller; +Cc: netdev

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 <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 67a4d5d45..f27e4da10 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -6825,6 +6825,15 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	int chipset, region;
 	int jumbo_max, rc;
 
+	/* Some tools for creating an initramfs don't consider softdeps, then
+	 * r8169.ko may be in initramfs, but realtek.ko not. Then the generic
+	 * PHY driver is used that doesn't work with most chip versions.
+	 */
+	if (!driver_find("RTL8201CP Ethernet", &mdio_bus_type)) {
+		dev_err(&pdev->dev, "realtek.ko not loaded, maybe it needs to be added to initramfs?\n");
+		return -ENOENT;
+	}
+
 	dev = devm_alloc_etherdev(&pdev->dev, sizeof (*tp));
 	if (!dev)
 		return -ENOMEM;
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] r8169: check that Realtek PHY driver module is loaded
  2019-12-13 15:53 [PATCH net-next] r8169: check that Realtek PHY driver module is loaded Heiner Kallweit
@ 2019-12-17  0:00 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-12-17  0:00 UTC (permalink / raw)
  To: hkallweit1; +Cc: nic_swsd, netdev

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Fri, 13 Dec 2019 16:53:37 +0100

> 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 <hkallweit1@gmail.com>

Applied but this really is a failure of the dependency system and tooling.

I don't know if tools like dracut is where this has to happen or
something closer to the kernel module dep system itself, but what's
happening right now obviously does not work.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-17  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13 15:53 [PATCH net-next] r8169: check that Realtek PHY driver module is loaded Heiner Kallweit
2019-12-17  0:00 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.