* [RFC PATCH 0/2] staging: tidspbridge: detecting wdt from baseimage
@ 2012-02-15 3:00 Omar Ramirez Luna
2012-02-15 3:00 ` [RFC PATCH 1/2] staging: tidspbridge: always compile dsp wdt code Omar Ramirez Luna
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Omar Ramirez Luna @ 2012-02-15 3:00 UTC (permalink / raw)
To: Felipe Contreras
Cc: linux-omap, Justin P. Mattock, devel, Jiri Kosina, Dan Carpenter,
Greg KH, Omar Ramirez Luna
This is an alternate solution for:
WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:162 omap3_l3_app_irq...
In-band Error seen by IVA_SS at address 0
Instead of setting CONFIG_TIDSPBRIDGE_WDT3 to 'default y', these patches
include the code to be compiled for runtime detection of this feature
based on baseimage symbols.
As mentioned in the description of the first patch, we will lose the option
to set a current overflow timeout and the default will be kept as 5 seconds.
This can be replaced by a debugfs/sysfs entry if needed, I didn't include
such a patch as we first need to decide which fix to take (between this and
default y for CONFIG_TIDSPBRIDGE_WDT3[1]).
[1] http://www.mail-archive.com/linux-omap@vger.kernel.org/msg62119.html
Omar Ramirez Luna (2):
staging: tidspbridge: always compile dsp wdt code
staging: tidspbridge: detect wdt3 feature at runtime
drivers/staging/tidspbridge/Kconfig | 16 -------------
drivers/staging/tidspbridge/core/tiomap3430.c | 10 +++++--
drivers/staging/tidspbridge/core/wdt.c | 24 +-------------------
.../tidspbridge/include/dspbridge/_chnl_sm.h | 4 ---
4 files changed, 8 insertions(+), 46 deletions(-)
--
1.7.4.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RFC PATCH 1/2] staging: tidspbridge: always compile dsp wdt code
2012-02-15 3:00 [RFC PATCH 0/2] staging: tidspbridge: detecting wdt from baseimage Omar Ramirez Luna
@ 2012-02-15 3:00 ` Omar Ramirez Luna
2012-02-15 3:00 ` [RFC PATCH 2/2] staging: tidspbridge: detect wdt3 feature at runtime Omar Ramirez Luna
2012-02-15 11:42 ` [RFC PATCH 0/2] staging: tidspbridge: detecting wdt from baseimage Felipe Contreras
2 siblings, 0 replies; 4+ messages in thread
From: Omar Ramirez Luna @ 2012-02-15 3:00 UTC (permalink / raw)
To: Felipe Contreras
Cc: linux-omap, Justin P. Mattock, devel, Jiri Kosina, Dan Carpenter,
Greg KH, Omar Ramirez Luna
In order to detect it at runtime, we need the code handling wdt
clock available at runtime to decide whether to enable or disable
based on the baseimage symbols. Default timeout has been set to 5
seconds.
Downside is that we will lose the option to set a custom timeout
for overflow, but than can be added (if needed) as part of debugfs.
Signed-off-by: Omar Ramirez <omar.ramirez@ti.com>
---
drivers/staging/tidspbridge/Kconfig | 16 -------------
drivers/staging/tidspbridge/core/wdt.c | 24 +-------------------
.../tidspbridge/include/dspbridge/_chnl_sm.h | 4 ---
3 files changed, 1 insertions(+), 43 deletions(-)
diff --git a/drivers/staging/tidspbridge/Kconfig b/drivers/staging/tidspbridge/Kconfig
index d660891..0dd479f 100644
--- a/drivers/staging/tidspbridge/Kconfig
+++ b/drivers/staging/tidspbridge/Kconfig
@@ -52,22 +52,6 @@ config TIDSPBRIDGE_CACHE_LINE_CHECK
This can lead to heap corruption. Say Y, to enforce the check for 128
byte alignment, buffers failing this check will be rejected.
-config TIDSPBRIDGE_WDT3
- bool "Enable watchdog timer"
- depends on TIDSPBRIDGE
- help
- WTD3 is managed by DSP and once it is enabled, DSP side bridge is in
- charge of refreshing the timer before overflow, if the DSP hangs MPU
- will caught the interrupt and try to recover DSP.
-
-config TIDSPBRIDGE_WDT_TIMEOUT
- int "Watchdog timer timeout (in secs)"
- depends on TIDSPBRIDGE && TIDSPBRIDGE_WDT3
- default 5
- help
- Watchdog timer timeout value, after that time if the watchdog timer
- counter is not reset the wdt overflow interrupt will be triggered
-
config TIDSPBRIDGE_NTFY_PWRERR
bool "Notify power errors"
depends on TIDSPBRIDGE
diff --git a/drivers/staging/tidspbridge/core/wdt.c b/drivers/staging/tidspbridge/core/wdt.c
index 2126f59..70055c8 100644
--- a/drivers/staging/tidspbridge/core/wdt.c
+++ b/drivers/staging/tidspbridge/core/wdt.c
@@ -25,8 +25,6 @@
#include <dspbridge/host_os.h>
-#ifdef CONFIG_TIDSPBRIDGE_WDT3
-
#define OMAP34XX_WDT3_BASE (L4_PER_34XX_BASE + 0x30000)
static struct dsp_wdt_setting dsp_wdt;
@@ -84,7 +82,7 @@ int dsp_wdt_init(void)
void dsp_wdt_sm_set(void *data)
{
dsp_wdt.sm_wdt = data;
- dsp_wdt.sm_wdt->wdt_overflow = CONFIG_TIDSPBRIDGE_WDT_TIMEOUT;
+ dsp_wdt.sm_wdt->wdt_overflow = 5; /* in seconds */
}
@@ -128,23 +126,3 @@ void dsp_wdt_enable(bool enable)
clk_disable(dsp_wdt.fclk);
}
}
-
-#else
-void dsp_wdt_enable(bool enable)
-{
-}
-
-void dsp_wdt_sm_set(void *data)
-{
-}
-
-int dsp_wdt_init(void)
-{
- return 0;
-}
-
-void dsp_wdt_exit(void)
-{
-}
-#endif
-
diff --git a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h
index 6e7ab4f..cc95a18 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h
@@ -99,14 +99,10 @@ struct shm {
struct opp_rqst_struct opp_request;
/* load monitor information structure */
struct load_mon_struct load_mon_info;
-#ifdef CONFIG_TIDSPBRIDGE_WDT3
/* Flag for WDT enable/disable F/I clocks */
u32 wdt_setclocks;
u32 wdt_overflow; /* WDT overflow time */
char dummy[176]; /* padding to 256 byte boundary */
-#else
- char dummy[184]; /* padding to 256 byte boundary */
-#endif
u32 shm_dbg_var[64]; /* shared memory debug variables */
};
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RFC PATCH 2/2] staging: tidspbridge: detect wdt3 feature at runtime
2012-02-15 3:00 [RFC PATCH 0/2] staging: tidspbridge: detecting wdt from baseimage Omar Ramirez Luna
2012-02-15 3:00 ` [RFC PATCH 1/2] staging: tidspbridge: always compile dsp wdt code Omar Ramirez Luna
@ 2012-02-15 3:00 ` Omar Ramirez Luna
2012-02-15 11:42 ` [RFC PATCH 0/2] staging: tidspbridge: detecting wdt from baseimage Felipe Contreras
2 siblings, 0 replies; 4+ messages in thread
From: Omar Ramirez Luna @ 2012-02-15 3:00 UTC (permalink / raw)
To: Felipe Contreras
Cc: linux-omap, Justin P. Mattock, devel, Jiri Kosina, Dan Carpenter,
Greg KH, Omar Ramirez Luna
In order to detect WDT feature on the dsp code, we need to
find the symbol used to enable it inside the baseimage.
This should fix the warning comming from L3 driver:
WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:161 omap3_l3_app_irq...
In-band Error seen by IVA_SS at address 0
...
That occurs because the dsp tries to access wdt3 registers when the clock
for those registers is not enabled.
Reported-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
drivers/staging/tidspbridge/core/tiomap3430.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c
index 670de0a..7862513 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -383,6 +383,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
u32 clk_cmd;
struct io_mgr *hio_mgr;
u32 ul_load_monitor_timer;
+ u32 wdt_en = 0;
struct omap_dsp_platform_data *pdata =
omap_dspbridge_dev->dev.platform_data;
@@ -594,9 +595,12 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
if (!wait_for_start(dev_context, dw_sync_addr))
status = -ETIMEDOUT;
- /* Start wdt */
- dsp_wdt_sm_set((void *)ul_shm_base);
- dsp_wdt_enable(true);
+ dev_get_symbol(dev_context->dev_obj, "_WDT_enable", &wdt_en);
+ if (wdt_en) {
+ /* Start wdt */
+ dsp_wdt_sm_set((void *)ul_shm_base);
+ dsp_wdt_enable(true);
+ }
status = dev_get_io_mgr(dev_context->dev_obj, &hio_mgr);
if (hio_mgr) {
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC PATCH 0/2] staging: tidspbridge: detecting wdt from baseimage
2012-02-15 3:00 [RFC PATCH 0/2] staging: tidspbridge: detecting wdt from baseimage Omar Ramirez Luna
2012-02-15 3:00 ` [RFC PATCH 1/2] staging: tidspbridge: always compile dsp wdt code Omar Ramirez Luna
2012-02-15 3:00 ` [RFC PATCH 2/2] staging: tidspbridge: detect wdt3 feature at runtime Omar Ramirez Luna
@ 2012-02-15 11:42 ` Felipe Contreras
2 siblings, 0 replies; 4+ messages in thread
From: Felipe Contreras @ 2012-02-15 11:42 UTC (permalink / raw)
To: Omar Ramirez Luna
Cc: Felipe Contreras, linux-omap, Justin P. Mattock, devel,
Jiri Kosina, Dan Carpenter, Greg KH
On Wed, Feb 15, 2012 at 5:00 AM, Omar Ramirez Luna <omar.ramirez@ti.com> wrote:
> This is an alternate solution for:
>
> WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:162 omap3_l3_app_irq...
> In-band Error seen by IVA_SS at address 0
>
> Instead of setting CONFIG_TIDSPBRIDGE_WDT3 to 'default y', these patches
> include the code to be compiled for runtime detection of this feature
> based on baseimage symbols.
>
> As mentioned in the description of the first patch, we will lose the option
> to set a current overflow timeout and the default will be kept as 5 seconds.
> This can be replaced by a debugfs/sysfs entry if needed, I didn't include
> such a patch as we first need to decide which fix to take (between this and
> default y for CONFIG_TIDSPBRIDGE_WDT3[1]).
>
> [1] http://www.mail-archive.com/linux-omap@vger.kernel.org/msg62119.html
LGTM.
--
Felipe Contreras
--
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] 4+ messages in thread
end of thread, other threads:[~2012-02-15 11:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 3:00 [RFC PATCH 0/2] staging: tidspbridge: detecting wdt from baseimage Omar Ramirez Luna
2012-02-15 3:00 ` [RFC PATCH 1/2] staging: tidspbridge: always compile dsp wdt code Omar Ramirez Luna
2012-02-15 3:00 ` [RFC PATCH 2/2] staging: tidspbridge: detect wdt3 feature at runtime Omar Ramirez Luna
2012-02-15 11:42 ` [RFC PATCH 0/2] staging: tidspbridge: detecting wdt from baseimage Felipe Contreras
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).