All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
To: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	James Ralston
	<james.d.ralston-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v3 1/4] i2c: Add DIMM bus code
Date: Wed, 17 Jul 2013 16:04:37 -0700	[thread overview]
Message-ID: <CALCETrVCotmG2PCQUF1BaAcbvnysMbS-kE4SJHoSokgzaML0jg@mail.gmail.com> (raw)
In-Reply-To: <20130717222349.GD990-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>

On Wed, Jul 17, 2013 at 3:23 PM, Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> wrote:
> On Wed, Jul 17, 2013 at 01:53:05PM -0700, Andy Lutomirski wrote:
>> Add i2c_scan_dimm_bus to declare that a particular i2c_adapter
>> contains DIMMs.  This will probe (and autoload modules!) for useful
>> SMBUS devices that live on DIMMs.
>>
>> As more SMBUS-addressable DIMM components become supported, this
>> code can be extended to probe for them.
>>
> I don't think this code is necessary. The temperature sensor would be
> auto-detected if you mark the bus driver as I2C_CLASS_HWMON, and DIM eeprom
> auto-detection should not be needed.

I'm not at all sure I want to mark this thing I2C_CLASS_HWMON.  I
don't want random hwmon drivers probing the bus.  (Although I wouldn't
need to -- jc42 is looking for I2C_CLASS_SPD.)

Also, my code is IMO better than the i2c core probing code for several reasons:

 - i2c_imc is incompatible with the i2c core class-based detection
code because it can't do a read byte operation.  I believe that,
because of exactly this limitation, devices soldered onto DIMMs are
unlikely to ever require this operation.  (LGA2011 is the premier
platform for interesting DIMM-like devices right now.)  So I'd have to
modify the i2c core with more nasty hard-coded lists of what can be
safely probed how, and ISTM that kind of thing is better handled in
code that runs on busses that are really known to contain DIMMs (and
not, say, i2c-gpio).

 - The eventual goal is to write a driver for NVDIMMs, which will also
appear on this bus, and I want them to pull in the right drivers via
modalias and udev, which the i2c core code can't do.  To do this well,
I'll want the SMBUS driver to pass in (via platform-data) information
on which DIMM channel is which, and I don't know any way to do
anything like that without using i2c_new_device.

 - Busses like i2c_i801 may or may not contain DIMMs.  They do on some
machines I have.  But on my Core i7 Extreme box, there are no DIMMs on
that bus, and there are no SPDs on that bus (i.e. addresses 0x50
through 0x57 don't answer), but there is an unknown device at address
0x19.  I don't really want to think about whether it's safe to probe
by, say, read_word_data(0).  When NVDIMMs show up, even more bizarre
addresses may be populated.  My code can probe *carefully* by looking
for SPDs first, whereas the i2c-core code is not nearly as careful.

One option would be to move code like this into the core and replace
I2C_CLASS_SPD with something like it.  That way everything could get
the benefit of DIMM-specific probing.

--Andy

WARNING: multiple messages have this Message-ID (diff)
From: Andy Lutomirski <luto@amacapital.net>
To: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	James Ralston
	<james.d.ralston-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [lm-sensors] [PATCH v3 1/4] i2c: Add DIMM bus code
Date: Wed, 17 Jul 2013 23:04:37 +0000	[thread overview]
Message-ID: <CALCETrVCotmG2PCQUF1BaAcbvnysMbS-kE4SJHoSokgzaML0jg@mail.gmail.com> (raw)
In-Reply-To: <20130717222349.GD990-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>

On Wed, Jul 17, 2013 at 3:23 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> On Wed, Jul 17, 2013 at 01:53:05PM -0700, Andy Lutomirski wrote:
>> Add i2c_scan_dimm_bus to declare that a particular i2c_adapter
>> contains DIMMs.  This will probe (and autoload modules!) for useful
>> SMBUS devices that live on DIMMs.
>>
>> As more SMBUS-addressable DIMM components become supported, this
>> code can be extended to probe for them.
>>
> I don't think this code is necessary. The temperature sensor would be
> auto-detected if you mark the bus driver as I2C_CLASS_HWMON, and DIM eeprom
> auto-detection should not be needed.

I'm not at all sure I want to mark this thing I2C_CLASS_HWMON.  I
don't want random hwmon drivers probing the bus.  (Although I wouldn't
need to -- jc42 is looking for I2C_CLASS_SPD.)

Also, my code is IMO better than the i2c core probing code for several reasons:

 - i2c_imc is incompatible with the i2c core class-based detection
code because it can't do a read byte operation.  I believe that,
because of exactly this limitation, devices soldered onto DIMMs are
unlikely to ever require this operation.  (LGA2011 is the premier
platform for interesting DIMM-like devices right now.)  So I'd have to
modify the i2c core with more nasty hard-coded lists of what can be
safely probed how, and ISTM that kind of thing is better handled in
code that runs on busses that are really known to contain DIMMs (and
not, say, i2c-gpio).

 - The eventual goal is to write a driver for NVDIMMs, which will also
