aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-versatile
Commit message (Expand)AuthorAge
* Merge tag 'soc-for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...Linus Torvalds2014-08-08
|\
| * ARM: versatile: remove init_irq hook for DT bootRob Herring2014-06-24
* | video: move Versatile CLCD helpersLinus Walleij2014-06-27
|/
* Merge tag 'kconfig-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git...Olof Johansson2014-05-05
|\
| * Merge tag 'drivers-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...Linus Torvalds2014-04-05
| |\
| | * irqchip: support cascaded VICsLinus Walleij2014-02-13
| * | Merge tag 'dropmachtimexh-v2' of git://git.pengutronix.de/git/ukl/linux into ...Olof Johansson2014-02-19
| |\ \ | | |/ | |/|
| | * ARM: drop <mach/timex.h> for !ARCH_MULTIPLATFORM, tooUwe Kleine-König2013-12-20
* | | ARM: plat-versatile: convert LEDs to platform deviceLinus Walleij2014-02-27
|/ /
* / ARM: versatile: move GPIO2 and GPIO3 to coreLinus Walleij2013-12-20
|/
* Merge branch 'versatile/fixes' into fixesOlof Johansson2013-09-09
|\
| * ARM: PCI: versatile: Fix SMAP register offsetsPeter Maydell2013-09-04
| * ARM: PCI: versatile: Fix PCI I/OPeter Maydell2013-09-04
| * ARM: PCI: versatile: Fix map_irq function to match hardwarePeter Maydell2013-09-04
* | ARM: debug: move PL01X debug include into arch/arm/include/debug/Russell King2013-08-25
* | ARM: debug: provide PL01x debug uart phys/virt address configuration optionsRussell King2013-08-25
|/
* reboot: arm: change reboot_mode to use enum reboot_modeRobin Holt2013-07-09
* ARM: versatile: use OF init for sp804 timerRob Herring2013-04-11
* Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds2013-02-21
|\
| * Merge tag 'cleanup-decompwdog-3.9' of git://git.linaro.org/people/shawnguo/li...Olof Johansson2013-02-05
| |\
| | * ARM: remove unused arch_decomp_wdog()Shawn Guo2013-01-10
| * | Merge tag 'gic-vic-to-irqchip' of git://sources.calxeda.com/kernel/linux into...Olof Johansson2013-01-14
| |\ \
| | * | irqchip: Move ARM vic.h to include/linux/irqchip/arm-vic.hRob Herring2013-01-12
| | * | ARM: remove unneeded vic.h includesRob Herring2013-01-12
| | * | ARM: remove mach .handle_irq for VIC usersRob Herring2013-01-12
| * | | Merge branch 'clocksource/cleanup' into next/cleanupOlof Johansson2013-01-14
| |\| |
| * | | ARM: delete struct sys_timerStephen Warren2012-12-24
| | |/ | |/|
* | | Merge tag 'fixes-non-critical' of git://git.kernel.org/pub/scm/linux/kernel/g...Linus Torvalds2013-02-21
|\ \ \
| * | | ARM: pick Versatile by default for !MMUArnd Bergmann2013-02-14
| * | | ARM: integrator/versatile: fix NOMMU warningsArnd Bergmann2013-02-14
| | |/ | |/|
* / | ARM: 7635/1: versatile: fix the PCI IRQ regressionLinus Walleij2013-02-06
|/ /
* / ARM: 7610/1: versatile: bump IRQ numbersLinus Walleij2013-01-02
|/
* ARM: plat-versatile: move FPGA irq driver to drivers/irqchipLinus Walleij2012-11-04
* ARM: config: sort select statements alphanumericallyRussell King2012-10-13
* Merge tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/ar...Linus Torvalds2012-10-01
|\
| * Merge tag 'multi-platform-for-3.7' of git://sources.calxeda.com/kernel/linux ...Olof Johansson2012-09-21
| |\
| | * ARM: make mach/gpio.h headers optionalRob Herring2012-09-14
* | | Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds2012-10-01
|\ \ \ | |/ / |/| |
| * | ARM: mach-realview and mach-versatile: retire custom LED codeBryan Wu2012-07-31
| |/
* / ARM: versatile: use fixed PCI i/o mappingRob Herring2012-07-26
|/
* ARM: fix mach-versatile/pci.c warningRussell King2012-07-04
* arm: versatile: fix and enable PCI I/O spaceArnd Bergmann2012-06-16
*-. Merge branches 'amba', 'devel-stable', 'fixes', 'mach-types', 'mmci', 'pci' a...Russell King2012-05-21
|\ \
| | * ARM: 7391/1: versatile: add some auxdata for device treesLinus Walleij2012-05-04
| | * ARM: 7389/2: plat-versatile: modernize FPGA IRQ controllerLinus Walleij2012-05-04
| |/ |/|
| * ARM: PCI: provide a default bus scan implementationRussell King2012-05-13
| * ARM: PCI: get rid of pci_std_swizzle()Russell King2012-05-13
| * ARM: PCI: versatile: fix PCI interrupt setupRussell King2012-05-13
|/
* ARM: versatile: fix build failure in pci.cPaul Gortmaker2012-04-03
* Merge tag 'cleanup2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm...Linus Torvalds2012-03-29
|\
 
                                                                   
 

                                                             




                                                                         


                                                            







                                           


                                   
                                                 
                                                                  
                                                                            
                                

 

                                                           
 
                              


                                                           
                                                                
                                                       
      










                                                                   
                                      
 
                                                   



                                 
/*
 * kernel/mutex-debug.c
 *
 * Debugging code for mutexes
 *
 * Started by Ingo Molnar:
 *
 *  Copyright (C) 2004, 2005, 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
 *
 * lock debugging, locking tree, deadlock detection started by:
 *
 *  Copyright (C) 2004, LynuxWorks, Inc., Igor Manyilov, Bill Huey
 *  Released under the General Public License (GPL).
 */
