Commit 8a696a29 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'platform-drivers-x86-v6.8-2' of...

Merge tag 'platform-drivers-x86-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:

 - WMI bus driver fixes

 - Second attempt (previously reverted) at P2SB PCI rescan deadlock fix

 - AMD PMF driver improvements

 - MAINTAINERS updates

 - Misc other small fixes and hw-id additions

* tag 'platform-drivers-x86-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: touchscreen_dmi: Add info for the TECLAST X16 Plus tablet
  platform/x86/intel/ifs: Call release_firmware() when handling errors.
  platform/x86/amd/pmf: Fix memory leak in amd_pmf_get_pb_data()
  platform/x86/amd/pmf: Get ambient light information from AMD SFH driver
  platform/x86/amd/pmf: Get Human presence information from AMD SFH driver
  platform/mellanox: mlxbf-pmc: Fix offset calculation for crspace events
  platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full
  MAINTAINERS: remove defunct acpi4asus project info from asus notebooks section
  MAINTAINERS: add Luke Jones as maintainer for asus notebooks
  MAINTAINERS: Remove Perry Yuan as DELL WMI HARDWARE PRIVACY SUPPORT maintainer
  platform/x86: silicom-platform: Add missing "Description:" for power_cycle sysfs attr
  platform/x86: intel-wmi-sbl-fw-update: Fix function name in error message
  platform/x86: p2sb: Use pci_resource_n() in p2sb_read_bar0()
  platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe
  platform/x86: intel-uncore-freq: Fix types in sysfs callbacks
  platform/x86: wmi: Fix wmi_dev_probe()
  platform/x86: wmi: Fix notify callback locking
  platform/x86: wmi: Decouple legacy WMI notify handlers from wmi_block_list
  platform/x86: wmi: Return immediately if an suitable WMI event is found
  platform/x86: wmi: Fix error handling in legacy WMI notify handler functions
parents 95534043 1abdf288
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ What: /sys/devices/platform/silicom-platform/power_cycle
Date:		November 2023
KernelVersion:	6.7
Contact:	Henry Shi <henrys@silicom-usa.com>
Description:
		This file allow user to power cycle the platform.
		Default value is 0; when set to 1, it powers down
		the platform, waits 5 seconds, then powers on the
+2 −3
Original line number Diff line number Diff line
@@ -3168,10 +3168,10 @@ F: drivers/hwmon/asus-ec-sensors.c
ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS
M:	Corentin Chary <corentin.chary@gmail.com>
L:	acpi4asus-user@lists.sourceforge.net
M:	Luke D. Jones <luke@ljones.dev>
L:	platform-driver-x86@vger.kernel.org
S:	Maintained
W:	http://acpi4asus.sf.net
W:	https://asus-linux.org/
F:	drivers/platform/x86/asus*.c
F:	drivers/platform/x86/eeepc*.c
@@ -5958,7 +5958,6 @@ S: Maintained
F:	drivers/platform/x86/dell/dell-wmi-descriptor.c
DELL WMI HARDWARE PRIVACY SUPPORT
M:	Perry Yuan <Perry.Yuan@dell.com>
L:	Dell.Client.Kernel@dell.com
L:	platform-driver-x86@vger.kernel.org
S:	Maintained
+2 −2
Original line number Diff line number Diff line
@@ -1170,7 +1170,7 @@ static int mlxbf_pmc_program_crspace_counter(int blk_num, uint32_t cnt_num,
	int ret;

	addr = pmc->block[blk_num].mmio_base +
		(rounddown(cnt_num, 2) * MLXBF_PMC_CRSPACE_PERFSEL_SZ);
		((cnt_num / 2) * MLXBF_PMC_CRSPACE_PERFSEL_SZ);
	ret = mlxbf_pmc_readl(addr, &word);
	if (ret)
		return ret;
@@ -1413,7 +1413,7 @@ static int mlxbf_pmc_read_crspace_event(int blk_num, uint32_t cnt_num,
	int ret;

	addr = pmc->block[blk_num].mmio_base +
		(rounddown(cnt_num, 2) * MLXBF_PMC_CRSPACE_PERFSEL_SZ);
		((cnt_num / 2) * MLXBF_PMC_CRSPACE_PERFSEL_SZ);
	ret = mlxbf_pmc_readl(addr, &word);
	if (ret)
		return ret;
+67 −0
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@
/* Message with data needs at least two words (for header & data). */
#define MLXBF_TMFIFO_DATA_MIN_WORDS		2

/* Tx timeout in milliseconds. */
#define TMFIFO_TX_TIMEOUT			2000

/* ACPI UID for BlueField-3. */
#define TMFIFO_BF3_UID				1

@@ -62,12 +65,14 @@ struct mlxbf_tmfifo;
 * @drop_desc: dummy desc for packet dropping
 * @cur_len: processed length of the current descriptor
 * @rem_len: remaining length of the pending packet
 * @rem_padding: remaining bytes to send as paddings
 * @pkt_len: total length of the pending packet
 * @next_avail: next avail descriptor id
 * @num: vring size (number of descriptors)
 * @align: vring alignment size
 * @index: vring index
 * @vdev_id: vring virtio id (VIRTIO_ID_xxx)
 * @tx_timeout: expire time of last tx packet
 * @fifo: pointer to the tmfifo structure
 */
struct mlxbf_tmfifo_vring {
@@ -79,12 +84,14 @@ struct mlxbf_tmfifo_vring {
	struct vring_desc drop_desc;
	int cur_len;
	int rem_len;
	int rem_padding;
	u32 pkt_len;
	u16 next_avail;
	int num;
	int align;
	int index;
	int vdev_id;
	unsigned long tx_timeout;
	struct mlxbf_tmfifo *fifo;
};

@@ -819,6 +826,50 @@ static bool mlxbf_tmfifo_rxtx_one_desc(struct mlxbf_tmfifo_vring *vring,
	return true;
}

static void mlxbf_tmfifo_check_tx_timeout(struct mlxbf_tmfifo_vring *vring)
{
	unsigned long flags;

	/* Only handle Tx timeout for network vdev. */
	if (vring->vdev_id != VIRTIO_ID_NET)
		return;

	/* Initialize the timeout or return if not expired. */
	if (!vring->tx_timeout) {
		/* Initialize the timeout. */
		vring->tx_timeout = jiffies +
			msecs_to_jiffies(TMFIFO_TX_TIMEOUT);
		return;
	} else if (time_before(jiffies, vring->tx_timeout)) {
		/* Return if not timeout yet. */
		return;
	}

	/*
	 * Drop the packet after timeout. The outstanding packet is
	 * released and the remaining bytes will be sent with padding byte 0x00
	 * as a recovery. On the peer(host) side, the padding bytes 0x00 will be
	 * either dropped directly, or appended into existing outstanding packet
	 * thus dropped as corrupted network packet.
	 */
	vring->rem_padding = round_up(vring->rem_len, sizeof(u64));
	mlxbf_tmfifo_release_pkt(vring);
	vring->cur_len = 0;
	vring->rem_len = 0;
	vring->fifo->vring[0] = NULL;

	/*
	 * Make sure the load/store are in order before
	 * returning back to virtio.
	 */
	virtio_mb(false);

	/* Notify upper layer. */
	spin_lock_irqsave(&vring->fifo->spin_lock[0], flags);
	vring_interrupt(0, vring->vq);
	spin_unlock_irqrestore(&vring->fifo->spin_lock[0], flags);
}

/* Rx & Tx processing of a queue. */
static void mlxbf_tmfifo_rxtx(struct mlxbf_tmfifo_vring *vring, bool is_rx)
{
@@ -841,6 +892,7 @@ static void mlxbf_tmfifo_rxtx(struct mlxbf_tmfifo_vring *vring, bool is_rx)
		return;

	do {
retry:
		/* Get available FIFO space. */
		if (avail == 0) {
			if (is_rx)
@@ -851,6 +903,17 @@ static void mlxbf_tmfifo_rxtx(struct mlxbf_tmfifo_vring *vring, bool is_rx)
				break;
		}

		/* Insert paddings for discarded Tx packet. */
		if (!is_rx) {
			vring->tx_timeout = 0;
			while (vring->rem_padding >= sizeof(u64)) {
				writeq(0, vring->fifo->tx.data);
				vring->rem_padding -= sizeof(u64);
				if (--avail == 0)
					goto retry;
			}
		}

		/* Console output always comes from the Tx buffer. */
		if (!is_rx && devid == VIRTIO_ID_CONSOLE) {
			mlxbf_tmfifo_console_tx(fifo, avail);
@@ -860,6 +923,10 @@ static void mlxbf_tmfifo_rxtx(struct mlxbf_tmfifo_vring *vring, bool is_rx)
		/* Handle one descriptor. */
		more = mlxbf_tmfifo_rxtx_one_desc(vring, is_rx, &avail);
	} while (more);

	/* Check Tx timeout. */
	if (avail <= 0 && !is_rx)
		mlxbf_tmfifo_check_tx_timeout(vring);
}

/* Handle Rx or Tx queues. */
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ config AMD_PMF
	depends on AMD_NB
	select ACPI_PLATFORM_PROFILE
	depends on TEE && AMDTEE
	depends on AMD_SFH_HID
	help
	  This driver provides support for the AMD Platform Management Framework.
	  The goal is to enhance end user experience by making AMD PCs smarter,
Loading