* [PATCH] DSPBRIDGE: dont pass invalid DSP OPP requests
@ 2010-01-20 1:44 Nishanth Menon
2010-01-20 10:01 ` Ameya Palande
0 siblings, 1 reply; 4+ messages in thread
From: Nishanth Menon @ 2010-01-20 1:44 UTC (permalink / raw)
To: linux-omap
Cc: Nishanth Menon, Ameya Palande, Deepak Chitriki, Felipe Contreras,
Hiroshi Doyu, Omar Ramirez Luna
If DSP baseimage requests for invalid OPPs, do not pass them
to the rest of the linux kernel subsystem. with a test baseimage
it was found to send
IO_DispatchPM: WMDIOCTL_CONSTRAINT_REQUEST with parameter 0.
this is an invalid OPP ID and should not be passed anywhere.
we add a param check for this prior to passing it along to the
workqueue.
Cc: Ameya Palande <ameya.palande@nokia.com>
Cc: Deepak Chitriki <deepak.chitriki@ti.com>
Cc: Felipe Contreras <felipe.contreras@nokia.com>
Cc: Hiroshi Doyu <hiroshi.doyu@nokia.com>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
drivers/dsp/bridge/wmd/io_sm.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
index 6c140c5..618bedb 100644
--- a/drivers/dsp/bridge/wmd/io_sm.c
+++ b/drivers/dsp/bridge/wmd/io_sm.c
@@ -960,9 +960,12 @@ static void IO_DispatchPM(struct work_struct *work)
pArg[1] = pIOMgr->pSharedMem->oppRequest.rqstOppPt;
DBG_Trace(DBG_LEVEL7, "IO_DispatchPM : Value of OPP "
"value =0x%x \n", pArg[1]);
- status = pIOMgr->pIntfFxns->pfnDevCntrl(pIOMgr->
- hWmdContext, WMDIOCTL_CONSTRAINT_REQUEST,
- pArg);
+ if (!pArg[1])
+ status = DSP_EINVALIDARG;
+ else
+ status = pIOMgr->pIntfFxns->pfnDevCntrl(pIOMgr->
+ hWmdContext,
+ WMDIOCTL_CONSTRAINT_REQUEST, pArg);
if (DSP_FAILED(status)) {
DBG_Trace(DBG_LEVEL7, "IO_DispatchPM : Failed "
"to set constraint = 0x%x \n",
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] DSPBRIDGE: dont pass invalid DSP OPP requests
2010-01-20 1:44 [PATCH] DSPBRIDGE: dont pass invalid DSP OPP requests Nishanth Menon
@ 2010-01-20 10:01 ` Ameya Palande
2010-01-20 12:02 ` Nishanth Menon
0 siblings, 1 reply; 4+ messages in thread
From: Ameya Palande @ 2010-01-20 10:01 UTC (permalink / raw)
To: ext Nishanth Menon
Cc: linux-omap, Deepak Chitriki, Contreras Felipe (Nokia-D/Helsinki),
Doyu Hiroshi (Nokia-D/Helsinki), Omar Ramirez Luna
Hi Nishanth,
On Wed, 2010-01-20 at 02:44 +0100, ext Nishanth Menon wrote:
> If DSP baseimage requests for invalid OPPs, do not pass them
> to the rest of the linux kernel subsystem. with a test baseimage
> it was found to send
> IO_DispatchPM: WMDIOCTL_CONSTRAINT_REQUEST with parameter 0.
> this is an invalid OPP ID and should not be passed anywhere.
> we add a param check for this prior to passing it along to the
> workqueue.
>
> Cc: Ameya Palande <ameya.palande@nokia.com>
> Cc: Deepak Chitriki <deepak.chitriki@ti.com>
> Cc: Felipe Contreras <felipe.contreras@nokia.com>
> Cc: Hiroshi Doyu <hiroshi.doyu@nokia.com>
> Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
> drivers/dsp/bridge/wmd/io_sm.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
> index 6c140c5..618bedb 100644
> --- a/drivers/dsp/bridge/wmd/io_sm.c
> +++ b/drivers/dsp/bridge/wmd/io_sm.c
> @@ -960,9 +960,12 @@ static void IO_DispatchPM(struct work_struct *work)
> pArg[1] = pIOMgr->pSharedMem->oppRequest.rqstOppPt;
> DBG_Trace(DBG_LEVEL7, "IO_DispatchPM : Value of OPP "
> "value =0x%x \n", pArg[1]);
> - status = pIOMgr->pIntfFxns->pfnDevCntrl(pIOMgr->
> - hWmdContext, WMDIOCTL_CONSTRAINT_REQUEST,
> - pArg);
> + if (!pArg[1])
> + status = DSP_EINVALIDARG;
> + else
> + status = pIOMgr->pIntfFxns->pfnDevCntrl(pIOMgr->
> + hWmdContext,
> + WMDIOCTL_CONSTRAINT_REQUEST, pArg);
> if (DSP_FAILED(status)) {
> DBG_Trace(DBG_LEVEL7, "IO_DispatchPM : Failed "
> "to set constraint = 0x%x \n",
Instead of checking just for 0, isn't it better to check for any value
outside of valid OPPs? (Especially if we need robust implementation
which shouldn't break because of DSP BIOS blackbox!).
Cheers,
Ameya.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] DSPBRIDGE: dont pass invalid DSP OPP requests
2010-01-20 10:01 ` Ameya Palande
@ 2010-01-20 12:02 ` Nishanth Menon
2010-01-20 17:04 ` Ramirez Luna, Omar
0 siblings, 1 reply; 4+ messages in thread
From: Nishanth Menon @ 2010-01-20 12:02 UTC (permalink / raw)
To: Ameya Palande
Cc: linux-omap, Deepak Chitriki, Contreras Felipe (Nokia-D/Helsinki),
Doyu Hiroshi (Nokia-D/Helsinki), Omar Ramirez Luna
Ameya Palande said the following on 01/20/2010 04:01 AM:
> Hi Nishanth,
>
> On Wed, 2010-01-20 at 02:44 +0100, ext Nishanth Menon wrote:
>
>> If DSP baseimage requests for invalid OPPs, do not pass them
>> to the rest of the linux kernel subsystem. with a test baseimage
>> it was found to send
>> IO_DispatchPM: WMDIOCTL_CONSTRAINT_REQUEST with parameter 0.
>> this is an invalid OPP ID and should not be passed anywhere.
>> we add a param check for this prior to passing it along to the
>> workqueue.
>>
>> Cc: Ameya Palande <ameya.palande@nokia.com>
>> Cc: Deepak Chitriki <deepak.chitriki@ti.com>
>> Cc: Felipe Contreras <felipe.contreras@nokia.com>
>> Cc: Hiroshi Doyu <hiroshi.doyu@nokia.com>
>> Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
>>
>> Signed-off-by: Nishanth Menon <nm@ti.com>
>> ---
>> drivers/dsp/bridge/wmd/io_sm.c | 9 ++++++---
>> 1 files changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
>> index 6c140c5..618bedb 100644
>> --- a/drivers/dsp/bridge/wmd/io_sm.c
>> +++ b/drivers/dsp/bridge/wmd/io_sm.c
>> @@ -960,9 +960,12 @@ static void IO_DispatchPM(struct work_struct *work)
>> pArg[1] = pIOMgr->pSharedMem->oppRequest.rqstOppPt;
>> DBG_Trace(DBG_LEVEL7, "IO_DispatchPM : Value of OPP "
>> "value =0x%x \n", pArg[1]);
>> - status = pIOMgr->pIntfFxns->pfnDevCntrl(pIOMgr->
>> - hWmdContext, WMDIOCTL_CONSTRAINT_REQUEST,
>> - pArg);
>> + if (!pArg[1])
>> + status = DSP_EINVALIDARG;
>> + else
>> + status = pIOMgr->pIntfFxns->pfnDevCntrl(pIOMgr->
>> + hWmdContext,
>> + WMDIOCTL_CONSTRAINT_REQUEST, pArg);
>> if (DSP_FAILED(status)) {
>> DBG_Trace(DBG_LEVEL7, "IO_DispatchPM : Failed "
>> "to set constraint = 0x%x \n",
>>
>
> Instead of checking just for 0, isn't it better to check for any value
> outside of valid OPPs? (Especially if we need robust implementation
> which shouldn't break because of DSP BIOS blackbox!).
>
>
yeah, i agree. should check for the max level also. dropping this and
will resend.
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 4+ messages in thread* RE: [PATCH] DSPBRIDGE: dont pass invalid DSP OPP requests
2010-01-20 12:02 ` Nishanth Menon
@ 2010-01-20 17:04 ` Ramirez Luna, Omar
0 siblings, 0 replies; 4+ messages in thread
From: Ramirez Luna, Omar @ 2010-01-20 17:04 UTC (permalink / raw)
To: Nishanth Menon, Ameya Palande
Cc: linux-omap, Chitriki Rudramuni, Deepak,
Contreras Felipe (Nokia-D/Helsinki),
Doyu Hiroshi (Nokia-D/Helsinki)
>From: Nishanth Menon on Wednesday, January 20, 2010 6:02 AM
>
>Ameya Palande said the following on 01/20/2010 04:01 AM:
>> Hi Nishanth,
>>
>> On Wed, 2010-01-20 at 02:44 +0100, ext Nishanth Menon wrote:
>>
>>> If DSP baseimage requests for invalid OPPs, do not pass them
>>> to the rest of the linux kernel subsystem. with a test baseimage
>>> it was found to send
>>> IO_DispatchPM: WMDIOCTL_CONSTRAINT_REQUEST with parameter 0.
>>> this is an invalid OPP ID and should not be passed anywhere.
>>> we add a param check for this prior to passing it along to the
>>> workqueue.
>>>
>>> Cc: Ameya Palande <ameya.palande@nokia.com>
>>> Cc: Deepak Chitriki <deepak.chitriki@ti.com>
>>> Cc: Felipe Contreras <felipe.contreras@nokia.com>
>>> Cc: Hiroshi Doyu <hiroshi.doyu@nokia.com>
>>> Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
>>>
>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>> ---
>>> drivers/dsp/bridge/wmd/io_sm.c | 9 ++++++---
>>> 1 files changed, 6 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
>>> index 6c140c5..618bedb 100644
>>> --- a/drivers/dsp/bridge/wmd/io_sm.c
>>> +++ b/drivers/dsp/bridge/wmd/io_sm.c
>>> @@ -960,9 +960,12 @@ static void IO_DispatchPM(struct work_struct *work)
>>> pArg[1] = pIOMgr->pSharedMem->oppRequest.rqstOppPt;
>>> DBG_Trace(DBG_LEVEL7, "IO_DispatchPM : Value of OPP "
>>> "value =0x%x \n", pArg[1]);
>>> - status = pIOMgr->pIntfFxns->pfnDevCntrl(pIOMgr->
>>> - hWmdContext, WMDIOCTL_CONSTRAINT_REQUEST,
>>> - pArg);
>>> + if (!pArg[1])
>>> + status = DSP_EINVALIDARG;
>>> + else
>>> + status = pIOMgr->pIntfFxns->pfnDevCntrl(pIOMgr->
>>> + hWmdContext,
>>> + WMDIOCTL_CONSTRAINT_REQUEST, pArg);
>>> if (DSP_FAILED(status)) {
>>> DBG_Trace(DBG_LEVEL7, "IO_DispatchPM : Failed "
>>> "to set constraint = 0x%x \n",
>>>
>>
>> Instead of checking just for 0, isn't it better to check for any value
>> outside of valid OPPs? (Especially if we need robust implementation
>> which shouldn't break because of DSP BIOS blackbox!).
Dsp will ask only for the opps programmed to the shared memory... so no need, as long as the shared memory is filled with the right values.
>>
>>
>yeah, i agree. should check for the max level also. dropping this and
>will resend.
Dsp doesn't request opp 0 to kernel.
- omar
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-20 17:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 1:44 [PATCH] DSPBRIDGE: dont pass invalid DSP OPP requests Nishanth Menon
2010-01-20 10:01 ` Ameya Palande
2010-01-20 12:02 ` Nishanth Menon
2010-01-20 17:04 ` 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