* [PATCH 1/3] remoteproc/davinci: add the missing retval check for clk_enable()
2018-05-02 9:56 [PATCH 0/3] remoteproc/davinci: common clock framework related fixes Bartosz Golaszewski
@ 2018-05-02 9:56 ` Bartosz Golaszewski
2018-05-09 21:31 ` Bjorn Andersson
2018-05-02 9:56 ` [PATCH 2/3] remoteproc/davinci: prepare and unprepare the clock where needed Bartosz Golaszewski
2018-05-02 9:56 ` [PATCH 3/3] remoteproc/davinci: use octal permissions for module_param() Bartosz Golaszewski
2 siblings, 1 reply; 5+ messages in thread
From: Bartosz Golaszewski @ 2018-05-02 9:56 UTC (permalink / raw)
To: Ohad Ben-Cohen, Bjorn Andersson, Sekhar Nori, David Lechner,
Suman Anna, Aparna Balasubramanian, Kevin Hilman
Cc: linux-remoteproc, linux-kernel, Bartosz Golaszewski
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
The davinci platform is being switched to using the common clock
framework, where clk_enable() can fail. Add the return value check.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Suman Anna <s-anna@ti.com>
Reviewed-by: David Lechner <david@lechnology.com>
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
---
drivers/remoteproc/da8xx_remoteproc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index bf3b9034c319..2b24291337b7 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -138,6 +138,7 @@ static int da8xx_rproc_start(struct rproc *rproc)
struct device *dev = rproc->dev.parent;
struct da8xx_rproc *drproc = (struct da8xx_rproc *)rproc->priv;
struct clk *dsp_clk = drproc->dsp_clk;
+ int ret;
/* hw requires the start (boot) address be on 1KB boundary */
if (rproc->bootaddr & 0x3ff) {
@@ -148,7 +149,12 @@ static int da8xx_rproc_start(struct rproc *rproc)
writel(rproc->bootaddr, drproc->bootreg);
- clk_enable(dsp_clk);
+ ret = clk_enable(dsp_clk);
+ if (ret) {
+ dev_err(dev, "clk_enable() failed: %d\n", ret);
+ return ret;
+ }
+
davinci_clk_reset_deassert(dsp_clk);
return 0;
--
2.17.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/3] remoteproc/davinci: add the missing retval check for clk_enable()
2018-05-02 9:56 ` [PATCH 1/3] remoteproc/davinci: add the missing retval check for clk_enable() Bartosz Golaszewski
@ 2018-05-09 21:31 ` Bjorn Andersson
0 siblings, 0 replies; 5+ messages in thread
From: Bjorn Andersson @ 2018-05-09 21:31 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Ohad Ben-Cohen, Sekhar Nori, David Lechner, Suman Anna,
Aparna Balasubramanian, Kevin Hilman, linux-remoteproc,
linux-kernel, Bartosz Golaszewski
On Wed 02 May 02:56 PDT 2018, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> The davinci platform is being switched to using the common clock
> framework, where clk_enable() can fail. Add the return value check.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Acked-by: Suman Anna <s-anna@ti.com>
> Reviewed-by: David Lechner <david@lechnology.com>
> Reviewed-by: Sekhar Nori <nsekhar@ti.com>
Hi Bartosz,
All three patches applied to rproc-next.
Regards,
Bjorn
> ---
> drivers/remoteproc/da8xx_remoteproc.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
> index bf3b9034c319..2b24291337b7 100644
> --- a/drivers/remoteproc/da8xx_remoteproc.c
> +++ b/drivers/remoteproc/da8xx_remoteproc.c
> @@ -138,6 +138,7 @@ static int da8xx_rproc_start(struct rproc *rproc)
> struct device *dev = rproc->dev.parent;
> struct da8xx_rproc *drproc = (struct da8xx_rproc *)rproc->priv;
> struct clk *dsp_clk = drproc->dsp_clk;
> + int ret;
>
> /* hw requires the start (boot) address be on 1KB boundary */
> if (rproc->bootaddr & 0x3ff) {
> @@ -148,7 +149,12 @@ static int da8xx_rproc_start(struct rproc *rproc)
>
> writel(rproc->bootaddr, drproc->bootreg);
>
> - clk_enable(dsp_clk);
> + ret = clk_enable(dsp_clk);
> + if (ret) {
> + dev_err(dev, "clk_enable() failed: %d\n", ret);
> + return ret;
> + }
> +
> davinci_clk_reset_deassert(dsp_clk);
>
> return 0;
> --
> 2.17.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] remoteproc/davinci: prepare and unprepare the clock where needed
2018-05-02 9:56 [PATCH 0/3] remoteproc/davinci: common clock framework related fixes Bartosz Golaszewski
2018-05-02 9:56 ` [PATCH 1/3] remoteproc/davinci: add the missing retval check for clk_enable() Bartosz Golaszewski
@ 2018-05-02 9:56 ` Bartosz Golaszewski
2018-05-02 9:56 ` [PATCH 3/3] remoteproc/davinci: use octal permissions for module_param() Bartosz Golaszewski
2 siblings, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2018-05-02 9:56 UTC (permalink / raw)
To: Ohad Ben-Cohen, Bjorn Andersson, Sekhar Nori, David Lechner,
Suman Anna, Aparna Balasubramanian, Kevin Hilman
Cc: linux-remoteproc, linux-kernel, Bartosz Golaszewski
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
We're currently switching the platform to using the common clock
framework. We need to explicitly prepare and unprepare the rproc
clock.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Suman Anna <s-anna@ti.com>
Reviewed-by: David Lechner <david@lechnology.com>
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
---
drivers/remoteproc/da8xx_remoteproc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index 2b24291337b7..f134192922e0 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -149,9 +149,9 @@ static int da8xx_rproc_start(struct rproc *rproc)
writel(rproc->bootaddr, drproc->bootreg);
- ret = clk_enable(dsp_clk);
+ ret = clk_prepare_enable(dsp_clk);
if (ret) {
- dev_err(dev, "clk_enable() failed: %d\n", ret);
+ dev_err(dev, "clk_prepare_enable() failed: %d\n", ret);
return ret;
}
@@ -165,7 +165,7 @@ static int da8xx_rproc_stop(struct rproc *rproc)
struct da8xx_rproc *drproc = rproc->priv;
davinci_clk_reset_assert(drproc->dsp_clk);
- clk_disable(drproc->dsp_clk);
+ clk_disable_unprepare(drproc->dsp_clk);
return 0;
}
--
2.17.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/3] remoteproc/davinci: use octal permissions for module_param()
2018-05-02 9:56 [PATCH 0/3] remoteproc/davinci: common clock framework related fixes Bartosz Golaszewski
2018-05-02 9:56 ` [PATCH 1/3] remoteproc/davinci: add the missing retval check for clk_enable() Bartosz Golaszewski
2018-05-02 9:56 ` [PATCH 2/3] remoteproc/davinci: prepare and unprepare the clock where needed Bartosz Golaszewski
@ 2018-05-02 9:56 ` Bartosz Golaszewski
2 siblings, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2018-05-02 9:56 UTC (permalink / raw)
To: Ohad Ben-Cohen, Bjorn Andersson, Sekhar Nori, David Lechner,
Suman Anna, Aparna Balasubramanian, Kevin Hilman
Cc: linux-remoteproc, linux-kernel, Bartosz Golaszewski
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Checkpatch recommends to use octal perms instead of S_IRUGO.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Suman Anna <s-anna@ti.com>
---
drivers/remoteproc/da8xx_remoteproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index f134192922e0..b668e32996e2 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -25,7 +25,7 @@
#include "remoteproc_internal.h"
static char *da8xx_fw_name;
-module_param(da8xx_fw_name, charp, S_IRUGO);
+module_param(da8xx_fw_name, charp, 0444);
MODULE_PARM_DESC(da8xx_fw_name,
"Name of DSP firmware file in /lib/firmware (if not specified defaults to 'rproc-dsp-fw')");
--
2.17.0
^ permalink raw reply related [flat|nested] 5+ messages in thread