linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: mxc_nand: fix unbalanced clk_disable() in error path
@ 2012-12-06  7:42 Lothar Waßmann
  2012-12-06  7:42 ` [PATCH 2/2] mtd: mxc_nand: reorder part_probes to let cmdline override other sources Lothar Waßmann
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Lothar Waßmann @ 2012-12-06  7:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Shawn Guo, Sascha Hauer, linux-kernel, David Woodhouse,
	Artem Bityutskiy, Lothar Waßmann

If nand_scan_ident() or nand_scan_tail() fails, the NAND chip may have
been deselected and the clock already disabled. Thus, check 'clk_act'
in the error path to decide whether the clock still needs to be
disabled.

This fixes a:
|WARNING: at drivers/clk/clk.c:472 __clk_disable+0x3c/0x78()

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 drivers/mtd/nand/mxc_nand.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index d316324..d965809 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1556,7 +1556,8 @@ static int mxcnd_probe(struct platform_device *pdev)
 	return 0;
 
 escan:
-	clk_disable_unprepare(host->clk);
+	if (host->clk_act)
+		clk_disable_unprepare(host->clk);
 
 	return err;
 }
-- 
1.7.2.5


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

* [PATCH 2/2] mtd: mxc_nand: reorder part_probes to let cmdline override other sources
  2012-12-06  7:42 [PATCH 1/2] mtd: mxc_nand: fix unbalanced clk_disable() in error path Lothar Waßmann
@ 2012-12-06  7:42 ` Lothar Waßmann
  2012-12-10 14:46   ` Artem Bityutskiy
  2012-12-06  7:45 ` [PATCH 1/2] mtd: mxc_nand: fix unbalanced clk_disable() in error path Sascha Hauer
  2012-12-10 14:46 ` Artem Bityutskiy
  2 siblings, 1 reply; 5+ messages in thread
From: Lothar Waßmann @ 2012-12-06  7:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Shawn Guo, Sascha Hauer, linux-kernel, David Woodhouse,
	Artem Bityutskiy, Lothar Waßmann

The cmdline is the easiest to change source of information. Thus
let it take precedence over 'RedBoot' and 'ofpart'. This makes the
mxc_nand driver to be in sync with all other NAND drivers that support
'cmdlinepart' partition parsing.

Also change 'const char *' to 'const char const *' as advised by checkpatch.pl

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 drivers/mtd/nand/mxc_nand.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index d316324..fb98775 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -266,7 +266,8 @@ static struct nand_ecclayout nandv2_hw_eccoob_4k = {
 	}
 };
 
-static const char *part_probes[] = { "RedBoot", "cmdlinepart", "ofpart", NULL };
+static const char const *part_probes[] = {
+	"cmdlinepart", "RedBoot", "ofpart", NULL };
 
 static void memcpy32_fromio(void *trg, const void __iomem  *src, size_t size)
 {
-- 
1.7.2.5


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

* Re: [PATCH 1/2] mtd: mxc_nand: fix unbalanced clk_disable() in error path
  2012-12-06  7:42 [PATCH 1/2] mtd: mxc_nand: fix unbalanced clk_disable() in error path Lothar Waßmann
  2012-12-06  7:42 ` [PATCH 2/2] mtd: mxc_nand: reorder part_probes to let cmdline override other sources Lothar Waßmann
@ 2012-12-06  7:45 ` Sascha Hauer
  2012-12-10 14:46 ` Artem Bityutskiy
  2 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2012-12-06  7:45 UTC (permalink / raw)
  To: Lothar Waßmann
  Cc: linux-mtd, Shawn Guo, linux-kernel, David Woodhouse,
	Artem Bityutskiy

On Thu, Dec 06, 2012 at 08:42:27AM +0100, Lothar Waßmann wrote:
> If nand_scan_ident() or nand_scan_tail() fails, the NAND chip may have
> been deselected and the clock already disabled. Thus, check 'clk_act'
> in the error path to decide whether the clock still needs to be
> disabled.
> 
> This fixes a:
> |WARNING: at drivers/clk/clk.c:472 __clk_disable+0x3c/0x78()
> 
> Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>

Both: Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

Sascha

> ---
>  drivers/mtd/nand/mxc_nand.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> index d316324..d965809 100644
> --- a/drivers/mtd/nand/mxc_nand.c
> +++ b/drivers/mtd/nand/mxc_nand.c
> @@ -1556,7 +1556,8 @@ static int mxcnd_probe(struct platform_device *pdev)
>  	return 0;
>  
>  escan:
> -	clk_disable_unprepare(host->clk);
> +	if (host->clk_act)
> +		clk_disable_unprepare(host->clk);
>  
>  	return err;
>  }
> -- 
> 1.7.2.5
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH 1/2] mtd: mxc_nand: fix unbalanced clk_disable() in error path
  2012-12-06  7:42 [PATCH 1/2] mtd: mxc_nand: fix unbalanced clk_disable() in error path Lothar Waßmann
  2012-12-06  7:42 ` [PATCH 2/2] mtd: mxc_nand: reorder part_probes to let cmdline override other sources Lothar Waßmann
  2012-12-06  7:45 ` [PATCH 1/2] mtd: mxc_nand: fix unbalanced clk_disable() in error path Sascha Hauer
@ 2012-12-10 14:46 ` Artem Bityutskiy
  2 siblings, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2012-12-10 14:46 UTC (permalink / raw)
  To: Lothar Waßmann
  Cc: linux-mtd, Sascha Hauer, linux-kernel, Shawn Guo, David Woodhouse

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

On Thu, 2012-12-06 at 08:42 +0100, Lothar Waßmann wrote:
> If nand_scan_ident() or nand_scan_tail() fails, the NAND chip may have
> been deselected and the clock already disabled. Thus, check 'clk_act'
> in the error path to decide whether the clock still needs to be
> disabled.
> 
> This fixes a:
> |WARNING: at drivers/clk/clk.c:472 __clk_disable+0x3c/0x78()

Pushed to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 2/2] mtd: mxc_nand: reorder part_probes to let cmdline override other sources
  2012-12-06  7:42 ` [PATCH 2/2] mtd: mxc_nand: reorder part_probes to let cmdline override other sources Lothar Waßmann
@ 2012-12-10 14:46   ` Artem Bityutskiy
  0 siblings, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2012-12-10 14:46 UTC (permalink / raw)
  To: Lothar Waßmann
  Cc: linux-mtd, Sascha Hauer, linux-kernel, Shawn Guo, David Woodhouse

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

On Thu, 2012-12-06 at 08:42 +0100, Lothar Waßmann wrote:
> The cmdline is the easiest to change source of information. Thus
> let it take precedence over 'RedBoot' and 'ofpart'. This makes the
> mxc_nand driver to be in sync with all other NAND drivers that support
> 'cmdlinepart' partition parsing.

Pushed to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-12-10 14:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-06  7:42 [PATCH 1/2] mtd: mxc_nand: fix unbalanced clk_disable() in error path Lothar Waßmann
2012-12-06  7:42 ` [PATCH 2/2] mtd: mxc_nand: reorder part_probes to let cmdline override other sources Lothar Waßmann
2012-12-10 14:46   ` Artem Bityutskiy
2012-12-06  7:45 ` [PATCH 1/2] mtd: mxc_nand: fix unbalanced clk_disable() in error path Sascha Hauer
2012-12-10 14:46 ` Artem Bityutskiy

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).