Re: [PATCH] DSPBRIDGE: MMU-Fault debugging enhancements

2010-05-13 Thread Felipe Contreras
On Wed, May 5, 2010 at 2:58 PM, Felipe Contreras
felipe.contre...@nokia.com wrote:
 Hey Ernesto,

 On Fri, Apr 30, 2010 at 09:24:15PM +0200, ext Ramos Falcon, Ernesto wrote:
 This patch seems to be doing a lot of things. Couldn't it have been
 split?
 
 Also, from the commit message it seems to implement a new feature,
 however, I heard it's supposed to fix memory corruption too. Is that
 true? If that's the case the code that fixes that would have to be
 separate.
 
 I understand this patch was already pushed to dspbridge branch, but I
 think such important changes should be properly recorded in the
 history.

 I agree important changes must be properly recorded but in this case
 the patch introduces only one new feature and because of the way that
 it is implemented using gpt8 overflow interrupt instead of mailbox to
 inform about the MMU Fault, the problem of the memory corruption was
 fixed indirectly, however these changes are part of the feature design
 itself and I don't see the need to split this new feature.

 In general, logically independent changes should end up as separate
 patches. Many times it looks like a patch cannot be split further, but
 with a little bit of creativity it usually can.

 I can think of one patch that switches to gpt8 overflow, and another one
 that actually shows the extra information.

 Anyway, I ask because we found some issues with the latest commits of
 dspbridge, and I would like to isolate the memory corruption fix just to
 be safe.

Disregard that. This patch doesn't actually fix the corruption. I sent
one proposal for a patch that does.

 Also, from that description it looks like there might be still a problem
 in the mailbox that is hidded by this patch... so it's more like a
 workaround, not really a fix.

I've extracted the GPT8 related changes, which are good in themselves,
and I sent a separate patch for reference. I also cleaned the patch a
bit.

Now I wonder if there are some situations where we might not want to
use GPT8, but the mailbox interrupt. Maybe some baseimages are not
using GPT8, or maybe the system doesn't have OMAP_DM_TIMER.

Also, all this MMU fault backtracing and so on seems to consume quite
a bit of code. Production systems most likely would want to have this
off (specially when constrained by size), so it should be a
configuration option.

Cheers.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] DSPBRIDGE: MMU-Fault debugging enhancements

2010-05-05 Thread Felipe Contreras
Hey Ernesto,

On Fri, Apr 30, 2010 at 09:24:15PM +0200, ext Ramos Falcon, Ernesto wrote:
 This patch seems to be doing a lot of things. Couldn't it have been
 split?
 
 Also, from the commit message it seems to implement a new feature,
 however, I heard it's supposed to fix memory corruption too. Is that
 true? If that's the case the code that fixes that would have to be
 separate.
 
 I understand this patch was already pushed to dspbridge branch, but I
 think such important changes should be properly recorded in the
 history.
 
 I agree important changes must be properly recorded but in this case
 the patch introduces only one new feature and because of the way that
 it is implemented using gpt8 overflow interrupt instead of mailbox to
 inform about the MMU Fault, the problem of the memory corruption was
 fixed indirectly, however these changes are part of the feature design
 itself and I don't see the need to split this new feature.

In general, logically independent changes should end up as separate
patches. Many times it looks like a patch cannot be split further, but
with a little bit of creativity it usually can.

I can think of one patch that switches to gpt8 overflow, and another one
that actually shows the extra information.

Anyway, I ask because we found some issues with the latest commits of
dspbridge, and I would like to isolate the memory corruption fix just to
be safe.

Also, from that description it looks like there might be still a problem
in the mailbox that is hidded by this patch... so it's more like a
workaround, not really a fix.

Cheers.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] DSPBRIDGE: MMU-Fault debugging enhancements

2010-04-30 Thread Felipe Contreras
On Fri, Apr 9, 2010 at 3:15 AM, Guzman Lugo, Fernando x0095...@ti.com wrote:
 From db3d76a2e89a1c227322a2732ddf7ebf5cd4b4cf Mon Sep 17 00:00:00 2001
 From: Ernesto Ramos erne...@ti.com
 Date: Wed, 24 Mar 2010 11:12:05 -0600
 Subject: [PATCH] DSPBRIDGE: MMU-Fault debugging enhancements

 These changes allow for DSP task information to be printed
 by the MPU dspbridge when DSP MMU fault ocurrs.

 Signed-off-by: Cris Jansson cjans...@ti.com
 [change to open source coding style]
 Signed-off-by: Ernesto Ramos erne...@ti.com

This patch seems to be doing a lot of things. Couldn't it have been split?

Also, from the commit message it seems to implement a new feature,
however, I heard it's supposed to fix memory corruption too. Is that
true? If that's the case the code that fixes that would have to be
separate.

I understand this patch was already pushed to dspbridge branch, but I
think such important changes should be properly recorded in the
history.

Cheers.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] DSPBRIDGE: MMU-Fault debugging enhancements

2010-04-22 Thread Ramirez Luna, Omar

From db3d76a2e89a1c227322a2732ddf7ebf5cd4b4cf Mon Sep 17 00:00:00 2001
From: Ernesto Ramos erne...@ti.com
Date: Wed, 24 Mar 2010 11:12:05 -0600
Subject: [PATCH] DSPBRIDGE: MMU-Fault debugging enhancements

These changes allow for DSP task information to be printed
by the MPU dspbridge when DSP MMU fault ocurrs.

Signed-off-by: Cris Jansson cjans...@ti.com
[change to open source coding style]
Signed-off-by: Ernesto Ramos erne...@ti.com
---

Pushed to dspbridge.

- omar
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] DSPBRIDGE: MMU-Fault debugging enhancements

2010-04-16 Thread Ramos Falcon, Ernesto
From 4aee61479659b42127d107da6054e1c22be56d66 Mon Sep 17 00:00:00 2001
From: Cris Jansson cjans...@ti.com
Date: Wed, 24 Mar 2010 11:12:05 -0600
Subject: [PATCH] DSPBRIDGE: MMU-Fault debugging enhancements

These changes allow for DSP task information to be printed
by the MPU dspbridge when DSP MMU fault ocurrs.

Signed-off-by: Cris Jansson cjans...@ti.com
[change to open source coding style]
Signed-off-by: Ernesto Ramos erne...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/cod.h   |1 +
 arch/arm/plat-omap/include/dspbridge/dbll.h  |3 +-
 arch/arm/plat-omap/include/dspbridge/gh.h|2 +
 arch/arm/plat-omap/include/dspbridge/io_sm.h |5 +
 arch/arm/plat-omap/include/dspbridge/nldr.h  |2 +
 arch/arm/plat-omap/include/dspbridge/node.h  |   15 +
 drivers/dsp/bridge/Makefile  |1 +
 drivers/dsp/bridge/gen/gh.c  |   24 ++
 drivers/dsp/bridge/pmgr/dbll.c   |   84 
 drivers/dsp/bridge/rmgr/nldr.c   |   80 
 drivers/dsp/bridge/rmgr/node.c   |   31 ++
 drivers/dsp/bridge/wmd/io_sm.c   |  568 +-
 drivers/dsp/bridge/wmd/ue_deh.c  |   65 +++-
 13 files changed, 771 insertions(+), 110 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/cod.h 
b/arch/arm/plat-omap/include/dspbridge/cod.h
index 3d76a6b..e508565 100644
--- a/arch/arm/plat-omap/include/dspbridge/cod.h
+++ b/arch/arm/plat-omap/include/dspbridge/cod.h
@@ -26,6 +26,7 @@
 #define COD_MAXPATHLENGTH   255
 #define COD_TRACEBEGSYS_PUTCBEG
 #define COD_TRACEENDSYS_PUTCEND
+#define COD_TRACECURPOSBRIDGE_SYS_PUTC_current
 #define COD_TRACESECT   trace
 #define COD_TRACEBEGOLD PUTCBEG
 #define COD_TRACEENDOLD PUTCEND
diff --git a/arch/arm/plat-omap/include/dspbridge/dbll.h 
b/arch/arm/plat-omap/include/dspbridge/dbll.h
index daf8a0a..01c4647 100644
--- a/arch/arm/plat-omap/include/dspbridge/dbll.h
+++ b/arch/arm/plat-omap/include/dspbridge/dbll.h
@@ -51,5 +51,6 @@ extern void dbll_set_attrs(struct dbll_tar_obj *target,
 extern void dbll_unload(struct dbll_library_obj *lib, struct dbll_attrs 
*attrs);
 extern dsp_status dbll_unload_sect(struct dbll_library_obj *lib,
   char *sectName, struct dbll_attrs *attrs);
-
+bool dbll_find_dsp_symbol(struct dbll_library_obj *zl_lib, u32 address,
+   u32 offset_range, u32 *sym_addr_output, char *name_output);
 #endif /* DBLL_ */
diff --git a/arch/arm/plat-omap/include/dspbridge/gh.h 
b/arch/arm/plat-omap/include/dspbridge/gh.h
index e4da0f2..55c0489 100644
--- a/arch/arm/plat-omap/include/dspbridge/gh.h
+++ b/arch/arm/plat-omap/include/dspbridge/gh.h
@@ -27,4 +27,6 @@ extern void gh_exit(void);
 extern void *gh_find(struct gh_t_hash_tab *hash_tab, void *key);
 extern void gh_init(void);
 extern void *gh_insert(struct gh_t_hash_tab *hash_tab, void *key, void *value);
+void gh_iterate(struct gh_t_hash_tab *hash_tab,
+   void (*callback)(void *, void *), void *user_data);
 #endif /* GH_ */
diff --git a/arch/arm/plat-omap/include/dspbridge/io_sm.h 
b/arch/arm/plat-omap/include/dspbridge/io_sm.h
index aa4d0cf..66aa50f 100644
--- a/arch/arm/plat-omap/include/dspbridge/io_sm.h
+++ b/arch/arm/plat-omap/include/dspbridge/io_sm.h
@@ -293,4 +293,9 @@ extern void io_sm_init(void);
 extern dsp_status print_dsp_trace_buffer(struct wmd_dev_context
 *hwmd_context);

+dsp_status dump_dsp_stack(struct wmd_dev_context *wmd_context);
+
+void dump_dl_modules(struct wmd_dev_context *wmd_context);
+
+
 #endif /* IOSM_ */
diff --git a/arch/arm/plat-omap/include/dspbridge/nldr.h 
b/arch/arm/plat-omap/include/dspbridge/nldr.h
index 2ec928a..2b930d1 100644
--- a/arch/arm/plat-omap/include/dspbridge/nldr.h
+++ b/arch/arm/plat-omap/include/dspbridge/nldr.h
@@ -49,5 +49,7 @@ extern dsp_status nldr_load(struct nldr_nodeobject 
*nldr_node_obj,
enum nldr_phase phase);
 extern dsp_status nldr_unload(struct nldr_nodeobject *nldr_node_obj,
  enum nldr_phase phase);
+dsp_status nldr_find_addr(struct nldr_nodeobject *nldr_node, u32 sym_addr,
+   u32 offset_range, void *offset_output, char *sym_name);

 #endif /* NLDR_ */
diff --git a/arch/arm/plat-omap/include/dspbridge/node.h 
b/arch/arm/plat-omap/include/dspbridge/node.h
index f2375a2..57d820b 100644
--- a/arch/arm/plat-omap/include/dspbridge/node.h
+++ b/arch/arm/plat-omap/include/dspbridge/node.h
@@ -566,4 +566,19 @@ extern dsp_status node_get_uuid_props(void *hprocessor,
  OUT struct dsp_ndbprops
  *node_props);

+/**
+ * node_find_addr() - Find the closest symbol to the given address.
+ *
+ * @node_mgr:  Node manager handle
+ * @sym_addr:  Given address to find the closest symbol
+ * @offset_range:  offset range to look fo the closest symbol

Re: PATCH] DSPBRIDGE: MMU-Fault debugging enhancements

2010-03-05 Thread Ameya Palande
Hi Ernesto,

On Fri, 2010-03-05 at 01:39 +0100, ext Ramos Falcon, Ernesto wrote:
 From 1d7f5d634176be558d5a60e26ee2bdeddffd7d3b Mon Sep 17 00:00:00 2001
 From: Cris Jansson cjans...@ti.com
 Date: Thu, 25 Feb 2010 11:38:23 -0600
 Subject: [PATCH] DSPBRIDGE: MMU-Fault debugging enhancements
 
 These changes allow for DSP task information to be printed
 by the MPU dspbridge when DSP MMU fault ocurrs.
 
 Signed-off-by: Cris Jansson cjans...@ti.com
 [change to open soutce coding style]

source

 Signed-off-by: Ernesto Ramos erne...@ti.com
 ---
  arch/arm/plat-omap/include/dspbridge/dbll.h  |3 +
  arch/arm/plat-omap/include/dspbridge/gh.h|3 +
  arch/arm/plat-omap/include/dspbridge/io_sm.h |5 +
  arch/arm/plat-omap/include/dspbridge/nldr.h  |3 +
  arch/arm/plat-omap/include/dspbridge/node.h  |   12 +
  drivers/dsp/bridge/Makefile  |1 +
  drivers/dsp/bridge/gen/gh.c  |   22 ++
  drivers/dsp/bridge/pmgr/dbll.c   |   62 +++
  drivers/dsp/bridge/rmgr/nldr.c   |   71 
  drivers/dsp/bridge/rmgr/node.c   |   31 ++
  drivers/dsp/bridge/wmd/io_sm.c   |  515 
 --
  drivers/dsp/bridge/wmd/ue_deh.c  |   67 +++-
  12 files changed, 680 insertions(+), 115 deletions(-)

Snip

 +
 +/*
 + *  node_find_addr 
 + * Purpose:
 + * Find the closest symbol to the given address.
 + * Parameters:
 + *
 + */

Since you are adhering to open source coding style why not use linux
kernel commenting style at all places in patch ;)

Cheers,
Ameya.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


PATCH] DSPBRIDGE: MMU-Fault debugging enhancements

2010-03-04 Thread Ramos Falcon, Ernesto
From 1d7f5d634176be558d5a60e26ee2bdeddffd7d3b Mon Sep 17 00:00:00 2001
From: Cris Jansson cjans...@ti.com
Date: Thu, 25 Feb 2010 11:38:23 -0600
Subject: [PATCH] DSPBRIDGE: MMU-Fault debugging enhancements

These changes allow for DSP task information to be printed
by the MPU dspbridge when DSP MMU fault ocurrs.

Signed-off-by: Cris Jansson cjans...@ti.com
[change to open soutce coding style]
Signed-off-by: Ernesto Ramos erne...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dbll.h  |3 +
 arch/arm/plat-omap/include/dspbridge/gh.h|3 +
 arch/arm/plat-omap/include/dspbridge/io_sm.h |5 +
 arch/arm/plat-omap/include/dspbridge/nldr.h  |3 +
 arch/arm/plat-omap/include/dspbridge/node.h  |   12 +
 drivers/dsp/bridge/Makefile  |1 +
 drivers/dsp/bridge/gen/gh.c  |   22 ++
 drivers/dsp/bridge/pmgr/dbll.c   |   62 +++
 drivers/dsp/bridge/rmgr/nldr.c   |   71 
 drivers/dsp/bridge/rmgr/node.c   |   31 ++
 drivers/dsp/bridge/wmd/io_sm.c   |  515 --
 drivers/dsp/bridge/wmd/ue_deh.c  |   67 +++-
 12 files changed, 680 insertions(+), 115 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dbll.h 
b/arch/arm/plat-omap/include/dspbridge/dbll.h
index 8c6eea7..3443f09 100644
--- a/arch/arm/plat-omap/include/dspbridge/dbll.h
+++ b/arch/arm/plat-omap/include/dspbridge/dbll.h
@@ -56,6 +56,9 @@
extern DSP_STATUS DBLL_unloadSect(struct DBLL_LibraryObj *lib,
  char *sectName,
  struct DBLL_Attrs *attrs);
