linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: "Hawkins, Nick" <nick.hawkins@hpe.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	"Verdun, Jean-Marie" <verdun@hpe.com>,
	"brgl@bgdev.pl" <brgl@bgdev.pl>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"krzysztof.kozlowski+dt@linaro.org" 
	<krzysztof.kozlowski+dt@linaro.org>,
	"jdelvare@suse.com" <jdelvare@suse.com>,
	"andy.shevchenko@gmail.com" <andy.shevchenko@gmail.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>
Subject: Re: [PATCH v2 4/5] hwmon: (gxp_fan_ctrl) Provide fan info via gpio
Date: Thu, 1 Jun 2023 19:11:10 +0200	[thread overview]
Message-ID: <CACRpkdarJCSCif+r1e_jXbbAgv03OgGAO6pkW9x-yiYZJxdGeQ@mail.gmail.com> (raw)
In-Reply-To: <DM4PR84MB19273A008BB11589CEEF697188499@DM4PR84MB1927.NAMPRD84.PROD.OUTLOOK.COM>

On Thu, Jun 1, 2023 at 5:48 PM Hawkins, Nick <nick.hawkins@hpe.com> wrote:

> Thank you for your valuable feedback with the solutions you have provided.
> Before I proceed though I have a quick query about the fan driver.
> If I were to let the user space "own" gpio pins, would it be permissible for
> the userspace to feed a kernel driver data via sysfs?
>
> Ex:
> GPIO Driver -> (OpenBMC) -> Fandriver (sysfs).
>
> Here the GPIO driver would provide fan presence information to OpenBMC
> and then OpenBMC would provide fan presence info to the fan driver.

But why? Don't be so obsessed about userspace doing stuff using
sysfs, usually it is a better idea to let the kernel handle hardware.

I think this is a simple thermal zone you can define in the device
tree as indicated in my previous comment.

> If it were permissible to provide data to the driver via this method I could
> apply it to the PSU driver as well. the PSU driver which requires presence
> info to verify a PSU is inserted / removed.

It feels like you are looking for a way for two drivers to communicate
with each other.

This can be done several ways, the most straight-forward is notifiers.
include/linux/notifier.h

Yours,
Linus Walleij

  reply	other threads:[~2023-06-01 17:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 15:19 [PATCH v2 0/5] ARM: Add GPIO support nick.hawkins
2023-05-31 15:19 ` [PATCH v2 1/5] dt-bindings: gpio: Add HPE GXP GPIO nick.hawkins
2023-06-01  6:52   ` Krzysztof Kozlowski
2023-05-31 15:19 ` [PATCH v2 2/5] gpio: gxp: " nick.hawkins
2023-06-01  8:11   ` Bartosz Golaszewski
2023-06-01 11:39   ` Linus Walleij
2023-05-31 15:19 ` [PATCH v2 3/5] dt-bindings: hwmon: hpe,gxp-fanctrl: remove fn2 and pl regs nick.hawkins
2023-06-01  6:53   ` Krzysztof Kozlowski
2023-06-05 16:52     ` Hawkins, Nick
2023-06-06  6:22       ` Krzysztof Kozlowski
2023-05-31 15:19 ` [PATCH v2 4/5] hwmon: (gxp_fan_ctrl) Provide fan info via gpio nick.hawkins
2023-05-31 16:42   ` Guenter Roeck
     [not found]     ` <DM4PR84MB19274F575858CBCB2FA5C23E88489@DM4PR84MB1927.NAMPRD84.PROD.OUTLOOK.COM>
     [not found]       ` <b1d8f851-4e87-333c-229c-b9dc37ea3c40@roeck-us.net>
2023-06-01 15:47         ` Hawkins, Nick
2023-06-01 17:11           ` Linus Walleij [this message]
2023-06-01 17:45             ` Guenter Roeck
2023-06-02 15:02               ` Hawkins, Nick
2023-05-31 15:19 ` [PATCH v2 5/5] MAINTAINERS: hpe: Add GPIO nick.hawkins

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=CACRpkdarJCSCif+r1e_jXbbAgv03OgGAO6pkW9x-yiYZJxdGeQ@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nick.hawkins@hpe.com \
    --cc=robh+dt@kernel.org \
    --cc=verdun@hpe.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).