History

pinctrl: core: Fix regression caused by delayed work for hogs

Commit df61b366af26 ("pinctrl: core: Use delayed work for hogs") caused a regression at least with sh-pfc that is also a GPIO controller as noted by Geert Uytterhoeven <geert@linux-m68k.org>. As the original pinctrl_register() has issues calling pin controller driver functions early before the controller has finished registering, we can't just revert commit df61b366af26. That would break the drivers using GENERIC_PINCTRL_GROUPS or GENERIC_PINMUX_FUNCTIONS. So let's fix the issue with the following steps as a single patch: 1. Revert the late_init parts of commit df61b366af26. The late_init clearly won't work and we have to just give up on fixing pinctrl_register() for GENERIC_PINCTRL_GROUPS and GENERIC_PINMUX_FUNCTIONS. 2. Split pinctrl_register() into two parts By splitting pinctrl_register() into pinctrl_init_controller() and pinctrl_create_and_start() we have better control over when it's safe to call pinctrl_create(). 3. Introduce a new pinctrl_register_and_init() function As suggested by Linus Walleij <linus.walleij@linaro.org>, we can just introduce a new function for the controllers that need pinctrl_create() called later. 4. Convert the four known problem cases to use new function Let's convert pinctrl-imx, pinctrl-single, sh-pfc and ti-iodelay to use the new function to fix the issues. The rest of the drivers can be converted later. Let's also update Documentation/pinctrl.txt accordingly because of the known issues with pinctrl_register().

Tony Lindgren committed 9 years ago

Commit 950b0d91 parent 56d9e4a8 files · +165 −79Browse files

Showing the changes to include/linux/pinctrl (1 of 8 files). Show all

Unified · Split

include/linux/pinctrl/pinctrl.h+15−0
@@ -141,12 +141,27 @@ struct pinctrl_desc { · 140 unmodified lines
141};141};
142 142
143/* External interface to pin controller */143/* External interface to pin controller */
144
145extern int pinctrl_register_and_init(struct pinctrl_desc *pctldesc,
146 struct device *dev, void *driver_data,
147 struct pinctrl_dev **pctldev);
148
149/* Please use pinctrl_register_and_init() instead */
144extern struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,150extern struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
145 struct device *dev, void *driver_data);151 struct device *dev, void *driver_data);
152
146extern void pinctrl_unregister(struct pinctrl_dev *pctldev);153extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
154
155extern int devm_pinctrl_register_and_init(struct device *dev,
156 struct pinctrl_desc *pctldesc,
157 void *driver_data,
158 struct pinctrl_dev **pctldev);
159
160/* Please use devm_pinctrl_register_and_init() instead */
147extern struct pinctrl_dev *devm_pinctrl_register(struct device *dev,161extern struct pinctrl_dev *devm_pinctrl_register(struct device *dev,
148 struct pinctrl_desc *pctldesc,162 struct pinctrl_desc *pctldesc,
149 void *driver_data);163 void *driver_data);
164
150extern void devm_pinctrl_unregister(struct device *dev,165extern void devm_pinctrl_unregister(struct device *dev,
151 struct pinctrl_dev *pctldev);166 struct pinctrl_dev *pctldev);
152 167

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t