iMC SMBUS and DIMM bus probing
v4 cover iMC SMBUS and DIMM bus probing
Intel LGA2011 machines have dedicated SMBUS controllers for DIMM sockets. Because they're dedicated, they can be safely and accurately probed, since all devices on them are known to be attached to DIMMs. The devices found are:
- SPD EEPROMs
- TSODs (Temperature Sensor on DIMMs)
- Other interesting things, with drivers hopefully to follow...
This patch series adds a simple generic layer for probing for DIMMs over SMBUS and an i2c bus driver for the iMC controller found on Intel LGA2011 chips.
It now uses only modern infrastructure -- new-style I2C probing and the at24 (instead of eeprom) driver.
I've tested this on a Core i7 Extreme and on a Xeon E5 server. With this series applied, sensors shows (on the Xeon E5):
jc42-i2c-1-18
Adapter: iMC socket 0 channel 0
temp1: +33.0°C (low = +0.0°C) ALARM (HIGH)
(high = +0.0°C, hyst = +0.0°C)
(crit = +100.0°C, hyst = +100.0°C)jc42-i2c-1-1c
Adapter: iMC socket 0 channel 0
temp1: +35.2°C (low = +0.0°C) ALARM (HIGH)
(high = +0.0°C, hyst = +0.0°C)
(crit = +100.0°C, hyst = +100.0°C)jc42-i2c-3-18
Adapter: iMC socket 1 channel 0
temp1: +27.0°C (low = +0.0°C) ALARM (HIGH)
(high = +0.0°C, hyst = +0.0°C)
(crit = +100.0°C, hyst = +100.0°C)jc42-i2c-3-1c
Adapter: iMC socket 1 channel 0
temp1: +33.2°C (low = +0.0°C) ALARM (HIGH)
(high = +0.0°C, hyst = +0.0°C)
(crit = +100.0°C, hyst = +100.0°C)with no need for any userspace probing or manual module loading. decode-dimms works on both machines, again without any manual module loading.
The whole series is available on git here (against v3.9.7):
https://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/log/?h=i2c_imc/patch_v4
I'm not entirely attached the to the probing approach in patch 1 -- see comments there.
Changes from v3:
- Dropped redundant "tsod" driver
- Dropped eeprom modalias
- Switched to probing for the "eeprom" and "jc42"
Andy Lutomirski (2):
i2c: Add DIMM bus code
i2c_imc: New driver for Intel's iMC, found on LGA2011 chips
drivers/i2c/busses/Kconfig | 19 ++ drivers/i2c/busses/Makefile | 5 + drivers/i2c/busses/dimm-bus.c | 97 ++++++++ drivers/i2c/busses/i2c-imc.c | 548 ++++++++++++++++++++++++++++++++++++++++++ include/linux/i2c/dimm-bus.h | 24 ++ 5 files changed, 693 insertions(+) create mode 100644 drivers/i2c/busses/dimm-bus.c create mode 100644 drivers/i2c/busses/i2c-imc.c create mode 100644 include/linux/i2c/dimm-bus.h
Signature · 1 line
1.8.1.4
A message that is not in the archive (sent off-list or not yet received): cover.1374171757.git.luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org
PATCH v4 1/2 i2c: Add DIMM bus code
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.
---
This code could live in the i2c core or it could be restructured. The current approach isn't so bad, I think, but I'd be happy to take suggestions for better ways to do this.
If you don't like this code, please try to suggest something better than "use new_device from userspace".
drivers/i2c/busses/Kconfig | 4 ++ drivers/i2c/busses/Makefile | 4 ++ drivers/i2c/busses/dimm-bus.c | 97 +++++++++++++++++++++++++++++++++++++++++++ include/linux/i2c/dimm-bus.h | 24 +++++++++++ 4 files changed, 129 insertions(+) create mode 100644 drivers/i2c/busses/dimm-bus.c create mode 100644 include/linux/i2c/dimm-bus.h
drivers/i2c/busses/Kconfig +4 -0
@@ -133,6 +133,10 @@ config I2C_ISMT This driver can also be built as a module. If so, the module will be called i2c-ismt. +config I2C_DIMM_BUS + tristate + default n + config I2C_PIIX4 tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)" depends on PCI
drivers/i2c/busses/Makefile +4 -0
@@ -24,6 +24,10 @@ obj-$(CONFIG_I2C_SIS96X) += i2c-sis96x.o obj-$(CONFIG_I2C_VIA) += i2c-via.o obj-$(CONFIG_I2C_VIAPRO) += i2c-viapro.o +# DIMM busses +obj-$(CONFIG_I2C_DIMM_BUS) += dimm-bus.o +obj-$(CONFIG_I2C_IMC) += i2c-imc.o + # Mac SMBus host controller drivers obj-$(CONFIG_I2C_HYDRA) += i2c-hydra.o obj-$(CONFIG_I2C_POWERMAC) += i2c-powermac.o
drivers/i2c/busses/dimm-bus.c new file +97 -0
97 lines not on this page · raw message
include/linux/i2c/dimm-bus.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* Copyright (c) 2013 Andrew Lutomirski <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _I2C_DIMM_BUS +#define _I2C_DIMM_BUS + +struct i2c_adapter ; +void i2c_scan_dimm_bus (struct i2c_adapter *adapter); + +#endif /* _I2C_DIMM_BUS */
Signature · 1 line
1.8.1.4
PATCH v4 2/2 i2c_imc: New driver for Intel's iMC, found on LGA2011 chips
In reply to a message not in the archiveSandy Bridge Xeon and Extreme chips have integrated memory controllers with (rather limited) onboard SMBUS masters. This driver gives access to the bus.
--- drivers/i2c/busses/Kconfig | 15 ++ drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-imc.c | 548 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 564 insertions(+) create mode 100644 drivers/i2c/busses/i2c-imc.c
drivers/i2c/busses/Kconfig +15 -0
@@ -137,6 +137,21 @@ config I2C_DIMM_BUS tristate default n +config I2C_IMC + tristate "Intel iMC (LGA 2011) SMBus Controller" + depends on PCI && X86 + select I2C_DIMM_BUS + help + If you say yes to this option, support will be included for the Intel + Integrated Memory Controller SMBus host controller interface. This + controller is found on LGA 2011 Xeons and Core i7 Extremes. + + It is possibly, although unlikely, that the use of this driver will + interfere with your platform's RAM thermal management. + + This driver can also be built as a module. If so, the module will be + called i2c-imc. + config I2C_PIIX4 tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)" depends on PCI
drivers/i2c/busses/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o obj-$(CONFIG_I2C_I801) += i2c-i801.o obj-$(CONFIG_I2C_ISCH) += i2c-isch.o obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o +obj-$(CONFIG_I2C_IMC) += i2c-imc.o obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o obj-$(CONFIG_I2C_PIIX4) += i2c-piix4.o
drivers/i2c/busses/i2c-imc.c new file +548 -0
548 lines not on this page · raw message
Signature · 1 line
1.8.1.4
A message that is not in the archive (sent off-list or not yet received): c4bb014e8793e8d0059ecf5633f01ab9e15409d2.1374171757.git.luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org
Re: [PATCH v4 2/2] i2c_imc: New driver for Intel's iMC, found on LGA2011 chips
Quoted 55 lines · Andy Lutomirski
Sandy Bridge Xeon and Extreme chips have integrated memory controllers with (rather limited) onboard SMBUS masters. This driver gives access to the bus.
Signed-off-by Andy Lutomirski <[email protected]>--- drivers/i2c/busses/Kconfig | 15 ++ drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-imc.c | 548 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 564 insertions(+) create mode 100644 drivers/i2c/busses/i2c-imc.cdrivers/i2c/busses/Kconfig +15
-0@@ -137,6 +137,21 @@ config I2C_DIMM_BUS tristate default n +config I2C_IMC + tristate "Intel iMC (LGA 2011) SMBus Controller" + depends on PCI && X86 + select I2C_DIMM_BUS + help + If you say yes to this option, support will be included for the Intel + Integrated Memory Controller SMBus host controller interface. This + controller is found on LGA 2011 Xeons and Core i7 Extremes. + + It is possibly, although unlikely, that the use of this driver will + interfere with your platform's RAM thermal management. + + This driver can also be built as a module. If so, the module will be + called i2c-imc. + config I2C_PIIX4 tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)" depends on PCIdrivers/i2c/busses/Makefile +1
-0@@ -15,6 +15,7 @@ obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o obj-$(CONFIG_I2C_I801) += i2c-i801.o obj-$(CONFIG_I2C_ISCH) += i2c-isch.o obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o +obj-$(CONFIG_I2C_IMC) += i2c-imc.o obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o obj-$(CONFIG_I2C_PIIX4) += i2c-piix4.odrivers/i2c/busses/i2c-imc.c new file +0
-0
[ ... ]
drivers/i2c/busses/i2c-imc.c line 399
Quoted 3 lines
drivers/i2c/busses/i2c-imc.c new file +3
-0+ +i2c_scan_dimm_bus (&ch->adapter); +
Wonder if this should (can) be part of the infrastructure, eg by introducing I2C_CLASS_DIMM.
Guenter
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH v4 2/2] i2c_imc: New driver for Intel's iMC, found on LGA2011 chips
Quoted 59 lines · Guenter Roeck
Quoted 55 lines · Andy Lutomirski
Sandy Bridge Xeon and Extreme chips have integrated memory controllers with (rather limited) onboard SMBUS masters. This driver gives access to the bus.
Signed-off-by Andy Lutomirski <[email protected]>--- drivers/i2c/busses/Kconfig | 15 ++ drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-imc.c | 548 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 564 insertions(+) create mode 100644 drivers/i2c/busses/i2c-imc.cdrivers/i2c/busses/Kconfig +15
-0@@ -137,6 +137,21 @@ config I2C_DIMM_BUS tristate default n +config I2C_IMC + tristate "Intel iMC (LGA 2011) SMBus Controller" + depends on PCI && X86 + select I2C_DIMM_BUS + help + If you say yes to this option, support will be included for the Intel + Integrated Memory Controller SMBus host controller interface. This + controller is found on LGA 2011 Xeons and Core i7 Extremes. + + It is possibly, although unlikely, that the use of this driver will + interfere with your platform's RAM thermal management. + + This driver can also be built as a module. If so, the module will be + called i2c-imc. + config I2C_PIIX4 tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)" depends on PCIdrivers/i2c/busses/Makefile +1
-0@@ -15,6 +15,7 @@ obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o obj-$(CONFIG_I2C_I801) += i2c-i801.o obj-$(CONFIG_I2C_ISCH) += i2c-isch.o obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o +obj-$(CONFIG_I2C_IMC) += i2c-imc.o obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o obj-$(CONFIG_I2C_PIIX4) += i2c-piix4.odrivers/i2c/busses/i2c-imc.c new file +0
-0[ ... ]
Quoted 5 lines
drivers/i2c/busses/i2c-imc.c line 399
Quoted 3 lines
drivers/i2c/busses/i2c-imc.c new file +3
-0+ +i2c_scan_dimm_bus (&ch->adapter); +Wonder if this should (can) be part of the infrastructure, eg by introducing
I2C_CLASS_DIMM.
If so, it'll have to work differently than the current class bits. All they do is determine which drivers get detected, and that detection happens by completely generic means that's not really applicable to DIMMs (and doesn't work on this bus).
--Andy
Signature · 2 lines
Andy Lutomirski AMA Capital Management, LLC
A message that is not in the archive (sent off-list or not yet received): CALCETrUUkSenOD1KS7rrVV1czjhTJ-c1sFebrDygcCB+5Y2upA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH v4 2/2] i2c_imc: New driver for Intel's iMC, found on LGA2011 chips
Quoted 66 lines · Andy Lutomirski
Quoted 59 lines · Guenter Roeck
Quoted 55 lines · Andy Lutomirski
Sandy Bridge Xeon and Extreme chips have integrated memory controllers with (rather limited) onboard SMBUS masters. This driver gives access to the bus.
Signed-off-by Andy Lutomirski <[email protected]>--- drivers/i2c/busses/Kconfig | 15 ++ drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-imc.c | 548 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 564 insertions(+) create mode 100644 drivers/i2c/busses/i2c-imc.cdrivers/i2c/busses/Kconfig +15
-0@@ -137,6 +137,21 @@ config I2C_DIMM_BUS tristate default n +config I2C_IMC + tristate "Intel iMC (LGA 2011) SMBus Controller" + depends on PCI && X86 + select I2C_DIMM_BUS + help + If you say yes to this option, support will be included for the Intel + Integrated Memory Controller SMBus host controller interface. This + controller is found on LGA 2011 Xeons and Core i7 Extremes. + + It is possibly, although unlikely, that the use of this driver will + interfere with your platform's RAM thermal management. + + This driver can also be built as a module. If so, the module will be + called i2c-imc. + config I2C_PIIX4 tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)" depends on PCIdrivers/i2c/busses/Makefile +1
-0@@ -15,6 +15,7 @@ obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o obj-$(CONFIG_I2C_I801) += i2c-i801.o obj-$(CONFIG_I2C_ISCH) += i2c-isch.o obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o +obj-$(CONFIG_I2C_IMC) += i2c-imc.o obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o obj-$(CONFIG_I2C_PIIX4) += i2c-piix4.odrivers/i2c/busses/i2c-imc.c new file +0
-0[ ... ]
Quoted 5 lines
drivers/i2c/busses/i2c-imc.c line 399
Quoted 3 lines
drivers/i2c/busses/i2c-imc.c new file +3
-0+ +i2c_scan_dimm_bus (&ch->adapter); +Wonder if this should (can) be part of the infrastructure, eg by introducing
I2C_CLASS_DIMM.
Quoted 5 lines
If so, it'll have to work differently than the current class bits. All they do is determine which drivers get detected, and that detection happens by completely generic means that's not really applicable to DIMMs (and doesn't work on this bus).
In i2c_detect_address:
if (adap->class & I2C_CLASS_DIMM) return i2c_detect_dimm();
or in i2c_default_probe, call a dimm specific probe function and then depend on the device detect functions (if that is possible).
Sure, the i2c core code would have to change a bit to accomodate the new I2C_CLASS_DIMM, but I personally would prefer that to calling the detect function from the adapter driver.
Personal preference, though; this ultimately depends on the i2c maintainers.
Thanks,
Guenter
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH v4 2/2] i2c_imc: New driver for Intel's iMC, found on LGA2011 chips
Quoted 81 lines · Guenter Roeck
Quoted 66 lines · Andy Lutomirski
Quoted 59 lines · Guenter Roeck
Quoted 55 lines · Andy Lutomirski
Sandy Bridge Xeon and Extreme chips have integrated memory controllers with (rather limited) onboard SMBUS masters. This driver gives access to the bus.
Signed-off-by Andy Lutomirski <[email protected]>--- drivers/i2c/busses/Kconfig | 15 ++ drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-imc.c | 548 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 564 insertions(+) create mode 100644 drivers/i2c/busses/i2c-imc.cdrivers/i2c/busses/Kconfig +15
-0@@ -137,6 +137,21 @@ config I2C_DIMM_BUS tristate default n +config I2C_IMC + tristate "Intel iMC (LGA 2011) SMBus Controller" + depends on PCI && X86 + select I2C_DIMM_BUS + help + If you say yes to this option, support will be included for the Intel + Integrated Memory Controller SMBus host controller interface. This + controller is found on LGA 2011 Xeons and Core i7 Extremes. + + It is possibly, although unlikely, that the use of this driver will + interfere with your platform's RAM thermal management. + + This driver can also be built as a module. If so, the module will be + called i2c-imc. + config I2C_PIIX4 tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)" depends on PCIdrivers/i2c/busses/Makefile +1
-0@@ -15,6 +15,7 @@ obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o obj-$(CONFIG_I2C_I801) += i2c-i801.o obj-$(CONFIG_I2C_ISCH) += i2c-isch.o obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o +obj-$(CONFIG_I2C_IMC) += i2c-imc.o obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o obj-$(CONFIG_I2C_PIIX4) += i2c-piix4.odrivers/i2c/busses/i2c-imc.c new file +0
-0[ ... ]
Quoted 5 lines
drivers/i2c/busses/i2c-imc.c
Quoted 3 lines
drivers/i2c/busses/i2c-imc.c new file +3
-0+ +i2c_scan_dimm_bus (&ch->adapter); +Wonder if this should (can) be part of the infrastructure, eg by introducing
I2C_CLASS_DIMM.Quoted 5 lines
If so, it'll have to work differently than the current class bits. All they do is determine which drivers get detected, and that detection happens by completely generic means that's not really applicable to DIMMs (and doesn't work on this bus).
In
i2c_detect_address:if (adap->class & I2C_CLASS_DIMM) return i2c_detect_dimm();or in
i2c_default_probe, call a dimm specific probe function and then depend on the device detect functions (if that is possible).
Quoted 8 lines
Sure, the i2c core code would have to change a bit to accomodate the new
I2C_CLASS_DIMM, but I personally would prefer that to calling the detect function from the adapter driver.Personal preference, though; this ultimately depends on the i2c maintainers.
Thanks,
Guenter
Jean?
I have some driver changes pending for v5, but I'd like to nail down whether the current scanning approach is acceptable first.
Thanks,
Andy
Quoted 7 lines · Andy Lutomirski
Intel LGA2011 machines have dedicated SMBUS controllers for DIMM sockets. Because they're dedicated, they can be safely and accurately probed, since all devices on them are known to be attached to DIMMs. The devices found are:
- SPD EEPROMs
- TSODs (Temperature Sensor on DIMMs)
- Other interesting things, with drivers hopefully to follow...
Just to let you know, I keep thinking about it now and then but have not made up my mind yet... still at it.
Quoted 9 lines · Wolfram Sang
Quoted 7 lines · Andy Lutomirski
Intel LGA2011 machines have dedicated SMBUS controllers for DIMM sockets. Because they're dedicated, they can be safely and accurately probed, since all devices on them are known to be attached to DIMMs. The devices found are:
- SPD EEPROMs
- TSODs (Temperature Sensor on DIMMs)
- Other interesting things, with drivers hopefully to follow...
Quoted 3 lines
Just to let you know, I keep thinking about it now and then but have not made up my mind yet... still at it.
I've written the updated version of the driver. Can you give me an opinion on the dimm bus stuff so I can minimize the number of times I have to ask for permission to send the driver?
(There aren't any huge changes -- the main thing is that it will now refuse to run on some systems.)
Thanks,
Andy
Signature · 2 lines
Andy Lutomirski AMA Capital Management, LLC