* [PATCH 0/2] DSPBRIDGE: unrelated fixes @ 2010-02-18 21:55 Omar Ramirez Luna 2010-02-18 21:55 ` [PATCH 1/2] DSPBRIDGE: logic error fix for SleepDSP timeout value Omar Ramirez Luna 0 siblings, 1 reply; 5+ messages in thread From: Omar Ramirez Luna @ 2010-02-18 21:55 UTC (permalink / raw) To: linux-omap Cc: Ameya Palande, Hiroshi Doyu, Felipe Contreras, Nishanth Menon, Omar Ramirez Luna A couple of unrelated fixes. Omar Ramirez Luna (2): DSPBRIDGE: logic error fix for SleepDSP timeout value DSPBRIDGE: check pointer before dereference drivers/dsp/bridge/pmgr/msg.c | 16 ++++++++-------- drivers/dsp/bridge/wmd/tiomap3430_pwr.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] DSPBRIDGE: logic error fix for SleepDSP timeout value 2010-02-18 21:55 [PATCH 0/2] DSPBRIDGE: unrelated fixes Omar Ramirez Luna @ 2010-02-18 21:55 ` Omar Ramirez Luna 2010-02-18 21:55 ` [PATCH 2/2] DSPBRIDGE: check pointer before dereference Omar Ramirez Luna 2010-02-24 2:11 ` [PATCH 1/2] DSPBRIDGE: logic error fix for SleepDSP timeout value Omar Ramirez Luna 0 siblings, 2 replies; 5+ messages in thread From: Omar Ramirez Luna @ 2010-02-18 21:55 UTC (permalink / raw) To: linux-omap Cc: Ameya Palande, Hiroshi Doyu, Felipe Contreras, Nishanth Menon, Omar Ramirez Luna When leaving the loop waiting for the dsp to transition from its power state, timeout value will be negative, therefore a print for "timeout waiting for the dsp" won't be displayed, as the condition to check for is !timeout. Reported-by: Berenice Herrera <berenice@ti.com> Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com> --- drivers/dsp/bridge/wmd/tiomap3430_pwr.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c b/drivers/dsp/bridge/wmd/tiomap3430_pwr.c index 084f406..96b942b 100644 --- a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c +++ b/drivers/dsp/bridge/wmd/tiomap3430_pwr.c @@ -239,7 +239,7 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd, &pwrState); /* Wait for DSP to move into target power state */ - while ((pwrState != targetPwrState) && timeout--) { + while ((pwrState != targetPwrState) && --timeout) { if (msleep_interruptible(10)) { pr_err("Waiting for DSP to Suspend interrupted\n"); return DSP_EFAIL; -- 1.6.2.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] DSPBRIDGE: check pointer before dereference 2010-02-18 21:55 ` [PATCH 1/2] DSPBRIDGE: logic error fix for SleepDSP timeout value Omar Ramirez Luna @ 2010-02-18 21:55 ` Omar Ramirez Luna 2010-02-24 2:11 ` Omar Ramirez Luna 2010-02-24 2:11 ` [PATCH 1/2] DSPBRIDGE: logic error fix for SleepDSP timeout value Omar Ramirez Luna 1 sibling, 1 reply; 5+ messages in thread From: Omar Ramirez Luna @ 2010-02-18 21:55 UTC (permalink / raw) To: linux-omap Cc: Ameya Palande, Hiroshi Doyu, Felipe Contreras, Nishanth Menon, Omar Ramirez Luna Change the check for valid handle to detect a possible error, and now use it before dereferencing the pointer. Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com> --- drivers/dsp/bridge/pmgr/msg.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/dsp/bridge/pmgr/msg.c b/drivers/dsp/bridge/pmgr/msg.c index 5cfeb5b..9e4b202 100644 --- a/drivers/dsp/bridge/pmgr/msg.c +++ b/drivers/dsp/bridge/pmgr/msg.c @@ -104,19 +104,19 @@ void MSG_Delete(struct MSG_MGR *hMsgMgr) struct WMD_DRV_INTERFACE *pIntfFxns; DBC_Require(cRefs > 0); - DBC_Require(MEM_IsValidHandle(pMsgMgr, MSGMGR_SIGNATURE)); GT_1trace(MSG_debugMask, GT_ENTER, "MSG_Delete: hMsgMgr: 0x%x\n", hMsgMgr); - pIntfFxns = pMsgMgr->pIntfFxns; + if (MEM_IsValidHandle(pMsgMgr, MSGMGR_SIGNATURE)) { + pIntfFxns = pMsgMgr->pIntfFxns; - /* Let WMD message module destroy the MSG_MGR: */ - (*pIntfFxns->pfnMsgDelete)(hMsgMgr); - - if (MEM_IsValidHandle(pMsgMgr, MSGMGR_SIGNATURE)) - GT_1trace(MSG_debugMask, GT_7CLASS, "MSG_Delete: Error hMsgMgr " - "Valid Handle: 0x%x\n", hMsgMgr); + /* Let WMD message module destroy the MSG_MGR: */ + (*pIntfFxns->pfnMsgDelete)(hMsgMgr); + } else { + GT_1trace(MSG_debugMask, GT_7CLASS, "MSG_Delete: Error hMsgMgr" + "invalid Handle: 0x%x\n", hMsgMgr); + } } /* -- 1.6.2.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] DSPBRIDGE: check pointer before dereference 2010-02-18 21:55 ` [PATCH 2/2] DSPBRIDGE: check pointer before dereference Omar Ramirez Luna @ 2010-02-24 2:11 ` Omar Ramirez Luna 0 siblings, 0 replies; 5+ messages in thread From: Omar Ramirez Luna @ 2010-02-24 2:11 UTC (permalink / raw) To: Ramirez Luna, Omar Cc: linux-omap, Ameya Palande, Hiroshi Doyu, Felipe Contreras, Menon, Nishanth On 2/18/2010 3:55 PM, Ramirez Luna, Omar wrote: > Change the check for valid handle to detect a possible > error, and now use it before dereferencing the pointer. > > Signed-off-by: Omar Ramirez Luna<omar.ramirez@ti.com> > --- > drivers/dsp/bridge/pmgr/msg.c | 16 ++++++++-------- > 1 files changed, 8 insertions(+), 8 deletions(-) > Rebased and pushed to dspbridge - omar ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] DSPBRIDGE: logic error fix for SleepDSP timeout value 2010-02-18 21:55 ` [PATCH 1/2] DSPBRIDGE: logic error fix for SleepDSP timeout value Omar Ramirez Luna 2010-02-18 21:55 ` [PATCH 2/2] DSPBRIDGE: check pointer before dereference Omar Ramirez Luna @ 2010-02-24 2:11 ` Omar Ramirez Luna 1 sibling, 0 replies; 5+ messages in thread From: Omar Ramirez Luna @ 2010-02-24 2:11 UTC (permalink / raw) To: Ramirez Luna, Omar Cc: linux-omap, Ameya Palande, Hiroshi Doyu, Felipe Contreras, Menon, Nishanth On 2/18/2010 3:55 PM, Ramirez Luna, Omar wrote: > When leaving the loop waiting for the dsp to transition > from its power state, timeout value will be negative, therefore > a print for "timeout waiting for the dsp" won't be displayed, as > the condition to check for is !timeout. > > Reported-by: Berenice Herrera<berenice@ti.com> > Signed-off-by: Omar Ramirez Luna<omar.ramirez@ti.com> > --- > drivers/dsp/bridge/wmd/tiomap3430_pwr.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > Pushed to dspbridge - omar ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-02-24 2:11 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-02-18 21:55 [PATCH 0/2] DSPBRIDGE: unrelated fixes Omar Ramirez Luna 2010-02-18 21:55 ` [PATCH 1/2] DSPBRIDGE: logic error fix for SleepDSP timeout value Omar Ramirez Luna 2010-02-18 21:55 ` [PATCH 2/2] DSPBRIDGE: check pointer before dereference Omar Ramirez Luna 2010-02-24 2:11 ` Omar Ramirez Luna 2010-02-24 2:11 ` [PATCH 1/2] DSPBRIDGE: logic error fix for SleepDSP timeout value Omar Ramirez Luna
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox