Skip to content

Commit 196202b

Browse files
committed
Merge tag 'for-linus-4.10' of git://git.code.sf.net/p/openipmi/linux-ipmi
Pull IPMI updates from Corey Minyard: "Various small fixes for IPMI. Cleanups in the documentation and convertion printk() to pr_xxx() and removal of an unused module parameter. Some small bug fixes and enhancements. This also adds a post softdep from the IPMI core module to the IPMI device interface. Many people have complained that the device interface isn't automatically avaiable when IPMI is loaded. I don't want to make the device interface mandatory, though, plenty of people use IPMI internally (like with ACPI) and don't need a device interface or the added possible security entry. A softdep should make it work 'out of the box' but allow people to not have it if they don't want it" * tag 'for-linus-4.10' of git://git.code.sf.net/p/openipmi/linux-ipmi: ipmi: create hardware-independent softdep for ipmi_devintf ipmi: Fix sequence number handling ipmi: Pick up slave address from SMBIOS on an ACPI device ipmi_si: Clean up printks Move platform device creation earlier in the initialization ipmi: Update documentation ipmi_ssif: Remove an unused module parameter ipmi: Periodically check for events, not messages
2 parents e3842cb + 070cbd1 commit 196202b

File tree

5 files changed

+165
-130
lines changed

5 files changed

+165
-130
lines changed

Documentation/IPMI.txt

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,24 @@ ipmi_ssif - A driver for accessing BMCs on the SMBus. It uses the
111111
I2C kernel driver's SMBus interfaces to send and receive IPMI messages
112112
over the SMBus.
113113

114+
ipmi_powernv - A driver for access BMCs on POWERNV systems.
115+
114116
ipmi_watchdog - IPMI requires systems to have a very capable watchdog
115117
timer. This driver implements the standard Linux watchdog timer
116118
interface on top of the IPMI message handler.
117119

118120
ipmi_poweroff - Some systems support the ability to be turned off via
119121
IPMI commands.
120122

121-
These are all individually selectable via configuration options.
123+
bt-bmc - This is not part of the main driver, but instead a driver for
124+
accessing a BMC-side interface of a BT interface. It is used on BMCs
125+
running Linux to provide an interface to the host.
122126

123-
Note that the KCS-only interface has been removed. The af_ipmi driver
124-
is no longer supported and has been removed because it was impossible
125-
to do 32 bit emulation on 64-bit kernels with it.
127+
These are all individually selectable via configuration options.
126128

127129
Much documentation for the interface is in the include files. The
128130
IPMI include files are:
129131

130-
net/af_ipmi.h - Contains the socket interface.
131-
132132
linux/ipmi.h - Contains the user interface and IOCTL interface for IPMI.
133133

134134
linux/ipmi_smi.h - Contains the interface for system management interfaces
@@ -245,6 +245,16 @@ addressed (because some boards actually have multiple BMCs on them)
245245
and the user should not have to care what type of SMI is below them.
246246

247247

248+
Watching For Interfaces
249+
250+
When your code comes up, the IPMI driver may or may not have detected
251+
if IPMI devices exist. So you might have to defer your setup until
252+
the device is detected, or you might be able to do it immediately.
253+
To handle this, and to allow for discovery, you register an SMI
254+
watcher with ipmi_smi_watcher_register() to iterate over interfaces
255+
and tell you when they come and go.
256+
257+
248258
Creating the User
249259

250260
To user the message handler, you must first create a user using
@@ -263,7 +273,7 @@ closing the device automatically destroys the user.
263273

264274
Messaging
265275

266-
To send a message from kernel-land, the ipmi_request() call does
276+
To send a message from kernel-land, the ipmi_request_settime() call does
267277
pretty much all message handling. Most of the parameter are
268278
self-explanatory. However, it takes a "msgid" parameter. This is NOT
269279
the sequence number of messages. It is simply a long value that is
@@ -352,11 +362,12 @@ that for more details.
352362
The SI Driver
353363
-------------
354364

355-
The SI driver allows up to 4 KCS or SMIC interfaces to be configured
356-
in the system. By default, scan the ACPI tables for interfaces, and
357-
if it doesn't find any the driver will attempt to register one KCS
358-
interface at the spec-specified I/O port 0xca2 without interrupts.
359-
You can change this at module load time (for a module) with:
365+
The SI driver allows KCS, BT, and SMIC interfaces to be configured
366+
in the system. It discovers interfaces through a host of different
367+
methods, depending on the system.
368+
369+
You can specify up to four interfaces on the module load line and
370+
control some module parameters:
360371

361372
modprobe ipmi_si.o type=<type1>,<type2>....
362373
ports=<port1>,<port2>... addrs=<addr1>,<addr2>...
@@ -367,7 +378,7 @@ You can change this at module load time (for a module) with:
367378
force_kipmid=<enable1>,<enable2>,...
368379
kipmid_max_busy_us=<ustime1>,<ustime2>,...
369380
unload_when_empty=[0|1]
370-
trydefaults=[0|1] trydmi=[0|1] tryacpi=[0|1]
381+
trydmi=[0|1] tryacpi=[0|1]
371382
tryplatform=[0|1] trypci=[0|1]
372383

