* [PATCH v2 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer()
[not found] <20201126191146.8753-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
@ 2020-11-26 19:11 ` Lad Prabhakar
2020-11-27 9:34 ` Geert Uytterhoeven
` (2 more replies)
2020-11-26 19:11 ` [PATCH v2 2/5] memory: renesas-rpc-if: Fix unbalanced pm_runtime_enable in rpcif_{enable,disable}_rpm Lad Prabhakar
2020-11-26 19:11 ` [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe() Lad Prabhakar
2 siblings, 3 replies; 11+ messages in thread
From: Lad Prabhakar @ 2020-11-26 19:11 UTC (permalink / raw)
To: Sergei Shtylyov, Krzysztof Kozlowski, Philipp Zabel, Jiri Kosina,
Mark Brown, linux-renesas-soc, Pavel Machek, Geert Uytterhoeven
Cc: linux-kernel, Prabhakar, Lad Prabhakar, stable
In the error path of rpcif_manual_xfer() the value of ret is overwritten
by value returned by reset_control_reset() function and thus returning
incorrect value to the caller.
This patch makes sure the correct value is returned to the caller of
rpcif_manual_xfer() by dropping the overwrite of ret in error path.
Also now we ignore the value returned by reset_control_reset() in the
error path and instead print a error message when it fails.
Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: stable@vger.kernel.org
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
---
drivers/memory/renesas-rpc-if.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index f2a33a1af836..69f2e2b4cd50 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -508,7 +508,8 @@ int rpcif_manual_xfer(struct rpcif *rpc)
return ret;
err_out:
- ret = reset_control_reset(rpc->rstc);
+ if (reset_control_reset(rpc->rstc))
+ dev_err(rpc->dev, "Failed to reset HW\n");
rpcif_hw_init(rpc, rpc->bus_size == 2);
goto exit;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/5] memory: renesas-rpc-if: Fix unbalanced pm_runtime_enable in rpcif_{enable,disable}_rpm
[not found] <20201126191146.8753-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
2020-11-26 19:11 ` [PATCH v2 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer() Lad Prabhakar
@ 2020-11-26 19:11 ` Lad Prabhakar
2020-11-26 19:33 ` Sergei Shtylyov
2020-11-28 11:33 ` Krzysztof Kozlowski
2020-11-26 19:11 ` [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe() Lad Prabhakar
2 siblings, 2 replies; 11+ messages in thread
From: Lad Prabhakar @ 2020-11-26 19:11 UTC (permalink / raw)
To: Sergei Shtylyov, Krzysztof Kozlowski, Philipp Zabel, Jiri Kosina,
Mark Brown, linux-renesas-soc, Pavel Machek, Geert Uytterhoeven
Cc: linux-kernel, Prabhakar, Lad Prabhakar, stable
rpcif_enable_rpm calls pm_runtime_enable, so rpcif_disable_rpm needs to
call pm_runtime_disable and not pm_runtime_put_sync.
Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
Reported-by: Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: stable@vger.kernel.org
---
drivers/memory/renesas-rpc-if.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index 69f2e2b4cd50..a8d0ba368625 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -212,7 +212,7 @@ EXPORT_SYMBOL(rpcif_enable_rpm);
void rpcif_disable_rpm(struct rpcif *rpc)
{
- pm_runtime_put_sync(rpc->dev);
+ pm_runtime_disable(rpc->dev);
}
EXPORT_SYMBOL(rpcif_disable_rpm);
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe()
[not found] <20201126191146.8753-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
2020-11-26 19:11 ` [PATCH v2 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer() Lad Prabhakar
2020-11-26 19:11 ` [PATCH v2 2/5] memory: renesas-rpc-if: Fix unbalanced pm_runtime_enable in rpcif_{enable,disable}_rpm Lad Prabhakar
@ 2020-11-26 19:11 ` Lad Prabhakar
2020-11-27 9:33 ` Geert Uytterhoeven
2020-11-27 22:41 ` Pavel Machek
2 siblings, 2 replies; 11+ messages in thread
From: Lad Prabhakar @ 2020-11-26 19:11 UTC (permalink / raw)
To: Sergei Shtylyov, Krzysztof Kozlowski, Philipp Zabel, Jiri Kosina,
Mark Brown, linux-renesas-soc, Pavel Machek, Geert Uytterhoeven
Cc: linux-kernel, Prabhakar, Lad Prabhakar, stable
Release the node reference by calling of_node_put(flash) in the probe.
Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: stable@vger.kernel.org
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
---
drivers/memory/renesas-rpc-if.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index a8d0ba368625..da0fdb4c7595 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -561,9 +561,11 @@ static int rpcif_probe(struct platform_device *pdev)
} else if (of_device_is_compatible(flash, "cfi-flash")) {
name = "rpc-if-hyperflash";
} else {
+ of_node_put(flash);
dev_warn(&pdev->dev, "unknown flash type\n");
return -ENODEV;
}
+ of_node_put(flash);
vdev = platform_device_alloc(name, pdev->id);
if (!vdev)
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/5] memory: renesas-rpc-if: Fix unbalanced pm_runtime_enable in rpcif_{enable,disable}_rpm
2020-11-26 19:11 ` [PATCH v2 2/5] memory: renesas-rpc-if: Fix unbalanced pm_runtime_enable in rpcif_{enable,disable}_rpm Lad Prabhakar
@ 2020-11-26 19:33 ` Sergei Shtylyov
2020-11-28 11:33 ` Krzysztof Kozlowski
1 sibling, 0 replies; 11+ messages in thread
From: Sergei Shtylyov @ 2020-11-26 19:33 UTC (permalink / raw)
To: Lad Prabhakar, Krzysztof Kozlowski, Philipp Zabel, Jiri Kosina,
Mark Brown, linux-renesas-soc, Pavel Machek, Geert Uytterhoeven
Cc: linux-kernel, Prabhakar, stable
On 11/26/20 10:11 PM, Lad Prabhakar wrote:
> rpcif_enable_rpm calls pm_runtime_enable, so rpcif_disable_rpm needs to
> call pm_runtime_disable and not pm_runtime_put_sync.
>
> Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
> Reported-by: Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reported by reported? :-)
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: stable@vger.kernel.org
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe()
2020-11-26 19:11 ` [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe() Lad Prabhakar
@ 2020-11-27 9:33 ` Geert Uytterhoeven
2020-11-27 22:41 ` Pavel Machek
1 sibling, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2020-11-27 9:33 UTC (permalink / raw)
To: Lad Prabhakar
Cc: Sergei Shtylyov, Krzysztof Kozlowski, Philipp Zabel, Jiri Kosina,
Mark Brown, Linux-Renesas, Pavel Machek, Geert Uytterhoeven,
Linux Kernel Mailing List, Prabhakar, stable
On Thu, Nov 26, 2020 at 8:12 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
> Release the node reference by calling of_node_put(flash) in the probe.
>
> Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
> Reported-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: stable@vger.kernel.org
> Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer()
2020-11-26 19:11 ` [PATCH v2 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer() Lad Prabhakar
@ 2020-11-27 9:34 ` Geert Uytterhoeven
2020-11-27 22:38 ` Pavel Machek
2020-11-28 11:32 ` Krzysztof Kozlowski
2 siblings, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2020-11-27 9:34 UTC (permalink / raw)
To: Lad Prabhakar
Cc: Sergei Shtylyov, Krzysztof Kozlowski, Philipp Zabel, Jiri Kosina,
Mark Brown, Linux-Renesas, Pavel Machek, Geert Uytterhoeven,
Linux Kernel Mailing List, Prabhakar, stable
On Thu, Nov 26, 2020 at 8:12 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
> In the error path of rpcif_manual_xfer() the value of ret is overwritten
> by value returned by reset_control_reset() function and thus returning
> incorrect value to the caller.
>
> This patch makes sure the correct value is returned to the caller of
> rpcif_manual_xfer() by dropping the overwrite of ret in error path.
> Also now we ignore the value returned by reset_control_reset() in the
> error path and instead print a error message when it fails.
>
> Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
> Reported-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: stable@vger.kernel.org
> Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer()
2020-11-26 19:11 ` [PATCH v2 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer() Lad Prabhakar
2020-11-27 9:34 ` Geert Uytterhoeven
@ 2020-11-27 22:38 ` Pavel Machek
2020-11-28 11:32 ` Krzysztof Kozlowski
2 siblings, 0 replies; 11+ messages in thread
From: Pavel Machek @ 2020-11-27 22:38 UTC (permalink / raw)
To: Lad Prabhakar
Cc: Sergei Shtylyov, Krzysztof Kozlowski, Philipp Zabel, Jiri Kosina,
Mark Brown, linux-renesas-soc, Pavel Machek, Geert Uytterhoeven,
linux-kernel, Prabhakar, stable
[-- Attachment #1: Type: text/plain, Size: 992 bytes --]
On Thu 2020-11-26 19:11:42, Lad Prabhakar wrote:
> In the error path of rpcif_manual_xfer() the value of ret is overwritten
> by value returned by reset_control_reset() function and thus returning
> incorrect value to the caller.
>
> This patch makes sure the correct value is returned to the caller of
> rpcif_manual_xfer() by dropping the overwrite of ret in error path.
> Also now we ignore the value returned by reset_control_reset() in the
> error path and instead print a error message when it fails.
>
> Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
> Reported-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: stable@vger.kernel.org
> Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Reviewed-by: Pavel Machek (CIP) <pavel@denx.de>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe()
2020-11-26 19:11 ` [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe() Lad Prabhakar
2020-11-27 9:33 ` Geert Uytterhoeven
@ 2020-11-27 22:41 ` Pavel Machek
2020-11-28 11:35 ` Krzysztof Kozlowski
1 sibling, 1 reply; 11+ messages in thread
From: Pavel Machek @ 2020-11-27 22:41 UTC (permalink / raw)
To: Lad Prabhakar
Cc: Sergei Shtylyov, Krzysztof Kozlowski, Philipp Zabel, Jiri Kosina,
Mark Brown, linux-renesas-soc, Pavel Machek, Geert Uytterhoeven,
linux-kernel, Prabhakar, stable
[-- Attachment #1: Type: text/plain, Size: 602 bytes --]
On Thu 2020-11-26 19:11:44, Lad Prabhakar wrote:
> Release the node reference by calling of_node_put(flash) in the probe.
>
> Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
> Reported-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: stable@vger.kernel.org
> Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Reviewed-by: Pavel Machek (CIP)< <pavel@denx.de>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer()
2020-11-26 19:11 ` [PATCH v2 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer() Lad Prabhakar
2020-11-27 9:34 ` Geert Uytterhoeven
2020-11-27 22:38 ` Pavel Machek
@ 2020-11-28 11:32 ` Krzysztof Kozlowski
2 siblings, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-28 11:32 UTC (permalink / raw)
To: Lad Prabhakar
Cc: Sergei Shtylyov, Philipp Zabel, Jiri Kosina, Mark Brown,
linux-renesas-soc, Pavel Machek, Geert Uytterhoeven, linux-kernel,
Prabhakar, stable
On Thu, Nov 26, 2020 at 07:11:42PM +0000, Lad Prabhakar wrote:
> In the error path of rpcif_manual_xfer() the value of ret is overwritten
> by value returned by reset_control_reset() function and thus returning
> incorrect value to the caller.
>
> This patch makes sure the correct value is returned to the caller of
> rpcif_manual_xfer() by dropping the overwrite of ret in error path.
> Also now we ignore the value returned by reset_control_reset() in the
> error path and instead print a error message when it fails.
>
> Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
> Reported-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: stable@vger.kernel.org
> Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
> ---
> drivers/memory/renesas-rpc-if.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Thanks, applied to mem-ctrl tree.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/5] memory: renesas-rpc-if: Fix unbalanced pm_runtime_enable in rpcif_{enable,disable}_rpm
2020-11-26 19:11 ` [PATCH v2 2/5] memory: renesas-rpc-if: Fix unbalanced pm_runtime_enable in rpcif_{enable,disable}_rpm Lad Prabhakar
2020-11-26 19:33 ` Sergei Shtylyov
@ 2020-11-28 11:33 ` Krzysztof Kozlowski
1 sibling, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-28 11:33 UTC (permalink / raw)
To: Lad Prabhakar
Cc: Sergei Shtylyov, Philipp Zabel, Jiri Kosina, Mark Brown,
linux-renesas-soc, Pavel Machek, Geert Uytterhoeven, linux-kernel,
Prabhakar, stable
On Thu, Nov 26, 2020 at 07:11:43PM +0000, Lad Prabhakar wrote:
> rpcif_enable_rpm calls pm_runtime_enable, so rpcif_disable_rpm needs to
> call pm_runtime_disable and not pm_runtime_put_sync.
>
> Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
> Reported-by: Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: stable@vger.kernel.org
> ---
> drivers/memory/renesas-rpc-if.c | 2 +-
Thanks, applied with corrected Reported-by.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe()
2020-11-27 22:41 ` Pavel Machek
@ 2020-11-28 11:35 ` Krzysztof Kozlowski
0 siblings, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-28 11:35 UTC (permalink / raw)
To: Pavel Machek
Cc: Lad Prabhakar, Sergei Shtylyov, Philipp Zabel, Jiri Kosina,
Mark Brown, linux-renesas-soc, Geert Uytterhoeven, linux-kernel,
Prabhakar, stable
On Fri, Nov 27, 2020 at 11:41:14PM +0100, Pavel Machek wrote:
> On Thu 2020-11-26 19:11:44, Lad Prabhakar wrote:
> > Release the node reference by calling of_node_put(flash) in the probe.
> >
> > Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
> > Reported-by: Pavel Machek <pavel@denx.de>
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > Cc: stable@vger.kernel.org
> > Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
>
> Reviewed-by: Pavel Machek (CIP)< <pavel@denx.de>
This breaks b4. Corrected and applied.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-11-28 22:16 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20201126191146.8753-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
2020-11-26 19:11 ` [PATCH v2 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer() Lad Prabhakar
2020-11-27 9:34 ` Geert Uytterhoeven
2020-11-27 22:38 ` Pavel Machek
2020-11-28 11:32 ` Krzysztof Kozlowski
2020-11-26 19:11 ` [PATCH v2 2/5] memory: renesas-rpc-if: Fix unbalanced pm_runtime_enable in rpcif_{enable,disable}_rpm Lad Prabhakar
2020-11-26 19:33 ` Sergei Shtylyov
2020-11-28 11:33 ` Krzysztof Kozlowski
2020-11-26 19:11 ` [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe() Lad Prabhakar
2020-11-27 9:33 ` Geert Uytterhoeven
2020-11-27 22:41 ` Pavel Machek
2020-11-28 11:35 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox