From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 E299D340D9D for ; Sat, 22 Aug 2026 15:53:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787413991; cv=none; b=Unwf3H0CIIYGTDl3EblIGon1WjvyUEPIwbTv3Kujsc7QjH1XN8Uw29CJmCSmB+2ZA3d+Y4Ub8NNo8WY/iJwcTC/Sk8mY/RfM7PcCeh5JC/xJ2OYc27+yQctEb/j4MtC+SOusIiP9ZtsR5f8U7PI318i7j2PM7luMmfUkSCvs69w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787413991; c=relaxed/simple; bh=T29vQSW/QHENQ809Ln3UnsVeNkX6mY9PFld3z99VIoA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BCthaHQjfpaMwYTg1s2zrVFQVPFjvQE9hitUVFLjUSReC6x+3RL07fdWsTyS52GQL42CJski7TCPHdaAu/EyEzl9thmVP3L4GAmv7Dt5DKdFDImyj+xhKaXs8awqSNGyt2p2JGYk9PcDsQs9QWW8yczvsR+42wyDdY/hvp3DFSM= 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=FP0XPmSZ; arc=none smtp.client-ip=209.85.208.47 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="FP0XPmSZ" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-6a374bea882so4071218a12.1 for ; Sat, 22 Aug 2026 08:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lex.la; s=google; t=1787413988; x=1788018788; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=SsY4kNeedScXtOEr+uFYJGSPWyovaLUZEQHHFrnCwNU=; b=FP0XPmSZZ2GJFF/6zP+oXjquHBHeQgeURjHHKE2709SfOyqj8kJojNYe++iYWHsWLp 1oW+AT7zJOXqabNyppMUdP0mLloKQx29zRm9fzyMI09ukPu1GvW2Aw3MYpCPztuFl9Hi mhXD4NEBj9yuNRlkTShMzADPPXASJEUdveAVe8yiKYw+dzN/77seIvbvCr9Pl7nR+wzR DLg60GKSz+wtmwFP98QvL2lmwagYj693JAyrse3gm8yGgH15uSQUfEfojaE0puP8Qfqa qt8MNF1xRA/sqt4rEI8t8lehRYBAj5DduTK0y/ODoTlPHGzRfrX9XgVveXI5xNKd3iVu B5ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787413988; x=1788018788; h=content-transfer-encoding:mime-version: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=SsY4kNeedScXtOEr+uFYJGSPWyovaLUZEQHHFrnCwNU=; b=ohMq7uabmmtdBhnQ6TnKaIgplyE66VBDHEg8B4+4DyFRsyz1atd0vdK065+rKil4YR XSQaDbAU7P0EeKqiSWQBi3Zp1shBU/FyevxANei1GSek1S+17u5gNe21UDy8w9kXKOc+ VGbGqcRWRMH6lgroSrxWyULkWeZiGfPQf87TPD328iL0TBw1rSo9MRSZPsfWZpn4e1tj LAS4PUZFAHTCzK3cVGZ6qZLhNUYfQEf3AJtoFwHM49nEccvsPTYJkMwAAXf+7ggJaZ3z kmPmRLWah1D3C0mEPN95QCI+hfcKS4ak+nG6qgFynxPdEKcpWQPJDsayMGZnMvIOlk2u 86CQ== X-Forwarded-Encrypted: i=1; AHgh+RowZnOlw1v9bCvrFGy/+PAe2R8C0O1+U4DTdUXN4I/0W0OVpaoFngB6AQyxMHK2wkCOXP/aUIWJb1yJKXk=@vger.kernel.org X-Gm-Message-State: AFuF++m7PrUwvv2d9Fq9FTCEvU/gER63HKxDQNouWGcFqjag2ypdi4lz lXJtP4Pez7UKdbHJo4dVN+GFPIXM8JUSTcBxpJYgPJ70Q9iwbhZEiwRTj1MbYL2Vs2Y= X-Gm-Gg: AR+sD10wV/chsk7yMp4fFfPTsqdKtFcKrv6iLkYtNvgMUO78FC6vpbLsvMOaSWxOlU4 j38tSY+VweFylmazlS+t7nbsagkpJKfWSbz9JBMkfXe07QA8T1jsTAqPOGkuyXgkKxmkxlz9C4i 26TIq17BI6LY5aXDkXpsGpX02BL3Ec9UXYs8cx3SCfRaOjl23cHkAlcHIeaZor4T27+wayar+RW Pq2G0zfbdrxi/w3HJryqRitgRr7//VkzaS1/e2RKvEp3RRAW890P/3jPpKaj0CvW6OMKui3CiXF Z/6BuCWYN7PrOneoGprIbYWc3Uc7OziyR7+lHBu2UYalKQRB0Xj0pYnZMjmeDhiwdDu+fggyjGa CpfVyS8sTe0bMSAS/BwsgNgJiVAYlQaUtkjPSzac8SR1nEUh9i4j8i1NvqumqEhq/qFyM5I55Bg D2xqi5l865yDtcoj5dLJpK+XhPpicSetdKWraC3UllIPkUK8DAKxxCg8raJyWcjl8TIt0bFg== X-Received: by 2002:a05:6402:4588:b0:699:fbe4:16d5 with SMTP id 4fb4d7f45d1cf-6a42f13c47dmr17517952a12.1.1787413987598; Sat, 22 Aug 2026 08:53:07 -0700 (PDT) Received: from ownbook.home.lex.la ([84.17.55.225]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6a3ff16c546sm12396250a12.21.2026.08.22.08.53.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 22 Aug 2026 08:53:07 -0700 (PDT) From: Aleksei Sviridkin To: Andrew Lunn , Vladimir Oltean , Heiner Kallweit , Russell King Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Aleksei Sviridkin Subject: [PATCH net-next 0/3] net: survive a PHY whose driver arrives after the switch probes Date: Sat, 22 Aug 2026 18:52:56 +0300 Message-ID: <20260822155259.87146-1-f@lex.la> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit A PHY that loads firmware at probe keeps its driver in a module on the rootfs: built in, request_firmware_direct() fails against a rootfs that is not mounted yet and the error comes straight out of probe. A DSA switch probes long before that module can load, and three things go wrong, one per layer. phylink can fail its PHY bringup after it has already recorded the PHY in pl->phydev, leaving a pointer to a PHY that phy_detach() has since released. Depending on the caller that is either a permanent -EBUSY or a stale pointer handed to phy_disconnect() later, which detaches the same PHY twice (patch 1). Keeping a port across a failed connect makes that window reachable, so it comes first. phylib binds the generic driver during the attach, and once the failed connect unwinds, the interrupt the firmware node declared is gone: phy_probe() parked the PHY in polling mode and nothing after MDIO bus registration ever brings the irq back (patch 2). DSA drops the user port when the connect at setup fails, so the port never exists, no matter that the driver shows up seconds later (patch 3). With the series applied the port survives setup and connects its PHY on the first ifup after the module loads, with the interrupt the device tree declares. Tested on an MT7981B board (mt7530 switch, Airoha EN8811H with its INT_B line in the device tree) running a 6.18 backport of everything here except the retry in patch 3: the attach line reports a real interrupt instead of irq=POLL, the EINT is claimed and its counter advances on link changes forced from the link partner, and the port passes traffic. On net-next all three files are compile-tested; the board runs an OpenWrt 6.18 kernel. Aleksei Sviridkin (3): net: phylink: unwind the PHY binding when bringup fails late net: phy: restore the interrupt after a generic-driver bind cycle net: dsa: connect a late-arriving PHY at ifup drivers/net/phy/phy_device.c | 13 +++++ drivers/net/phy/phylink.c | 12 +++++ include/linux/phy.h | 6 +++ net/dsa/user.c | 98 ++++++++++++++++++++++++++++++++++++ 4 files changed, 129 insertions(+) -- 2.43.0