Commit 524c4a5d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents 3ee22ad4 d46651d4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@ properties:
      - description: ODR register
      - description: STR register

  clocks:
    maxItems: 1

  aspeed,lpc-io-reg:
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
+7 −0
Original line number Diff line number Diff line
@@ -84,6 +84,13 @@ config IPMI_IPMB
	  bus, and it also supports direct messaging on the bus using
	  IPMB direct messages.  This module requires I2C support.

config IPMI_LS2K
	bool 'Loongson-2K IPMI interface'
	depends on LOONGARCH
	select MFD_LS2K_BMC_CORE
	help
	  Provides a driver for Loongson-2K IPMI interfaces.

config IPMI_POWERNV
	depends on PPC_POWERNV
	tristate 'POWERNV (OPAL firmware) IPMI interface'
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ ipmi_si-y := ipmi_si_intf.o ipmi_kcs_sm.o ipmi_smic_sm.o ipmi_bt_sm.o \
	ipmi_si_mem_io.o
ipmi_si-$(CONFIG_HAS_IOPORT) += ipmi_si_port_io.o
ipmi_si-$(CONFIG_PCI) += ipmi_si_pci.o
ipmi_si-$(CONFIG_IPMI_LS2K) += ipmi_si_ls2k.o
ipmi_si-$(CONFIG_PARISC) += ipmi_si_parisc.o

obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o
+2 −2
Original line number Diff line number Diff line
@@ -404,8 +404,7 @@ static void ipmi_ipmb_shutdown(void *send_info)
	ipmi_ipmb_stop_thread(iidev);
}

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

	up(&iidev->wake_thread);
	return IPMI_CC_NO_ERROR;
}

static void ipmi_ipmb_request_events(void *send_info)
+5 −11
Original line number Diff line number Diff line
@@ -122,10 +122,10 @@ struct si_sm_data {
	unsigned long  error0_timeout;
};

static unsigned int init_kcs_data_with_state(struct si_sm_data *kcs,
				  struct si_sm_io *io, enum kcs_states state)
static unsigned int init_kcs_data(struct si_sm_data *kcs,
				  struct si_sm_io *io)
{
	kcs->state = state;
	kcs->state = KCS_IDLE;
	kcs->io = io;
	kcs->write_pos = 0;
	kcs->write_count = 0;
@@ -140,12 +140,6 @@ static unsigned int init_kcs_data_with_state(struct si_sm_data *kcs,
	return 2;
}

static unsigned int init_kcs_data(struct si_sm_data *kcs,
				  struct si_sm_io *io)
{
	return init_kcs_data_with_state(kcs, io, KCS_IDLE);
}

static inline unsigned char read_status(struct si_sm_data *kcs)
{
	return kcs->io->inputb(kcs->io, 1);
@@ -276,7 +270,7 @@ static int start_kcs_transaction(struct si_sm_data *kcs, unsigned char *data,
	if (size > MAX_KCS_WRITE_SIZE)
		return IPMI_REQ_LEN_EXCEEDED_ERR;

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

	if (kcs->state == KCS_HOSED) {
		init_kcs_data_with_state(kcs, kcs->io, KCS_ERROR0);
		init_kcs_data(kcs, kcs->io);
		return SI_SM_HOSED;
	}

Loading