Commit 941209ef authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'platform-drivers-x86-v6.1-4' of...

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

Pull x86 platform driver fixes from Hans de Goede:

 - Surface Pro 9 and Surface Laptop 5 kbd, battery, etc support (this
   is just a few hw-id additions)

 - A couple of other hw-id / DMI-quirk additions

 - A few small bug fixes + 1 build fix

* tag 'platform-drivers-x86-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: ideapad-laptop: Add module parameters to match DMI quirk tables
  platform/x86: ideapad-laptop: Fix interrupt storm on fn-lock toggle on some Yoga laptops
  platform/x86: hp-wmi: Ignore Smart Experience App event
  platform/surface: aggregator_registry: Add support for Surface Laptop 5
  platform/surface: aggregator_registry: Add support for Surface Pro 9
  platform/surface: aggregator: Do not check for repeated unsequenced packets
  platform/x86: acer-wmi: Enable SW_TABLET_MODE on Switch V 10 (SW5-017)
  platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr()
  platform/x86/intel: pmc: Don't unconditionally attach Intel PMC when virtualized
  platform/x86: thinkpad_acpi: Enable s2idle quirk for 21A1 machine type
  platform/x86/amd: pmc: Add new ACPI ID AMDI0009
  platform/x86/amd: pmc: Remove more CONFIG_DEBUG_FS checks
parents 59d0d52c b44fd994
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -1596,16 +1596,32 @@ static void ssh_ptl_timeout_reap(struct work_struct *work)
		ssh_ptl_tx_wakeup_packet(ptl);
}

