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:

status = DSPManager_WaitForEvents(notifier, EVENTS, &index,
                                                                DSP_FOREVER);
printf("Event received %s\n", evt_name[index]);  <<< print event received
try_err_out("Catch notification signal", status);


And this is what I get:

#####Load baseimage with absolute path, so that kernel thread can load 
#####baseimage

# ./cexec.out /dspbridge_reco/ddspbase_tiomap3430.dof64P


#####Run listener.out

# ./listener.out
# DspManager_Open succeeded
DSPProcessor_Attach succeeded
DSP node register notify DSP_MMUFAULT succeeded
DSP node register notify DSP_SYSERROR succeeded
DSP node register notify DSP_PWRERROR succeeded
DSP node register notify DSP_StateChange succeeded
#


#####Cause MMUFault.

# ./faultapp.out ddspbase_tiomap3430.dof64P test
DSP device detected !!
DSPProcessor_Attach succeeded.
DSPNode_Allocate succeeded.
DSPNode_Create succeeded.
DSPNod***** DSPMMU FAULT ***** IRQStatus 0x2  <<< MMUFault caused
e_Run succeeded.
DSPProcessor_R***** DSPMMU FAULT ***** fault_addr 0x80000000
eserveMemory succeeded. dspAddrSbridge_deh_notify: ********** DEVICE EXCEPTION *
*********
end= 0x203f0000
DSPProcessor_Rbridge_deh_notify: DSP_MMUFAULT,err_info = 0x0
eserveMemory succeeded. dspAddrdbridge_deh_notify: DSP_MMUFAULT, High Address =
0x8000
Recv= 0x2040a000
DSPProcessor_bridge_deh_notify: DSP_MMUFAULT, Low Address = 0x0
Map succeeded.
DSPProcessor_Mapbridge_deh_notify: DSP_MMUFAULT, fault address = 0x80000000
 succeeded.
Sending DMM BUFs toprint_dsp_trace_buffer:
DSP MMU FAULT currtask:0x20061114

 DSP cmd=SETUP, DspRecvBuf=0x2b2DSPTrace: DSP MMU FAULT currtask:0x20061114

f0, DspSendBuf=0x122e8
Read 102400 bytes from input file.
Event received MMU_FAULT   <<< MMUFault detected by the application 
(notification was really received) >>>
Catch notification signal succeeded

^C   <<< kill faultapp.out it is stuck by doing Ctrl + C
# proc_load: Processor Loaded /dspbridge_reco/ddspbase_tiomap3430.dof64P
                        <<< baseimage was reloaded successfully >>>
proc_start: dsp in running state
DspManager_Open succeeded
DSPProcessor_Attach succeeded
DSP node register notify DSP_MMUFAULT succeeded
DSP node register notify DSP_SYSERROR succeeded
DSP node register notify DSP_PWRERROR succeeded
DSP node register notify DSP_StateChange succeeded

#


#####Run dmmcopy.out sample to make sure DSP was recovered successfully

# ./dmmcopy.out  ddspbase_tiomap3430.dof64P test
DSP device detected !!
DSPProcessor_Attach succeeded.
DSPNode_Allocate succeeded.
DSPNode_Create succeeded.
DSPNode_Run succeeded.
DSPProcessor_ReserveMemory succeeded. dspAddrSend= 0x203f0000
DSPProcessor_ReserveMemory succeeded. dspAddrdRecv= 0x2040a000
DSPProcessor_Map succeeded.
DSPProcessor_Map succeeded.
Sending DMM BUFs to DSP cmd=SETUP, DspRecvBuf=0x203f02e8, DspSendBuf=0x2040a2f0
Read 102400 bytes from input file.
Writing 102400 bytes to output file.
Read 33684 bytes from input file.
Writing 33684 bytes to output file.
DSPProcessor_UnMap succeeded.
DSPProcessor_UnMap succeeded.
DSPProcessor_UnReserveMemory succeeded.
DSPProcessor_UnReserveMemory succeeded.
RunTask succeeded.

DSPNode_Terminate succeeded.procwrap_detach: deprecated dspbridge ioctl

DSPNode_Delete succeeded.
DSPProcessor_Detach succeeded.
#


You can use the application attached to see if you are able to receive 
notifications, if you still don't receives the notifications can you share the 
code you are using?


Regards,
Fernando.


>-----Original Message-----
>From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
>ow...@vger.kernel.org] On Behalf Of Guzman Lugo, Fernando
>Sent: Friday, March 19, 2010 4:31 PM
>To: Felipe Contreras
>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
>
>
>
>>-----Original Message-----
>>From: Felipe Contreras [mailto:felipe.contre...@gmail.com]
>>Sent: Friday, March 19, 2010 4:11 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 Fri, Mar 19, 2010 at 11:49 PM, Guzman Lugo, Fernando <x0095...@ti.com>
>>wrote:
>>> Do you mean applying DSP recovery process you are no able to receive
>>MMUFault notifications?
>>>
>>> I am going to check that case. Is there any possibility that the process
>>is stuck waiting other event?
>>
>>I think mgr_wait_for_bridge_events is constantly failing, so no
>>MMUFAULT notifications come through.
>
>Ok, I am going to see if the patch is changing something related to that
>function and debug the problem.
>
>Regards,
>Fernando.
>
>>
>>--
>>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
/*
 * Bridge driver Daemon
 * DSP Recovery feature for TI OMAP processors.
 *
 * Copyright (C) 2009 Texas Instruments, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * THIS PROGRAM IS PROVIDED ''AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include <stdio.h>
#include <string.h>

#include <dbapi.h>

#define try_err_out(msg, err)                                           \
do {                                                                    \
    if (DSP_FAILED(err)) {                                              \
        printf("%s failed : Err Num = %lx\n", msg, err);                \
        goto out;                                                       \
    } else                                                              \
        printf("%s succeeded\n", msg);                                  \
} while (0);

#define EVENTS 4
#define ROOT_ACCESS     1406

char *evt_name[5] = {"MMU_FAULT", "SYS_ERROR", "PWR_ERROR",
                 "STATE_CHANGE", "UNKNOWN"};


unsigned long bridge_listener(void)
{
        DSP_HPROCESSOR proc;
        unsigned int index = 0, i;
        unsigned long status = DSP_SOK;
        struct DSP_NOTIFICATION *notifier[EVENTS];

        for (i = 0; i < EVENTS; i++) {
                notifier[i] = malloc(sizeof(struct DSP_NOTIFICATION));
                if (!notifier[i])
                        return DSP_EMEMORY;
                memset(notifier[i], 0, sizeof(struct DSP_NOTIFICATION));
        }

        /* Big listener loop */
        while (1) {
                status = DspManager_Open(ROOT_ACCESS, NULL);
                try_err_out("DspManager_Open", status);
                status = DSPProcessor_Attach(0, NULL, &proc);
                try_err_out("DSPProcessor_Attach", status);

                /* Register notify objects */
                status = DSPProcessor_RegisterNotify(proc, DSP_MMUFAULT,
                                        DSP_SIGNALEVENT, notifier[0]);
                try_err_out("DSP node register notify DSP_MMUFAULT", status);

                status = DSPProcessor_RegisterNotify(proc, DSP_SYSERROR,
                                        DSP_SIGNALEVENT, notifier[1]);
                try_err_out("DSP node register notify DSP_SYSERROR", status);

                status = DSPProcessor_RegisterNotify(proc, DSP_PWRERROR,
                                        DSP_SIGNALEVENT, notifier[2]);
                try_err_out("DSP node register notify DSP_PWRERROR", status);

                status = DSPProcessor_RegisterNotify(proc,
                        DSP_PROCESSORSTATECHANGE, DSP_SIGNALEVENT, notifier[3]);
                try_err_out("DSP node register notify DSP_StateChange", status);

                status = DSPManager_WaitForEvents(notifier, EVENTS, &index,
                                                                DSP_FOREVER);
                printf("Event received %s\n", evt_name[index]);
                try_err_out("Catch notification signal", status);
                status = DspManager_Close(0, NULL);
        }

out:
        status = DSPProcessor_Detach(proc);
        status = DspManager_Close(0, NULL);

        for (i = 0; i < EVENTS; i++)
                free(notifier[i]);

        return status;
}


int main ()
{
        pid_t child_pid, child_sid;

        /* Fork off the parent process */
        child_pid = fork();
        if (child_pid < 0) {
                exit(1);        /* Failure */
        }
        /* If we got a good PID, then we can exit the parent process. */
        if (child_pid > 0) {
                exit(0);        /* Succeess */
        }
        /* Create a new SID for the child process */
        child_sid = setsid();
        if (child_sid < 0)
                exit(0);

        bridge_listener();

        return 0;
}


Reply via email to