public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] OMAP: McSPI: Unpaired clk_{en,dis}able calls.
@ 2009-02-19 15:24 Phil Carmody
  2009-02-19 15:24 ` [PATCH 1/1] " Phil Carmody
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Carmody @ 2009-02-19 15:24 UTC (permalink / raw)
  To: linux-omap


It appears that if clk_enable fails for the functional clock, the
interface clock will be left enabled. Any tallying (locks, ref-
counts, whatever) will therefore be out of step between the two 
clocks.

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

* [PATCH 1/1] OMAP: McSPI: Unpaired clk_{en,dis}able calls.
  2009-02-19 15:24 [PATCH 0/1] OMAP: McSPI: Unpaired clk_{en,dis}able calls Phil Carmody
@ 2009-02-19 15:24 ` Phil Carmody
  2009-02-27 18:28   ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Carmody @ 2009-02-19 15:24 UTC (permalink / raw)
  To: linux-omap; +Cc: Phil Carmody

If the sky is always blue, and no functions fail, then the interface
and functional clocks will always be in the same state. However,
defensively, failure to enable the 2nd should re-disable the 1st.

Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
---
 drivers/spi/omap2_mcspi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index 3da8825..bdccb27 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -277,9 +277,10 @@ static int omap2_mcspi_enable_clocks(struct omap2_mcspi *mcspi)
 {
 	if (clk_enable(mcspi->ick))
 		return -ENODEV;
-	if (clk_enable(mcspi->fck))
+	if (clk_enable(mcspi->fck)) {
+		clk_disable(mcspi->ick);
 		return -ENODEV;
-
+	}
 	omap2_mcspi_restore_ctx(mcspi);
 
 	return 0;
-- 
1.5.4.3


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

* Re: [PATCH 1/1] OMAP: McSPI: Unpaired clk_{en,dis}able calls.
  2009-02-19 15:24 ` [PATCH 1/1] " Phil Carmody
@ 2009-02-27 18:28   ` Tony Lindgren
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2009-02-27 18:28 UTC (permalink / raw)
  To: Phil Carmody; +Cc: linux-omap

* Phil Carmody <ext-phil.2.carmody@nokia.com> [090219 07:26]:
> If the sky is always blue, and no functions fail, then the interface
> and functional clocks will always be in the same state. However,
> defensively, failure to enable the 2nd should re-disable the 1st.

This too should be sent for mainline integration. See "SPI SUBSYSTEM"
in the MAINTAINERS file.

Regards,

Tony
 
> Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
> ---
>  drivers/spi/omap2_mcspi.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
> index 3da8825..bdccb27 100644
> --- a/drivers/spi/omap2_mcspi.c
> +++ b/drivers/spi/omap2_mcspi.c
> @@ -277,9 +277,10 @@ static int omap2_mcspi_enable_clocks(struct omap2_mcspi *mcspi)
>  {
>  	if (clk_enable(mcspi->ick))
>  		return -ENODEV;
> -	if (clk_enable(mcspi->fck))
> +	if (clk_enable(mcspi->fck)) {
> +		clk_disable(mcspi->ick);
>  		return -ENODEV;
> -
> +	}
>  	omap2_mcspi_restore_ctx(mcspi);
>  
>  	return 0;
> -- 
> 1.5.4.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2009-02-27 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-19 15:24 [PATCH 0/1] OMAP: McSPI: Unpaired clk_{en,dis}able calls Phil Carmody
2009-02-19 15:24 ` [PATCH 1/1] " Phil Carmody
2009-02-27 18:28   ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox