* [PATCH] i2c: designware: Fix regression when dynamic TAR update is disabled
@ 2017-02-09 19:50 Shah Nehal-Bakulchandra
2017-02-09 20:07 ` Andy Shevchenko
0 siblings, 1 reply; 6+ messages in thread
From: Shah Nehal-Bakulchandra @ 2017-02-09 19:50 UTC (permalink / raw)
To: jarkko.nikula, andriy.shevchenko, mika.westerberg
Cc: lucas.demarchi, wsa, linux-i2c, linux-kernel, Shyam-sundar.S-k,
Shah Nehal-Bakulchandra, Shah Nehal-Bakulchandra,
Suravee Suthikulpanit
The following commit causes a regression when dynamic TAR update is
disabled:
commit 63d0f0a6952a1a02bc4f116b7da7c7887e46efa3 ("i2c: designware:
detect when dynamic tar update is possible")
In such case, the DW_IC_CON_10BITADDR_MASTER is R/W, and is changed
by the logic that's trying to detect dynamic TAR update.The original
value of DW_IC_CON_10BITADDR_MASTER bit should be restored.
Signed-off-by: Shah Nehal-Bakulchandra <Nehal-bakulchandra.Shah@amd.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
drivers/i2c/busses/i2c-designware-core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 6d81c56..0c57166 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -987,6 +987,11 @@ int i2c_dw_probe(struct dw_i2c_dev *dev)
(reg & DW_IC_CON_10BITADDR_MASTER)) {
dev->dynamic_tar_update_enabled = true;
dev_dbg(dev->dev, "Dynamic TAR update enabled");
+ } else {
+ /* If test is failed then restore the original value */
+ dev->dynamic_tar_update_enabled = false;
+ dev_dbg(dev->dev, "Dynamic TAR update disable restore the value");
+ dw_writel(dev, reg, DW_IC_CON);
}
i2c_dw_release_lock(dev);
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: designware: Fix regression when dynamic TAR update is disabled
2017-02-09 19:50 [PATCH] i2c: designware: Fix regression when dynamic TAR update is disabled Shah Nehal-Bakulchandra
@ 2017-02-09 20:07 ` Andy Shevchenko
2017-02-09 21:34 ` De Marchi, Lucas
0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2017-02-09 20:07 UTC (permalink / raw)
To: Shah Nehal-Bakulchandra, jarkko.nikula, mika.westerberg
Cc: lucas.demarchi, wsa, linux-i2c, linux-kernel, Shyam-sundar.S-k,
Suravee Suthikulpanit
On Fri, 2017-02-10 at 01:20 +0530, Shah Nehal-Bakulchandra wrote:
> The following commit causes a regression when dynamic TAR update is
> disabled:
>
> commit 63d0f0a6952a1a02bc4f116b7da7c7887e46efa3 ("i2c:
> designware:
> detect when dynamic tar update is possible")
Please, leave just 12 characters, it still enough.
> In such case, the DW_IC_CON_10BITADDR_MASTER is R/W, and is changed
> by the logic that's trying to detect dynamic TAR update.The original
> value of DW_IC_CON_10BITADDR_MASTER bit should be restored.
>
+ Fixes tag?
> Signed-off-by: Shah Nehal-Bakulchandra <Nehal-
> bakulchandra.Shah@amd.com>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
> drivers/i2c/busses/i2c-designware-core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-designware-core.c
> b/drivers/i2c/busses/i2c-designware-core.c
> index 6d81c56..0c57166 100644
> --- a/drivers/i2c/busses/i2c-designware-core.c
> +++ b/drivers/i2c/busses/i2c-designware-core.c
> @@ -987,6 +987,11 @@ int i2c_dw_probe(struct dw_i2c_dev *dev)
> (reg & DW_IC_CON_10BITADDR_MASTER)) {
> dev->dynamic_tar_update_enabled = true;
> dev_dbg(dev->dev, "Dynamic TAR update enabled");
> + } else {
> + /* If test is failed then restore the original value
> */
> + dev->dynamic_tar_update_enabled = false;
It's default.
> + dev_dbg(dev->dev, "Dynamic TAR update disable restore
> the value");
I think this is useless. Either you have enabled message, or have
nothing.
> + dw_writel(dev, reg, DW_IC_CON);
> }
>
> i2c_dw_release_lock(dev);
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: designware: Fix regression when dynamic TAR update is disabled
2017-02-09 20:07 ` Andy Shevchenko
@ 2017-02-09 21:34 ` De Marchi, Lucas
2017-02-10 6:38 ` Suravee Suthikulpanit
0 siblings, 1 reply; 6+ messages in thread
From: De Marchi, Lucas @ 2017-02-09 21:34 UTC (permalink / raw)
To: mika.westerberg@linux.intel.com,
andriy.shevchenko@linux.intel.com, jarkko.nikula@linux.intel.com,
Nehal-Bakulchandra.Shah@amd.com
Cc: wsa@the-dreams.de, linux-kernel@vger.kernel.org,
suravee.suthikulpanit@amd.com, linux-i2c@vger.kernel.org,
Shyam-sundar.S-k@amd.com
On Thu, 2017-02-09 at 22:07 +0200, Andy Shevchenko wrote:
> On Fri, 2017-02-10 at 01:20 +0530, Shah Nehal-Bakulchandra wrote:
> > The following commit causes a regression when dynamic TAR update is
> > disabled:
> >
> > commit 63d0f0a6952a1a02bc4f116b7da7c7887e46efa3 ("i2c:
> > designware:
> > detect when dynamic tar update is possible")
>
> Please, leave just 12 characters, it still enough.
>
> > In such case, the DW_IC_CON_10BITADDR_MASTER is R/W, and is changed
> > by the logic that's trying to detect dynamic TAR update.The original
> > value of DW_IC_CON_10BITADDR_MASTER bit should be restored.
You are right, thanks for the fix. This may also explains why
0317e6c (i2c: designware: do not disable adapter after transfer) caused problems
and ended up being reverted. Could you try that on your hardware?
The dynamic tar update detection was only done as preparation work to allow not
disabling the adapter, which is reverted. We may also just revert this commit
instead of fixing the logic.
thanks
Lucas De Marchi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: designware: Fix regression when dynamic TAR update is disabled
2017-02-09 21:34 ` De Marchi, Lucas
@ 2017-02-10 6:38 ` Suravee Suthikulpanit
2017-02-10 10:48 ` Jarkko Nikula
0 siblings, 1 reply; 6+ messages in thread
From: Suravee Suthikulpanit @ 2017-02-10 6:38 UTC (permalink / raw)
To: De Marchi, Lucas, mika.westerberg@linux.intel.com,
andriy.shevchenko@linux.intel.com, jarkko.nikula@linux.intel.com,
Nehal-Bakulchandra.Shah@amd.com
Cc: wsa@the-dreams.de, linux-kernel@vger.kernel.org,
linux-i2c@vger.kernel.org, Shyam-sundar.S-k@amd.com
On 2/10/17 04:34, De Marchi, Lucas wrote:
> On Thu, 2017-02-09 at 22:07 +0200, Andy Shevchenko wrote:
>> On Fri, 2017-02-10 at 01:20 +0530, Shah Nehal-Bakulchandra wrote:
>>> The following commit causes a regression when dynamic TAR update is
>>> disabled:
>>>
>>> commit 63d0f0a6952a1a02bc4f116b7da7c7887e46efa3 ("i2c:
>>> designware:
>>> detect when dynamic tar update is possible")
>>
>> Please, leave just 12 characters, it still enough.
>>
>>> In such case, the DW_IC_CON_10BITADDR_MASTER is R/W, and is changed
>>> by the logic that's trying to detect dynamic TAR update.The original
>>> value of DW_IC_CON_10BITADDR_MASTER bit should be restored.
>
> You are right, thanks for the fix. This may also explains why
> 0317e6c (i2c: designware: do not disable adapter after transfer) caused problems
> and ended up being reverted. Could you try that on your hardware?
After looking at the patch (i2c: designware: do not disable adapter after transfer),
we see that it modifies the i2c_dw_xfer_init(). However, this function is never
called on our platform. So, this patch would not have any effects.
At this points, my understanding is there are probably two options here:
1) Keep the commit 63d0f0a6952a (i2c: designware: detect when dynamic tar update
is possible) and apply V2 of this patch in 4.10. We might need to back-port the change
to v4.9 stable as well.
2) Revert the 63d0f0a6952a (i2c: designware: detect when dynamic tar update is possible) in 4.10,
and also in v4.9 stable as well.
Thanks,
Suravee
> The dynamic tar update detection was only done as preparation work to allow not
> disabling the adapter, which is reverted. We may also just revert this commit
> instead of fixing the logic.
>
>
> thanks
> Lucas De Marchi
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: designware: Fix regression when dynamic TAR update is disabled
2017-02-10 6:38 ` Suravee Suthikulpanit
@ 2017-02-10 10:48 ` Jarkko Nikula
2017-02-13 4:15 ` Shah, Nehal-bakulchandra
0 siblings, 1 reply; 6+ messages in thread
From: Jarkko Nikula @ 2017-02-10 10:48 UTC (permalink / raw)
To: Suravee Suthikulpanit, De Marchi, Lucas,
mika.westerberg@linux.intel.com,
andriy.shevchenko@linux.intel.com,
Nehal-Bakulchandra.Shah@amd.com
Cc: wsa@the-dreams.de, linux-kernel@vger.kernel.org,
linux-i2c@vger.kernel.org, Shyam-sundar.S-k@amd.com
On 10.02.2017 08:38, Suravee Suthikulpanit wrote:
> At this points, my understanding is there are probably two options here:
>
> 1) Keep the commit 63d0f0a6952a (i2c: designware: detect when dynamic
> tar update
> is possible) and apply V2 of this patch in 4.10. We might need to
> back-port the change
> to v4.9 stable as well.
>
> 2) Revert the 63d0f0a6952a (i2c: designware: detect when dynamic tar
> update is possible) in 4.10,
> and also in v4.9 stable as well.
>
I'm fine with both options. Maybe revert as commit 0317e6c0f1dc ("i2c:
designware: do not disable adapter after transfer") was also reverted
and this revert doesn't seem to cause conflicts.
--
Jarkko
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] i2c: designware: Fix regression when dynamic TAR update is disabled
2017-02-10 10:48 ` Jarkko Nikula
@ 2017-02-13 4:15 ` Shah, Nehal-bakulchandra
0 siblings, 0 replies; 6+ messages in thread
From: Shah, Nehal-bakulchandra @ 2017-02-13 4:15 UTC (permalink / raw)
To: Jarkko Nikula, Suthikulpanit, Suravee, De Marchi, Lucas,
mika.westerberg@linux.intel.com,
andriy.shevchenko@linux.intel.com
Cc: wsa@the-dreams.de, linux-kernel@vger.kernel.org,
linux-i2c@vger.kernel.org, S-k, Shyam-sundar
It is better to revert the 63d0f0a6952a.
-----Original Message-----
From: Jarkko Nikula [mailto:jarkko.nikula@linux.intel.com]
Sent: Friday, February 10, 2017 4:19 PM
To: Suthikulpanit, Suravee <Suravee.Suthikulpanit@amd.com>; De Marchi, Lucas <lucas.demarchi@intel.com>; mika.westerberg@linux.intel.com; andriy.shevchenko@linux.intel.com; Shah, Nehal-bakulchandra <Nehal-bakulchandra.Shah@amd.com>
Cc: wsa@the-dreams.de; linux-kernel@vger.kernel.org; linux-i2c@vger.kernel.org; S-k, Shyam-sundar <Shyam-sundar.S-k@amd.com>
Subject: Re: [PATCH] i2c: designware: Fix regression when dynamic TAR update is disabled
On 10.02.2017 08:38, Suravee Suthikulpanit wrote:
> At this points, my understanding is there are probably two options here:
>
> 1) Keep the commit 63d0f0a6952a (i2c: designware: detect when dynamic
> tar update
> is possible) and apply V2 of this patch in 4.10. We might need to
> back-port the change
> to v4.9 stable as well.
>
> 2) Revert the 63d0f0a6952a (i2c: designware: detect when dynamic tar
> update is possible) in 4.10,
> and also in v4.9 stable as well.
>
I'm fine with both options. Maybe revert as commit 0317e6c0f1dc ("i2c:
designware: do not disable adapter after transfer") was also reverted and this revert doesn't seem to cause conflicts.
--
Jarkko
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-02-13 4:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-09 19:50 [PATCH] i2c: designware: Fix regression when dynamic TAR update is disabled Shah Nehal-Bakulchandra
2017-02-09 20:07 ` Andy Shevchenko
2017-02-09 21:34 ` De Marchi, Lucas
2017-02-10 6:38 ` Suravee Suthikulpanit
2017-02-10 10:48 ` Jarkko Nikula
2017-02-13 4:15 ` Shah, Nehal-bakulchandra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox