devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Akhil R <akhilrajeev@nvidia.com>
To: <andy.shevchenko@gmail.com>
Cc: <akhilrajeev@nvidia.com>, <andi.shyti@kernel.org>,
	<andriy.shevchenko@linux.intel.com>, <conor+dt@kernel.org>,
	<devicetree@vger.kernel.org>, <digetx@gmail.com>,
	<jonathanh@nvidia.com>, <krzk+dt@kernel.org>,
	<ldewangan@nvidia.com>, <linux-i2c@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
	<p.zabel@pengutronix.de>, <robh@kernel.org>,
	<thierry.reding@gmail.com>
Subject: Re: [PATCH v4 2/3] i2c: tegra: make reset an optional property
Date: Fri, 13 Jun 2025 11:30:32 +0530	[thread overview]
Message-ID: <20250613060032.14927-1-akhilrajeev@nvidia.com> (raw)
In-Reply-To: <aEsf7Ml__JE1ixQX@surfacebook.localdomain>

On Thu, 12 Jun 2025 21:43:56 +0300, Andy Shevchenko wrote:

>> >> >     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.
>> 
>> As in Thierry's comment, I was in thought of updating the code as below.
>> Does it make sense or would it be better keep what it is there now?
>> 
>> if (handle && acpi_has_method(handle, "_RST"))
>> 	err = acpi_evaluate_object(handle, "_RST", NULL, NULL);
>> else if (i2c_dev->rst)
>> 	err = reset_control_reset(i2c_dev->rst);
>> else
>> 	err = tegra_i2c_master_reset(i2c_dev);
>
> This will change current behaviour for the ACPI based platforms that do not
> have an _RST method. At bare minumum this has to be elaborated in the commit
> message with an explanation why it's not a probnlem.
>

This sequence is hit only at boot and on any error. It should be good to reset
the controller internally at least for those cases. We are reconfiguring the I2C
anyway after this and hence should not cause any problem.
Will add these in the commit message as well.

Thanks & Regards,
Akhil


  reply	other threads:[~2025-06-13  6:01 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
2025-06-12 15:33       ` Akhil R
2025-06-12 18:43         ` Andy Shevchenko
2025-06-13  6:00           ` Akhil R [this message]
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=20250613060032.14927-1-akhilrajeev@nvidia.com \
    --to=akhilrajeev@nvidia.com \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).