+   bool dbll_find_symbol(struct DBLL_LibraryObj *zl_lib, u32 address,
+   u32 offset_range, u32 *sym_addr_output, char *name_output);
+

 #endif /* DBLL_ */

diff --git a/arch/arm/plat-omap/include/dspbridge/gh.h 
b/arch/arm/plat-omap/include/dspbridge/gh.h
index 8bff0b4..c19c242 100644
--- a/arch/arm/plat-omap/include/dspbridge/gh.h
+++ b/arch/arm/plat-omap/include/dspbridge/gh.h
@@ -26,4 +26,7 @@ extern void GH_exit(void);
 extern void *GH_find(struct GH_THashTab *hashTab, void *key);
 extern void GH_init(void);
 extern void *GH_insert(struct GH_THashTab *hashTab, void *key, void *value);
+void gh_iterate(struct GH_THashTab *hash_tab,
+   void (*callback)(void *, void *), void *user_data);
+
 #endif /* GH_ */
diff --git a/arch/arm/plat-omap/include/dspbridge/io_sm.h 
b/arch/arm/plat-omap/include/dspbridge/io_sm.h
index cc365ec..dfb431d 100644
--- a/arch/arm/plat-omap/include/dspbridge/io_sm.h
+++ b/arch/arm/plat-omap/include/dspbridge/io_sm.h
@@ -296,4 +296,9 @@
extern DSP_STATUS PrintDspTraceBuffer(struct WMD_DEV_CONTEXT
*hWmdContext);

+   DSP_STATUS dump_dsp_stack(struct WMD_DEV_CONTEXT *wmd_context);
+
+   void dump_dl_modules(struct WMD_DEV_CONTEXT *wmd_context);
+
+
 #endif /* IOSM_ */
diff --git a/arch/arm/plat-omap/include/dspbridge/nldr.h 
b/arch/arm/plat-omap/include/dspbridge/nldr.h
index 4f0639a..0f82a69 100644
--- a/arch/arm/plat-omap/include/dspbridge/nldr.h
+++ b/arch/arm/plat-omap/include/dspbridge/nldr.h
@@ -51,5 +51,8 @@
enum NLDR_PHASE phase);
extern DSP_STATUS NLDR_Unload(struct NLDR_NODEOBJECT *hNldrNode,
enum NLDR_PHASE phase);
+   DSP_STATUS nldr_find_addr(
+   struct NLDR_NODEOBJECT *nldr_node, u32 sym_addr,
+   u32 offset_range, void *offset_output, char *sym_name);

 #endif /* NLDR_ */
diff --git a/arch/arm/plat-omap/include/dspbridge/node.h 
b/arch/arm/plat-omap/include/dspbridge/node.h
index 2a45fc0..0b2ed79 100644
--- a/arch/arm/plat-omap/include/dspbridge/node.h
+++ b/arch/arm/plat-omap/include/dspbridge/node.h
@@ -575,4 +575,16 @@
OUT struct DSP_NDBPROPS
*pNodeProps);

+
+/*
+ *  node_find_addr 
+ * Purpose:
+ * Find the closest symbol to the given address.
+ * Parameters:
+ *
+ */
+   DSP_STATUS node_find_addr(struct NODE_MGR *node_mgr,
+   u32 sym_addr, u32 offset_range,
+   void *sym_addr_output, char *sym_name);
+
 #endif /* NODE_ */
diff --git a/drivers/dsp/bridge/Makefile b/drivers/dsp/bridge/Makefile
index 8ae4d21..ca6af08 100644
--- a/drivers/dsp/bridge/Makefile
+++ b/drivers/dsp/bridge/Makefile
@@ -35,5 +35,6 @@ ccflags-y += -Idrivers/dsp/bridge/services
 ccflags-y += -Idrivers/dsp/bridge/wmd
 ccflags-y += -Idrivers/dsp/bridge/pmgr
 ccflags-y += -Idrivers/dsp/bridge/rmgr
+ccflags-y += -Idrivers/dsp/bridge/dynload
 ccflags-y += -Idrivers/dsp/bridge/hw
 ccflags-y += -Iarch/arm
diff --git a/drivers/dsp/bridge/gen/gh.c b/drivers/dsp