[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZqfhPffOTu53bfwU@shikoro>
Date: Mon, 29 Jul 2024 20:36:45 +0200
From: Wolfram Sang <wsa+renesas@...g-engineering.com>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Wolfram Sang <wsa@...nel.org>, Jean Delvare <khali@...ux-fr.org>,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] i2c: smbus: Send alert notifications to all devices
if source not found
> I looked into the code again. The sequence is (or is supposed to be):
>
> 1st loop:
> if (!alert_pending)
> break;
> smbus_do_alert()
> if (failed at same address)
> smbus_do_alert_force()
>
> 2nd loop:
> if (!alert_pending)
> break;
> smbus_do_alert()
> if (failed at same address)
> break;
>
> I think what you are suggesting is
...
What I am suggesting is more like this:
1st loop:
smbus_do_alert()
//impossible to have same address on first run, so go to 2nd loop
2nd loop:
smbus_do_alert()
if (failed at same address)
smbus_do_alert_force()
break;
As I understand it, your sequence is missing "my" 1st loop with the
invalid address, so you will end up having 3 loops altogether?
The code I am suggesting is bascially yours without the retries
variable:
status = device_for_each_child(&ara->adapter->dev, &data,
smbus_do_alert);
if (data.addr == prev_addr && status != -EBUSY) {
device_for_each_child(&ara->adapter->dev, &data,
smbus_do_alert_force);
break;
}
prev_addr = data.addr;
Makes sense or am I missing something?
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists