All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] xhci fixes for usb-linus
@ 2020-03-06 15:08 Mathias Nyman
  2020-03-06 15:08 ` [PATCH 1/2] xhci: Do not open code __print_symbolic() in xhci trace events Mathias Nyman
  2020-03-06 15:08 ` [PATCH 2/2] usb: xhci: apply XHCI_SUSPEND_DELAY to AMD XHCI controller 1022:145c Mathias Nyman
  0 siblings, 2 replies; 12+ messages in thread
From: Mathias Nyman @ 2020-03-06 15:08 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, Mathias Nyman

Hi Greg

A couple minor xhci fixes for usb-linus, fixing xhci trace events and
adding a quirk flag for a AMD xhci host.

-Mathias

Alberto Mattea (1):
  usb: xhci: apply XHCI_SUSPEND_DELAY to AMD XHCI controller 1022:145c

Steven Rostedt (VMware) (1):
  xhci: Do not open code __print_symbolic() in xhci trace events

 drivers/usb/host/xhci-pci.c   |  3 ++-
 drivers/usb/host/xhci-trace.h | 23 ++++++-----------------
 2 files changed, 8 insertions(+), 18 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] xhci: Do not open code __print_symbolic() in xhci trace events
  2020-03-06 15:08 [PATCH 0/2] xhci fixes for usb-linus Mathias Nyman
@ 2020-03-06 15:08 ` Mathias Nyman
  2020-03-06 15:08 ` [PATCH 2/2] usb: xhci: apply XHCI_SUSPEND_DELAY to AMD XHCI controller 1022:145c Mathias Nyman
  1 sibling, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2020-03-06 15:08 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, Steven Rostedt (VMware), stable, Mathias Nyman

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

libtraceevent (used by perf and trace-cmd) failed to parse the
xhci_urb_dequeue trace event. This is because the user space trace
event format parsing is not a full C compiler. It can handle some basic
logic, but is not meant to be able to handle everything C can do.

In cases where a trace event field needs to be converted from a number
to a string, there's the __print_symbolic() macro that should be used:

 See samples/trace_events/trace-events-sample.h

Some xhci trace events open coded the __print_symbolic() causing the
user spaces tools to fail to parse it. This has to be replaced with
__print_symbolic() instead.

CC: stable@vger.kernel.org
Reported-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=206531
Fixes: 5abdc2e6e12ff ("usb: host: xhci: add urb_enqueue/dequeue/giveback tracers")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
 drivers/usb/host/xhci-trace.h | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/xhci-trace.h b/drivers/usb/host/xhci-trace.h
