All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Bishop <bradleyb@fuzziesquirrel.com>
To: Patrick Venture <venture@google.com>
Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: GPIO Centralized Control Daemon
Date: Sun, 17 Sep 2017 17:38:22 -0400	[thread overview]
Message-ID: <1505684302.29751.6.camel@fuzziesquirrel.com> (raw)
In-Reply-To: <CAO=notzxdXfK9_x-LwbOkwawcLLqUTuLZ8kbHGnMUxN6rCQ6WA@mail.gmail.com>


> > Is it just stuck behind a gpio for no reason?  If that is the case,
> > I
> > would think you just wiggle the gpio when the bmc boots.
> 
> In this particular case, it's behind a GPIO so it doesn't drain the
> battery -- or at least that's my understanding of the design.
> 
> The appropriate time would be -- when someone tries to read it from
> the host.  What you're suggesting is that, the ipmi daemon, when it
> receives a request for this sensor - that is then launches something
> that sets the gpio, and then waits for the dbus objects to exist from
> the launched phosphor-hwmon, before then requesting the sensor value
> in its normal course of action.  Because it's my understanding it's a
> gated sensor so that it doesn't drain the battery, which means
> leaving it open effectively permanently isn't an option.  If I'm
> misunderstanding the goal of the design, then obviously just
> unlocking the GPIO effectively permanently is a solution.

Aha!  Now I understand the motivation.  And yes the approach I've
outlined is quite painful.  In my defense I would not have suggested
that had I known :-)

> > 
> > I'm not arguing that there aren't several board setups where this
> > is
> > the case.  Rather, board designers are free to do whatever they
> > want,
> > and if we start putting the board specific logic in phosphor-hwmon
> > you
> > won't have "one nice package" for very long....
> 
> True-ish.  This is quite similar to dealing with GAIN and OFFSET.  

Those feel different to me.  They are needed for thermistor type
sensors regardless of board wiring.

> Those are particulars of a board that now get factored into the
> value.  I'm not suggesting something beyond the norms of hwmon.  It
> would be convenient however, if the ADC driver could be programmed to
> know that some sensor is gated by a GPIO and handled flipping, 

Can you reach out to Guenter or the relevant maintainer (is this an IIO
device?) for ideas here?  I hadn't mentioned it but in the back of my
head this whole time I've been wondering about a completely in-kernel
solution.

> waiting, reading, and flipping-back for someone -- quasi-similarly to
> i2c muxes that use gpios.  Except, obviously, the waiting and setting
> it back part are ... a bad plan to build into a driver, in that it 

It has to be done in one place or the other, does it not?  You mention
i2c muxes - managing those isn't delegated to userspace (there are
drivers for i2c muxes) so maybe this situation need not be any
different?

> could delay returning a value.  Although -- one could argue the fan
> speed controller driver does that -- takes time to respond.  It's
> just, one would then also want to configure the wait time, because 

In the very near future I intend to make all the wait/delay/retry
intervals runtime configurable to handle exactly these kinds of nuances
between devices and their drivers.

> some configurations will take longer for a sensor value to stabilize.
> 
> Patrick
> 

  reply	other threads:[~2017-09-17 21:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14 22:02 GPIO Centralized Control Daemon Patrick Venture
2017-09-14 22:29 ` Rick Altherr
2017-09-14 22:55   ` Patrick Venture
2017-09-16 22:12 ` Brad Bishop
2017-09-17  4:22   ` Patrick Venture
2017-09-17 16:26     ` Brad Bishop
2017-09-17 16:39       ` Patrick Venture
2017-09-17 17:33         ` Brad Bishop
2017-09-17 21:04           ` Patrick Venture
2017-09-17 21:38             ` Brad Bishop [this message]
2017-09-17 21:49               ` Patrick Venture
2017-09-17 22:10                 ` Brad Bishop
2017-09-18  7:32                 ` Andrew Jeffery
2017-09-18 14:52                   ` Patrick Venture
2017-09-18  7:07     ` Andrew Jeffery

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=1505684302.29751.6.camel@fuzziesquirrel.com \
    --to=bradleyb@fuzziesquirrel.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=venture@google.com \
    /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.