Re: [PATCH net-next v7 2/2] net: ti: icssg-prueth: Add support for PA Stats

From: Jan Kiszka
Date: Mon Sep 02 2024 - 03:23:56 EST


On 22.08.24 14:26, MD Danish Anwar wrote:
> Add support for dumping PA stats registers via ethtool.
> Firmware maintained stats are stored at PA Stats registers.
> Also modify emac_get_strings() API to use ethtool_puts().
>
> This commit also maintains consistency between miig_stats and pa_stats by
> - renaming the array icssg_all_stats to icssg_all_miig_stats
> - renaming the structure icssg_stats to icssg_miig_stats
> - renaming ICSSG_STATS() to ICSSG_MIIG_STATS()
> - changing order of stats related data structures and arrays so that data
> structures of a certain stats type is clubbed together.
>
> Signed-off-by: MD Danish Anwar <danishanwar@xxxxxx>
> ---
> drivers/net/ethernet/ti/icssg/icssg_ethtool.c | 19 ++-
> drivers/net/ethernet/ti/icssg/icssg_prueth.c | 6 +
> drivers/net/ethernet/ti/icssg/icssg_prueth.h | 9 +-
> drivers/net/ethernet/ti/icssg/icssg_stats.c | 31 +++-
> drivers/net/ethernet/ti/icssg/icssg_stats.h | 158 +++++++++++-------
> 5 files changed, 140 insertions(+), 83 deletions(-)
>

...

> diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> index 53a3e44b99a2..f623a0f603fc 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> @@ -1182,6 +1182,12 @@ static int prueth_probe(struct platform_device *pdev)
> return -ENODEV;
> }
>
> + prueth->pa_stats = syscon_regmap_lookup_by_phandle(np, "ti,pa-stats");
> + if (IS_ERR(prueth->pa_stats)) {
> + dev_err(dev, "couldn't get ti,pa-stats syscon regmap\n");
> + return -ENODEV;

I was just beaten for potentially not being backward compatible, but
this is definitely not working with existing DTs, just ran into it.

Jan

--
Siemens AG, Technology
Linux Expert Center