public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
Cc: git@amd.com, michal.simek@amd.com, peda@axentia.se,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	radhey.shyam.pandey@amd.com, srinivas.goud@amd.com,
	shubhrajyoti.datta@amd.com, manikantaguntupalli09@gmail.com,
	Jonathan Stroud <jonathan.stroud@amd.com>
Subject: Re: [PATCH 1/1] PCA9541: Increase I2C bus arbitration timeout
Date: Mon, 28 Jul 2025 10:55:13 +0200	[thread overview]
Message-ID: <aIc68UkzN_l0gZ_D@shikoro> (raw)
In-Reply-To: <20250711124503.3390451-2-manikanta.guntupalli@amd.com>

[-- Attachment #1: Type: text/plain, Size: 917 bytes --]

Hi,

thanks for your patch.

>  /* 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 */
> +#define ARB_TIMEOUT	(HZ)		/* 1 s until forcing bus ownership */
> +#define ARB2_TIMEOUT	(2 * HZ)	/* 2 s until acquisition failure */

Can't we use the timeout value of the parent struct i2c_adapter? This is
by default HZ and can be set by userspace via IOCTL depending on the
actual use case. So, we would use (pseudo-code, probably):

254         unsigned long timeout = jiffies + 2 * client->adapter->timeout;
255                 /* give up after this time */
256 
257         data->arb_timeout = jiffies + client->adapter->timeout;

?


> +			dev_info(&client->dev, "I2C Bus Arbiter timeout, forcing take bus\n");

'dev_warn' for both?

Happy hacking,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2025-07-28  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-11 12:45 [PATCH 0/1] Increase I2C bus arbitration timeout in the PCA9541 driver Manikanta Guntupalli
2025-07-11 12:45 ` [PATCH 1/1] PCA9541: Increase I2C bus arbitration timeout Manikanta Guntupalli
2025-07-28  8:55   ` Wolfram Sang [this message]

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=aIc68UkzN_l0gZ_D@shikoro \
    --to=wsa+renesas@sang-engineering.com \
    --cc=git@amd.com \
    --cc=jonathan.stroud@amd.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manikanta.guntupalli@amd.com \
    --cc=manikantaguntupalli09@gmail.com \
    --cc=michal.simek@amd.com \
    --cc=peda@axentia.se \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=shubhrajyoti.datta@amd.com \
    --cc=srinivas.goud@amd.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox