[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZJ82qDAL92tQh1dV@corigine.com>
Date: Fri, 30 Jun 2023 22:10:16 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Saeed Mahameed <saeed@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
Saeed Mahameed <saeedm@...dia.com>, netdev@...r.kernel.org,
Tariq Toukan <tariqt@...dia.com>,
Sandipan Patra <spatra@...dia.com>
Subject: Re: [net 5/9] net/mlx5: Register a unique thermal zone per device
On Fri, Jun 30, 2023 at 11:15:40AM -0700, Saeed Mahameed wrote:
> From: Saeed Mahameed <saeedm@...dia.com>
>
> Prior to this patch only one "mlx5" thermal zone could have been
> registered regardless of the number of individual mlx5 devices in the
> system.
>
> To fix this setup a unique name per device to register its own thermal
> zone.
>
> In order to not register a thermal zone for a virtual device (VF/SF) add
> a check for PF device type.
>
> The new name is a concatenation between "mlx5_" and "<PCI_DEV_BDF>", which
> will also help associating a thermal zone with its PCI device.
>
> $ lspci | grep ConnectX
> 00:04.0 Ethernet controller: Mellanox Technologies MT2892 Family [ConnectX-6 Dx]
> 00:05.0 Ethernet controller: Mellanox Technologies MT2892 Family [ConnectX-6 Dx]
>
> $ cat /sys/devices/virtual/thermal/thermal_zone0/type
> mlx5_0000:00:04.0
> $ cat /sys/devices/virtual/thermal/thermal_zone1/type
> mlx5_0000:00:05.0
>
> Fixes: c1fef618d611 ("net/mlx5: Implement thermal zone")
> CC: Sandipan Patra <spatra@...dia.com>
> Signed-off-by: Saeed Mahameed <saeedm@...dia.com>
...
> @@ -89,10 +94,10 @@ int mlx5_thermal_init(struct mlx5_core_dev *mdev)
> &mlx5_thermal_ops,
> NULL, 0, MLX5_THERMAL_POLL_INT_MSEC);
> if (IS_ERR(thermal->tzdev)) {
> - dev_err(mdev->device, "Failed to register thermal zone device (%s) %ld\n",
> - data, PTR_ERR(thermal->tzdev));
> + err = PTR_ERR(thermal->tzdev);
> + mlx5_core_err(mdev, "Failed to register thermal zone device (%s) %ld\n", data, err);
Hi Saeed,
unfortunately it seems that this breaks allmodconfig.
drivers/net/ethernet/mellanox/mlx5/core/thermal.c:98:82: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
mlx5_core_err(mdev, "Failed to register thermal zone device (%s) %ld\n", data, err);
~~~ ^~~
%d
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h:67:11: note: expanded from macro 'mlx5_core_err'
##__VA_ARGS__)
^~~~~~~~~~~
./include/linux/dev_printk.h:144:65: note: expanded from macro 'dev_err'
dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
./include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
1 warning generated.
> kfree(thermal);
> - return -EINVAL;
> + return err;
> }
>
> mdev->thermal = thermal;
> --
> 2.41.0
>
>
Powered by blists - more mailing lists