373384
Each of these except try... items is a list, the first item for the
@@ -386,10 +397,6 @@ use the I/O port given as the device address.
386397
If you specify irqs as non-zero for an interface, the driver will
387398
attempt to use the given interrupt for the device.
388399

389-
trydefaults sets whether the standard IPMI interface at 0xca2 and
390-
any interfaces specified by ACPE are tried. By default, the driver
391-
tries it, set this value to zero to turn this off.
392-
393400
The other try... items disable discovery by their corresponding
394401
names. These are all enabled by default, set them to zero to disable
395402
them. The tryplatform disables openfirmware.
@@ -434,7 +441,7 @@ kernel command line as:
434441

435442
ipmi_si.type=<type1>,<type2>...
436443
ipmi_si.ports=<port1>,<port2>... ipmi_si.addrs=<addr1>,<addr2>...
437-
ipmi_si.irqs=<irq1>,<irq2>... ipmi_si.trydefaults=[0|1]
444+
ipmi_si.irqs=<irq1>,<irq2>...
438445
ipmi_si.regspacings=<sp1>,<sp2>,...
439446
ipmi_si.regsizes=<size1>,<size2>,...
440447
ipmi_si.regshifts=<shift1>,<shift2>,...
@@ -444,11 +451,6 @@ kernel command line as:
444451

445452
It works the same as the module parameters of the same names.
446453

447-
By default, the driver will attempt to detect any device specified by
448-
ACPI, and if none of those then a KCS device at the spec-specified
449-
0xca2. If you want to turn this off, set the "trydefaults" option to
450-
false.
451-
452454
If your IPMI interface does not support interrupts and is a KCS or
453455
SMIC interface, the IPMI driver will start a kernel thread for the
454456
interface to help speed things up. This is a low-priority kernel
@@ -500,7 +502,8 @@ at module load time (for a module) with:
500502
addr=<i2caddr1>[,<i2caddr2>[,...]]
501503
adapter=<adapter1>[,<adapter2>[...]]
502504
dbg=<flags1>,<flags2>...
503-
slave_addrs=<addr1>,<addr2>,...
505+
slave_addrs=<addr1>,<addr2>,...
506+
tryacpi=[0|1] trydmi=[0|1]
504507
[dbg_probe=1]
505508

506509
The addresses are normal I2C addresses. The adapter is the string
@@ -513,6 +516,9 @@ spaces in kernel parameters.
513516
The debug flags are bit flags for each BMC found, they are:
514517
IPMI messages: 1, driver state: 2, timing: 4, I2C probe: 8
515518

519+
The tryxxx parameters can be used to disable detecting interfaces
520+
from various sources.
521+
516522
Setting dbg_probe to 1 will enable debugging of the probing and
517523
detection process for BMCs on the SMBusses.
518524

@@ -535,7 +541,8 @@ kernel command line as:
535541
ipmi_ssif.adapter=<adapter1>[,<adapter2>[...]]
536542
ipmi_ssif.dbg=<flags1>[,<flags2>[...]]
537543
ipmi_ssif.dbg_probe=1
538-
ipmi_ssif.slave_addrs=<addr1>[,<addr2>[...]]
544+
ipmi_ssif.slave_addrs=<addr1>[,<addr2>[...]]
545+
ipmi_ssif.tryacpi=[0|1] ipmi_ssif.trydmi=[0|1]
539546

540547
These are the same options as on the module command line.
541548

drivers/char/ipmi/ipmi_devintf.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,4 +989,3 @@ module_exit(cleanup_ipmi);
989989
MODULE_LICENSE("GPL");
990990
MODULE_AUTHOR("Corey Minyard <minyard@mvista.com>");
991991
MODULE_DESCRIPTION("Linux device interface for the IPMI message handler.");
992-
MODULE_ALIAS("platform:ipmi_si");

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,16 @@ struct seq_table {
158158
* Store the information in a msgid (long) to allow us to find a
159159
* sequence table entry from the msgid.
160160
*/
161-
#define STORE_SEQ_IN_MSGID(seq, seqid) (((seq&0xff)<<26) | (seqid&0x3ffffff))
161+
#define STORE_SEQ_IN_MSGID(seq, seqid) \
162+
((((seq) & 0x3f) << 26) | ((seqid) & 0x3ffffff))
162163

163164
#define GET_SEQ_FROM_MSGID(msgid, seq, seqid) \
164165
do { \
165-
seq = ((msgid >> 26) & 0x3f); \
166-
seqid = (msgid & 0x3fffff); \
166+
seq = (((msgid) >> 26) & 0x3f); \
167+
seqid = ((msgid) & 0x3ffffff); \
167168
} while (0)
168169

169-
#define NEXT_SEQID(seqid) (((seqid) + 1) & 0x3fffff)
170+
#define NEXT_SEQID(seqid) (((seqid) + 1) & 0x3ffffff)
170171

171172
struct ipmi_channel {
172173
unsigned char medium;
@@ -4645,3 +4646,4 @@ MODULE_AUTHOR("Corey Minyard <minyard@mvista.com>");
46454646
MODULE_DESCRIPTION("Incoming and outgoing message routing for an IPMI"
46464647
" interface.");
46474648
MODULE_VERSION(IPMI_DRIVER_VERSION);
4649+
MODULE_SOFTDEP("post: ipmi_devintf");

0 commit comments

Comments
 (0)