All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] memory: tegra: Check whether reset is already asserted
@ 2021-01-19 23:52 Dmitry Osipenko
  2021-01-22 21:40 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Osipenko @ 2021-01-19 23:52 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Peter Geis, Nicolas Chauvet,
	Matt Merhar, Krzysztof Kozlowski
  Cc: linux-tegra, linux-kernel

Check whether memory client reset is already asserted in order to prevent
DMA-flush error on trying to re-assert an already asserted reset.

This becomes a problem once PMC GENPD is enabled to use memory resets
since GENPD will get a error and fail to toggle power domain. PMC GENPDs
can't be toggled safely without holding memory reset on Tegra and we're
about to fix this.

Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
Tested-by: Dmitry Osipenko <digetx@gmail.com> # A500 T20 and Nexus7 T30
Tested-by: Nicolas Chauvet <kwizart@gmail.com> # PAZ00 T20
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/memory/tegra/mc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index 44064de962c2..a21163ccadc4 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -176,6 +176,13 @@ static int tegra_mc_hotreset_assert(struct reset_controller_dev *rcdev,
 	if (!rst_ops)
 		return -ENODEV;
 
+	/* DMA flushing will fail if reset is already asserted */
+	if (rst_ops->reset_status) {
+		/* check whether reset is asserted */
+		if (rst_ops->reset_status(mc, rst))
+			return 0;
+	}
+
 	if (rst_ops->block_dma) {
 		/* block clients DMA requests */
 		err = rst_ops->block_dma(mc, rst);
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] memory: tegra: Check whether reset is already asserted
  2021-01-19 23:52 [PATCH v1] memory: tegra: Check whether reset is already asserted Dmitry Osipenko
@ 2021-01-22 21:40 ` Krzysztof Kozlowski
  2021-01-22 21:58   ` Dmitry Osipenko
  0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:40 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Thierry Reding, Jonathan Hunter, Peter Geis, Nicolas Chauvet,
	Matt Merhar, linux-tegra, linux-kernel

On Wed, Jan 20, 2021 at 02:52:10AM +0300, Dmitry Osipenko wrote:
> Check whether memory client reset is already asserted in order to prevent
> DMA-flush error on trying to re-assert an already asserted reset.
> 
> This becomes a problem once PMC GENPD is enabled to use memory resets
> since GENPD will get a error and fail to toggle power domain. PMC GENPDs
> can't be toggled safely without holding memory reset on Tegra and we're
> about to fix this.
> 
> Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
> Tested-by: Dmitry Osipenko <digetx@gmail.com> # A500 T20 and Nexus7 T30

Don't add your own Tested-by. Author has to test it.  However this is a
v1 and already three other people added tests. Where are the emails?

> Tested-by: Nicolas Chauvet <kwizart@gmail.com> # PAZ00 T20
> Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>  drivers/memory/tegra/mc.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] memory: tegra: Check whether reset is already asserted
  2021-01-22 21:40 ` Krzysztof Kozlowski
@ 2021-01-22 21:58   ` Dmitry Osipenko
  2021-01-22 23:19     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Osipenko @ 2021-01-22 21:58 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Thierry Reding, Jonathan Hunter, Peter Geis, Nicolas Chauvet,
	Matt Merhar, linux-tegra, linux-kernel

23.01.2021 00:40, Krzysztof Kozlowski пишет:
> On Wed, Jan 20, 2021 at 02:52:10AM +0300, Dmitry Osipenko wrote:
>> Check whether memory client reset is already asserted in order to prevent
>> DMA-flush error on trying to re-assert an already asserted reset.
>>
>> This becomes a problem once PMC GENPD is enabled to use memory resets
>> since GENPD will get a error and fail to toggle power domain. PMC GENPDs
>> can't be toggled safely without holding memory reset on Tegra and we're
>> about to fix this.
>>
>> Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
>> Tested-by: Dmitry Osipenko <digetx@gmail.com> # A500 T20 and Nexus7 T30
> 
> Don't add your own Tested-by. Author has to test it.  However this is a
> v1 and already three other people added tests. Where are the emails?

The test results were given on #tegra irc.

Author doesn't have to test, from time to time I'm helping people who
can't make a patch with fixing obvious bugs for the h/w that I don't
have access to.

