* [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature
@ 2023-09-22 17:18 Petr Machata
2023-09-22 17:18 ` [PATCH net-next 1/3] mlxsw: reg: Limit MTBR register payload to a single data record Petr Machata
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Petr Machata @ 2023-09-22 17:18 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev
Cc: Ido Schimmel, Petr Machata, Vadim Pasternak, mlxsw
Vadim Pasternak writes:
Patch #1 - Optimize transaction size for efficient retrieval of module
data.
Patch #3 - Enable thermal zone binding with new cooling device.
Patch #4 - Employ standard macros for dividing buffer into the chunks.
Vadim Pasternak (3):
mlxsw: reg: Limit MTBR register payload to a single data record
mlxsw: core: Extend allowed list of external cooling devices for
thermal zone binding
mlxsw: i2c: Utilize standard macros for dividing buffer into chunks
drivers/net/ethernet/mellanox/mlxsw/core_env.c | 2 +-
drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 2 +-
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 1 +
drivers/net/ethernet/mellanox/mlxsw/i2c.c | 4 +---
drivers/net/ethernet/mellanox/mlxsw/reg.h | 6 +++---
5 files changed, 7 insertions(+), 8 deletions(-)
--
2.41.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 1/3] mlxsw: reg: Limit MTBR register payload to a single data record
2023-09-22 17:18 [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature Petr Machata
@ 2023-09-22 17:18 ` Petr Machata
2023-09-22 17:18 ` [PATCH net-next 2/3] mlxsw: core: Extend allowed list of external cooling devices for thermal zone binding Petr Machata
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Petr Machata @ 2023-09-22 17:18 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev
Cc: Ido Schimmel, Petr Machata, Vadim Pasternak, mlxsw
From: Vadim Pasternak <vadimp@nvidia.com>
The MTBR register is used to read temperatures from multiple sensors in
one transaction, but the driver only reads from a single sensor in each
transaction.
Rrestrict the payload size of the MTBR register to prevent the
transmission of redundant data to the firmware.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlxsw/core_env.c | 2 +-
drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 2 +-
drivers/net/ethernet/mellanox/mlxsw/reg.h | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c
index d637c0348fa1..7286f0deb5f9 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c
@@ -775,7 +775,7 @@ static int mlxsw_env_module_has_temp_sensor(struct mlxsw_core *mlxsw_core,
int err;
mlxsw_reg_mtbr_pack(mtbr_pl, slot_index,
- MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, 1);
+ MLXSW_REG_MTBR_BASE_MODULE_INDEX + module);
err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mtbr), mtbr_pl);
if (err)
return err;
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c
index 0fd290d776ff..9c12e1feb643 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c
@@ -293,7 +293,7 @@ static ssize_t mlxsw_hwmon_module_temp_fault_show(struct device *dev,
module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon_dev->sensor_count;
mlxsw_reg_mtbr_pack(mtbr_pl, mlxsw_hwmon_dev->slot_index,
- MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, 1);
+ MLXSW_REG_MTBR_BASE_MODULE_INDEX + module);
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtbr), mtbr_pl);
if (err) {
dev_err(dev, "Failed to query module temperature sensor\n");
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index ae556ddd7624..9970921ceef3 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -9551,7 +9551,7 @@ MLXSW_ITEM_BIT_ARRAY(reg, mtwe, sensor_warning, 0x0, 0x10, 1);
#define MLXSW_REG_MTBR_ID 0x900F
#define MLXSW_REG_MTBR_BASE_LEN 0x10 /* base length, without records */
#define MLXSW_REG_MTBR_REC_LEN 0x04 /* record length */
-#define MLXSW_REG_MTBR_REC_MAX_COUNT 47 /* firmware limitation */
+#define MLXSW_REG_MTBR_REC_MAX_COUNT 1
#define MLXSW_REG_MTBR_LEN (MLXSW_REG_MTBR_BASE_LEN + \
MLXSW_REG_MTBR_REC_LEN * \
MLXSW_REG_MTBR_REC_MAX_COUNT)
@@ -9597,12 +9597,12 @@ MLXSW_ITEM32_INDEXED(reg, mtbr, rec_temp, MLXSW_REG_MTBR_BASE_LEN, 0, 16,
MLXSW_REG_MTBR_REC_LEN, 0x00, false);
static inline void mlxsw_reg_mtbr_pack(char *payload, u8 slot_index,
- u16 base_sensor_index, u8 num_rec)
+ u16 base_sensor_index)
{
MLXSW_REG_ZERO(mtbr, payload);
mlxsw_reg_mtbr_slot_index_set(payload, slot_index);
mlxsw_reg_mtbr_base_sensor_index_set(payload, base_sensor_index);
- mlxsw_reg_mtbr_num_rec_set(payload, num_rec);
+ mlxsw_reg_mtbr_num_rec_set(payload, 1);
}
/* Error codes from temperatute reading */
--
2.41.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 2/3] mlxsw: core: Extend allowed list of external cooling devices for thermal zone binding
2023-09-22 17:18 [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature Petr Machata
2023-09-22 17:18 ` [PATCH net-next 1/3] mlxsw: reg: Limit MTBR register payload to a single data record Petr Machata
@ 2023-09-22 17:18 ` Petr Machata
2023-09-22 17:18 ` [PATCH net-next 3/3] mlxsw: i2c: Utilize standard macros for dividing buffer into chunks Petr Machata
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Petr Machata @ 2023-09-22 17:18 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev
Cc: Ido Schimmel, Petr Machata, Vadim Pasternak, mlxsw
From: Vadim Pasternak <vadimp@nvidia.com>
Extend the list of allowed external cooling devices for thermal zone
binding to include devices of type "emc2305".
The motivation is to provide support for the system SN2201, which is
equipped with the Spectrum-1 ASIC.
The system's airflow control is managed by the EMC2305 RPM-based PWM
Fan Speed Controller as the cooling device.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
index 70d7fff24fa2..f709e44c76a8 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
@@ -31,6 +31,7 @@
/* External cooling devices, allowed for binding to mlxsw thermal zones. */
static char * const mlxsw_thermal_external_allowed_cdev[] = {
"mlxreg_fan",
+ "emc2305",
};
struct mlxsw_cooling_states {
--
2.41.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 3/3] mlxsw: i2c: Utilize standard macros for dividing buffer into chunks
2023-09-22 17:18 [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature Petr Machata
2023-09-22 17:18 ` [PATCH net-next 1/3] mlxsw: reg: Limit MTBR register payload to a single data record Petr Machata
2023-09-22 17:18 ` [PATCH net-next 2/3] mlxsw: core: Extend allowed list of external cooling devices for thermal zone binding Petr Machata
@ 2023-09-22 17:18 ` Petr Machata
2023-09-28 12:42 ` [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature Simon Horman
2023-10-02 7:10 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: Petr Machata @ 2023-09-22 17:18 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev
Cc: Ido Schimmel, Petr Machata, Vadim Pasternak, mlxsw
From: Vadim Pasternak <vadimp@nvidia.com>
Use standard macro DIV_ROUND_UP() to determine the number of chunks
required for a given buffer.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlxsw/i2c.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c
index d23f293e285c..1e150ce1c73a 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c
@@ -424,9 +424,7 @@ mlxsw_i2c_cmd(struct device *dev, u16 opcode, u32 in_mod, size_t in_mbox_size,
if (in_mbox) {
reg_size = mlxsw_i2c_get_reg_size(in_mbox);
- num = reg_size / mlxsw_i2c->block_size;
- if (reg_size % mlxsw_i2c->block_size)
- num++;
+ num = DIV_ROUND_UP(reg_size, mlxsw_i2c->block_size);
if (mutex_lock_interruptible(&mlxsw_i2c->cmd.lock) < 0) {
dev_err(&client->dev, "Could not acquire lock");
--
2.41.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature
2023-09-22 17:18 [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature Petr Machata
` (2 preceding siblings ...)
2023-09-22 17:18 ` [PATCH net-next 3/3] mlxsw: i2c: Utilize standard macros for dividing buffer into chunks Petr Machata
@ 2023-09-28 12:42 ` Simon Horman
2023-10-02 7:10 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2023-09-28 12:42 UTC (permalink / raw)
To: Petr Machata
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev, Ido Schimmel, Vadim Pasternak, mlxsw
On Fri, Sep 22, 2023 at 07:18:35PM +0200, Petr Machata wrote:
> Vadim Pasternak writes:
>
> Patch #1 - Optimize transaction size for efficient retrieval of module
> data.
> Patch #3 - Enable thermal zone binding with new cooling device.
> Patch #4 - Employ standard macros for dividing buffer into the chunks.
>
> Vadim Pasternak (3):
> mlxsw: reg: Limit MTBR register payload to a single data record
> mlxsw: core: Extend allowed list of external cooling devices for
> thermal zone binding
> mlxsw: i2c: Utilize standard macros for dividing buffer into chunks
>
> drivers/net/ethernet/mellanox/mlxsw/core_env.c | 2 +-
> drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 2 +-
> drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 1 +
> drivers/net/ethernet/mellanox/mlxsw/i2c.c | 4 +---
> drivers/net/ethernet/mellanox/mlxsw/reg.h | 6 +++---
> 5 files changed, 7 insertions(+), 8 deletions(-)
For series,
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature
2023-09-22 17:18 [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature Petr Machata
` (3 preceding siblings ...)
2023-09-28 12:42 ` [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature Simon Horman
@ 2023-10-02 7:10 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-02 7:10 UTC (permalink / raw)
To: Petr Machata; +Cc: davem, edumazet, kuba, pabeni, netdev, idosch, vadimp, mlxsw
Hello:
This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
On Fri, 22 Sep 2023 19:18:35 +0200 you wrote:
> Vadim Pasternak writes:
>
> Patch #1 - Optimize transaction size for efficient retrieval of module
> data.
> Patch #3 - Enable thermal zone binding with new cooling device.
> Patch #4 - Employ standard macros for dividing buffer into the chunks.
>
> [...]
Here is the summary with links:
- [net-next,1/3] mlxsw: reg: Limit MTBR register payload to a single data record
https://git.kernel.org/netdev/net-next/c/c755655c3d8b
- [net-next,2/3] mlxsw: core: Extend allowed list of external cooling devices for thermal zone binding
https://git.kernel.org/netdev/net-next/c/7afc79e20e22
- [net-next,3/3] mlxsw: i2c: Utilize standard macros for dividing buffer into chunks
https://git.kernel.org/netdev/net-next/c/1f73286371c2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-10-02 7:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-22 17:18 [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature Petr Machata
2023-09-22 17:18 ` [PATCH net-next 1/3] mlxsw: reg: Limit MTBR register payload to a single data record Petr Machata
2023-09-22 17:18 ` [PATCH net-next 2/3] mlxsw: core: Extend allowed list of external cooling devices for thermal zone binding Petr Machata
2023-09-22 17:18 ` [PATCH net-next 3/3] mlxsw: i2c: Utilize standard macros for dividing buffer into chunks Petr Machata
2023-09-28 12:42 ` [PATCH net-next 0/3] mlxsw: Provide enhancements and new feature Simon Horman
2023-10-02 7:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).