Hi Felipe,

>-----Original Message-----
>From: Felipe Contreras [mailto:felipe.contre...@gmail.com]
>Sent: Wednesday, March 24, 2010 12:15 PM
>To: Guzman Lugo, Fernando
>Cc: Hebbar, Shivananda; linux-omap@vger.kernel.org; Hiroshi DOYU; Ameya
>Palande; felipe.contre...@nokia.com
>Subject: Re: [PATCH 2/2] DSPBRIDGE: DSP recovery feature
>
>On Tue, Mar 23, 2010 at 9:29 PM, Guzman Lugo, Fernando <x0095...@ti.com>
>wrote:
>> I have tested just using an application (base on bridged code) which is
>registered for fatal events and once it receives an event it prints the
>received event:
>
>Ok, I ran your test and it works, however, I tried to modify it to fit
>what I'm doing in gst-dsp and it turns out it's very easy for this
>code to reboot the device. I'm attaching the test.
>
>Also, I found the exact reason why my code fails but yours not. I do
>something like this:
>
>while (!done) {
>  dsp_wait_for_events(&index);
>
>  if (index == 0) {
>    /* node message */
>    while (true) {
>      if (!dsp_node_get_message(&msg))
>        break;
>      handle_message(msg);
>    }
>  }
>}
>
>So, before your patch, the get_message() failed, and the next
>wait_for_events() succeeded and returned the MMU fault. Now, the
>get_message() fails, and so does the wait_for_events().

The think is that the now after fatal error and recovery process start all 
bridge ioctl's will fail with -EIO (that was the requirement when I did the 
code)

@@ -496,6 +553,12 @@ static long bridge_ioctl(struct file *filp, unsigned int 
code,
        union Trapped_Args buf_in;
 
        DBC_REQUIRE(filp != NULL);
+#ifdef CONFIG_BRIDGE_RECOVERY
+       if (recover) {
+               status = -EIO;
+               goto err;
+       }
+#endif

So you if you call dsp_node_get_message and then a fatal error happens, 
dsp_node_get_message will failed and if you what to call dsp_wait_for_events 
will fail because we are in recovery process (before it was succeeded because 
wait_for_events ioctl can go through and the MMUFault event was already 
signaled).

To sum up:
With this patch in order to be notified of fatal errors you need to register 
for those and call dsp_wait_for_events before the fatal error occurs. Otherwise 
dsp_wait_for_events will fail.

So I think you need a dedicate thread to receive fatal errors.

Regards,
Fernando.
>
>The only way to make that code work with your patch is to remove the
>inner while, so wait_for_events() and get_message() are always run one
>after the other.
>
>That is breaking old behavior and should be fixed, right?
>
>--
>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

Reply via email to