From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B27DECD98C5 for ; Mon, 15 Jun 2026 14:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Subject:Cc:To: From:Date:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xNzTJAzLpoj9UCkQ0S0Kema5FeZLkRTnD+aulM3+7ZM=; b=wuvctUMUymBOBn0bEXxNoZQ6f0 i3t8sDKArNoO/20J7fR5XrmIc++WTQ5XBpnCK4sq/gQou4/OzMyAJX8gWkMUELCy8q5NvQmq31hyn DXxfuAstVHfWe/s2fMHdCBk1B8exW8V+e14qI5p5nEnQ4x7ws/uyLqClgGe/7pH9hANEU9qQAaaoP 33vejP8beTWMEm4LdsJGZw/gb6fTf/eW7zion2xNjLntQw9+rbSGq6Qa5TMmjeB3eJPSfIOCWX3S6 TWe0XqHOYlLwRkpaZ28sj31cDKM5g0L3yEFu7zqIg9HSuCyktm3NV0c5QUh/X8SUiqLlclAAPSPuu Ei/KdrDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wZ8PF-0000000EQGT-3xEq; Mon, 15 Jun 2026 14:35:17 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wZ8PD-0000000EQFF-1W3M for linux-mediatek@lists.infradead.org; Mon, 15 Jun 2026 14:35:16 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4903d730b1fso44692935e9.2 for ; Mon, 15 Jun 2026 07:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781534113; x=1782138913; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:subject:cc:to:from:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=xNzTJAzLpoj9UCkQ0S0Kema5FeZLkRTnD+aulM3+7ZM=; b=kY0JqbcXKt7MCyWoVokXkqoey0CZC9NgkHXiqze9EjRQccc7vRfQDfZ3h/l6VGRRg/ d9pv1yU5tucAKRokjJSFq975Squ2h/EsazE0JWqIcn4qGKo6VpmI2mtEZA6FZXtLqcwY E1V/pNkfdW4YZppSG/F6qLoRvQHfwklArmha6U0ASRRes3q0hNB8t5vdmjgByMckkLi+ etsmfeBCRGNcP+saH8Gb67IVRRwihAim7XdShKcNDaA0a09PKsMflVEHSRZZxFm277yg yGeUiY2K97eMhUXCKAKrmLiz9ooZA4o8EBXA7LYEYwjh3D//ooEOZVfDpEk/1ea8Fi9b neXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781534113; x=1782138913; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:subject:cc:to:from:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xNzTJAzLpoj9UCkQ0S0Kema5FeZLkRTnD+aulM3+7ZM=; b=Q+4REMBusxu6WhLdBzc3s+I5rRQIxi7KkiG0go4vYAGi0xfGJRdkyEusrLCzRpKGOj zDxJWE/35zMC8fv40vbAnjk7nxiGIAwEGiMWJbL6MAx4U2zQ6QHyMc8bYQTpaKi/8Vvk 0IFjR+4Iv0m/lHbC6Owsl4A5GA1IBuhDfqE2Qp2cGsYas11xqz5PkhNaGorTuQyJqueg Y9Du3TzTFXz88ZnAdRTIfNabDpcsHFb7af9NiIkPnoJOqbQXVmAIZh16GgK9IjWVGQeP nJyKfSX0/J1nprjd9d5LnqwbvN0kAegSseaFXzRpJEcCbHqerQUyxrDFc/cTwzdYhP0Q P0Xg== X-Forwarded-Encrypted: i=1; AFNElJ+VUCzGHJzraMsDdjUUIUnMFqCqVfEKmvqQJ0fmHS8Xo5yUy5dKxuNJr5PJuEPAQDCKDZlV90XbuSB4jjaC+w==@lists.infradead.org X-Gm-Message-State: AOJu0YyW/lkIAn/DGn57pzGbjvTJCvgbNNqRKd7R9Sxrj32FieOHQsdG RHiUumrxdPaWYe3oinxwODmn8LmypY5LpWuaHAVSGbRrYkfDK1SNoRVA X-Gm-Gg: Acq92OGLf6NJVodGvtvSTgjzl09n4UdW/PtLyw+cMQiIjZptaxDMMqSp3LjZM/RHRms yrbLOAkWY+ypmtzExNphZ8RfRp+NRiKkNpvy2+C3fXA8oVuIRAMAZxRWdnXPyxyVNgaKzggVVI6 XCZjevbTxar4rxiJGFQaMg/wcvb9LCEW0siD8rXvZ1NXz20U9DyLi4ypVgR5hvlh3uznox/uf3N RXna6Y236anzVBtnxqbV2cgBR7waaWlWbrEA8Wyk27K0va24ydYNTVpfQx9RaRUSAWWsK5HKEgi 5jsKnd2Zj6TyQvJ2zUkaGm9UG3iBVliXcbJ17RiDOgshePe1kZxLbeJViWUiUF9+PMtAJx27ZJE /dlubqutovm4x5XWoTnCW+dItgXAi782hTr0b/xo/Xj6TCU6bT/X1ehtOtzIINbqocn5WJcuZAs UUF5zBRO04mKtX3artgjfkZX/AP+oWvnE+rXHkNvIGiwRXrah/p2eDzg== X-Received: by 2002:a05:600c:3512:b0:491:9969:739d with SMTP id 5b1f17b1804b1-4922011393fmr148091175e9.29.1781534113065; Mon, 15 Jun 2026 07:35:13 -0700 (PDT) Received: from Ansuel-XPS. (93-34-88-103.ip49.fastwebnet.it. [93.34.88.103]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4606f263945sm35561117f8f.8.2026.06.15.07.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2026 07:35:12 -0700 (PDT) Message-ID: <6a300da0.d5af3cef.1ca29d.19c4@mx.google.com> X-Google-Original-Message-ID: Date: Mon, 15 Jun 2026 16:35:07 +0200 From: Christian Marangi To: Maxime Chevallier Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Jonathan Corbet , Shuah Khan , Lorenzo Bianconi , Heiner Kallweit , Russell King , Saravana Kannan , Philipp Zabel , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, llvm@lists.linux.dev Subject: Re: [PATCH net-next v7 05/12] net: phylink: support late PCS provider attach References: <20260615122950.22281-1-ansuelsmth@gmail.com> <20260615122950.22281-6-ansuelsmth@gmail.com> <867a39de-ccc2-4dcf-be24-ab2542d20ab6@bootlin.com> <6a3007ce.73de60af.3a056d.d903@mx.google.com> <7702ac09-75fd-49de-8ad2-fceaa122b627@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7702ac09-75fd-49de-8ad2-fceaa122b627@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260615_073515_428895_9005ABA1 X-CRM114-Status: GOOD ( 31.01 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Mon, Jun 15, 2026 at 04:29:04PM +0200, Maxime Chevallier wrote: > > > On 6/15/26 16:10, Christian Marangi wrote: > > On Mon, Jun 15, 2026 at 04:07:03PM +0200, Maxime Chevallier wrote: > >> Hi Christian, > >> > >> On 6/15/26 14:29, Christian Marangi wrote: > >>> Add support for late PCS provider attachment to a phylink instance. > >>> This works by creating a global notifier for the PCS provider and > >>> making each phylink instance that makes use of fwnode subscribe to > >>> this notifier. > >>> > >>> The PCS notifier will emit the event FWNODE_PCS_PROVIDER_ADD every time > >>> a new PCS provider is added. > >>> > >>> phylink will then react to this event and will call the new function > >>> fwnode_phylink_pcs_get_from_fwnode() that will check if the PCS fwnode > >>> provided by the event is present in the pcs-handle property of the > >>> phylink instance. > >>> > >>> If a related PCS is found, then such PCS is added to the phylink > >>> instance PCS list. > >>> > >>> Then we link the PCS to the phylink instance and we refresh the supported > >>> interfaces of the phylink instance. > >>> > >>> Finally we check if we are in a major_config_failed scenario and trigger > >>> an interface reconfiguration in the next phylink resolve. > >>> > >>> In the example scenario where the link was previously torn down due to > >>> removal of PCS, the link will be established again as the PCS came back > >>> and is now available to phylink. > >>> > >>> Signed-off-by: Christian Marangi > >>> --- > >> > >> [...] > >> > >>> @@ -2151,6 +2204,10 @@ void phylink_destroy(struct phylink *pl) > >>> if (pl->link_gpio) > >>> gpiod_put(pl->link_gpio); > >>> > >>> + /* Unregister notifier for late PCS attach */ > >>> + if (pl->fwnode_pcs_nb.notifier_call) > >>> + unregister_fwnode_pcs_notifier(&pl->fwnode_pcs_nb); > >> > >> I wanted to try this out, but I get : > >> > >> drivers/net/phy/phylink.c:2218:17: error: implicit declaration of function ‘unregister_fwnode_pcs_notifier’; did you mean ‘register_fwnode_pcs_notifier’? [-Werror=implicit-function-declaration] > >> 2218 | unregister_fwnode_pcs_notifier(&pl->fwnode_pcs_nb); > >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > >> | register_fwnode_pcs_notifier > >> > >> I guess you either need to stub this, or there's a missing Kconfig > >> dependency somewhere > >> > > > > Hi yes if you want toi test just enable CONFIG_FWNODE_PCS. I forgot to add > > the static declaration for unregister_fwnode_pcs_notifier. > > I'll give it a go with this yeah, I have a few devices here I'd like to > try this on. > > Can you CC me for the next rounds ? > Sure, if you can would be good to check also the other commit if everything is logically correct. BTW by checking test from patchwork I can see also another fix is needed if you want to test this revision. phylink_create() -if (config->num_possible_pcs && pl->mac_ops->mac_select_pcs) { +if (config->num_possible_pcs && mac_ops->mac_select_pcs) { Aside from these change I expect the current legacy code to be not affected by these change. -- Ansuel