linux-usb.vger.kernel.org archive mirror
 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; 4+ 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] 4+ 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; 4+ 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] 4+ 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; 4+ 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] 4+ 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; 4+ 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] 4+ messages in thread

end of thread, other threads:[~2020-03-07 23:20 UTC | newest]

Thread overview: 4+ 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).