Skip to content

Commit 3ce951f

Browse files
Ramesh GuptaLuis Henriques
authored andcommitted
SYSLINK:notify-add notify module to syslink with associated fixes
SYSLINK:notify-add notify module to syslink add notify module to syslink Signed-off-by: Suman Anna <[email protected]> Signed-off-by: Ramesh Gupta G <[email protected]> Signed-off-by: Hari Kanigeri <[email protected]> Signed-off-by: Subramaniam C.A <[email protected]> SYSLINK:notify-added notify ducati driver to syslink Add notify ducati driver to syslink Signed-off-by: Suman Anna <[email protected]> Signed-off-by: Hari Kanigeri <[email protected]> Signed-off-by: Subramaniam C.A <[email protected]> Signed-off-by: Ramesh Gupta G <[email protected]> SYSLINK: notify - minor fix for error check copy_to_user returns a non-zero value in case of error. This patch fixes it and resolved an associated KW defect: Comparison of unsigned value against 0 is always false Signed-off-by: Suman Anna <[email protected]> omap:notify: call restore_ctx when send_event first time In notify.c when sending an event using notify_send_event() the funtion ipu_pm_restore_ctx() is called to enable just the first time idle and disable hibernation. Also is changing the ducati clock state transition control to HW_auto to allowed retention. The rest of the restore ctx remains under a menuconfig macro. Signed-off-by: Juan Gutierrez <[email protected]> SYSLINK: notify - reset notify registration chart correctly This patch fixes a minor bug in the notify driver unregistration process. The notify registration chart is an array and stores all the registered events in ascending order (dictates the notify event priorities). This array is compacted whenever an event is unregistered. The compaction is done shifting all the subsequent events to the left. Currently, the next element to the element being unregistered is not reset correctly, thereby leading to duplicate registrations in the array. This still leaves a valid duplicate event when that event is unregistered. This scenario happens when a lower event is unregistered while a higher event is also present. Change-Id: I47a04e4d01a5081099117280be286a51afa7d1cf Signed-off-by: Suman Anna <[email protected]> syslink: notifier - add a mutext per notify_object Critital section are per notify_object we not need to block other notify_object of other processors. Instead create a new mutex per notify_object to protect critical sections which belong to a specific processor. This would increase the performance. Also fix unprotected part while calling the registered callback fucntions that was causing a kernel panic. Change-Id: Ie99eef8eb5eca6a75d203df33c2a31981ce50489 Signed-off-by: Fernando Guzman Lugo <[email protected]> SYSLINK:IPC - Notify reserve events moved from 4 to 5 Making room for new reserved event for devh. Devh is using event 4 for sys error notifications. Change-Id: I545b3da56167d6f539092ab434d33f993129324f Signed-off-by: Shahid Akhtar <[email protected]>
1 parent 6eed284 commit 3ce951f

File tree

6 files changed

+3926
-0
lines changed

6 files changed

+3926
-0
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* notifydefs.h
3+
*
4+
* Notify driver support for OMAP Processors.
5+
*
6+
* Copyright (C) 2008-2009 Texas Instruments, Inc.
7+
*
8+
* This package is free software; you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License version 2 as
10+
* published by the Free Software Foundation.
11+
*
12+
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13+
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14+
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15+
*/
16+
17+
18+
#if !defined(_NOTIFYDEFS_H_)
19+
#define _NOTIFYDEFS_H_
20+
21+
/* Linux headers */
22+
#include <linux/list.h>
23+
24+
/* Osal And Utils headers */
25+
#include <syslink/atomic_linux.h>
26+
27+
/* Module headers */
28+
#include <syslink/notify.h>
29+
#include <syslink/_notify.h>
30+
#include <syslink/notify_driverdefs.h>
31+
32+
33+
/*Macro to make a correct module magic number with ref Count */
34+
#define NOTIFY_MAKE_MAGICSTAMP(x) ((NOTIFY_MODULEID << 12u) | (x))
35+
36+
/* Maximum number of Notify drivers supported. */
37+
#define NOTIFY_MAX_DRIVERS 4u
38+
39+
/* Mask to check for system key. */
40+
#define NOTIFY_SYSTEMKEY_MASK ((u16)0xFFFF0000)
41+
42+
43+
/* Defines the Event callback information instance */
44+
struct notify_event_callback {
45+
notify_fn_notify_cbck fn_notify_cbck;
46+
/* Callback function pointer */
47+
uint *cbck_arg;
48+
/* Argument associated with callback function */
49+
};
50+
51+
/* Defines the Notify state object, which contains all the module
52+
* specific information. */
53+
struct notify_module_object {
54+
atomic_t ref_count;
55+
/* Reference count */
56+
struct notify_config cfg;
57+
/* Notify configuration structure */
58+
struct notify_config def_cfg;
59+
/* Default module configuration */
60+
struct mutex *gate_handle;
61+
/* Handle of gate to be used for local thread safety */
62+
struct notify_driver_object
63+
drivers[NOTIFY_MAX_DRIVERS][NOTIFY_MAX_INTLINES];
64+
/* Array of configured drivers. */
65+
u32 local_enable_mask;
66+
/* This is used for local/loopback events. Default to enabled (-1) */
67+
bool start_complete;
68+
/* TRUE if start() was called */
69+
bool is_setup;
70+
/* Indicates whether the Notify module is setup. */
71+
struct notify_object *local_notify_handle;
72+
/* Handle to Notify object for local notifications. */
73+
};
74+
75+
/* Defines the Notify instance object. */
76+
struct notify_object {
77+
uint nesting;
78+
/* Disable/restore nesting */
79+
void *driver_handle;
80+
/* Handle to device specific driver */
81+
u16 remote_proc_id;
82+
/* Remote MultiProc id */
83+
u16 line_id;
84+
/* Interrupt line id */
85+
struct notify_event_callback callbacks[NOTIFY_MAXEVENTS];
86+
/* List of event callbacks registered */
87+
struct list_head event_list[NOTIFY_MAXEVENTS];
88+
/* List of event listeners registered */
89+
struct mutex lock;
90+
/* Lock for event_list */
91+
};
92+
93+
94+
#endif /* !defined (_NOTIFYDEFS_H_) */

0 commit comments

Comments
 (0)