Anyways, I'll make v2 with myself removed if you prefer that, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] memory: tegra: Check whether reset is already asserted
  2021-01-22 21:58   ` Dmitry Osipenko
@ 2021-01-22 23:19     ` Krzysztof Kozlowski
  2021-01-23 14:04       ` Dmitry Osipenko
  0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 23:19 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Thierry Reding, Jonathan Hunter, Peter Geis, Nicolas Chauvet,
	Matt Merhar, linux-tegra, linux-kernel

On Sat, Jan 23, 2021 at 12:58:12AM +0300, Dmitry Osipenko wrote:
> 23.01.2021 00:40, Krzysztof Kozlowski пишет:
> > On Wed, Jan 20, 2021 at 02:52:10AM +0300, Dmitry Osipenko wrote:
> >> Check whether memory client reset is already asserted in order to prevent
> >> DMA-flush error on trying to re-assert an already asserted reset.
> >>
> >> This becomes a problem once PMC GENPD is enabled to use memory resets
> >> since GENPD will get a error and fail to toggle power domain. PMC GENPDs
> >> can't be toggled safely without holding memory reset on Tegra and we're
> >> about to fix this.
> >>
> >> Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
> >> Tested-by: Dmitry Osipenko <digetx@gmail.com> # A500 T20 and Nexus7 T30
> > 
> > Don't add your own Tested-by. Author has to test it.  However this is a
> > v1 and already three other people added tests. Where are the emails?
> 
> The test results were given on #tegra irc.
> 
> Author doesn't have to test, from time to time I'm helping people who
> can't make a patch with fixing obvious bugs for the h/w that I don't
> have access to.

By default, author's patches are assumed to be tested, otherwise we
would be putting own Tested-by in most of the cases (ideally: in all).
Just because you do not see author's Tested-by everywhere it does not
mean that author did not test it...

Testing is also a requirement:
https://elixir.bootlin.com/linux/latest/source/Documentation/process/5.Posting.rst#L35

Therefore if your non-trivial patches are not tested, please also
mention it with RFT or after '---'.

> 
> Anyways, I'll make v2 with myself removed if you prefer that, thanks.

I applied it without your tested-by. If the tested platform is anyhow
relevant, just mention it in the commit msg.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] memory: tegra: Check whether reset is already asserted
  2021-01-22 23:19     ` Krzysztof Kozlowski
@ 2021-01-23 14:04       ` Dmitry Osipenko
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Osipenko @ 2021-01-23 14:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Thierry Reding, Jonathan Hunter, Peter Geis, Nicolas Chauvet,
	Matt Merhar, linux-tegra, linux-kernel

23.01.2021 02:19, Krzysztof Kozlowski пишет:
> On Sat, Jan 23, 2021 at 12:58:12AM +0300, Dmitry Osipenko wrote:
>> 23.01.2021 00:40, Krzysztof Kozlowski пишет:
>>> On Wed, Jan 20, 2021 at 02:52:10AM +0300, Dmitry Osipenko wrote:
>>>> Check whether memory client reset is already asserted in order to prevent
>>>> DMA-flush error on trying to re-assert an already asserted reset.
>>>>
>>>> This becomes a problem once PMC GENPD is enabled to use memory resets
>>>> since GENPD will get a error and fail to toggle power domain. PMC GENPDs
>>>> can't be toggled safely without holding memory reset on Tegra and we're
>>>> about to fix this.
>>>>
>>>> Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
>>>> Tested-by: Dmitry Osipenko <digetx@gmail.com> # A500 T20 and Nexus7 T30
>>>
>>> Don't add your own Tested-by. Author has to test it.  However this is a
>>> v1 and already three other people added tests. Where are the emails?
>>
>> The test results were given on #tegra irc.
>>
>> Author doesn't have to test, from time to time I'm helping people who
>> can't make a patch with fixing obvious bugs for the h/w that I don't
>> have access to.
> 
> By default, author's patches are assumed to be tested, otherwise we
> would be putting own Tested-by in most of the cases (ideally: in all).
> Just because you do not see author's Tested-by everywhere it does not
> mean that author did not test it...
> 
> Testing is also a requirement:
> https://elixir.bootlin.com/linux/latest/source/Documentation/process/5.Posting.rst#L35
> 
> Therefore if your non-trivial patches are not tested, please also
> mention it with RFT or after '---'.
> 
>>
>> Anyways, I'll make v2 with myself removed if you prefer that, thanks.
> 
> I applied it without your tested-by. If the tested platform is anyhow
> relevant, just mention it in the commit msg.

Alright, thank you. In this particular case the platform should be
irrelevant.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-23 14:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 23:52 [PATCH v1] memory: tegra: Check whether reset is already asserted Dmitry Osipenko
2021-01-22 21:40 ` Krzysztof Kozlowski
2021-01-22 21:58   ` Dmitry Osipenko
2021-01-22 23:19     ` Krzysztof Kozlowski
2021-01-23 14:04       ` Dmitry Osipenko

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.