Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1520007

Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs
Date 2016-11-11 21:20 +0100
Message-ID <sCqsN-EV-17@gated-at.bofh.it> (permalink)
References <swh8R-2vP-7@gated-at.bofh.it> <swh8R-2vP-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Oct 25, 2016 at 11:02 PM, Tony Lindgren <tony@atomide.com> wrote:

> Having the pin control framework call pin controller functions
> before it's probe has finished is not nice as the pin controller
> device driver does not yet have struct pinctrl_dev handle.
>
> Let's fix this issue by adding deferred work for hogs. This is
> needed to be able to add pinctrl generic helper functions.
>
> Note that the pinctrl functions already take care of the necessary
> locking.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

I don't see why this is necessary?

The hogging was placed inside pinctrl_register() so that any hogs
would be taken before it returns, so nothing else can take it
before the controller itself has the first chance. This semantic
needs to be preserved I think.

> +       schedule_delayed_work(&pctldev->hog_work,
> +                                     msecs_to_jiffies(100));

If we arbitrarily delay, something else can go in and take the
pins used by the hogs before the pinctrl core? That is what
we want to avoid.

Hm, 100ms seems arbitrarily chosen BTW. Can it be 1 ms?
1 ns?

I'm pretty sure that whatever it is that needs to happen before
the hog work runs can race with this delayed work under
some circumstances (such as slow external expanders
on i2c). It should be impossible for that to happen
and I don't think it is?

Yours,
Linus Walleij

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs Linus Walleij <linus.walleij@linaro.org> - 2016-11-11 21:20 +0100
  Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs Tony Lindgren <tony@atomide.com> - 2016-11-11 21:30 +0100
    Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs Tony Lindgren <tony@atomide.com> - 2016-11-11 21:40 +0100
      Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs Tony Lindgren <tony@atomide.com> - 2016-11-11 22:00 +0100
    Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs Tony Lindgren <tony@atomide.com> - 2016-11-14 22:00 +0100
      Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs Tony Lindgren <tony@atomide.com> - 2016-11-14 23:10 +0100
        Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs Tony Lindgren <tony@atomide.com> - 2016-11-15 01:50 +0100
          Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs Linus Walleij <linus.walleij@linaro.org> - 2016-11-15 08:00 +0100
            Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs Tony Lindgren <tony@atomide.com> - 2016-11-15 16:50 +0100
              Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs Tony Lindgren <tony@atomide.com> - 2016-11-15 18:10 +0100

csiph-web