index 56eb867803a6..b19582b2a72c 100644
--- a/drivers/usb/host/xhci-trace.h
+++ b/drivers/usb/host/xhci-trace.h
@@ -289,23 +289,12 @@ DECLARE_EVENT_CLASS(xhci_log_urb,
 	),
 	TP_printk("ep%d%s-%s: urb %p pipe %u slot %d length %d/%d sgs %d/%d stream %d flags %08x",
 			__entry->epnum, __entry->dir_in ? "in" : "out",
-			({ char *s;
-			switch (__entry->type) {
-			case USB_ENDPOINT_XFER_INT:
-				s = "intr";
-				break;
-			case USB_ENDPOINT_XFER_CONTROL:
-				s = "control";
-				break;
-			case USB_ENDPOINT_XFER_BULK:
-				s = "bulk";
-				break;
-			case USB_ENDPOINT_XFER_ISOC:
-				s = "isoc";
-				break;
-			default:
-				s = "UNKNOWN";
-			} s; }), __entry->urb, __entry->pipe, __entry->slot_id,
+			__print_symbolic(__entry->type,
+				   { USB_ENDPOINT_XFER_INT,	"intr" },
+				   { USB_ENDPOINT_XFER_CONTROL,	"control" },
+				   { USB_ENDPOINT_XFER_BULK,	"bulk" },
+				   { USB_ENDPOINT_XFER_ISOC,	"isoc" }),
+			__entry->urb, __entry->pipe, __entry->slot_id,
 			__entry->actual, __entry->length, __entry->num_mapped_sgs,
 			__entry->num_sgs, __entry->stream, __entry->flags
 		)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/2] usb: xhci: apply XHCI_SUSPEND_DELAY to AMD XHCI controller 1022:145c
  2020-03-06 15:08 [PATCH 0/2] xhci fixes for usb-linus Mathias Nyman
  2020-03-06 15:08 ` [PATCH 1/2] xhci: Do not open code __print_symbolic() in xhci trace events Mathias Nyman
@ 2020-03-06 15:08 ` Mathias Nyman
  2020-03-07 23:20   ` Sasha Levin
  1 sibling, 1 reply; 12+ messages in thread
From: Mathias Nyman @ 2020-03-06 15:08 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, Alberto Mattea, stable, Mathias Nyman

From: Alberto Mattea <alberto@mattea.info>

This controller timeouts during suspend (S3) with
[  240.521724] xhci_hcd 0000:30:00.3: WARN: xHC save state timeout
[  240.521729] xhci_hcd 0000:30:00.3: ERROR mismatched command completion event
thus preventing the system from entering S3.
Moreover it remains in an undefined state where some connected devices stop
working until a reboot.
Apply the XHCI_SUSPEND_DELAY quirk to make it suspend properly.

CC: stable@vger.kernel.org
Signed-off-by: Alberto Mattea <alberto@mattea.info>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
 drivers/usb/host/xhci-pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 5e9b537df631..1fddc41fa1f3 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -136,7 +136,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 		xhci->quirks |= XHCI_AMD_PLL_FIX;
 
 	if (pdev->vendor == PCI_VENDOR_ID_AMD &&
-		(pdev->device == 0x15e0 ||
+		(pdev->device == 0x145c ||
+		 pdev->device == 0x15e0 ||
 		 pdev->device == 0x15e1 ||
 		 pdev->device == 0x43bb))
 		xhci->quirks |= XHCI_SUSPEND_DELAY;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] usb: xhci: apply XHCI_SUSPEND_DELAY to AMD XHCI controller 1022:145c
  2020-03-06 15:08 ` [PATCH 2/2] usb: xhci: apply XHCI_SUSPEND_DELAY to AMD XHCI controller 1022:145c Mathias Nyman
@ 2020-03-07 23:20   ` Sasha Levin
  0 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2020-03-07 23:20 UTC (permalink / raw)
  To: Sasha Levin, Mathias Nyman, Alberto Mattea, gregkh
  Cc: linux-usb, Alberto Mattea, stable, stable

Hi

[This is an automated email]

This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v5.5.8, v5.4.24, v4.19.108, v4.14.172, v4.9.215, v4.4.215.

v5.5.8: Build OK!
v5.4.24: Build OK!
v4.19.108: Build OK!
v4.14.172: Build OK!
v4.9.215: Failed to apply! Possible dependencies:
    191edc5e2e51 ("xhci: Fix front USB ports on ASUS PRIME B350M-A")
    4750bc78efdb ("usb: host: xhci support option to disable the xHCI USB2 HW LPM")
    488dc164914f ("xhci: remove WARN_ON if dma mask is not set for platform devices")
    4c39d4b949d3 ("usb: xhci: use bus->sysdev for DMA configuration")
    621faf4f6a18 ("xhci: Fix USB ports for Dell Inspiron 5775")

v4.4.215: Failed to apply! Possible dependencies:
    191edc5e2e51 ("xhci: Fix front USB ports on ASUS PRIME B350M-A")
    21939f003ad0 ("usb: host: xhci-plat: enable BROKEN_PED quirk if platform requested")
    41135de1e7fd ("usb: xhci: add quirk flag for broken PED bits")
    4750bc78efdb ("usb: host: xhci support option to disable the xHCI USB2 HW LPM")
    488dc164914f ("xhci: remove WARN_ON if dma mask is not set for platform devices")
    4c39d4b949d3 ("usb: xhci: use bus->sysdev for DMA configuration")
    4efb2f694114 ("usb: host: xhci-plat: add struct xhci_plat_priv")
    621faf4f6a18 ("xhci: Fix USB ports for Dell Inspiron 5775")
    69307ccb9ad7 ("usb: xhci: bInterval quirk for TI TUSB73x0")
    76f9502fe761 ("xhci: plat: adapt to unified device property interface")
    9da5a1092b13 ("xhci: Bad Ethernet performance plugged in ASM1042A host")
    a3aef3793071 ("xhci: get rid of platform data")
    dec08194ffec ("xhci: Limit USB2 port wake support for AMD Promontory hosts")
    def4e6f7b419 ("xhci: refactor and cleanup endpoint initialization.")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/2] xhci fixes for usb-linus
@ 2024-04-04 12:11 Mathias Nyman
  0 siblings, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2024-04-04 12:11 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, niklas.neronin, Thinh.Nguyen, Mathias Nyman

Hi Greg

A couple xhci fixes for 6.9 rc
The null pointer dereferece fix solves a regression in 6.9-rc1,
so no need to add it to stable

Thanks
-Mathias

Mathias Nyman (1):
  xhci: Fix root hub port null pointer dereference in xhci tracepoints

Oliver Neukum (1):
  usb: xhci: correct return value in case of STS_HCE

 drivers/usb/host/xhci-ring.c  |  9 ++++-----
 drivers/usb/host/xhci-trace.h | 12 +++++-------
 2 files changed, 9 insertions(+), 12 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/2] xhci fixes for usb-linus
@ 2023-05-15 13:40 Mathias Nyman
  0 siblings, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2023-05-15 13:40 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, Mathias Nyman

Hi Greg

A couple xhci fixes for 6.4
Fixing a S3 resume issue on AMD hosts, and a flaw in calculating free TRBs
in ring buffer which may cause xhci to hog extra memory.

Thanks
Mathias

Mario Limonciello (1):
  xhci-pci: Only run d3cold avoidance quirk for s2idle

Mathias Nyman (1):
  xhci: Fix incorrect tracking of free space on transfer rings

 drivers/usb/host/xhci-pci.c  | 12 ++++++++++--
 drivers/usb/host/xhci-ring.c | 29 ++++++++++++++++++++++++++++-
 drivers/usb/host/xhci.h      |  2 +-
 3 files changed, 39 insertions(+), 4 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/2] xhci fixes for usb-linus
@ 2022-02-15 12:33 Mathias Nyman
  0 siblings, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2022-02-15 12:33 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, Mathias Nyman

Hi Greg

A couple small xhci fixes for usb-linus

Add Host controller error (HCE) to the list of reasons to reset the host
during resume.
Also make sure we don't change the error value returned if URB submission
fails.

Thanks
-Mathias


Hongyu Xie (1):
  xhci: Prevent futile URB re-submissions due to incorrect return value.

Puma Hsu (1):
  xhci: re-initialize the HC during resume if HCE was set

 drivers/usb/host/xhci.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/2] xhci fixes for usb-linus
@ 2021-12-10 14:17 Mathias Nyman
  0 siblings, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2021-12-10 14:17 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, Mathias Nyman

Hi Greg

A couple xhci patches for usb-linus that solves two suspend/resume related issues.

Thanks
-Mathias

Kai-Heng Feng (1):
  xhci: Remove CONFIG_USB_DEFAULT_PERSIST to prevent xHCI from runtime
    suspending

Mathias Nyman (1):
  xhci: avoid race between disable slot command and host runtime suspend

 drivers/usb/host/xhci-hub.c  |  1 +
 drivers/usb/host/xhci-ring.c |  1 -
 drivers/usb/host/xhci.c      | 26 +++++++++++++++-----------
 3 files changed, 16 insertions(+), 12 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/2] xhci fixes for usb-linus
@ 2021-05-25  7:40 Mathias Nyman
  0 siblings, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2021-05-25  7:40 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, Mathias Nyman

Hi Greg

two patches for usb-linus and 5.12 stable
xhci changes in 5.12 caused a regression in stall handling.
Due to this some usb card readers failed to work with 5.12

These two patches fix that regression.

Thanks
-Mathias

Mathias Nyman (2):
  xhci: fix giving back URB with incorrect status regression in 5.12
  xhci: Fix 5.12 regression of missing xHC cache clearing command after
    a Stall

 drivers/usb/host/xhci-ring.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/2] xhci fixes for usb-linus
@ 2021-01-15 16:19 Mathias Nyman
  0 siblings, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2021-01-15 16:19 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, Mathias Nyman

Hi Greg

A couple fixes for usb-linus.
Fixes one "xHCI died" case found when stress testing URB cancel on
several devices at once, and one timing issue on Tegra xhci

JC Kuo (1):
  xhci: tegra: Delay for disabling LFPS detector

Mathias Nyman (1):
  xhci: make sure TRB is fully written before giving it to the
    controller

 drivers/usb/host/xhci-ring.c  | 2 ++
 drivers/usb/host/xhci-tegra.c | 7 +++++++
 2 files changed, 9 insertions(+)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/2] xhci fixes for usb-linus
@ 2020-05-14 11:04 Mathias Nyman
  0 siblings, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2020-05-14 11:04 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, Mathias Nyman

Hi Greg

Two small xhci fixes for usb-linus, both fix NULL pointer dereference issues.
Would be nice if they could still make 5.7 

Thanks
Mathias

Li Jun (1):
  usb: host: xhci-plat: keep runtime active when removing host

Sriharsha Allenki (1):
  usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb
    sg list

 drivers/usb/host/xhci-plat.c | 4 +++-
 drivers/usb/host/xhci-ring.c | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/2] xhci fixes for usb-linus
@ 2019-06-18 14:27 Mathias Nyman
  0 siblings, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2019-06-18 14:27 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, Mathias Nyman

Hi Greg

A couple of fixes for usb-linus, one to detect usb 3.2 xhci hosts,
another to resolve a rare host hang at resume issue.

-Mathias

Mathias Nyman (2):
  usb: xhci: Don't try to recover an endpoint if port is in error state.
  xhci: detect USB 3.2 capable host controllers correctly

 drivers/usb/host/xhci-ring.c | 15 ++++++++++++++-
 drivers/usb/host/xhci.c      | 25 ++++++++++++++++++++-----
 drivers/usb/host/xhci.h      |  9 +++++++++
 3 files changed, 43 insertions(+), 6 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-04-04 12:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 15:08 [PATCH 0/2] xhci fixes for usb-linus Mathias Nyman
2020-03-06 15:08 ` [PATCH 1/2] xhci: Do not open code __print_symbolic() in xhci trace events Mathias Nyman
2020-03-06 15:08 ` [PATCH 2/2] usb: xhci: apply XHCI_SUSPEND_DELAY to AMD XHCI controller 1022:145c Mathias Nyman
2020-03-07 23:20   ` Sasha Levin
  -- strict thread matches above, loose matches on Subject: below --
2024-04-04 12:11 [PATCH 0/2] xhci fixes for usb-linus Mathias Nyman
2023-05-15 13:40 Mathias Nyman
2022-02-15 12:33 Mathias Nyman
2021-12-10 14:17 Mathias Nyman
2021-05-25  7:40 Mathias Nyman
2021-01-15 16:19 Mathias Nyman
2020-05-14 11:04 Mathias Nyman
2019-06-18 14:27 Mathias Nyman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.