Re: PINCTRL:We May need mutex protect in pinctrl API

From: Linus Walleij
Date: Thu Nov 07 2013 - 04:41:09 EST


On Thu, Nov 7, 2013 at 5:53 AM, xulinuxkernel@xxxxxxxxx
<xulinuxkernel@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/