Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 19EB43AEB2D for ; Sun, 9 Aug 2026 20:59:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786309184; cv=none; b=SA7hpVFthNkNogDfjj65GW70QqjsV8BIBUAxbnWYPCZUj8VBYosy5VX/FfiETt0oZXk5NK/yxFzpSL6nAHhN0d86n/swub/wKuKuyS+uNPzn39m97Y7PQB8U2I38E4gyOh4aDZkCigupXzuQckkFn/nWYpheHODpXagtMt25QB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786309184; c=relaxed/simple; bh=yP48NfBQNo4R0PchtDbozjKoJ2iHh4aYKSNN83OczTE=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OtVPZ7nEQvNRgrvBEdBWVCoREhDiYoWKk+yT7CinToAtTS2kxj9pAwEGQ1mGiK/X4/4nVydiXrr1qwn9pT2z/yClHlKJVDqg6KS18Ro2CC6CXqlgO1yQG608sc6rdNp+L8tZnypf79L9M1NSaUib6v3Cb1TFsueaLSHTFe1uZo4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KxNwN1ww; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KxNwN1ww" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-47fe2d179e2so657559f8f.1 for ; Sun, 09 Aug 2026 13:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786309181; x=1786913981; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:subject:cc:to:from:date:message-id:from:to:cc:subject :date:message-id:reply-to:content-type; bh=vO4zsqd6+CKiqzXBlsgszWemmLXQdGd/m+GIX3H8Vzs=; b=KxNwN1wwdMSi+lPudeW+FJ7QhaKt1A+yYoaNtUZaHLTZby9Yk9yLeVqz6I4gJGer5w BmDDqAnZPHg/QSd9BY2d0uHN89/rmrIKm3PA+FbUVlFocc7fBsaBnkfutKs7J3eGsnKS tRl67spqpd8u5JCywuhHTozcv8vRUlWHg6SUFd3g/WSSd93Q6B4dhCxB8a3t4VblEt8g rAZsmUzO+dz6dr0ygidJ69E7TnyHt6/kROsr1BTLiXPVA2B4X48NnpAtDaYTdeQPn3h/ IthNM21IxIk5r3O64LWpnT4IbL0wuKI6Yyji03Ra7DxHiw1YBTFli2G09GamGDHi5ffK 0w7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786309181; x=1786913981; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=vO4zsqd6+CKiqzXBlsgszWemmLXQdGd/m+GIX3H8Vzs=; b=XdHO9t+E3M4hk467Gi2ydMdz5rLH10CzYlX4FYruYKoURNUQ3jOgPRNcNbgXbWGUHY J2d6SOeLEAD2uOTJOb1BDjLVfx/2Xz8zzeDDYh6tUgSowpt07vNxV/Ws6thA83AXUgb/ T18jgPHOhljG4m/0QLmUinhDQ/CjpM1m/yyWWVIluU6VuKBNpezvMc/RfqVLzD3mwKyY /e4/EBpDVY7ogCFDkQRCa9k6yklX7XTO7GY2Wr5VPXlSROJOgbdsT5iXDXOy8vRqYdEv FAVWnKUeZMuDcV+btfzIqtAmIIWjYmIM35iaILCq/utZ0aoUJ8MqI+Aki0ws9u8gOPkB fOiw== X-Forwarded-Encrypted: i=1; AHgh+RoczzWLKvr5ZaQ5jRMj+hzReOKsmveqI8isvpCiyrDYimie/tN19KsFI/SQwQQev369Itf6YLxKTBNU@vger.kernel.org X-Gm-Message-State: AOJu0YzB24p2ApxVnDuzKuPqauY8SnedVNO7gk37b6XvHzSrFmLcWwlL vbY3S2CJ9aj0p0Xp41D+dr4llqHCAzRiaQ/R68+jEtx0TtogpNgQ7EXo X-Gm-Gg: AR+sD12bRBgO/GLof8vAW447BPN3EV1GieO8xSJVFRGiLoIPWxZilTMDHvV1MyjmCwL ZuXLgPpqbiFEpGx+Iusfn4ZCQwqHz6nOZrsuvG2dvFDDRC012rvFACD2es7QPi9t/0dIpdy1nEv 8VZ13//seoCCdf5hXdnoG8LQhPQjRm2ZDfIQbf90AIRq0OTB2rICw3EcWeGgCtVX23ugSlcKvDz fDUWd4l9CQ4Nf0EBKG/xexTfF1wApkLZeujZNEep7eCMP5rvryoDgluAuPL02msdM41jybqDMqY VZ2mlrCH2l9A8Vco6GfZbA3Drnwq2Xo1I8asl6X1w2HhnfMs5xfKhmykBq3aIw9QGgqG5D9Tdci 5ztGZUVcwLDCLGWBGknI/3itWpdHTkZTOAA4mOH6EKc+aqPDaftXhlFSqRAc7BgkAAXmaCTYrwM 1PYlGHZ5mxLQN8s/zv+yOuyneoR6riXQYCg5DtGLIXgo1l2m0dvy9+4PMuRpAP5cNBgullkJwLX 7eZPRdtGZZBK7JnCH1M2IxccpYGt3E= X-Received: by 2002:a05:6000:2006:b0:480:c5:d635 with SMTP id ffacd0b85a97d-48000c5d6d9mr30371840f8f.0.1786309181299; Sun, 09 Aug 2026 13:59:41 -0700 (PDT) Received: from Ansuel-XPS. (host-87-20-3-207.retail.telecomitalia.it. [87.20.3.207]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4800220a6d9sm30149581f8f.34.2026.08.09.13.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Aug 2026 13:59:40 -0700 (PDT) Message-ID: <6a78ea3c.be490abf.cfd7.7505@mx.google.com> X-Google-Original-Message-ID: Date: Sun, 9 Aug 2026 22:59:36 +0200 From: Christian Marangi To: Andrew Lunn Cc: Maxime Chevallier , 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 , 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 v11 00/12] net: pcs: Introduce support for fwnode PCS References: <20260807131301.192060-1-ansuelsmth@gmail.com> <4c595c15-17d9-4c23-bb44-344c48d36e9a@lunn.ch> <6a78bdc6.89544747.3fcae.b8e0@mx.google.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sun, Aug 09, 2026 at 10:43:27PM +0200, Andrew Lunn wrote: > > I think the most annoying one will be stmmac with the 3 different PCS > > implementation but we already handled that in a upcoming ipq50xx driver > > currently present in OpenWrt mainline. > > stmmac is always annoying :-( > > If this can make it more uniform, make internal and external PCS look > the same, that would be great. > > I posted v12 that should smooth stuff even more. I think I found a good way with the notifier approach. > > @@ -6808,7 +6792,10 @@ static void mvpp2_acpi_start(struct mvpp2_port *port) > > }; > > struct phylink_pcs *pcs; > > > > - pcs = mvpp2_select_pcs(&port->phylink_config, port->phy_interface); > > + if (mvpp2_is_xlg(port->phy_interface)) > > + pcs = &port->pcs_xlg; > > + else > > + pcs = &port->pcs_gmac; > > I thought the point of new API was that phylink picked the PCS. Why > this if? Why not register both and let phylink pick? > Yep I'm not sure of this... If they expose different interface mode then both can be provided at the same time. I think it was done to reduce the logic difference and patch delta to the minimum. > > +static int mvpp2_port_fill_pcs(struct phylink_config *config, > > + struct phylink_pcs **available_pcs, > > + unsigned int num_possible_pcs) > > +{ > > + struct mvpp2_port *port = mvpp2_phylink_to_port(config); > > + > > + available_pcs[0] = &port->pcs_gmac; > > + > > + if (mvpp2_port_supports_xlg(port)) { > > + if (num_possible_pcs < 2) > > + return -EINVAL; > > This seems like defensive programming. If we said there was two, we > should assume available_pcs has room for two. I would not even pass > int num_possible_pcs as a parameter. > Yes the if is redundant. The phylink core code ALWAYS allocate based on the phylink_config value. The num_possible is just as a validation value of what the space allocated in available_pcs. If everyone is ok I can change and include this in the series. -- Ansuel