Changes:
- Add patch to support Surface Go 3 power/volume buttons by Alex Hung.
- Add patch to to support Surface Go 3 battery status/information.
- Rebase onto v5.15.6
Links:
- kernel: e7ecf4debb
- https://github.com/linux-surface/linux-surface/issues/595
- https://github.com/linux-surface/linux-surface/issues/639
124 lines
4.4 KiB
Diff
124 lines
4.4 KiB
Diff
From e7ba91e0e45669d3ab6947f8faa8822ca44a738b Mon Sep 17 00:00:00 2001
|
|
From: Mathias Nyman <mathias.nyman@linux.intel.com>
|
|
Date: Fri, 29 Oct 2021 15:51:54 +0300
|
|
Subject: [PATCH] xhci: Fix commad ring abort, write all 64 bits to CRCR
|
|
register.
|
|
|
|
Turns out some xHC controllers require all 64 bits in the CRCR register
|
|
to be written to execute a command abort.
|
|
|
|
The lower 32 bits containing the command abort bit is written first.
|
|
In case the command ring stops before we write the upper 32 bits then
|
|
hardware may use these upper bits to set the commnd ring dequeue pointer.
|
|
|
|
Solve this by making sure the upper 32 bits contain a valid command
|
|
ring dequeue pointer.
|
|
|
|
The original patch that only wrote the first 32 to stop the ring went
|
|
to stable, so this fix should go there as well.
|
|
|
|
Fixes: ff0e50d3564f ("xhci: Fix command ring pointer corruption while aborting a command")
|
|
Cc: stable@vger.kernel.org
|
|
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
|
|
Patchset: misc-fixes
|
|
---
|
|
drivers/usb/host/xhci-ring.c | 21 ++++++++++++++-------
|
|
1 file changed, 14 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
|
|
index 311597bba80e..eaa49aef2935 100644
|
|
--- a/drivers/usb/host/xhci-ring.c
|
|
+++ b/drivers/usb/host/xhci-ring.c
|
|
@@ -366,7 +366,9 @@ static void xhci_handle_stopped_cmd_ring(struct xhci_hcd *xhci,
|
|
/* Must be called with xhci->lock held, releases and aquires lock back */
|
|
static int xhci_abort_cmd_ring(struct xhci_hcd *xhci, unsigned long flags)
|
|
{
|
|
- u32 temp_32;
|
|
+ struct xhci_segment *new_seg = xhci->cmd_ring->deq_seg;
|
|
+ union xhci_trb *new_deq = xhci->cmd_ring->dequeue;
|
|
+ u64 crcr;
|
|
int ret;
|
|
|
|
xhci_dbg(xhci, "Abort command ring\n");
|
|
@@ -375,13 +377,18 @@ static int xhci_abort_cmd_ring(struct xhci_hcd *xhci, unsigned long flags)
|
|
|
|
/*
|
|
* The control bits like command stop, abort are located in lower
|
|
- * dword of the command ring control register. Limit the write
|
|
- * to the lower dword to avoid corrupting the command ring pointer
|
|
- * in case if the command ring is stopped by the time upper dword
|
|
- * is written.
|
|
+ * dword of the command ring control register.
|
|
+ * Some controllers require all 64 bits to be written to abort the ring.
|
|
+ * Make sure the upper dword is valid, pointing to the next command,
|
|
+ * avoiding corrupting the command ring pointer in case the command ring
|
|
+ * is stopped by the time the upper dword is written.
|
|
*/
|
|
- temp_32 = readl(&xhci->op_regs->cmd_ring);
|
|
- writel(temp_32 | CMD_RING_ABORT, &xhci->op_regs->cmd_ring);
|
|
+ next_trb(xhci, NULL, &new_seg, &new_deq);
|
|
+ if (trb_is_link(new_deq))
|
|
+ next_trb(xhci, NULL, &new_seg, &new_deq);
|
|
+
|
|
+ crcr = xhci_trb_virt_to_dma(new_seg, new_deq);
|
|
+ xhci_write_64(xhci, crcr | CMD_RING_ABORT, &xhci->op_regs->cmd_ring);
|
|
|
|
/* Section 4.6.1.2 of xHCI 1.0 spec says software should also time the
|
|
* completion of the Command Abort operation. If CRR is not negated in 5
|
|
--
|
|
2.34.1
|
|
|
|
From cce4e5012d65da77323e511781efe4fbc8f9b962 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Wed, 8 Dec 2021 16:22:50 +0100
|
|
Subject: [PATCH] acpi/battery: Add device HID and quirk for Microsoft Surface
|
|
Go 3
|
|
|
|
For some reason, the Microsoft Surface Go 3 uses the standard ACPI
|
|
interface for battery information, but does not use the standard PNP0C0A
|
|
HID. Instead it uses MSHW0146 as identifier. Add that ID to the driver
|
|
as this seems to work well.
|
|
|
|
Additionally, the power state is not updated immediately after the AC
|
|
has been (un-)plugged, so add the respective quirk for that.
|
|
|
|
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Patchset: misc-fixes
|
|
---
|
|
drivers/acpi/battery.c | 12 ++++++++++++
|
|
1 file changed, 12 insertions(+)
|
|
|
|
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
|
|
index 8afa85d6eb6a..65882cb791a5 100644
|
|
--- a/drivers/acpi/battery.c
|
|
+++ b/drivers/acpi/battery.c
|
|
@@ -59,6 +59,10 @@ MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
|
|
|
|
static const struct acpi_device_id battery_device_ids[] = {
|
|
{"PNP0C0A", 0},
|
|
+
|
|
+ /* Microsoft Surface Go 3 */
|
|
+ {"MSHW0146", 0},
|
|
+
|
|
{"", 0},
|
|
};
|
|
|
|
@@ -1155,6 +1159,14 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
|
|
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
|
|
},
|
|
},
|
|
+ {
|
|
+ /* Microsoft Surface Go 3 */
|
|
+ .callback = battery_notification_delay_quirk,
|
|
+ .matches = {
|
|
+ DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
+ DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go 3"),
|
|
+ },
|
|
+ },
|
|
{},
|
|
};
|
|
|
|
--
|
|
2.34.1
|
|
|