All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Williams <patrick@stwcx.xyz>
To: Mike Jones <proclivis@gmail.com>
Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>,
	Jason Ling <jasonling@google.com>
Subject: Re: [pmbusplus] userspace i2c, pmbus interactions
Date: Fri, 30 Apr 2021 15:54:26 -0500	[thread overview]
Message-ID: <YIxugif2LaXLaL4D@heinlein> (raw)
In-Reply-To: <2CAF9521-76FA-4160-9711-4267341B018A@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2926 bytes --]

On Fri, Apr 30, 2021 at 09:43:21AM -0600, Mike Jones wrote:
 
> I had a similar discussion with Guenter, who suggested that any i2c code in user space is problematic, but I think it also said there was enough locking in the drivers that SMBus transactions from /dev/i2c or i2c-tools would not interact with hwmon.

I'm pretty sure there is locking such that the kernel won't let you talk to a
device that is already bound to a driver.  Once you unbind the kernel side
you're free to do what you want.

What I don't recall is how much of the i2c-mux support gets propagated
out to userspace.  Hopefully you don't have to mess with moving muxes
and talking past those devices.  (I've seen some nasty shell scripts
using i2c-tools doing things like this in the past.)

> However, in general, ADI PMBus devices have a PAGE command, especially the LTC388X and LTC297X families.
> 
> This means that many actions require locking the bus to create compound transactions or the use of PAGE_PLUS.
> 
> The In System Programming code we support on linux via /dev/i2c has this issue. If another process touched hwmon during programming, and touches a PAGE, the programming may fail, or worse it sends the wrong settings.

I'm not sure how this is even possible.  How did an hwmon driver touch
the device and userspace access it?  I'm fairly sure.

> If the work within the PMBus community to have a standard programming file format, if it were to be applied in user space, OBMC would have to disable hwmon and all telemetry while the programming is in process.
> 
> If the file (or data blob) was applied in a kernel driver, it could lock the i2c during the process so that all hwmon activity and telemetry are held off.

Right.  I would expect the locking at a pmbus level so that the
pmbus-hwmon parts would block on a mutex until the firmware update is
complete (if firmware update were done in the pmbus driver).

> This problem is not unique to our desire for a file format. That is driven by the vendors complexity and business models.
> 
> But, in the context of the ADM1266, it is a multipage device. The DS does not say it can do PAGE_PLUS. Therefore, unless I am missing something, the above problems apply unless using a PAGEless bulk programming mechanism. I don’t know this part well enough to know how that works, or if it is published.
> 
> The other two families LTC388X and LTC297X do have a PAGEless bulk programming. We don’t like do it with telemetry hammering it, mainly because it feels risky.
> 
> Finally, one could argue that most OMBC systems are using the 1266 and not the other parts. But I can say I have sent patches for other parts to OBMC users, so they are in use.

There is already some firmware blob support in the kernel, just not for
pmbus.  Has anyone investigated what (if anything) we'd need to do to be
able to leverage this?

-- 
Patrick Williams

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-04-30 20:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 22:22 [pmbusplus] userspace i2c, pmbus interactions Jason Ling
2021-04-27  1:27 ` Andrew Jeffery
2021-04-27  2:32 ` Mike Jones
2021-04-27 16:20   ` Jason Ling
2021-04-27 18:00     ` Mike Jones
2021-04-27 19:49       ` Vivek Gani
2021-04-30 14:18 ` Patrick Williams
2021-04-30 14:52   ` Jason Ling
2021-04-30 15:10     ` Patrick Williams
2021-04-30 15:43       ` Mike Jones
2021-04-30 20:54         ` Patrick Williams [this message]
2021-04-30 21:00           ` Jason Ling
2021-04-30 21:50             ` Mike Jones
2021-04-30 21:42           ` Mike Jones
2021-05-07 21:11             ` Alex Qiu
2021-04-30 15:45       ` Jason Ling
2021-04-30 15:53         ` Jason Ling
2021-04-30 20:47           ` Patrick Williams
2021-04-30 20:44         ` Patrick Williams

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=YIxugif2LaXLaL4D@heinlein \
    --to=patrick@stwcx.xyz \
    --cc=jasonling@google.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=proclivis@gmail.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.