All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Guzman Lugo, Fernando" <x0095840@ti.com>
To: "Guzman Lugo, Fernando" <x0095840@ti.com>,
	Felipe Contreras <felipe.contreras@gmail.com>
Cc: "Hebbar, Shivananda" <x0hebbar@ti.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	Hiroshi DOYU <Hiroshi.DOYU@nokia.com>,
	Ameya Palande <ameya.palande@nokia.com>,
	"felipe.contreras@nokia.com" <felipe.contreras@nokia.com>
Subject: RE: [PATCH 2/2] DSPBRIDGE: DSP recovery feature
Date: Tue, 23 Mar 2010 14:29:14 -0500	[thread overview]
Message-ID: <496565EC904933469F292DDA3F1663E602CACBDF08@dlee06.ent.ti.com> (raw)
In-Reply-To: <496565EC904933469F292DDA3F1663E602CACBD669@dlee06.ent.ti.com>

[-- Attachment #1: Type: text/plain, Size: 5197 bytes --]



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-owner@vger.kernel.org [mailto:linux-omap-
>owner@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.contreras@nokia.com
>Subject: RE: [PATCH 2/2] DSPBRIDGE: DSP recovery feature
>
>
>
>>-----Original Message-----
>>From: Felipe Contreras [mailto:felipe.contreras@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.contreras@nokia.com
>>Subject: Re: [PATCH 2/2] DSPBRIDGE: DSP recovery feature
>>
>>On Fri, Mar 19, 2010 at 11:49 PM, Guzman Lugo, Fernando <x0095840@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 majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: listener.c --]
[-- Type: text/plain, Size: 3003 bytes --]

/*
 * 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	other threads:[~2010-03-23 19:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Acq8TGBkJRXTEjd3QLyd0bJ27/2C7g==>
2010-03-05 10:12 ` [PATCH 2/2] DSPBRIDGE: DSP recovery feature Guzman Lugo, Fernando
2010-03-19 11:51   ` Felipe Contreras
2010-03-19 15:53     ` Felipe Contreras
2010-03-19 16:05       ` Hebbar, Shivananda
2010-03-19 16:18         ` Felipe Contreras
2010-03-19 19:00           ` Felipe Contreras
2010-03-19 21:49             ` Guzman Lugo, Fernando
2010-03-19 22:11               ` Felipe Contreras
2010-03-19 22:30                 ` Guzman Lugo, Fernando
2010-03-23 19:29                   ` Guzman Lugo, Fernando [this message]
2010-03-24 18:15                     ` Felipe Contreras
2010-03-24 19:18                       ` Guzman Lugo, Fernando
2010-03-24 19:49                         ` Felipe Contreras
2010-03-24 21:14   ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496565EC904933469F292DDA3F1663E602CACBDF08@dlee06.ent.ti.com \
    --to=x0095840@ti.com \
    --cc=Hiroshi.DOYU@nokia.com \
    --cc=ameya.palande@nokia.com \
    --cc=felipe.contreras@gmail.com \
    --cc=felipe.contreras@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=x0hebbar@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.