linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] DSPBRIDGE: fix a wrong clk index for gpt8
@ 2010-06-10 12:14 Omar Ramirez Luna
  2010-06-10 12:14 ` [PATCH 2/2] DSPBRIDGE: reorganize gpt8 overflow handling Omar Ramirez Luna
  2010-06-14 17:59 ` [PATCH 1/2] DSPBRIDGE: fix a wrong clk index for gpt8 Ramirez Luna, Omar
  0 siblings, 2 replies; 4+ messages in thread
From: Omar Ramirez Luna @ 2010-06-10 12:14 UTC (permalink / raw)
  To: linux-omap
  Cc: Ernesto Ramos Falcon, Shivananda Hebbar, Fernando Guzman Lugo,
	Ivan Gomez Castellanos, Omar Ramirez Luna

Mismatch between index for gpt clocks will result in writting
out of bounds into dsp clock timer array when requesting gpt8,
for the other gpt the bogus code is being masked as it falls
within the array's range.

Discovered-by: Ernesto Ramos Falcon <ernesto@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 drivers/dsp/bridge/core/dsp-clock.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/dsp/bridge/core/dsp-clock.c b/drivers/dsp/bridge/core/dsp-clock.c
index 4613de9..dba0535 100644
--- a/drivers/dsp/bridge/core/dsp-clock.c
+++ b/drivers/dsp/bridge/core/dsp-clock.c
@@ -212,7 +212,8 @@ int dsp_clk_enable(IN enum dsp_clk_id clk_id)
 		clk_enable(iva2_clk);
 		break;
 	case GPT_CLK:
-		timer[clk_id] = omap_dm_timer_request_specific(DMT_ID(clk_id));
+		timer[clk_id - 1] =
+				omap_dm_timer_request_specific(DMT_ID(clk_id));
 		break;
 	case MCBSP_CLK:
 		mcbsp_clk_prepare(true, clk_id);
@@ -287,7 +288,7 @@ int dsp_clk_disable(IN enum dsp_clk_id clk_id)
 		clk_disable(iva2_clk);
 		break;
 	case GPT_CLK:
-		omap_dm_timer_free(timer[clk_id]);
+		omap_dm_timer_free(timer[clk_id - 1]);
 		break;
 	case MCBSP_CLK:
 		mcbsp_clk_prepare(false, clk_id);
-- 
1.7.1


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

end of thread, other threads:[~2010-06-14 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-10 12:14 [PATCH 1/2] DSPBRIDGE: fix a wrong clk index for gpt8 Omar Ramirez Luna
2010-06-10 12:14 ` [PATCH 2/2] DSPBRIDGE: reorganize gpt8 overflow handling Omar Ramirez Luna
2010-06-14 17:59   ` Ramirez Luna, Omar
2010-06-14 17:59 ` [PATCH 1/2] DSPBRIDGE: fix a wrong clk index for gpt8 Ramirez Luna, Omar

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