Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp229768iob; Mon, 2 May 2022 17:54:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEue7U603lUZlN7j/Ce0zJpTAlS9yRXboNyNlzqK6WjK40W2NzaHP4gsOIZ8qD1BTEw1PT X-Received: by 2002:a17:902:aa8e:b0:158:e948:27 with SMTP id d14-20020a170902aa8e00b00158e9480027mr14242543plr.69.1651539251698; Mon, 02 May 2022 17:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651539251; cv=none; d=google.com; s=arc-20160816; b=n8C1wJH/NFP81aMaCdOArQRlw1tFolzQRxBrLz/UcsrxXcQtvtj5OEFPAyAUYi/m6G UAR4QaCxIUwYzNcEt7jObV+E1XfsCNiZTQYvhzYM3aNXGDZoeA4XaVMzM5J1hYSpKYG2 aggdr35YjR/zgklS2XCJ8pq1m5XcWlHpGUuYhTkHcioeGjrneQ5dwSC3k94UwZbPd5b6 yrE287EUUkHXlKnHsXwAwaLO9TX+hMTeIg6fy8UMHC2OShsNWaEPVDBl8umX1+cZwUGN FSImS5QQTwHtTi29RuSU/OhGmiJWJgQn7fYlJDymbuq9S4kT3pw6Pc6TpUNI/P26Z1c7 sqKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VQBIwY6gYucmpK0m5q+UiClACSjy1lrKIL+7r3g96NE=; b=kvwDDOL0IDkM96GAz8pdOg9uKD6vutC15Jf3e2CJitUJlCkqTnjcH+2SNd7i32z0cN D8p6uI6ugPPrNh0lbkssPyZhv6AOEgQ9fa4n7eTOvuza7YHLGtaWp2YsWiDJjSvJUwaV AmaXOS0qX9YE9hZgba1KdRdIMvVZG7rqFSnWfkJB39BeXQ5JJAtSRtsmvi6Tz8JRvXss NTa+ftVCZ+/ijPxtKWmtX6dFGM1I2RdYiLW2ykk4f6dH5Z7GeoiWhJJOkl0FE3NcAGyB aRMS55g4k23r10o/Pqfo6E3e39769UwP5FwArw9tA4EI2NcufeM0uMxxcy5wE5MRKZMA Rfxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mJewPIEQ; 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 j15-20020a170903024f00b00153b7df656asi17762110plh.490.2022.05.02.17.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 17:54:11 -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=mJewPIEQ; 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 C45A141609; Mon, 2 May 2022 17:40:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383128AbiD3QfL (ORCPT + 99 others); Sat, 30 Apr 2022 12:35:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383104AbiD3QfC (ORCPT ); Sat, 30 Apr 2022 12:35:02 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53A3218355; Sat, 30 Apr 2022 09:31:39 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id i38so19433068ybj.13; Sat, 30 Apr 2022 09:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VQBIwY6gYucmpK0m5q+UiClACSjy1lrKIL+7r3g96NE=; b=mJewPIEQt6k7No6Cs9mgMKMZpiDMbHOCzpdmu9Hd2D9DK1XXla4qkJeEslHt343F64 +fFfV++PExhSKg+0Bf478eXbqavUUHVfys017SvsqXZcWG2hLN4jjpGLjNpYDXC2w/3/ RYIrLgVeRrda0EfPcWSmPMG+OhHTXlfLUsm1FMufxwwgFOsE7TbNXbwWUl8yhWVPzj4A sLqiOyLTwLyKxW0lgcKEWr5HEmhub0795GKjfrt1IrP4laVRkDo/fjxdPquNAbyww+8h xEos337yRLnzvj3kvKVdIS7id0MeXg2kUaebuvXcryseCVuCyfXBP/FLxWFXyTTQwR7/ 2Nhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VQBIwY6gYucmpK0m5q+UiClACSjy1lrKIL+7r3g96NE=; b=Rrh/OE/j9WDMceOUjrlT6lHKB5gSJgc6bLA/oW5Ci8n2aw9upEUORWAG16ICMLp6v8 gCtIdp6Sm7A5t1RoyH2J+maQfqcIQHjK8OLUO+t3PnQ7IwQ+OFKRXIeLvCMrXp3P+Xh0 iqYa1XMAprj+ZrnEKeQKBMyXtUEfz2AgAUe9UZJUOyIEm8nAHc16JcftH/XXn56NaODL 4mKTnrHoYz5HyMTuIFF9QRLE2zAfps7xFrm6nN/fjD7VVXBnI57si+hmYdJiMGfjMIqf sS59zsbRMI4z+SPmxJ2nPkyhzQcXnehp+TGKf0ATTkJTOkKkLFe9Ilc6IKnvA3mvMZdm A9yw== X-Gm-Message-State: AOAM533zg3aNKSHXCx1/ZoyuRKcCWu4/+Nuf/0p3xrsG220/JoEbcJ6f xHZiecYfjwykmdgZrH3YPug3k/JocJpAuSlA6UA79ubZG6Y= X-Received: by 2002:a5b:dc8:0:b0:624:a898:dea6 with SMTP id t8-20020a5b0dc8000000b00624a898dea6mr4168113ybr.600.1651336298505; Sat, 30 Apr 2022 09:31:38 -0700 (PDT) MIME-Version: 1.0 References: <20220228233057.1140817-1-pgwipeout@gmail.com> In-Reply-To: From: Peter Geis Date: Sat, 30 Apr 2022 12:31:27 -0400 Message-ID: Subject: Re: [PATCH v1] net: phy: fix motorcomm module automatic loading To: Andrew Lunn Cc: "Russell King (Oracle)" , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , "open list:ARM/Rockchip SoC..." , Linux Kernel Network Developers , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 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,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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. > > 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