From: Eddie James <eajames@linux.ibm.com>
To: Guenter Roeck <linux@roeck-us.net>, linux-hwmon@vger.kernel.org
Cc: jdelvare@suse.com, joel@jms.id.au
Subject: Re: [PATCH] hwmon (occ): Avoid polling OCC during probe
Date: Wed, 27 Apr 2022 09:26:02 -0500 [thread overview]
Message-ID: <123fbca0-91e1-4472-8742-98e9cd4dd0cf@linux.ibm.com> (raw)
In-Reply-To: <eef45828-82df-1771-0ef9-454008836154@roeck-us.net>
On 4/27/22 08:45, Guenter Roeck wrote:
> On 4/26/22 08:26, Eddie James wrote:
>>
>> On 4/26/22 10:01, Guenter Roeck wrote:
>>> On 4/26/22 07:45, Eddie James wrote:
>>>> Instead of polling the OCC during the probe, use the "occ_active"
>>>> sysfs file to control when the driver polls the OCC for sensor data.
>>>> The reason for this change is that the SBE, which is the device by
>>>> which the driver communicates with the OCC, cannot handle
>>>> communications
>>>> during certain system state transitions.
>>>>
>>>
>>> This is hackish, to say the least. Why not just instantiate the driver
>>> manually instead if userspace interaction is indeed needed, and there
>>> is no means to auto-instantiate it only after the hardware is ready ?
>>
>>
>> Well, the occ-hwmon platform devices are currently created by the
>> parent FSI occ device (that's a bit of a hack too). I poked through
>> the platform/device/bus interfaces but couldn't work out how to
>> create the device but not probe it, so that userspace could later
>> bind the device to the driver. The current userspace does just that,
>> but it relies on the the initial probe failing since SBE can't handle
>> the communications yet. The error scenario is that the SBE can get
>> into a bad state, so communications shouldn't even be attempted.
>>
>> So to answer your question, there's no reason not to just instantiate
>> the driver manually, but I don't actually know how to do so with
>> these drivers.
>>
>>
>>>
>>> On the other side, what means does userspace have to determine that
>>> the SBE/OCC is ready ? Can't that same mechanism not be used in the
>>> kernel to auto-instantiate the driver ?
>>
>>
>> No it's impossible, it's not just some bit we can check in HW
>> unfortunately, the signal is PLDM (platform level data model) over
>> the network.
>>
>
> What a mess.
It is, yes. Just sent a v2. Thanks for taking a second look.
Eddie
>
> The subject and description are misleading. The code doesn't
> "avoid polling during probe", it delays hwmon registration until
> directed to do it by writing into a new sysfs attribute.
> Please update accordingly.
It's actually an existing sysfs file, I've just made it writeable.
>
> Thanks,
> Guenter
prev parent reply other threads:[~2022-04-27 14:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 14:45 [PATCH] hwmon (occ): Avoid polling OCC during probe Eddie James
2022-04-26 15:01 ` Guenter Roeck
2022-04-26 15:26 ` Eddie James
2022-04-27 13:45 ` Guenter Roeck
2022-04-27 14:26 ` Eddie James [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=123fbca0-91e1-4472-8742-98e9cd4dd0cf@linux.ibm.com \
--to=eajames@linux.ibm.com \
--cc=jdelvare@suse.com \
--cc=joel@jms.id.au \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
/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