All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: wujek dev <dev_public@wujek.eu>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmod: (pmbus) disable PEC if not enabled
Date: Tue, 19 Apr 2022 16:46:38 -0700	[thread overview]
Message-ID: <8a8124e0-0789-fcc2-826c-69ef870a42d3@roeck-us.net> (raw)
In-Reply-To: <zNXN2w4xqB6a_14RhNubTjTdcUmzypjeVY-5FXeXlPHsYDuSdQ0qlDjO0CNFnYOrUUAnIlBBIdvMjKURyH4nuthmNQ29ifpaNywsWiU99oQ=@wujek.eu>

On 4/19/22 15:10, wujek dev wrote:
> ------- Original Message -------
> On Wednesday, April 20th, 2022 at 00:00, Guenter Roeck <linux@roeck-us.net> wrote:
>>
>>
>> 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.
>>
>>
>> How can that happen ? I would assume the I2C device gets deleted and re-created
>> in that case, which should clear the PEC flag.
>>
>> Guenter
> In my case it was when I unloaded the driver for the I2C slave, changed the advertised PEC value in PMBUS_CAPABILITY register on slave. Then loaded the driver. When the switch was from disable->enable it worked as expected (this case was already covered), but when the PEC was set in the slave from enabled->disabled it was still using PEC to communicate.

So it is really the same device, only you unload the driver, change the
device configuration (presumably with i2cset commands), and load it
again. Please explain that in more detail in the commit description.

Thanks,
Guenter

  reply	other threads:[~2022-04-19 23:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 20:53 [PATCH] hwmod: (pmbus) disable PEC if not enabled Adam Wujek
2022-04-19 22:00 ` Guenter Roeck
2022-04-19 22:10   ` wujek dev
2022-04-19 23:46     ` Guenter Roeck [this message]
2022-04-20  1:00 ` Guenter Roeck
2022-04-20 12:54   ` Adam Wujek
2022-04-20 13:55     ` Guenter Roeck
2022-04-20 14:51       ` [v3 PATCH] hwmon: " Adam Wujek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a8124e0-0789-fcc2-826c-69ef870a42d3@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=dev_public@wujek.eu \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.