All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: Akhil R <akhilrajeev@nvidia.com>,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	thierry.reding@gmail.com, jonathanh@nvidia.com,
	ldewangan@nvidia.com, digetx@gmail.com, p.zabel@pengutronix.de,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/3] i2c: tegra: make reset an optional property
Date: Thu, 12 Jun 2025 15:55:21 +0300	[thread overview]
Message-ID: <aErOOSxt0ovCIeSA@smile.fi.intel.com> (raw)
In-Reply-To: <7sncphuidgiz6orsocixgybm2npcsjrdm7gnl3e52vfms2polu@4mmhdtc4zg5x>

On Thu, Jun 12, 2025 at 02:57:36AM +0200, Andi Shyti wrote:

...

> > +static int tegra_i2c_master_reset(struct tegra_i2c_dev *i2c_dev)
> > +{
> > +	if (!i2c_dev->hw->has_mst_reset)
> > +		return -EOPNOTSUPP;
> > +
> > +	i2c_writel(i2c_dev, 0x1, I2C_MASTER_RESET_CNTRL);
> > +	udelay(2);
> > +
> > +	i2c_writel(i2c_dev, 0x0, I2C_MASTER_RESET_CNTRL);
> > +	udelay(2);
> > +
> > +	return 0;
> > +}
> > +
> >  static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
> >  {
> >  	u32 val, clk_divisor, clk_multiplier, tsu_thd, tlow, thigh, non_hs_mode;
> > @@ -621,8 +641,10 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
> >  	 */
> >  	if (handle)
> >  		err = acpi_evaluate_object(handle, "_RST", NULL, NULL);
> > -	else
> > +	else if (i2c_dev->rst)
> >  		err = reset_control_reset(i2c_dev->rst);
> > +	else
> > +		err = tegra_i2c_master_reset(i2c_dev);
> 
> Can you please take a look here? Should the reset happen in ACPI?

This is a good question. Without seeing all the implementations of _RST method
for the platforms based on this SoC it's hard to say. Ideally the _RST (which
is called above) must handle it properly, but firmwares have bugs...

TL;DR: I think the approach is correct, and if any bug in ACPI will be found,
the workaround (quirk) needs to be added here later on.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-06-12 12:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 15:30 [PATCH v4 1/3] dt-bindings: i2c: nvidia,tegra20-i2c: Specify the required properties Akhil R
2025-06-03 15:30 ` [PATCH v4 2/3] i2c: tegra: make reset an optional property Akhil R
2025-06-10  8:32   ` Thierry Reding
2025-06-10  9:51     ` Akhil R
2025-06-10  9:56       ` Thierry Reding
2025-06-12  0:57   ` Andi Shyti
2025-06-12 12:55     ` Andy Shevchenko [this message]
2025-06-12 15:33       ` Akhil R
2025-06-12 18:43         ` Andy Shevchenko
2025-06-13  6:00           ` Akhil R
2025-06-13  7:00             ` Andy Shevchenko
2025-06-03 15:30 ` [PATCH v4 3/3] i2c: tegra: Remove dma_sync_*() calls Akhil R
2025-06-10  8:03   ` Thierry Reding
2025-06-03 19:00 ` [PATCH v4 1/3] dt-bindings: i2c: nvidia,tegra20-i2c: Specify the required properties Krzysztof Kozlowski
2025-06-09  9:02   ` Akhil R
2025-06-10  8:09     ` Krzysztof Kozlowski
2025-06-12  0:59 ` 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=aErOOSxt0ovCIeSA@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=akhilrajeev@nvidia.com \
    --cc=andi.shyti@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=digetx@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzk+dt@kernel.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=thierry.reding@gmail.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 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.