Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp213566iob; Mon, 2 May 2022 17:24:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhXcNoxpJqHsbsxWNYevQ2qn5A+G+C8HHxDOhvjLt8zdDwmEFOS45CPbPmcayCi5xfFdjL X-Received: by 2002:a17:902:c94f:b0:15e:b542:3ef6 with SMTP id i15-20020a170902c94f00b0015eb5423ef6mr1607755pla.55.1651537485078; Mon, 02 May 2022 17:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651537485; cv=none; d=google.com; s=arc-20160816; b=vh6C9WdJFN+FBjheWAodtUKoiSt5/42tvLfjDurTrjwS8tkzlsCp2yBvEFAikaf5MT KLL+RxQMsTSokk7pVpAmpTDI9uaxgvLUOMQtyRsaLs+zy6B0Yy2WnPLleOyJRRBLIGkq 7R9gak5UNkNBOFsNwNNnGAWj2CtYefJ4FW4yW5j/XjSiZRNSno37XdLw4pC5GDd8jGYW AVZtIXkZsHfTKSO8z1N+0cRbvuA3Zn2D075kjbL5NVIfInwM7zF+24zgxj3Xx0wyMqGF qEvJzE1d3gv1Ew3+k1hncQiYjmi6VTUq02bFjZ8q01ETGGJFpcIDwBnoempfBroXchyl 7zzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=POF+6d8762FMOUGJIUlV1M6qmWu0Pr8vnEd2cruJn/Q=; b=FJPORH1wQUYyx4viP89og81p9FdpYQJHXK60F0HWuBjTHqFD2ohLabh1vOpZ6G/Zad skrGuCgY21lm7e6opJ/iSm5EhWJZ5EiDe6a1yRP28igI6WsEzqTBZIYUvYTSVkOeJZ+p Kn1a5GxJyXP/ETFhASosPspF+5nFxO5ZeD9o4nOXYX5/g4RG169G/jDvfxONAASORoDA 0WXIBZZ8byRsCtJLS+ror7eAr7OTtdwQXfKlI22rdBf+MhHQbaJ4WbW2p4gIm2q4gIcO Hfib4kXljKIt0T0yd+1zdnZAu3NYcev99r8hxI14mkWlUCwwNil6yUF6trzt4Qp5gXoS 8ikw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GguguRy2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e30-20020a63545e000000b003aa36a52c4asi14982845pgm.284.2022.05.02.17.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 17:24:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GguguRy2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3B7112AB; Mon, 2 May 2022 17:20:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245019AbiD3UW6 (ORCPT + 99 others); Sat, 30 Apr 2022 16:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237108AbiD3UW5 (ORCPT ); Sat, 30 Apr 2022 16:22:57 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0754C8BF3F; Sat, 30 Apr 2022 13:19:34 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id m20so21256129ejj.10; Sat, 30 Apr 2022 13:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:content-language:to:cc :references:from:subject:in-reply-to:content-transfer-encoding; bh=POF+6d8762FMOUGJIUlV1M6qmWu0Pr8vnEd2cruJn/Q=; b=GguguRy2ohBkyOzRgJXUL5P1WS54HQv7SPDnAuU7MEYfgc73wwidWcB5/eCDb/o6qN RK12GmeHg9/VmD61o9af2NbQ9uApw9HDDRPRLLjnHlku63WdF6wo5YZ3+nS8sUEbaKzp gwbn0LuvD7IrUoboyREiqHJxwTvSFuyqDWFxDM1AL3PILyrtXXKPOUANo9R48aPRwnfD LBnNNTm1vKERAJTVJJSxc4w1M5l/pom72Bzfb13uLsz/FA667wgnnI3N5RtPhuf6NTnk hsb7Mqfbonu6IQri7w05qGQFVDZxszD+9MgW7ANf4flb1fSFYbIEWB4IjQsoL4O65c7p Ov/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=POF+6d8762FMOUGJIUlV1M6qmWu0Pr8vnEd2cruJn/Q=; b=nb22NC2y2/9Oy51Mi82ydRQQZrnwC4dUnJfW54m2oM63XEmjKNKwCRoBZB/sdOpI3k w3NAzu/7TaNQ51SeqZ0aZrSlu4OvhBOQDdllyaIH5rbBionNhRcX1Ae+al6Ts2sD+sk7 leCjc5qHaF6KAMMLj45X0f16nhQJa38wtMhLej81K01Ng+Ejjeq5lVTyqwhw/G5pYAaN zJhrIBp1vnRfLqUhjMQczAJDVdsWnhiW9/0wP6Xw/Hnx48fG595fmH/kKjBoJnZDxADE 6MppX3cTcRUJU+8AgQJTvyyeAx/YAtlzi3nUdA+l+YgxZ6JwJPCvweklR8vbQwojZNyc 4X4Q== X-Gm-Message-State: AOAM5306mKZCUQ2GJJLsqJ/Or+BPQndiN7xpUfRhtSP6VAIuWx8uDm1N KjyMSQCJjV9KKippLV47cQg= X-Received: by 2002:a17:907:1b10:b0:6e4:bac5:f080 with SMTP id mp16-20020a1709071b1000b006e4bac5f080mr5052303ejc.24.1651349972319; Sat, 30 Apr 2022 13:19:32 -0700 (PDT) Received: from ?IPV6:2a01:c22:6f21:fd00:3167:a16c:5aa:91c3? (dynamic-2a01-0c22-6f21-fd00-3167-a16c-05aa-91c3.c22.pool.telefonica.de. [2a01:c22:6f21:fd00:3167:a16c:5aa:91c3]) by smtp.googlemail.com with ESMTPSA id hg8-20020a1709072cc800b006f3ef214db1sm1904785ejc.23.2022.04.30.13.19.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 30 Apr 2022 13:19:31 -0700 (PDT) Message-ID: Date: Sat, 30 Apr 2022 22:19:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Content-Language: en-US To: Peter Geis , Andrew Lunn Cc: "Russell King (Oracle)" , "David S. Miller" , Jakub Kicinski , "open list:ARM/Rockchip SoC..." , Linux Kernel Network Developers , Linux Kernel Mailing List References: <20220228233057.1140817-1-pgwipeout@gmail.com> From: Heiner Kallweit Subject: Re: [PATCH v1] net: phy: fix motorcomm module automatic loading In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30.04.2022 18:31, Peter Geis wrote: > On Sat, Apr 30, 2022 at 11:52 AM Andrew Lunn wrote: >> >>> Good Morning, >>> >>> After testing various configurations I found what is actually >>> happening here. When libphy is built in but the phy drivers are >>> modules and not available in the initrd, the generic phy driver binds >>> here. This allows the phy to come up but it is not functional. >> >> What MAC are you using? > > Specifically Motorcomm, but I've discovered it can happen with any of > the phy drivers with the right kconfig. > >> >> Why is you interface being brought up by the initramfs? Are you using >> NFS root from within the initramfs? > > This was discovered with embedded programming. It's common to have a > small initramfs, or forgo an initramfs altogether. Another cause is a > mismatch in kernel config where phylib is built in because of a > dependency, but the rest of the phy drivers are modular. > The key is: > - phylib is built in > - ethernet driver is built in > - the phy driver is a module > - modules aren't available at probe time (for any reason). > > In this case phylib assumes there is no driver, when the vast majority > of phys now have device specific drivers.It seems this is an unsafe > assumption as this means there is now an implicit dependency of the > device specific phy drivers and phylib. It just so happens to work > simply because both broadcom and realtek, some of the more common > phys, have explicit dependencies elsewhere that cause them to be built > in as well. > Because you mention the realtek phy driver: Users reported similar issues like you if r8169 MAC driver is built-in (or r8169 module is in initramfs) but realtek phy driver is not. There's no direct code dependency between r8169 and realtek phy driver, therefore initramfs-creating tools sometimes missed to automatically include the phy driver in initramfs. To mitigate this r8169 has the following: MODULE_SOFTDEP("pre: realtek"); This isn't strictly needed but some initramfs-creating tools consider such soft dependencies when checking what should be included in initramfs. If some other MAC is used with a Realtek PHY, then you may still see the described issue. As Andrew wrote: Eventually it's a userspace responsibility to ensure that all needed modules are included in initramfs. >>>> What normally happens is that the kernel loads, maybe with the MAC >> driver and phylib loading, as part of the initramfs. The other modules >> in the initramfs allow the root filesystem to be found, mounted, and >> pivoted into it. The MAC driver is then brought up by the initscripts, >> which causes phylib to request the needed PHY driver modules, it loads >> and all is good. >> >> If you are using NFS root, then the load of the PHY driver happens >> earlier, inside the initramfs. If this is you situation, maybe the >> correct fix is to teach the initramfs tools to include the PHY drivers >> when NFS root is being used? >> >> Andrew