PINCTRL:We May need mutex protect in pinctrl API

Linus Walleij linus.walleij at linaro.org
Thu Nov 7 04:41:02 EST 2013


On Thu, Nov 7, 2013 at 5:53 AM, xulinuxkernel at gmail.com
<xulinuxkernel at gmail.com> wrote:

> Recently, our company use kernel 3.10 instead of 3.8.When we test the kernel
> we found there would be hang up in pinctrl subsystem,the reason may be as
> following,
> In out system,nand and spi pins are some of the same,so we need frequently
> get pinctrl and put pinctrl. and sd card also frequently get and put
> pinctrl.
> when the nand and sd card both come in
> pinctrl_lookup_state

If you're repeatedly doing pinctrl_lookup_state() in your driver,
then *this* is the problem, not that the pinctrl_lookup_state()
is not mutexed.

You should lookup your states at probe() and at runtime
only use pinctrl_select_state() to move between different
states.

Can you please refer me to the code in the upstream kernel
that is causing this.

If your code is not upstream and you're abusing the interface
as described above, the actual problem you have is that
you need to get your code upstream and properly reviewed
by the community.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list