appear on this bus, and I want them to pull in the right drivers via
modalias and udev, which the i2c core code can't do.  To do this well,
I'll want the SMBUS driver to pass in (via platform-data) information
on which DIMM channel is which, and I don't know any way to do
anything like that without using i2c_new_device.

 - Busses like i2c_i801 may or may not contain DIMMs.  They do on some
machines I have.  But on my Core i7 Extreme box, there are no DIMMs on
that bus, and there are no SPDs on that bus (i.e. addresses 0x50
through 0x57 don't answer), but there is an unknown device at address
0x19.  I don't really want to think about whether it's safe to probe
by, say, read_word_data(0).  When NVDIMMs show up, even more bizarre
addresses may be populated.  My code can probe *carefully* by looking
for SPDs first, whereas the i2c-core code is not nearly as careful.

One option would be to move code like this into the core and replace
I2C_CLASS_SPD with something like it.  That way everything could get
the benefit of DIMM-specific probing.

--Andy

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2013-07-17 23:04 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 20:53 [PATCH v3 0/4] iMC SMBUS, TSOD hwmon devices, and eeprom modalias Andy Lutomirski
2013-07-17 20:53 ` [lm-sensors] " Andy Lutomirski
     [not found] ` <cover.1374093761.git.luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
2013-07-17 20:53   ` [PATCH v3 1/4] i2c: Add DIMM bus code Andy Lutomirski
2013-07-17 20:53     ` [lm-sensors] " Andy Lutomirski
     [not found]     ` <b8e50b55358b4f0cd1db96174a9e6a2e69780359.1374093761.git.luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
2013-07-17 22:23       ` Guenter Roeck
2013-07-17 22:23         ` [lm-sensors] " Guenter Roeck
     [not found]         ` <20130717222349.GD990-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-07-17 23:04           ` Andy Lutomirski [this message]
2013-07-17 23:04             ` Andy Lutomirski
     [not found]             ` <CALCETrVCotmG2PCQUF1BaAcbvnysMbS-kE4SJHoSokgzaML0jg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-18  0:57               ` Andy Lutomirski
2013-07-18  0:57                 ` [lm-sensors] " Andy Lutomirski
2013-07-17 20:53   ` [PATCH v3 2/4] i2c_imc: New driver for Intel's iMC, found on LGA2011 chips Andy Lutomirski
2013-07-17 20:53     ` [lm-sensors] " Andy Lutomirski
2013-07-17 20:53   ` [PATCH v3 3/4] tsod: New hwmon driver for Temperature Sensors on DIMM Andy Lutomirski
2013-07-17 20:53     ` [lm-sensors] " Andy Lutomirski
     [not found]     ` <f358329ff1dd3c3c272cadb4a358a5587cb28e18.1374093761.git.luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
2013-07-17 22:19       ` Guenter Roeck
2013-07-17 22:19         ` [lm-sensors] " Guenter Roeck
     [not found]         ` <20130717221902.GC990-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-07-17 22:49           ` Andy Lutomirski
2013-07-17 22:49             ` [lm-sensors] " Andy Lutomirski
     [not found]             ` <CALCETrWQF6p+DveuOxfMhp0r_CrvF=+FOmvfkF-TQ2NVgJ_2aA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-17 23:09               ` Guenter Roeck
2013-07-17 23:09                 ` [lm-sensors] " Guenter Roeck
     [not found]                 ` <20130717230909.GB2120-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-07-17 23:13                   ` Andy Lutomirski
2013-07-17 23:13                     ` [lm-sensors] " Andy Lutomirski
2013-07-17 20:53   ` [PATCH v3 4/4] eeprom: Add a MODULE_DEVICE_TABLE Andy Lutomirski
2013-07-17 20:53     ` [lm-sensors] " Andy Lutomirski
     [not found]     ` <5661ebb4676a4d20678f369df3a2da5d587e9100.1374093761.git.luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
2013-07-18  7:11       ` Jean Delvare
2013-07-18  7:11         ` [lm-sensors] " Jean Delvare
     [not found]         ` <20130718091116.6757e088-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-07-18 16:15           ` Andy Lutomirski
2013-07-18 16:15             ` [lm-sensors] " Andy Lutomirski
     [not found]             ` <CALCETrX9Et-D+C9qJ9Ou46UyuWdqD6SN+PSu6RKDwnVogE=jZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-18 20:31               ` Jean Delvare
2013-07-18 20:31                 ` [lm-sensors] " Jean Delvare
     [not found]                 ` <20130718223125.63e03635-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-07-18 20:44                   ` Andy Lutomirski
2013-07-18 20:44                     ` [lm-sensors] " Andy Lutomirski

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=CALCETrVCotmG2PCQUF1BaAcbvnysMbS-kE4SJHoSokgzaML0jg@mail.gmail.com \
    --to=luto-klttt9wpgjjwatoyat5jvq@public.gmane.org \
    --cc=james.d.ralston-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lm-sensors-GZX6beZjE8VD60Wz+7aTrA@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 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.