#include <asm/io_bitmap.h>
 #include <asm/proto.h>
 #include <asm/frame.h>
+#include <asm/unwind.h>
 
 #include "process.h"
 
  */
 unsigned long __get_wchan(struct task_struct *p)
 {
-       unsigned long entry = 0;
+       struct unwind_state state;
+       unsigned long addr = 0;
 
-       stack_trace_save_tsk(p, &entry, 1, 0);
-       return entry;
+       for (unwind_start(&state, p, NULL, NULL); !unwind_done(&state);
+            unwind_next_frame(&state)) {
+               addr = unwind_get_return_address(&state);
+               if (!addr)
+                       break;
+               if (in_sched_functions(addr))
+                       continue;
+               break;
+       }
+
+       return addr;
 }
 
 long do_arch_prctl_common(struct task_struct *task, int option,