static bool ssh_ptl_rx_retransmit_check(struct ssh_ptl *ptl, u8 seq)
static bool ssh_ptl_rx_retransmit_check(struct ssh_ptl *ptl, const struct ssh_frame *frame)
{
	int i;

	/*
	 * Ignore unsequenced packets. On some devices (notably Surface Pro 9),
	 * unsequenced events will always be sent with SEQ=0x00. Attempting to
	 * detect retransmission would thus just block all events.
	 *
	 * While sequence numbers would also allow detection of retransmitted
	 * packets in unsequenced communication, they have only ever been used
	 * to cover edge-cases in sequenced transmission. In particular, the
	 * only instance of packets being retransmitted (that we are aware of)
	 * is due to an ACK timeout. As this does not happen in unsequenced
	 * communication, skip the retransmission check for those packets
	 * entirely.
	 */
	if (frame->type == SSH_FRAME_TYPE_DATA_NSQ)
		return false;

	/*
	 * Check if SEQ has been seen recently (i.e. packet was
	 * re-transmitted and we should ignore it).
	 */
	for (i = 0; i < ARRAY_SIZE(ptl->rx.blocked.seqs); i++) {
		if (likely(ptl->rx.blocked.seqs[i] != seq))
		if (likely(ptl->rx.blocked.seqs[i] != frame->seq))
			continue;

		ptl_dbg(ptl, "ptl: ignoring repeated data packet\n");
@@ -1613,7 +1629,7 @@ static bool ssh_ptl_rx_retransmit_check(struct ssh_ptl *ptl, u8 seq)
	}

	/* Update list of blocked sequence IDs. */
	ptl->rx.blocked.seqs[ptl->rx.blocked.offset] = seq;
	ptl->rx.blocked.seqs[ptl->rx.blocked.offset] = frame->seq;
	ptl->rx.blocked.offset = (ptl->rx.blocked.offset + 1)
				  % ARRAY_SIZE(ptl->rx.blocked.seqs);

@@ -1624,7 +1640,7 @@ static void ssh_ptl_rx_dataframe(struct ssh_ptl *ptl,
				 const struct ssh_frame *frame,
				 const struct ssam_span *payload)
{
	if (ssh_ptl_rx_retransmit_check(ptl, frame->seq))
	if (ssh_ptl_rx_retransmit_check(ptl, frame))
		return;

	ptl->ops.data_received(ptl, payload);
+37 −0
Original line number Diff line number Diff line
@@ -234,6 +234,19 @@ static const struct software_node *ssam_node_group_sl3[] = {
	NULL,
};

/* Devices for Surface Laptop 5. */
static const struct software_node *ssam_node_group_sl5[] = {
	&ssam_node_root,
	&ssam_node_bat_ac,
	&ssam_node_bat_main,
	&ssam_node_tmp_pprof,
	&ssam_node_hid_main_keyboard,
	&ssam_node_hid_main_touchpad,
	&ssam_node_hid_main_iid5,
	&ssam_node_hid_sam_ucm_ucsi,
	NULL,
};

/* Devices for Surface Laptop Studio. */
static const struct software_node *ssam_node_group_sls[] = {
	&ssam_node_root,
@@ -268,6 +281,7 @@ static const struct software_node *ssam_node_group_sp7[] = {
	NULL,
};

/* Devices for Surface Pro 8 */
static const struct software_node *ssam_node_group_sp8[] = {
	&ssam_node_root,
	&ssam_node_hub_kip,
@@ -284,6 +298,23 @@ static const struct software_node *ssam_node_group_sp8[] = {
	NULL,
};

/* Devices for Surface Pro 9 */
static const struct software_node *ssam_node_group_sp9[] = {
	&ssam_node_root,
	&ssam_node_hub_kip,
	&ssam_node_bat_ac,
	&ssam_node_bat_main,
	&ssam_node_tmp_pprof,
	/* TODO: Tablet mode switch (via POS subsystem) */
	&ssam_node_hid_kip_keyboard,
	&ssam_node_hid_kip_penstash,
	&ssam_node_hid_kip_touchpad,
	&ssam_node_hid_kip_fwupd,
	&ssam_node_hid_sam_sensors,
	&ssam_node_hid_sam_ucm_ucsi,
	NULL,
};


/* -- SSAM platform/meta-hub driver. ---------------------------------------- */

@@ -303,6 +334,9 @@ static const struct acpi_device_id ssam_platform_hub_match[] = {
	/* Surface Pro 8 */
	{ "MSHW0263", (unsigned long)ssam_node_group_sp8 },

	/* Surface Pro 9 */
	{ "MSHW0343", (unsigned long)ssam_node_group_sp9 },

	/* Surface Book 2 */
	{ "MSHW0107", (unsigned long)ssam_node_group_gen5 },

@@ -324,6 +358,9 @@ static const struct acpi_device_id ssam_platform_hub_match[] = {
	/* Surface Laptop 4 (13", Intel) */
	{ "MSHW0250", (unsigned long)ssam_node_group_sl3 },

	/* Surface Laptop 5 */
	{ "MSHW0350", (unsigned long)ssam_node_group_sl5 },

	/* Surface Laptop Go 1 */
	{ "MSHW0118", (unsigned long)ssam_node_group_slg1 },

+9 −0
Original line number Diff line number Diff line
@@ -564,6 +564,15 @@ static const struct dmi_system_id acer_quirks[] __initconst = {
		},
		.driver_data = (void *)ACER_CAP_KBD_DOCK,
	},
	{
		.callback = set_force_caps,
		.ident = "Acer Aspire Switch V 10 SW5-017",
		.matches = {
			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"),
			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SW5-017"),
		},
		.driver_data = (void *)ACER_CAP_KBD_DOCK,
	},
	{
		.callback = set_force_caps,
		.ident = "Acer One 10 (S1003)",
+1 −2
Original line number Diff line number Diff line
@@ -276,7 +276,6 @@ static const struct file_operations amd_pmc_stb_debugfs_fops_v2 = {
	.release = amd_pmc_stb_debugfs_release_v2,
};

#if defined(CONFIG_SUSPEND) || defined(CONFIG_DEBUG_FS)
static int amd_pmc_setup_smu_logging(struct amd_pmc_dev *dev)
{
	if (dev->cpu_id == AMD_CPU_ID_PCO) {
@@ -351,7 +350,6 @@ static int get_metrics_table(struct amd_pmc_dev *pdev, struct smu_metrics *table
	memcpy_fromio(table, pdev->smu_virt_addr, sizeof(struct smu_metrics));
	return 0;
}
#endif /* CONFIG_SUSPEND || CONFIG_DEBUG_FS */

#ifdef CONFIG_SUSPEND
static void amd_pmc_validate_deepest(struct amd_pmc_dev *pdev)
@@ -964,6 +962,7 @@ static const struct acpi_device_id amd_pmc_acpi_ids[] = {
	{"AMDI0006", 0},
	{"AMDI0007", 0},
	{"AMDI0008", 0},
	{"AMDI0009", 0},
	{"AMD0004", 0},
	{"AMD0005", 0},
	{ }
+2 −0
Original line number Diff line number Diff line
@@ -1738,6 +1738,8 @@ static void asus_wmi_set_xusb2pr(struct asus_wmi *asus)
	pci_write_config_dword(xhci_pdev, USB_INTEL_XUSB2PR,
				cpu_to_le32(ports_available));

	pci_dev_put(xhci_pdev);

	pr_info("set USB_INTEL_XUSB2PR old: 0x%04x, new: 0x%04x\n",
			orig_ports_available, ports_available);
}
Loading