linux/drivers/pinctrl
Doug Anderson eae444c126 pinctrl: Don't just pretend to protect pinctrl_maps, do it for real
[ Upstream commit c5272a2856 ]

Way back, when the world was a simpler place and there was no war, no
evil, and no kernel bugs, there was just a single pinctrl lock.  That
was how the world was when (57291ce pinctrl: core device tree mapping
table parsing support) was written.  In that case, there were
instances where the pinctrl mutex was already held when
pinctrl_register_map() was called, hence a "locked" parameter was
passed to the function to indicate that the mutex was already locked
(so we shouldn't lock it again).

A few years ago in (42fed7b pinctrl: move subsystem mutex to
pinctrl_dev struct), we switched to a separate pinctrl_maps_mutex.
...but (oops) we forgot to re-think about the whole "locked" parameter
for pinctrl_register_map().  Basically the "locked" parameter appears
to still refer to whether the bigger pinctrl_dev mutex is locked, but
we're using it to skip locks of our (now separate) pinctrl_maps_mutex.

That's kind of a bad thing(TM).  Probably nobody noticed because most
of the calls to pinctrl_register_map happen at boot time and we've got
synchronous device probing.  ...and even cases where we're
asynchronous don't end up actually hitting the race too often.  ...but
after banging my head against the wall for a bug that reproduced 1 out
of 1000 reboots and lots of looking through kgdb, I finally noticed
this.

Anyway, we can now safely remove the "locked" parameter and go back to
a war-free, evil-free, and kernel-bug-free world.

Fixes: 42fed7ba44 ("pinctrl: move subsystem mutex to pinctrl_dev struct")
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
History 2015-06-09 13:43:37 -04:00
..
berlin pinctrl: berlin: fix the dt_free_map function 2014-09-23 17:01:47 +02:00
freescale pinctrl: imx25: fix numbering for pins 2015-03-23 21:02:53 -04:00
mvebu pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
nomadik This is the bulk of GPIO changes for the v3.18 development 2014-10-09 14:58:15 -04:00
qcom pinctrl: qcom: Don't iterate past end of function array 2015-01-29 17:40:42 -08:00
samsung This is the bulk of GPIO changes for the v3.18 development 2014-10-09 14:58:15 -04:00
sh-pfc This is the bulk of pin control changes for the v3.18 2014-10-07 20:56:28 -04:00
sirf This is the bulk of GPIO changes for the v3.18 development 2014-10-09 14:58:15 -04:00
spear pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
sunxi pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
vt8500 pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
core.c pinctrl: Don't just pretend to protect pinctrl_maps, do it for real 2015-06-09 13:43:37 -04:00
core.h pinctrl: Don't just pretend to protect pinctrl_maps, do it for real 2015-06-09 13:43:37 -04:00
devicetree.c pinctrl: Don't just pretend to protect pinctrl_maps, do it for real 2015-06-09 13:43:37 -04:00
devicetree.h pinctrl: core device tree mapping table parsing support 2012-04-18 13:53:10 +02:00
Kconfig This is the bulk of GPIO changes for the v3.18 development 2014-10-09 14:58:15 -04:00
Makefile pinctrl: imx/mxs: move freescale drivers to subdir 2014-09-04 10:05:28 +02:00
pinconf-generic.c pinctrl: Enable "power-source" to be extracted from DT files 2014-05-28 10:16:35 +02:00
pinconf.c pinctrl: pinconf: remove warning: unused variable 'ops' 2013-12-13 13:55:15 +01:00
pinconf.h pinctrl: add function to parse generic pinconfig properties from a dt node 2013-06-16 11:57:32 +02:00
pinctrl-adi2-bf54x.c pinctrl: pinctrl-adi: combine multiple groups of one function together 2014-02-25 10:49:13 +01:00
pinctrl-adi2-bf60x.c pinctrl: pinctrl-adi: combine multiple groups of one function together 2014-02-25 10:49:13 +01:00
pinctrl-adi2.c pinctrl: adi2: Remove duplicate gpiochip_remove_pin_ranges 2014-09-05 10:33:51 +02:00
pinctrl-adi2.h pinctrl: pinctrl-adi: combine multiple groups of one function together 2014-02-25 10:49:13 +01:00
pinctrl-as3722.c pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
pinctrl-at91.c pinctrl: at91: allow to have disabled gpio bank 2015-02-05 22:36:06 -08:00
pinctrl-baytrail.c pinctrl: baytrail: show output gpio state correctly on Intel Baytrail 2014-10-28 11:16:26 +01:00
pinctrl-bcm281xx.c pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
pinctrl-bcm2835.c pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
pinctrl-coh901.c pinctrl: remove all usage of gpio_remove ret val in driver/pinctl 2014-07-22 16:34:12 +02:00
pinctrl-coh901.h pinctrl: support pinconfig on the U300 2012-03-12 22:49:03 +01:00
pinctrl-falcon.c pinctrl: Pass all configs to driver on pin_config_set() 2013-08-28 13:34:41 +02:00
pinctrl-lantiq.c pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
pinctrl-lantiq.h pinctrl: lantiq: Fix header file include guard 2014-04-22 08:41:35 +02:00
pinctrl-palmas.c pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
pinctrl-rockchip.c This is the bulk of pin control changes for the v3.18 2014-10-07 20:56:28 -04:00
pinctrl-single.c pinctrl: single: fix freudian slip 2014-09-05 10:33:25 +02:00
pinctrl-st.c pinctrl: st: remove gpiochip in failure cases 2014-09-23 16:53:18 +02:00
pinctrl-tb10x.c pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
pinctrl-tegra-xusb.c This is the bulk of pin control changes for the v3.18 2014-10-07 20:56:28 -04:00
pinctrl-tegra.c pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
pinctrl-tegra.h pinctrl: tegra: add missing kerneldoc 2014-04-22 16:55:41 +02:00
pinctrl-tegra20.c pinctrl: Make of_device_id array const 2014-08-29 07:13:04 +02:00
pinctrl-tegra30.c pinctrl: Make of_device_id array const 2014-08-29 07:13:04 +02:00
pinctrl-tegra114.c pinctrl: Make of_device_id array const 2014-08-29 07:13:04 +02:00
pinctrl-tegra124.c pinctrl: tegra: Add MIPI pad control 2014-09-19 12:28:54 -05:00
pinctrl-tz1090-pdc.c pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
pinctrl-tz1090.c pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
pinctrl-u300.c pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
pinctrl-utils.c pinctrl: utils: include export.h to avoid warnings 2013-08-28 15:50:33 +02:00
pinctrl-utils.h pinctrl: add utility functions for add map/configs 2013-08-14 21:00:41 +02:00
pinctrl-xway.c pinctrl: lantiq: remove bogus of_gpio_chip_add 2015-01-27 08:29:41 -08:00
pinmux.c pinctrl: clean up after enable refactoring 2014-09-04 10:05:07 +02:00
pinmux.h pinctrl: ifdef CONFIG_DEBUG_FS cleanup 2012-04-18 13:53:12 +02:00