3 * (C) COPYRIGHT 2011 ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
8 * A copy of the licence is included with the program, and can also be obtained from Free Software
9 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 #include <osk/mali_osk.h>
17 #if MALI_LICENSE_IS_GPL == 0
18 /* Wrapper function to allow flushing in Non-GPL driver */
19 void oskp_work_func_wrapper( struct work_struct *work )
21 osk_workq_work *osk_work = CONTAINER_OF( work, osk_workq_work, os_work );
26 parent_wq = osk_work->parent_wq;
27 osk_work->actual_fn( osk_work );
28 /* work and osk_work could disappear from this point on */
30 /* parent_wq of course shouldn't disappear *yet*, because it must itself flush this function before term */
32 spin_lock_irqsave( &parent_wq->active_items_lock, flags );
33 val = --(parent_wq->nr_active_items);
34 /* The operations above and below must form an atomic operation themselves,
35 * hence the lock. See osk_workq_flush() for why */
38 wake_up( &parent_wq->waitq_zero_active_items );
40 spin_unlock_irqrestore( &parent_wq->active_items_lock, flags );
42 /* parent_wq may've now disappeared */
45 #endif /* MALI_LICENSE_IS_GPL == 0 */