#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/poison.h>
#include <linux/spinlock.h>
#include <linux/kallsyms.h>
#include <linux/interrupt.h>
#include <linux/debug_locks.h>

#include "mutex-debug.h"

/*
 * Must be called with lock->wait_lock held.
 */
void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter)
{
	memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter));
	waiter->magic = waiter;
	INIT_LIST_HEAD(&waiter->list);
}

void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter)
{
	SMP_DEBUG_LOCKS_WARN_ON(!spin_is_locked(&lock->wait_lock));
	DEBUG_LOCKS_WARN_ON(list_empty(&lock->wait_list));
	DEBUG_LOCKS_WARN_ON(waiter->magic != waiter);
	DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list));
}

void debug_mutex_free_waiter(struct mutex_waiter *waiter)
{
	DEBUG_LOCKS_WARN_ON(!list_empty(&waiter->list));
	memset(waiter, MUTEX_DEBUG_FREE, sizeof(*waiter));
}

void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
			    struct thread_info *ti)
{
	SMP_DEBUG_LOCKS_WARN_ON(!spin_is_locked(&lock->wait_lock));

	/* Mark the current thread as blocked on the lock: */
	ti->task->blocked_on = waiter;
}

void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter,
			 struct thread_info *ti)
{
	DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list));
	DEBUG_LOCKS_WARN_ON(waiter->task != ti->task);
	DEBUG_LOCKS_WARN_ON(ti->task->blocked_on != waiter);
	ti->task->blocked_on = NULL;

	list_del_init(&waiter->list);
	waiter->task = NULL;
}

void debug_mutex_unlock(struct mutex *lock)
{
	if (unlikely(!debug_locks))
		return;

	DEBUG_LOCKS_WARN_ON(lock->magic != lock);
	DEBUG_LOCKS_WARN_ON(lock->owner != current_thread_info());
	DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);
	mutex_clear_owner(lock);
}

void debug_mutex_init(struct mutex *lock, const char *name,
		      struct lock_class_key *key)
{
#ifdef CONFIG_DEBUG_LOCK_ALLOC
	/*
	 * Make sure we are not reinitializing a held lock:
	 */
	debug_check_no_locks_freed((void *)lock, sizeof(*lock));
	lockdep_init_map(&lock->dep_map, name, key, 0);
#endif
	lock->magic = lock;
}

/***
 * mutex_destroy - mark a mutex unusable
 * @lock: the mutex to be destroyed
 *
 * This function marks the mutex uninitialized, and any subsequent
 * use of the mutex is forbidden. The mutex must not be locked when
 * this function is called.
 */
void mutex_destroy(struct mutex *lock)
{
	DEBUG_LOCKS_WARN_ON(mutex_is_locked(lock));
	lock->magic = NULL;
}

EXPORT_SYMBOL_GPL(mutex_destroy);