#!/usr/bin/env perl # # Copyright (C) 2006 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # use strict; sub get_ts($$) { my $path = shift; my $options = shift; my $ts = 0; my $fn = ""; $path .= "/" if( -d $path); open FIND, "find $path -type f -and -not -path \\*/.svn\\* -and -not -path \\*CVS\\* $options 2>/dev/null |"; while () { chomp; my $file = $_; next if -l $file; my $mt = (stat $file)[9]; if ($mt > $ts) { $ts = $mt; $fn = $file; } } close FIND; return ($ts, $fn); } (@ARGV > 0) or push @ARGV, "."; my $ts = 0; my $n = "."; my %options; while (@ARGV > 0) { my $path = shift @ARGV; if ($path =~ /^-x/) { my $str = shift @ARGV; $options{"findopts"} .= " -and -not -path '".$str."'" } elsif ($path =~ /^-f/) { $options{"findopts"} .= " -follow"; } elsif ($path =~ /^-n/) { my $arg = $ARGV[0]; $options{$path} = $arg; } elsif ($path =~ /^-/) { $options{$path} = 1; } else { my ($tmp, $fname) = get_ts($path, $options{"findopts"}); if ($tmp > $ts) { if ($options{'-F'}) { $n = $fname; } else { $n = $path; } $ts = $tmp; } } } if ($options{"-n"}) { exit ($n eq $options{"-n"} ? 0 : 1); } elsif ($options{"-p"}) { print "$n\n"; } elsif ($options{"-t"}) { print "$ts\n"; } else { print "$n\t$ts\n"; } on value='master' selected='selected'>master upstream openwrtJames
aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch
blob: 0805246f06d6f73b74454b88f718f0baeb2120ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From a0dc613140bab907a3d5787a7ae7b0638bf674d0 Mon Sep 17 00:00:00 2001
From: Christian Lamparter <chunkeey@gmail.com>
Date: Thu, 23 Jun 2016 20:28:20 +0200
Subject: [PATCH] usb: xhci: force MSI for uPD720201 and
 uPD720202

The APM82181 does not support MSI-X. When probed, it will
produce a noisy warning.

---
 drivers/usb/host/pci-quirks.c | 362 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 362 insertions(+)

--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -203,7 +203,7 @@ static void xhci_pci_quirks(struct devic
 	}
 	if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
 			pdev->device == 0x0015)
-		xhci->quirks |= XHCI_RESET_ON_RESUME;
+		xhci->quirks |= XHCI_RESET_ON_RESUME | XHCI_FORCE_MSI;
 	if (pdev->vendor == PCI_VENDOR_ID_VIA)
 		xhci->quirks |= XHCI_RESET_ON_RESUME;
 
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -387,10 +387,14 @@ static int xhci_try_enable_msi(struct us
 		free_irq(hcd->irq, hcd);
 	hcd->irq = 0;
 
-	ret = xhci_setup_msix(xhci);
-	if (ret)
-		/* fall back to msi*/
+	if (xhci->quirks & XHCI_FORCE_MSI) {
 		ret = xhci_setup_msi(xhci);
+	} else {
+		ret = xhci_setup_msix(xhci);
+		if (ret)
+			/* fall back to msi*/
+			ret = xhci_setup_msi(xhci);
+	}
 
 	if (!ret)
 		/* hcd->irq is 0, we have MSI */
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1679,6 +1679,7 @@ struct xhci_hcd {
 	/* support xHCI 0.96 spec USB2 software LPM */
 	unsigned		sw_lpm_support:1;
 	/* support xHCI 1.0 spec USB2 hardware LPM */
+#define XHCI_FORCE_MSI		(1 << 24)
 	unsigned		hw_lpm_support:1;
 	/* cached usb2 extened protocol capabilites */
 	u32                     *ext_caps;