mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
To: Prabhakar <prabhakar.csengg@gmail.com>,
	Chris Brandt <chris.brandt@renesas.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Wolfram Sang <wsa@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: Re: [PATCH v2 9/9] i2c: riic: Implement bus recovery
Date: Sat, 21 Dec 2024 11:13:38 +0200	[thread overview]
Message-ID: <5242fffa-c028-49dd-a7cc-b6d9330f3c1c@tuxon.dev> (raw)
In-Reply-To: <20241218001618.488946-10-prabhakar.mahadev-lad.rj@bp.renesas.com>



On 18.12.2024 02:16, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> 
> Implement bus recovery by reinitializing the hardware to reset the bus
> state and generating 9 clock cycles (and a stop condition) to release
> the SDA line.
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
> v1->v2
> - Used single register read to check SDA/SCL lines
> ---
>  drivers/i2c/busses/i2c-riic.c | 100 ++++++++++++++++++++++++++++++----
>  1 file changed, 90 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c
> index 586092454bb2..d93c371a22de 100644
> --- a/drivers/i2c/busses/i2c-riic.c
> +++ b/drivers/i2c/busses/i2c-riic.c
> @@ -50,6 +50,7 @@
>  

[ ... ]

> +static int riic_recover_bus(struct i2c_adapter *adap)
> +{
> +	struct riic_dev *riic = i2c_get_adapdata(adap);
> +	struct device *dev = riic->adapter.dev.parent;
> +	int ret;
> +	u8 val;
> +
> +	ret = riic_init_hw(riic, true);
> +	if (ret)
> +		return -EINVAL;

Any reason for not returning directly the ret? It is true the
riic_init_hw() can, ATM, return only -EINVAL in case of failure.

Thank you,
Claudiu

  parent reply	other threads:[~2024-12-21  9:13 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18  0:16 [PATCH v2 0/9] Add support for I2C bus recovery for riic driver Prabhakar
2024-12-18  0:16 ` [PATCH v2 1/9] i2c: riic: Replace dev_err with dev_err_probe in probe function Prabhakar
2024-12-20 21:17   ` Wolfram Sang
2024-12-18  0:16 ` [PATCH v2 2/9] i2c: riic: Use local `dev` pointer in `dev_err_probe()` Prabhakar
2024-12-19 12:21   ` Andi Shyti
2024-12-19 12:44     ` Lad, Prabhakar
2024-12-19 21:08       ` Andi Shyti
2024-12-20 21:18   ` Wolfram Sang
2024-12-26  1:19   ` Andi Shyti
2024-12-26  7:39     ` Lad, Prabhakar
2024-12-26 10:06       ` Andi Shyti
2024-12-18  0:16 ` [PATCH v2 3/9] i2c: riic: Use BIT macro consistently Prabhakar
2024-12-20 21:19   ` Wolfram Sang
2024-12-18  0:16 ` [PATCH v2 4/9] i2c: riic: Use GENMASK() macro for bitmask definitions Prabhakar
2024-12-20 21:20   ` Wolfram Sang
2024-12-20 21:21   ` Wolfram Sang
2024-12-18  0:16 ` [PATCH v2 5/9] i2c: riic: Make use of devres helper to request deasserted reset line Prabhakar
2024-12-18 13:30   ` Geert Uytterhoeven
2024-12-18  0:16 ` [PATCH v2 6/9] i2c: riic: Mark riic_irqs array as const Prabhakar
2024-12-18  0:16 ` [PATCH v2 7/9] i2c: riic: Use predefined macro and simplify clock tick calculation Prabhakar
2024-12-20 21:23   ` Wolfram Sang
2024-12-18  0:16 ` [PATCH v2 8/9] i2c: riic: Add `riic_bus_barrier()` to check bus availability Prabhakar
2024-12-18 13:31   ` Geert Uytterhoeven
2024-12-20 21:26   ` Wolfram Sang
2024-12-22  4:16     ` Lad, Prabhakar
2024-12-18  0:16 ` [PATCH v2 9/9] i2c: riic: Implement bus recovery Prabhakar
2024-12-20 21:16   ` Wolfram Sang
2024-12-22  4:12     ` Lad, Prabhakar
2024-12-22 12:44       ` Wolfram Sang
2024-12-23  6:35         ` Lad, Prabhakar
2024-12-26  1:21           ` Andi Shyti
2024-12-27 11:27             ` Wolfram Sang
2024-12-27 22:05               ` Andi Shyti
2025-01-06 17:45         ` Lad, Prabhakar
2025-04-16  7:43           ` Wolfram Sang
2025-04-16 13:04             ` Wolfram Sang
2024-12-21  9:13   ` Claudiu Beznea [this message]
2024-12-22  4:14     ` Lad, Prabhakar
2024-12-20 12:02 ` [PATCH v2 0/9] Add support for I2C bus recovery for riic driver Wolfram Sang
2024-12-20 21:28   ` Wolfram Sang
2024-12-21  9:42 ` Claudiu Beznea
2024-12-26  1:24 ` Andi Shyti

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=5242fffa-c028-49dd-a7cc-b6d9330f3c1c@tuxon.dev \
    --to=claudiu.beznea@tuxon.dev \
    --cc=andi.shyti@kernel.org \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=chris.brandt@renesas.com \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=prabhakar.csengg@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=wsa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®