Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1998487lqp; Tue, 16 Apr 2024 04:38:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMGLSBSJN+8IG4AXav2XkLFhqwGOgK7CwubBW8SXFMIa2i7eelNaeq0DaVOrjIHyp/nMG7LPkarhUv4jlEOLR4GkFcx7pJ3IX/zCs9WQ== X-Google-Smtp-Source: AGHT+IGvyZ3VRhh8hEmukYL/HGBxxRRM8IAQWSKofFkH58U3jvKIUpZJasMdu5yqBVB9pQ6Fx64n X-Received: by 2002:a17:906:ecac:b0:a52:6ba8:8bf1 with SMTP id qh12-20020a170906ecac00b00a526ba88bf1mr3119520ejb.77.1713267523877; Tue, 16 Apr 2024 04:38:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713267523; cv=pass; d=google.com; s=arc-20160816; b=Tz4rvKlDmP89334x5+kYVz/KAt0S9/f+RKjM0MCENrz36svw5s7SKjVPAt1vNsLYTZ ZEsL6mWIP5MqWGuYq0DDqxnvCGrvQkC+QcFqXVNNjITOtKpGsCcYG1k3i34A2T0DX/gW o5L7S1RyGqO/ye4LTk/va9IiiEqyzoT9B43vaoHVQyWKIQJA5dAeiZbr8BqKjI8utbBi t9VxBWyNQwpCH6zdEtt8nutH5e8F0rtBaeOXjyMBqhOhDyMGfNbrW2hag3MAZ6gxkujw UtW6WLS6eW4f3sMZ7BFCzrzURsr+MJw3bZZ6akRxA+vXVpV0DYddpTiyZ0pANOiDB0S1 Jqqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3imXpN/x1JQtEA6zkUwudIXWS06IjOEYxP3aQIvEud0=; fh=vTt6k1qgTF4NJdoGXiU6izF10R2FvJID0K47G73kg4Y=; b=LcKrp6SCA3f0ZmD4W0YN9lPT8WIqzLZJiAc1Y2jdAGpSVdDXnzN1O+Dpk/9/eoI/z5 VjLVdCD1pKDB5qZqx60UmSG3yWIfQiYRMZydpi2QPbu6ateoTAWvvJx3CLarHSFkUQYF OVdQWyuJZPtonPjDFfROUxiD89/0vSV9rubZ9hRFEqAVMhRftXj5n+hJPJTrFWtIWyaa x3xCp59NxX35Y4I8yyaZ6TzmkxvqndsbmSJ8l7TD4f7t8ULwU1lriInNUJKydusVywC5 Yq9FGV+yhEvmTnS6MyiIA8RAFHAxD9/WZZstfcGoz0PspAI0W7z1NXysGpzyBvMnTADu u1sw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aiXjuupn; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-146713-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146713-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ne30-20020a1709077b9e00b00a4e26173876si5915055ejc.554.2024.04.16.04.38.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 04:38:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146713-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aiXjuupn; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-146713-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146713-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 984541F217F1 for ; Tue, 16 Apr 2024 11:38:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 404C8129A73; Tue, 16 Apr 2024 11:38:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aiXjuupn" Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 D8DAC1292DB; Tue, 16 Apr 2024 11:38:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713267514; cv=none; b=vAZT66l7kRCp5Wc3+17047x+CKdd5D0ibYFR6JBTaTSlrSjIjYttjp2tw6BHT8qxlACZPK8bHHzKBL15M84IRG8tx3ZnDaiOTA4pn29wGpZJARB8kNdMa2K9Pu5G8IIbRnTQsIdovT+ohetSBnl7Wgibdn1vvTW77mzOOr1QvmA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713267514; c=relaxed/simple; bh=NIRfjbxBKlUF6UYKXQ9bPrhaNs+Ht9ITk6Oi0xFaqV0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aH0FHOolsv45f7veyorFFr1BbjmOB5Z0DsUk58Q7TNJNfAwwATF+7x/Mb00nP4aHFMDR7+3v0OjoFa4g7UPUcpuDVft5piFxzUu+nojAd766KHTho2G0lFJvQFsE2SIRhvcKpmxljpl8BGcrlWKWSHfnXoGvpCfm+ckx2uoNiuA= 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=aiXjuupn; arc=none smtp.client-ip=209.85.167.48 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 Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-516f2e0edb7so5207646e87.1; Tue, 16 Apr 2024 04:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713267511; x=1713872311; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3imXpN/x1JQtEA6zkUwudIXWS06IjOEYxP3aQIvEud0=; b=aiXjuupndvujWxncgReWgUH0eskEie/9LTEh8pssGvoFQo+ukmfrpp4GI6DCsSAnNv LaNDMwYNvLZdhd7y48m1kiifwYZcSYzogflePBuXIqCYFmkHFj5YKZZzJVm7Ykh5C+5p FygpGP/pquTHPomJsEhJZM7jN+zIOq8oqO1TExrK2ENkjI9V5wLK941aV6+0B0oz0eNY 9JBEmQHxLYp+v0TIWF3kXcXrBS/KHwSpGQo7phfpJoggfi3sA6llzI0R7AYOT0MAWQN6 SJrSlifY+0kI+KhPiOyBrVTurZYffsD0/++Qh5evED8SARknLWQ129nTCeJSE+hbm2SX gktg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713267511; x=1713872311; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3imXpN/x1JQtEA6zkUwudIXWS06IjOEYxP3aQIvEud0=; b=Wl7HwmVmGz04rpYWFoqWIiJi5cp4gAqRPgFMz1tfzhabqIbOornOE1qLaWAaqReMGy ZurEw+brn0alKQrRnLzu1qeJpbz41fTiD4JyejImGmmoqu5+ViUA9k+tiIPfZ+JblMfy TxrqCZshzrrUVmUbTqzAfwqd1tHShvVuCIJ8lsLJpfPKUWNPB8XTw/zy2GirCXaL3lnp F7OeKj77HiqNaOO6d7UNmSgAYhRMnTSRh5CEJ/Lv4bQwaHRDQuAGF6myT1A8xEHDIOq7 Dky4MNGfyPNuAP/Zlo1HpJKk0/lhUbXeEf2Jc2abBWdmhm6Ti+mQ4Ntp8PLOjzDjNVTp fMHw== X-Forwarded-Encrypted: i=1; AJvYcCWPZo+m7eQrIHS3KgW2acvmbGe1VPlv50Z8F8+469L1f8gZMiEiD5mJUzptSpv8qRGt97eFTD2bhGyAVoPjUnSxojbddkUoJfp6Bh/1Sy/Wp0BEMUmLEZ8HwZrXvj3sexf25HIb X-Gm-Message-State: AOJu0YyCm+EJVzjSpliXViwdUuot6tXYu+6dfnWc0Dyrx8FvMP6Sl3Ak a8Xsvhm1aMgD/mcdcfkIyRQOV6R7t24/NqM5WHE2srS5nR2ls0mv X-Received: by 2002:ac2:528c:0:b0:518:7e4a:2035 with SMTP id q12-20020ac2528c000000b005187e4a2035mr7410480lfm.45.1713267510734; Tue, 16 Apr 2024 04:38:30 -0700 (PDT) Received: from mobilestation ([213.79.110.82]) by smtp.gmail.com with ESMTPSA id bp22-20020a056512159600b00518e96b85b0sm568727lfb.234.2024.04.16.04.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 04:38:30 -0700 (PDT) Date: Tue, 16 Apr 2024 14:38:28 +0300 From: Serge Semin To: Romain Gantois Cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , Yanteng Si , Maxime Coquelin , Simon Horman , Huacai Chen , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 4/4] net: stmmac: Move MAC caps init to phylink MAC caps getter Message-ID: References: <20240412180340.7965-1-fancer.lancer@gmail.com> <20240412180340.7965-5-fancer.lancer@gmail.com> <714199e5-edf2-dcbb-216b-563431d70488@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <714199e5-edf2-dcbb-216b-563431d70488@bootlin.com> Hi Romain On Tue, Apr 16, 2024 at 09:56:32AM +0200, Romain Gantois wrote: > Hi Serge, > > On Fri, 12 Apr 2024, Serge Semin wrote: > > > +static unsigned long stmmac_mac_get_caps(struct phylink_config *config, > > + phy_interface_t interface) > > +{ > > + struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev)); > > + > > + /* Get the MAC-specific capabilities */ > > + stmmac_mac_phylink_get_caps(priv); > > This is a bit of a nitpick, but the terminology is quite confusing between > stmmac_mac_phylink_get_caps() and stmmac_mac_get_caps(). Right, the naming turns to be ambiguous "a bit".) > Ideally, we could just > get rid of the whole stmmac_do_void_callback() complexity and just call > phylink_get_caps() directly. No, this isn't a good solution. The local coding convention implies using the macro-functions implemented to execute the callbacks. We can't use the macros everywhere but in this place. > In the meantime, maybe renaming this to > stmmac_mac_core_get_caps() would be acceptable? The name was selected to align with the rest of the PHYLINK callbacks: static const struct phylink_mac_ops stmmac_phylink_mac_ops = { .mac_get_caps = stmmac_mac_get_caps, .mac_select_pcs = stmmac_mac_select_pcs, .mac_config = stmmac_mac_config, .mac_link_down = stmmac_mac_link_down, .mac_link_up = stmmac_mac_link_up, }; So I don't think that changing it to something different would be a good alternative. What could be a better option is to rename the stmmac_ops::phylink_get_caps() callback and stmmac_mac_phylink_get_caps() macro-function to something like: stmmac_ops::link_update_caps() stmmac_mac_link_update_caps() especially seeing the callback no longer sets the phylink MAC capabilities directly. What do you think? -Serge(y) > > Please let me know what you think. > > Thanks, > > -- > Romain Gantois, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com