From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C80025776 for ; Sun, 23 Aug 2026 00:05:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787443555; cv=none; b=qOMESK6iAdwNtxeMKBnGSOSfwRmUvbI0O/95IOIrqBgBcXDoyvWcSA/8WEu8yPD5XHHQYu4K+Bh5zKvKlngb02u9SA6KbvS1iGPvqBEjwJ6uuNVt8oN2cgSVQt7VuHgkNZSrZz1/+e9WnS7WNF2eIQ/paCpXl+mDl5qSC8AK+eM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787443555; c=relaxed/simple; bh=aZhme+fPtNRc4Hp5eZBvER/rDdLrQ2TdabO+HmWc3ho=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=emzGIPfKvlhoxChiWZkc9csTzP5vhTD08L0rX2JH3XcUJriJVsCimEt1NWpEiCkByML0zEl9frv0uzuT4LGI+Tfz1hfiksoDRaTT4SLOYkN1s7E+md+km3zTAKXQAeWrrlbSlNPLXNqj/mecwzthVcU8Soli6jB5LuwLASqId3Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lex.la; spf=pass smtp.mailfrom=lex.la; dkim=pass (2048-bit key) header.d=lex.la header.i=@lex.la header.b=OF9i+Gwa; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lex.la Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lex.la Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lex.la header.i=@lex.la header.b="OF9i+Gwa" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-c214321dc32so440415866b.0 for ; Sat, 22 Aug 2026 17:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lex.la; s=google; t=1787443552; x=1788048352; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=aZhme+fPtNRc4Hp5eZBvER/rDdLrQ2TdabO+HmWc3ho=; b=OF9i+Gwa6gIwvVESgm6EA0ZAECIUCylJzd25w56Ghw6eVXcG1lbO18VAgbHIGDzMKY fkHwioOuFguTOheG5TZ3qJeCc1PAyDnyglrN3+Kg18LYzhQqsVQaeuaEFTBEP/jr+Vx+ dKO/C4gDqeZ+bStM3GHDIu65klkO97jqnX8AN2Sgnay0T3yqx7C8a7c0T0dVWLXCXjIi /kfG/WMAyFkKgZu7wuaS35ft3Ca7bwVnk3AD1FMDzfCgmHKIrWqYwavRIfezHXExLayd H3YVHqbG5UzFVygulHAMfDERlajlbwuiVVT7DTOCQeznnC1nodjfs/ZI6JyIVTJEKogJ m1xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787443552; x=1788048352; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=aZhme+fPtNRc4Hp5eZBvER/rDdLrQ2TdabO+HmWc3ho=; b=hZALRwi1GRU18NvhSQJ/DgDDyMrYgptxp3hr9724UmfBNUIjwJvbKf5ROKuzp8/AE3 7EU6CWx6oAFstTWXXQNV50Wat9x+d04MLtqXjTrdTaQlD2zlYrpoccwR/pkJOIe5knNT xaPdfrBmK5QjKyMyOOW1HJqjEHfzzuSQTH7aK72154Divg3DkOgGGnbSCjGsxQinL490 maWFpwcMQ+AswN3BaSylPuAvY2jT0iLJPVVXMTvHAAZGEIYwYtgs3HZ3Fcfn9GnU6eUe 6Jh/1ObOB26HFmN0Smqs4xjTrsCUgd/dUZ12b46NHDy1ZD0T1vLvldMX/5dBX0vScn0G lnPA== X-Forwarded-Encrypted: i=1; AHgh+Rp2fkeBoS/1GMDa1E5LnQKkEE7JqYo7ap7Kze8zjY9fK8FJ2wxPYKGc4G/z9961s+Hb32hH5nl8dNCE3JU=@vger.kernel.org X-Gm-Message-State: AFuF++n5iuxdfj1woi4Ydyr6+g5CSD0hK5HxwLrW1FF4J18QDnwKZsVe vvVtsqF7rfljUCjDHaz625ztyX9gF4YWWvP1rljE0Onp/ezRZxsYtx8g7DXPVBwG1Ls= X-Gm-Gg: AR+sD12xNUX/LrYO0okgepcQ8ZJRKLQzIMgZFvzpd4XqeBXQ+moCe2OIrTTXBYMChno FQNSvQWBex0FCUj36RiPx/kpKwZiA1CVJj4t0O8yb1zBXi1Vi7Ylv4ABBHabBqTLMOBoepR7NpF YVuNJDIW6swjfkINJj3tYaCpImSPDwpygeJzyC+LvocSFdGCZSmZEnNrHNhbN1uclq5c0XwbFxW tqeQ+W//aHVQtPHJozTZi1i0ePWWcO61+V72EZmxDjqPwdbP31WJVpmdzuvn7FPDCJzh67zMuDG CG8KPchVGCmecInl+ZTKf+azYG7C9gzczU7XjCKL1MznU+hKY+M4df0gR6wCh5YD62VyXfDKmLR 6h7DcO+g1zBF+AycVH7k1n+ChRiBU5JWNoTiNo1irwD4qjEwNxHt0CpTWrXrJvWZlWYnDDpuiYB 1JGXKiP04O1nRKB8GaejH2jJmoWINpz+S/Cs1PfX0Uyf9EZdfmcUY8p9e9M2mSOzYBQzNBoZUif ng8w3Y3 X-Received: by 2002:a17:907:930a:b0:c1c:6f0d:5b22 with SMTP id a640c23a62f3a-c246a654342mr1941819866b.11.1787443551459; Sat, 22 Aug 2026 17:05:51 -0700 (PDT) Received: from ownbook.home.lex.la ([84.17.55.225]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c24966f6adfsm504267866b.31.2026.08.22.17.05.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 22 Aug 2026 17:05:51 -0700 (PDT) From: Aleksei Sviridkin To: Andrew Lunn Cc: Vladimir Oltean , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Aleksei Sviridkin Subject: Re: [PATCH net-next 3/3] net: dsa: connect a late-arriving PHY at ifup Date: Sun, 23 Aug 2026 03:05:49 +0300 Message-ID: <20260823000549.6095-1-f@lex.la> X-Mailer: git-send-email 2.55.0 In-Reply-To: <9557daed-f039-434a-ae64-ac849b9860be@lunn.ch> References: <20260822155259.87146-1-f@lex.la> <20260822155259.87146-4-f@lex.la> <9557daed-f039-434a-ae64-ac849b9860be@lunn.ch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit > The problem is, this is not guaranteed to work. The driver might still > not be loaded, or it is still downloading firmware to the PHY. These are two separate halves, and the driver can only reach one of them. When the firmware is late, your scheme works, and I want to do it as a follow-up. When the module itself is still on an unmounted rootfs, there is no probe to return success from, so the connect at switch setup still gets the genphy fallback and the port is gone for good. This patch is for that half, and it is the half the board in the commit message hits: the driver is a module on the rootfs. > Think about the case of NFS root. The kernel will open() the interface > as soon as netdev_register() is called. With NFS root the module and the firmware sit behind the network they are supposed to bring up, so that setup already requires building them in or an initramfs. With those in place the connect at setup succeeds and this patch stays out of the way. Without them, today's kernel drops the port at setup and NFS root is just as dead, so this does not regress it. > I think you need to look at the PHY driver. Make its probe function > return success, but start a thread downloading the firmware. While > firmware is downloading, either soft_reset() or config_init() needs to > block. I would rather not block: config_init runs inside phy_attach_direct, so on a DSA switch the blocked port holds up the whole switch probe and every other port with it. For the follow-up I want to attach with the real driver's features immediately and keep the link down until the firmware lands, then trigger aneg, the way an SFP port sits linkless without a module. aquantia and mscc load firmware from probe too, so a phylib helper for this would have three users. If the async firmware part should come first and this patch second, I can reorder.