Skip to content

Commit 524c4a5

Browse files
committed
Merge tag 'for-linus-6.18-1' of https://github.com/cminyard/linux-ipmi
Pull IPMI updates from Corey Minyard: "Bug fixes and enhancements for IPMI This fixes a number of small bugs, but has some more major changes: - Loongson-2K BMC support is added. This is an MFD device and is dependent on the changes coming from that tree. The way the driver handles BMCs that have become non-functional has been completely redone. A number of changes in the past have attempted to handle various issues around this, but nothing has been very good. After working with some people on this, the code has been reworked to disable the driver and fail all pending operations if the BMC becomes non functional. It will retry the BMC once a second to see if it's back up" * tag 'for-linus-6.18-1' of https://github.com/cminyard/linux-ipmi: ipmi: Add Loongson-2K BMC support ipmi:si: Gracefully handle if the BMC is non-functional ipmi: Rename "user_data" to "recv_msg" in an SMI message ipmi: Allow an SMI sender to return an error ipmi:si: Move flags get start to its own function ipmi:si: Merge some if statements ipmi: Set a timer for maintenance mode ipmi: Add a maintenance mode sysfs file ipmi: Disable sysfs access and requests in maintenance mode ipmi: Differentiate between reset and firmware update in maintenance dt-bindings: ipmi: aspeed,ast2400-kcs-bmc: Add missing "clocks" property ipmi: Rework user message limit handling Revert "ipmi: fix msg stack when IPMI is disconnected" ipmi:msghandler:Change seq_lock to a mutex
2 parents 3ee22ad + d46651d commit 524c4a5

12 files changed

Lines changed: 600 additions & 338 deletions

File tree

Documentation/devicetree/bindings/ipmi/aspeed,ast2400-kcs-bmc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ properties:
4040
- description: ODR register
4141
- description: STR register
4242

43+
clocks:
44+
maxItems: 1
45+
4346
aspeed,lpc-io-reg:
4447
$ref: /schemas/types.yaml#/definitions/uint32-array
4548
minItems: 1

drivers/char/ipmi/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ config IPMI_IPMB
8484
bus, and it also supports direct messaging on the bus using
8585
IPMB direct messages. This module requires I2C support.
8686

87+
config IPMI_LS2K
88+
bool 'Loongson-2K IPMI interface'
89+
depends on LOONGARCH
90+
select MFD_LS2K_BMC_CORE
91+
help
92+
Provides a driver for Loongson-2K IPMI interfaces.
93+
8794
config IPMI_POWERNV
8895
depends on PPC_POWERNV
8996
tristate 'POWERNV (OPAL firmware) IPMI interface'

drivers/char/ipmi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ipmi_si-y := ipmi_si_intf.o ipmi_kcs_sm.o ipmi_smic_sm.o ipmi_bt_sm.o \
88
ipmi_si_mem_io.o
99
ipmi_si-$(CONFIG_HAS_IOPORT) += ipmi_si_port_io.o
1010
ipmi_si-$(CONFIG_PCI) += ipmi_si_pci.o
11+
ipmi_si-$(CONFIG_IPMI_LS2K) += ipmi_si_ls2k.o
1112
ipmi_si-$(CONFIG_PARISC) += ipmi_si_parisc.o
1213

1314
obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o

drivers/char/ipmi/ipmi_ipmb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,7 @@ static void ipmi_ipmb_shutdown(void *send_info)
404404
ipmi_ipmb_stop_thread(iidev);
405405
}
406406

407-
static void ipmi_ipmb_sender(void *send_info,
408-
struct ipmi_smi_msg *msg)
407+
static int ipmi_ipmb_sender(void *send_info, struct ipmi_smi_msg *msg)
409408
{
410409
struct ipmi_ipmb_dev *iidev = send_info;
411410
unsigned long flags;
@@ -417,6 +416,7 @@ static void ipmi_ipmb_sender(void *send_info,
417416
spin_unlock_irqrestore(&iidev->lock, flags);
418417

419418
up(&iidev->wake_thread);
419+
return IPMI_CC_NO_ERROR;
420420
}
421421

422422
static void ipmi_ipmb_request_events(void *send_info)

drivers/char/ipmi/ipmi_kcs_sm.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ struct si_sm_data {
122122
unsigned long error0_timeout;
123123
};
124124

125-
static unsigned int init_kcs_data_with_state(struct si_sm_data *kcs,
126-
struct si_sm_io *io, enum kcs_states state)
125+
static unsigned int init_kcs_data(struct si_sm_data *kcs,
126+
struct si_sm_io *io)
127127
{
128-
kcs->state = state;
128+
kcs->state = KCS_IDLE;
129129
kcs->io = io;
130130
kcs->write_pos = 0;
131131
kcs->write_count = 0;
@@ -140,12 +140,6 @@ static unsigned int init_kcs_data_with_state(struct si_sm_data *kcs,
140140
return 2;
141141
}
142142

143-
static unsigned int init_kcs_data(struct si_sm_data *kcs,
144-
struct si_sm_io *io)
145-
{
146-
return init_kcs_data_with_state(kcs, io, KCS_IDLE);
147-
}
148-
149143
static inline unsigned char read_status(struct si_sm_data *kcs)
150144
{
151145
return kcs->io->inputb(kcs->io, 1);
@@ -276,7 +270,7 @@ static int start_kcs_transaction(struct si_sm_data *kcs, unsigned char *data,
276270
if (size > MAX_KCS_WRITE_SIZE)
277271
return IPMI_REQ_LEN_EXCEEDED_ERR;
278272

279-
if (kcs->state != KCS_IDLE) {
273+
if ((kcs->state != KCS_IDLE) && (kcs->state != KCS_HOSED)) {
280274
dev_warn(kcs->io->dev, "KCS in invalid state %d\n", kcs->state);
281275
return IPMI_NOT_IN_MY_STATE_ERR;
282276
}
@@ -501,7 +495,7 @@ static enum si_sm_result kcs_event(struct si_sm_data *kcs, long time)
501495
}
502496

503497
if (kcs->state == KCS_HOSED) {
504-
init_kcs_data_with_state(kcs, kcs->io, KCS_ERROR0);
498+
init_kcs_data(kcs, kcs->io);
505499
return SI_SM_HOSED;
506500
}
507501

0 commit comments

Comments
 (0)