[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d2d09fe1-dada-e844-cafa-da48424855a4@roeck-us.net>
Date: Tue, 19 Apr 2022 18:00:38 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Adam Wujek <dev_public@...ek.eu>
Cc: Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwmod: (pmbus) disable PEC if not enabled
On 4/19/22 13:53, Adam Wujek wrote:
> Explicitly disable PEC when the client does not support it.
> Without the explicit disable, when the device with the PEC support is removed
> later when a device without PEC support is inserted into the same address,
> the driver uses the old value of client->flags which contains the I2C_CLIENT_PEC
> flag. As a consequence the PEC is used when it should not.
>
> Signed-off-by: Adam Wujek <dev_public@...ek.eu>
> ---
> drivers/hwmon/pmbus/pmbus_core.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
> index 82c3754e21e3..f8ca36759b0a 100644
> --- a/drivers/hwmon/pmbus/pmbus_core.c
> +++ b/drivers/hwmon/pmbus/pmbus_core.c
> @@ -2014,6 +2014,8 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
> ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY);
> if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK))
> client->flags |= I2C_CLIENT_PEC;
> + else
> + client->flags &= ~I2C_CLIENT_PEC;
>
I just realized that this patch is not based on the latest
kernel version. Please rebase.
Guenter
Powered by blists - more mailing lists