Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp266266lqt; Thu, 6 Jun 2024 03:01:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYayR3R/ZprAJx7/nsg2O+4rymKA0RbTaB9sdGrYhEh8P74z1tDXH5UzxkjE0/QVx5GtQz2ANnPyVHRfG9ngfVe7JyHWTwULEUum0UiA== X-Google-Smtp-Source: AGHT+IEX3NWC5g6SwYg0db2+NuyTehjMYiiB2VDl/dC5Mff0IWddie3W2tzEAr85zmOeu9j8AENp X-Received: by 2002:a05:6a00:1307:b0:6ea:b818:f499 with SMTP id d2e1a72fcca58-703e599ca68mr5970534b3a.19.1717668105124; Thu, 06 Jun 2024 03:01:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717668105; cv=pass; d=google.com; s=arc-20160816; b=jam1eqmTdZUQLc94RkUgdvFKVxGfpXETLwiJ1PS2B/z7CVo9M5E5wb0rnM+/SZ0VxD K1XWr1SiWKHoJ/Q25uTw02QuuO9cKCIHEtZ4mpTpWbTrUtz28/luXxD5MXUl0Ya6pKSg C9kf0dvD9gDSu6LIwEajPHRjiMzVJry7n09KP/WvW6zSY9AX6lRutYkr8nYJZLuBznas /t+7weDmXxkt9uw6vJf1ttLfNASEpHOOAYtADopUyO08AjXAfS4MauzdXFP0gYnY3xgy R7R3JZ4zjvXkRSuTFtQ65/2P8OX4c1BZLiEpLVqg6pavi3ep/q+F7X8dToYCJ2mmzTup mDfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vyT2NYM9qUwiF9FawOrNdnAtsslanKEQNfrn4PY5Mec=; fh=XsKVuqWoStApkGdR68CgZjMqWa2x5Mxn+BzEatsMBfM=; b=01JQssJSFgqthJx+4hM1LQ5GTyLTQw0mnmp6Ic2CtpmaCkaKZgWPR0zc7Z8d1TN+v8 7Qh3YW2KiFpS2qKg8qAFQwKoG01bA67vxhUA63cMJTtk+sGFlVx9oMe8w5cO8VDbzwgb BE5MgH8sALZxnHFk33szEJ3y3J74Aj9J4SiiNXVsd3fxtae+yj3U44UtKBdMOw3Ix8Gr OGQFf7zy54sblm2WCe5BgPmwYlLnWXCp5fWcBM6CNqCyY/b3jiu1lAvDIGtw2agphZLW 7LGye6phHwuTXYvsrAqxpVP9pcxvV2KpGCvhwy2oynOhlTphhI0eSTzfoxW8G5E1nZxE lakQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TwyJArQX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-204016-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de262c026csi898811a12.267.2024.06.06.03.01.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 03:01:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204016-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TwyJArQX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-204016-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CCC21B2938A for ; Thu, 6 Jun 2024 09:35:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D04D153834; Thu, 6 Jun 2024 09:34:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TwyJArQX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 415DC13F45F; Thu, 6 Jun 2024 09:34:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717666468; cv=none; b=lX/iYw/unUwJ0nGQywFgzDfMfcHguJ/Zov9qoOJ60DIIm1pyPdep4xEf96EUBbLjRbF+NmMHATUIV/T3hVeAXJIIdm2SWUrXX7wMXC+W4phjH0b4XA/ALbpjiAEkFcTn3KwRy+ngkwcSfOnd7DFF+HITK+TXOnRLWeg24UAW9Hs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717666468; c=relaxed/simple; bh=8DJsXjzVmKHm3RmeoivdI/KL+nfdhfjGYXic0BYOQLw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lKQVOAZENs6OKlQcDwyqFDkH909ucj8c5EvFOdR7sGJQXFAHfbjdl27e0puhgMhAZJEcAJGc3iIZml+C0MJdWBz0G7m7xUE58FSszfZby49VIrzq/KmHgXgEDj8jHds+OJX8ZJeyRAw7C3aW6Igflur+43feNDeXM6NJR9dIAkU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TwyJArQX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3103CC2BD10; Thu, 6 Jun 2024 09:34:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717666467; bh=8DJsXjzVmKHm3RmeoivdI/KL+nfdhfjGYXic0BYOQLw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TwyJArQXGBLSXPUar3FTHcQcRsoH3E2NXmELLj7HmIX2GRLZpXmXKCymQUwto6j3g d/2t5nAaZF4M7gaQ9uf2+nOMQnQM7vcV4f8txrR791VwhUNTVbcPUQztTzDoLUbxOj 5G7zGxb8FSeGV6qGongBSGB42rB35wQvTBwNVqq5XJ7NkTtXIRfJ9AsAoQCDNug+U/ If48Ghb4WcErdQXlILEtA+UrWzeQTpLLcLdRIIg/O4pFSPGFDJG173vQlxCSDHpw0L PRZgOe3OYUplVrONWIcEJoR64ROpfeDOWfnZ8HTU1aer0mEg2A0aNP6Mks5N6FkPkR ur+jcEjPkrUfA== Date: Thu, 6 Jun 2024 10:34:23 +0100 From: Simon Horman To: Kamil =?utf-8?B?SG9yw6Fr?= - 2N Cc: florian.fainelli@broadcom.com, bcm-kernel-feedback-list@broadcom.com, andrew@lunn.ch, hkallweit1@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 3/3] net: phy: bcm-phy-lib: Implement BroadR-Reach link modes Message-ID: <20240606093423.GA875456@kernel.org> References: <20240605095646.3924454-1-kamilh@axis.com> <20240605095646.3924454-4-kamilh@axis.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240605095646.3924454-4-kamilh@axis.com> On Wed, Jun 05, 2024 at 11:56:46AM +0200, Kamil Horák - 2N wrote: > Implement single-pair BroadR-Reach modes on bcm5481x PHY by Broadcom. > Create set of functions alternative to IEEE 802.3 to handle configuration > of these modes on compatible Broadcom PHYs. > > Change-Id: I592d261bc0d60aaa78fc1717a315b0b1c1449c81 Hi Kamil, Please don't include tags for external trackers in upstream commit messages. > Signed-off-by: Kamil Horák - 2N ... > diff --git a/drivers/net/phy/bcm-phy-lib.c b/drivers/net/phy/bcm-phy-lib.c ... > +/** > + * bcm_linkmode_adv_to_mii_adv_t Please include a short description on the line above. Flagged by kernel-doc -none -Wall > + * @advertising: the linkmode advertisement settings > + * @return: LDS Auto-Negotiation Advertised Ability register value > + * > + * A small helper function that translates linkmode advertisement > + * settings to phy autonegotiation advertisements for the > + * MII_BCM54XX_LREANAA register of Broadcom PHYs capable of LDS > + */ > +static u32 bcm_linkmode_adv_to_mii_adv_t(unsigned long *advertising) ... > +/** > + * bcm_config_advert - sanitize and advertise auto-negotiation parameters > + * @phydev: target phy_device struct > + * > + * Description: Writes MII_BCM54XX_LREANAA with the appropriate values, > + * after sanitizing the values to make sure we only advertise > + * what is supported. Returns < 0 on error, 0 if the PHY's advertisement > + * hasn't changed, and > 0 if it has changed. > + */ > +int bcm_config_advert(struct phy_device *phydev) Please consider including a Return: section in Kernel docs for functions that return a value. Likewise for lre_update_link. Also flagged by kernel-doc -none -Wall ... > diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c ... > +static int bcm54811_read_abilities(struct phy_device *phydev) > +{ > + int val, err; > + int i; > + u8 brr_mode; > + static const int modes_array[] = { ETHTOOL_LINK_MODE_100baseT1_Full_BIT, > + ETHTOOL_LINK_MODE_10baseT1BRR_Full_BIT, > + ETHTOOL_LINK_MODE_1000baseT_Full_BIT, > + ETHTOOL_LINK_MODE_1000baseX_Full_BIT, > + ETHTOOL_LINK_MODE_1000baseT_Half_BIT, > + ETHTOOL_LINK_MODE_100baseT_Full_BIT, > + ETHTOOL_LINK_MODE_100baseT_Half_BIT, > + ETHTOOL_LINK_MODE_10baseT_Full_BIT, > + ETHTOOL_LINK_MODE_10baseT_Half_BIT }; Please consider arranging local variables in reverse xmas tree order - longest like to shortest. Edward Cree's tool can be useful here: https://github.com/ecree-solarflare/xmastree ...