thank you for first check…have marked the lines as wanted fallthroughs to get it compiled…any idea about the wakeup_source_prepare?
i tried to modify code to use wakeup_source_create directly, but can’t get it working till now
wake_lock_init called wakeup_source_init which is replaced by wakeup_source_create
static inline void wake_lock_init(struct wake_lock *lock, int type,
const char *name)
{
wakeup_source_init(&lock->ws, name);
}
something like this (not working):
+++ b/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pub/osal.c
@@ -984,12 +984,16 @@ INT32 osal_wake_lock_init(P_OSAL_WAKE_LOCK pLock)
{
if (!pLock)
return -1;
-
+ struct wakeup_source *ws;//=pLock->wake_lock;
+/*
#ifdef CONFIG_PM_WAKELOCKS
wakeup_source_init(&pLock->wake_lock, pLock->name);
#else
wake_lock_init(&pLock->wake_lock, WAKE_LOCK_SUSPEND, pLock->name);
#endif
+*/
+ ws=wakeup_source_create(pLock->name);
+ pLock->wake_lock->ws=ws;
return 0;
}
the wakeup-functions were dropped with this Patch: https://patchwork.kernel.org/patch/11080905/…
maybe my current implementation is ok…because before prepare-function has allocated memory which is now done by create-function
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -186,7 +186,7 @@ static inline void pm_wakeup_dev_event(struct device *dev, unsigned int msec,
static inline void wakeup_source_init(struct wakeup_source *ws,
const char *name)
{
- wakeup_source_prepare(ws, name);
+ ws=wakeup_source_create(name);
wakeup_source_add(ws);
}
seems it’s not right yet…
[ 340.888358] Backtrace:
[ 340.890813] [<c01afa48>] (mod_timer) from [<c0660c24>] (pm_wakeup_ws_event.part.8+0x94/0xc4)
[ 340.899260] r10:c13c9020 r9:c1301e08 r8:00000000 r7:a00f0193 r6:e68d51f8 r5:00000fd4
[ 340.907092] r4:e68d51e8
[ 340.909630] [<c0660b90>] (pm_wakeup_ws_event.part.8) from [<c0660c74>] (pm_wakeup_ws_event+0x20/0x24)
[ 340.918857] r9:c1301e08 r8:ea021000 r7:000000d7 r6:e68d54e0 r5:00000000 r4:e68d44e0
[ 340.926611] [<c0660c54>] (pm_wakeup_ws_event) from [<c06e9754>] (kalHifAhbKalWakeLockTimeout+0x34/0x38)
[ 340.936012] [<c06e9720>] (kalHifAhbKalWakeLockTimeout) from [<c0713d4c>] (HifAhbISR+0x78/0x1b4)
[ 340.944714] r5:00000000 r4:e68d44e0
[ 340.948294] [<c0713cd4>] (HifAhbISR) from [<c018ddd0>] (__handle_irq_event_percpu+0xa8/0x27c)
[ 340.956824] r6:00000000 r5:ea2f2268 r4:e68dc940
i guess it’s because pointer to ws changes inside function and does not pushed back to caller (no reference-parameter)…and the crash is the first access to the wrong pointer…how can i fix this?
in testing code above i need to assign pointer to new created struct (ws) to pLock->wake_lock->ws
pLock->wake_lock->ws=ws;