From: Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
To: Curt Brune
<curt-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>,
Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/2] Create eeprom_dev hardware class for EEPROM devices
Date: Wed, 22 Jan 2014 11:32:24 -0800 [thread overview]
Message-ID: <52E01CC8.4020709@amacapital.net> (raw)
In-Reply-To: <1390412855-2927-1-git-send-email-curt-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
On 01/22/2014 09:47 AM, Curt Brune wrote:
> Create a new hardware class under /sys/class/eeprom_dev
>
> EEPROM drivers can register their devices with the eeprom_dev class
> during instantiation.
>
> The registered devices show up as:
>
> /sys/class/eeprom_dev/eeprom0
> /sys/class/eeprom_dev/eeprom1
> ...
> /sys/class/eeprom_dev/eeprom[N]
>
> Each member of the eeprom class exports a sysfs file called "label",
> containing the label property from the corresponding device tree node.
>
> Example:
>
> /sys/class/eeprom_dev/eeprom0/label
>
> If the device tree node property "label" does not exist the value
> "unknown" is used.
>
> Userspace can use the label to identify what the EEPROM is for.
I will be using the at24 driver (most likely -- the SPD protocol is so
simple that it may be easier to use the raw SMBUS API) to talk to
NV-DIMMs. For this purpose, I really need to know that a given EEPROM
is the EEPROM attached to a particular DIMM. I wrote some code (search
for "DIMM bus", in limbo) that kind of solves this problem, but it's not
pretty.
In general, I suspect this will have the issue that EDID, SPD, etc.
eeprom devices will get all confused.
Ideally there would be a way to express the logical topology. In the
case of NV-DIMMs there's a DIMM. That DIMM exposes some memory (which
isn't really part of the driver model), some temperature sensors, an
SPD, and some other stuff. The DIMM as a whole lives in a DIMM slot.
Unfortunately, the kernel has no real awareness of what's going on. The
arch code just sees it as memory (without really associating it with a
DIMM) and the EDAC driver and things like dmidecode do their own thing.
The same issue shows up when sensors-detect offers to scan all the i2c
busses on the ports on my graphics card for things like motherboard
voltage sensors.
Unfortunately, I don't think that using a device tree label really helps
here, especially because none of the machines I care about use (or are
likely to ever use) device trees.
--Andy
next prev parent reply other threads:[~2014-01-22 19:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-22 17:47 [PATCH 1/2] Create eeprom_dev hardware class for EEPROM devices Curt Brune
[not found] ` <1390412855-2927-1-git-send-email-curt-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
2014-01-22 19:32 ` Andy Lutomirski [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-01-23 7:34 Laszlo Papp
2014-01-23 14:54 ` Curt Brune
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=52E01CC8.4020709@amacapital.net \
--to=luto-klttt9wpgjjwatoyat5jvq@public.gmane.org \
--cc=curt-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox