lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <DM4PR12MB610936CBF0B76A9402FD63D98C07A@DM4PR12MB6109.namprd12.prod.outlook.com>
Date: Mon, 1 Sep 2025 05:48:20 +0000
From: "Guntupalli, Manikanta" <manikanta.guntupalli@....com>
To: "Guntupalli, Manikanta" <manikanta.guntupalli@....com>, "git (AMD-Xilinx)"
	<git@....com>, "Simek, Michal" <michal.simek@....com>, "peda@...ntia.se"
	<peda@...ntia.se>, "linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"wsa+renesas@...g-engineering.com" <wsa+renesas@...g-engineering.com>
CC: "Pandey, Radhey Shyam" <radhey.shyam.pandey@....com>, "Goud, Srinivas"
	<srinivas.goud@....com>, "Datta, Shubhrajyoti" <shubhrajyoti.datta@....com>,
	"manion05gk@...il.com" <manion05gk@...il.com>
Subject: RE: [PATCH V2] PCA9541: Use I2C adapter timeout value for arbitration
 timeout

[Public]

Ping!

> -----Original Message-----
> From: Manikanta Guntupalli <manikanta.guntupalli@....com>
> Sent: Thursday, July 31, 2025 6:26 PM
> To: git (AMD-Xilinx) <git@....com>; Simek, Michal <michal.simek@....com>;
> peda@...ntia.se; linux-i2c@...r.kernel.org; linux-kernel@...r.kernel.org;
> wsa+renesas@...g-engineering.com
> Cc: Pandey, Radhey Shyam <radhey.shyam.pandey@....com>; Goud, Srinivas
> <srinivas.goud@....com>; Datta, Shubhrajyoti <shubhrajyoti.datta@....com>;
> manion05gk@...il.com; Guntupalli, Manikanta <manikanta.guntupalli@....com>
> Subject: [PATCH V2] PCA9541: Use I2C adapter timeout value for arbitration
> timeout
>
> Remove existing arbitration timeout macros and use I2C adapter timeout
> value for arbitration timeout and forceful bus ownership.
>
> I2C adapter timeout can be configurable from user space, so using it
> for arbitration timeout helps in configuring the arbitration timeout
> from user space depending on the use case.
>
> Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@....com>
> ---
> Changes for V2:
> Remove existing arbitration timeout macros and use i2c adapter timeout
> value.
> Change logging and commit details.
> Link for V1: https://lore.kernel.org/all/20250711124503.3390451-1-
> manikanta.guntupalli@....com/
> ---
>  drivers/i2c/muxes/i2c-mux-pca9541.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c b/drivers/i2c/muxes/i2c-mux-
> pca9541.c
> index 8663c8a7c269..3d8002caf703 100644
> --- a/drivers/i2c/muxes/i2c-mux-pca9541.c
> +++ b/drivers/i2c/muxes/i2c-mux-pca9541.c
> @@ -63,10 +63,6 @@
>  #define mybus(x)     (!((x) & MYBUS) || ((x) & MYBUS) == MYBUS)
>  #define busoff(x)    (!((x) & BUSON) || ((x) & BUSON) == BUSON)
>
> -/* arbitration timeouts, in jiffies */
> -#define ARB_TIMEOUT  (HZ / 8)        /* 125 ms until forcing bus ownership */
> -#define ARB2_TIMEOUT (HZ / 4)        /* 250 ms until acquisition failure */
> -
>  /* arbitration retry delays, in us */
>  #define SELECT_DELAY_SHORT   50
>  #define SELECT_DELAY_LONG    1000
> @@ -229,6 +225,9 @@ static int pca9541_arbitrate(struct i2c_client *client)
>                */
>               data->select_timeout = SELECT_DELAY_LONG;
>               if (time_is_before_eq_jiffies(data->arb_timeout)) {
> +                     dev_warn(&client->dev,
> +                              "Arbitration timeout on I2C bus, forcing bus
> ownership\n");
> +
>                       /* Time is up, take the bus and reset it. */
>                       pca9541_reg_write(client,
>                                         PCA9541_CONTROL,
> @@ -251,10 +250,10 @@ static int pca9541_select_chan(struct i2c_mux_core
> *muxc, u32 chan)
>       struct pca9541 *data = i2c_mux_priv(muxc);
>       struct i2c_client *client = data->client;
>       int ret;
> -     unsigned long timeout = jiffies + ARB2_TIMEOUT;
> +     unsigned long timeout = jiffies + (2 * client->adapter->timeout);
>               /* give up after this time */
>
> -     data->arb_timeout = jiffies + ARB_TIMEOUT;
> +     data->arb_timeout = jiffies + client->adapter->timeout;
>               /* force bus ownership after this time */
>
>       do {
> @@ -267,6 +266,7 @@ static int pca9541_select_chan(struct i2c_mux_core *muxc,
> u32 chan)
>               else
>                       msleep(data->select_timeout / 1000);
>       } while (time_is_after_eq_jiffies(timeout));
> +     dev_warn(&client->dev, "Failed to acquire I2C bus, timed out\n");
>
>       return -ETIMEDOUT;
>  }
> --
> 2.34.1

Thanks,
Manikanta.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