All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Bishop <bradleyb@fuzziesquirrel.com>
To: Joel Stanley <joel@jms.id.au>
Cc: Andrew Jeffery <andrew@aj.id.au>,
	OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: [PATCH linux dev-4.7 v3 2/2] ARM: dts: Enable checkstop and cooling gpio keys
Date: Thu, 20 Apr 2017 23:32:12 -0400	[thread overview]
Message-ID: <6871B647-C223-4D25-ABAE-3778E1CB4D19@fuzziesquirrel.com> (raw)
In-Reply-To: <CACPK8XeecjHPOYGG3mMQXUsxhrXt_Ry=NMTy+ng1pudO5p4+Jg@mail.gmail.com>


> On Apr 20, 2017, at 10:14 PM, Joel Stanley <joel@jms.id.au> wrote:
> 
> Hi Brad,
> 
> On Thu, Apr 20, 2017 at 11:54 PM, Brad Bishop
> <bradleyb@fuzziesquirrel.com> wrote:
>>>> Each gpio will have an application waiting for its state to change.  My
>>>> concern was waking up x number of applications every time any gpio changes
>>>> state.  Is that a valid concern?
>>> 
>>> How many applications do we expect to be reading the evdev? What are
>>> our expected interrupt rates? What are the worst expected cases?
>> 
>> For Witherspoon/Zaius or any OpenBMC platform?  I obviously can’t say for the
>> latter case.  On a bigger/enterprise systems I can see on the order of 10 to 100
>> applications looking at these.  I don’t have a good sense of how often.
>> 
>> On Witherspoon/Zaius, sure, we only have a handful of applications and the
>> interrupt rate should be very infrequent.
>> 
>> I think you typically see all the gpio keys mapped to a single device because
>> the usual thing to do is have a single application (Xorg) treat it like a keyboard.
> 
> I've been following the discussion you've been having. I went to merge
> the patches today, but first decided to satisfy myself that this was
> the right way to go. I didn't arrive at the same conclusion as you and
> Andrew.
> 
> The userspace use cases you've presented would be served well by a
> single node. We have the flexibility to revisit this decision when
> someone builds a machine that has 100 GPIOs they want to monitor; in
> addition I think we would revisit the decision to have 100 userspace
> programs.
> 
> By having separate nodes, you're creating a new instance of the kernel
> driver for each node.
> 
> The driver, and the binding, is designed to support your use case -
> multiple key events generated by the hardware.

Honestly I’m OK with either approach.  I think we will have userspace configurable
enough that switching back and forth would be pretty trivial, if this would need
to be revisited.  v5 en-route.

> 
> Finally, I looked at the other machines in the tree. None of them have
> separate gpio-keys nodes

Yeah I noticed this too.  I chalked it up to my previously mentioned
user-is-probably-Xorg logic, but standard practices are not usually a
hard sell for me….

> 
> arch/arm/boot/dts/armada-xp-netgear-rn2120.dts:
> 
>        gpio-keys {
>                compatible = "gpio-keys";
>                pinctrl-0 = <&power_button_pin &reset_button_pin>;
>                pinctrl-names = "default";
> 
>                power-button {
>                        label = "Power Button";
>                        linux,code = <KEY_POWER>;
>                        gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
>                };
> 
>                reset-button {
>                        label = "Reset Button";
>                        linux,code = <KEY_RESTART>;
>                        gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
>                };
>        };
> 
> arch/arm/boot/dts/at91sam9261ek.dts
>        gpio_keys {
>                compatible = "gpio-keys";
> 
>                button_0 {
>                        label = "button_0";
>                        gpios = <&pioA 27 GPIO_ACTIVE_LOW>;
>                        linux,code = <256>;
>                        wakeup-source;
>                };
> 
>                button_1 {
>                        label = "button_1";
>                        gpios = <&pioA 26 GPIO_ACTIVE_LOW>;
>                        linux,code = <257>;
>                        wakeup-source;
>                };
> 
>                button_2 {
>                        label = "button_2";
>                        gpios = <&pioA 25 GPIO_ACTIVE_LOW>;
>                        linux,code = <258>;
>                        wakeup-source;
>                };
> 
>                button_3 {
>                        label = "button_3";
>                        gpios = <&pioA 24 GPIO_ACTIVE_LOW>;
>                        linux,code = <259>;
>                        wakeup-source;
>                };
>        };
> 
> Cheers,
> 
> Joel
> 
> 
> 
>> 
>> We aren’t structured that way so rethinking the usual approach seems reasonable.
>> Another reason I went for per gpio devices because it prevents applications from
>> reacting to each others events without any special library code.
>> 
>> I’m not saying there aren’t disadvantages to this approach - I just don’t know what
>> they are?
>> 
>>> 
>>> It's hard to judge without knowing the numbers, but considering the
>>> chips we run on I agree we should generally favour performance if
>>> design is getting in the way. But to make that trade off we should be
>> 
>> Again, what exactly is being traded-off ?
>> 
>>> clear on the performance numbers.
>>> 
>>> Andrew

      reply	other threads:[~2017-04-21  3:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19  4:18 [PATCH linux dev-4.7 v3 0/2] enable gpio-keys Brad Bishop
2017-04-19  4:18 ` [PATCH linux dev-4.7 v3 1/2] ARM: configs: aspeed: Enable keyboard-gpio Brad Bishop
2017-04-19  4:18 ` [PATCH linux dev-4.7 v3 2/2] ARM: dts: Enable checkstop and cooling gpio keys Brad Bishop
2017-04-19 14:29   ` Andrew Jeffery
2017-04-19 14:38     ` Brad Bishop
2017-04-20  4:34       ` Andrew Jeffery
2017-04-20 14:24         ` Brad Bishop
2017-04-21  0:35           ` Andrew Jeffery
2017-04-21  2:14           ` Joel Stanley
2017-04-21  3:32             ` Brad Bishop [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6871B647-C223-4D25-ABAE-3778E1CB4D19@fuzziesquirrel.com \
    --to=bradleyb@fuzziesquirrel.com \
    --cc=andrew@aj.id.au \
    --cc=joel@jms.id.au \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.