Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1616348ybv; Fri, 21 Feb 2020 00:21:16 -0800 (PST) X-Google-Smtp-Source: APXvYqz1MRi+iXGEwAs+L3jPbbQvANMbvyRQdhPyfXvT0A+1E5aEiWhk+yJZkqy+vFXbXwlLgxUS X-Received: by 2002:a05:6830:50:: with SMTP id d16mr27263140otp.166.1582273276161; Fri, 21 Feb 2020 00:21:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273276; cv=none; d=google.com; s=arc-20160816; b=iydcWW/HA+J96HTSFJfbaLmAmDtJe56yYwbsWLf3d1r74b/KPUs5YB80gH6CSji59S TEoPXoNt7FJuqU3Y3Wa9UkhArdidHpV24Krh80qDyXGBDG2Uq4ZN/exLmAj8zkSxuxzU UTKu4T1HHSIiRgWq7IEXRs75PJ8hklyjwUoIQnDUOhr5vofKI8v2iwp6DwhSkBop/Ug+ bz1qfcP2qrBsInVGjtvX4eR4Z5avugl4QfeXzNMkEQqaWvL2Ir89GGLlPpLuxbBh16Wr CsMKTjej9frHt/iT8quXR5z8aVPaOG+sKCpHyzTRraVwc7sRhHXNczeF8/+bUGqiFaWk zmOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PuoqJ5ijgdvzMVbxJyRNx7WYmlRT3wks4qyzXWWIUig=; b=srBXAmelXN5h6gubZu/Acqa5SHb4XOOM8yXxJvANOXvTRfdRhcTypTE5nZmYQrX2t5 yjhB3XBM3+qwdlZuaDRu1I6DmZoyMsCEBOcEMImoO3C4JTfrSxpuBLIMfqE+w4eO0Qja X8BzSJ7ZtJWwHC2c6MGOUSHF+foCP7ydKCRmrCVsO/kkhyK/6872vjZaZYQAv/6/DP3o Wso/JEIKxnR8ajsZLiNbhwfp9+EBco4UzB3ERsXZrzZoBEmb1hUF5l74vINkEP8/cQRm 3FpEWz2RJ2XKlb4izMwQ119aK82N1pC5I/GdP6rcD7Cp4YNdFbC7ZaT3Lr6Zo3TeWa74 ccsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=utprmOLf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si1109580otq.112.2020.02.21.00.21.03; Fri, 21 Feb 2020 00:21:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=utprmOLf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388009AbgBUIT2 (ORCPT + 99 others); Fri, 21 Feb 2020 03:19:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:57966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732901AbgBUIT1 (ORCPT ); Fri, 21 Feb 2020 03:19:27 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 24DD124689; Fri, 21 Feb 2020 08:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273166; bh=m9ywS9W5sFzIk8yj1UQGFY10lpinxn5x/nVWAjNi0g8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=utprmOLffRwq0ZeN6xWi1UEw7XCd7WmP5i+UxPak8kXEEUjtw/tYnkKWIQ4TGPopT OgHT43nPWU3FELmQYpEGybK5ROIrWc45NOsx1wpQ6T6ELTfY4kmEj6KJy3zJPyX0ox O0kXS3fJUdpjVHGA8UcsZF1TjHgeWfUnQjDdmurA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 070/191] r8169: check that Realtek PHY driver module is loaded Date: Fri, 21 Feb 2020 08:40:43 +0100 Message-Id: <20200221072259.750344401@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Heiner Kallweit [ Upstream commit f325937735498afb054a0195291bbf68d0b60be5 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/realtek/r8169.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 4ab87fe845427..6ea43e48d5f97 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -7433,6 +7433,15 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) int chipset, region, i; 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.20.1