mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Alan Stern <stern@rowland.harvard.edu>
Subject: [012/102] USB: OHCI: fix another regression for NVIDIA controllers
Date: Wed, 03 Aug 2011 15:00:32 -0700	[thread overview]
Message-ID: <20110803221245.313472946@clark.kroah.org> (raw)
In-Reply-To: <20110803221345.GA10346@kroah.com>

3.0-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

commit 6ea12a04d295235ed67010a09fdea58c949e3eb0 upstream.

The NVIDIA series of OHCI controllers continues to be troublesome.  A
few people using the MCP67 chipset have reported that even with the
most recent kernels, the OHCI controller fails to handle new
connections and spams the system log with "unable to enumerate USB
port" messages.  This is different from the other problems previously
reported for NVIDIA OHCI controllers, although it is probably related.

It turns out that the MCP67 controller does not like to be kept in the
RESET state very long.  After only a few seconds, it decides not to
work any more.  This patch (as1479) changes the PCI initialization
quirk code so that NVIDIA controllers are switched into the SUSPEND
state after 50 ms of RESET.  With no interrupts enabled and all the
downstream devices reset, and thus unable to send wakeup requests,
this should be perfectly safe (even for non-NVIDIA hardware).

The removal code in ohci-hcd hasn't been changed; it will still leave
the controller in the RESET state.  As a result, if someone unloads
ohci-hcd and then reloads it, the controller won't work again until
the system is rebooted.  If anybody complains about this, the removal
code can be updated similarly.

This fixes Bugzilla #22052.

Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -35,6 +35,8 @@
 #define OHCI_INTRSTATUS		0x0c
 #define OHCI_INTRENABLE		0x10
 #define OHCI_INTRDISABLE	0x14
+#define OHCI_FMINTERVAL		0x34
+#define OHCI_HCR		(1 << 0)	/* host controller reset */
 #define OHCI_OCR		(1 << 3)	/* ownership change request */
 #define OHCI_CTRL_RWC		(1 << 9)	/* remote wakeup connected */
 #define OHCI_CTRL_IR		(1 << 8)	/* interrupt routing */
@@ -497,6 +499,32 @@ static void __devinit quirk_usb_handoff_
 
 	/* reset controller, preserving RWC (and possibly IR) */
 	writel(control & OHCI_CTRL_MASK, base + OHCI_CONTROL);
+	readl(base + OHCI_CONTROL);
+
+	/* Some NVIDIA controllers stop working if kept in RESET for too long */
+	if (pdev->vendor == PCI_VENDOR_ID_NVIDIA) {
+		u32 fminterval;
+		int cnt;
+
+		/* drive reset for at least 50 ms (7.1.7.5) */
+		msleep(50);
+
+		/* software reset of the controller, preserving HcFmInterval */
+		fminterval = readl(base + OHCI_FMINTERVAL);
+		writel(OHCI_HCR, base + OHCI_CMDSTATUS);
+
+		/* reset requires max 10 us delay */
+		for (cnt = 30; cnt > 0; --cnt) {	/* ... allow extra time */
+			if ((readl(base + OHCI_CMDSTATUS) & OHCI_HCR) == 0)
+				break;
+			udelay(1);
+		}
+		writel(fminterval, base + OHCI_FMINTERVAL);
+
+		/* Now we're in the SUSPEND state with all devices reset
+		 * and wakeups and interrupts disabled
+		 */
+	}
 
 	/*
 	 * disable interrupts



  parent reply	other threads:[~2011-08-03 23:25 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
2011-08-03 22:00 ` [001/102] USB: serial: add IDs for WinChipHead USB->RS232 adapter Greg KH
2011-08-03 22:00 ` [002/102] mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency Greg KH
2011-08-03 22:00 ` [003/102] mmc: sdhci-esdhc-imx: SDHCI_CARD_PRESENT does not get cleared Greg KH
2011-08-03 22:00 ` [004/102] bridge: send proper message_age in config BPDU Greg KH
2011-08-03 22:00 ` [005/102] gro: Only reset frag0 when skb can be pulled Greg KH
2011-08-03 22:00 ` [006/102] Staging: usbip: vhci-hcd: Do not kill already dead RX/TX kthread Greg KH
2011-08-03 22:00 ` [007/102] staging: r8192e_pci: Handle duplicate PCI ID 0x10ec:0x8192 conflict with rtl8192se Greg KH
2011-08-03 22:00 ` [008/102] staging: comedi: fix infoleak to userspace Greg KH
2011-08-03 22:00 ` [009/102] Staging: hv: storvsc: Increase the timeout value in the storvsc driver Greg KH
2011-08-03 22:00 ` [010/102] Staging: hv: vmbus: Increase the timeout value in the vmbus driver Greg KH
2011-08-03 22:00 ` [011/102] Staging: hv: netvsc: Increase the timeout value in the netvsc driver Greg KH
2011-08-03 22:00 ` Greg KH [this message]
2011-08-03 22:00 ` [013/102] USB: EHCI: go back to using the system clock for QH unlinks Greg KH
2011-08-03 22:00 ` [014/102] usb: musb: restore INDEX register in resume path Greg KH
2011-08-03 22:00 ` [015/102] rtc: handle errors correctly in rtc_irq_set_state() Greg KH
2011-08-03 22:00 ` [016/102] rtc: fix hrtimer deadlock Greg KH
2011-08-03 22:00 ` [017/102] rtc: limit frequency Greg KH
2011-08-03 22:00 ` [018/102] drivers/rtc/rtc-tegra.c: properly initialize spinlock Greg KH
2011-08-03 22:00 ` [019/102] ARM: pxa/cm-x300: fix V3020 RTC functionality Greg KH
2011-08-03 22:00 ` [020/102] ASoC: davinci: add missing break statement Greg KH
2011-08-03 22:00 ` [021/102] ASoC: davinci: fix codec start and stop functions Greg KH
2011-08-03 22:00 ` [022/102] ASoC: Mark cache as dirty when suspending Greg KH
2011-08-03 22:00 ` [023/102] ath6kl: cache firmware Greg KH
2011-08-03 22:00 ` [024/102] ath6kl: fix crash when interface is closed but scan is ongoing Greg KH
2011-08-03 22:00 ` [025/102] ath9k_hw: Fix incorrect key_miss handling Greg KH
2011-08-03 22:00 ` [026/102] CIFS: Fix oops while mounting with prefixpath Greg KH
2011-08-03 22:00 ` [027/102] staging: brcm80211: fix for reported log spam problem Greg KH
2011-08-03 22:00 ` [028/102] jme: Fix unmap error (Causing system freeze) Greg KH
2011-08-03 22:00 ` [029/102] ethtool: Allow zero-length register dumps again Greg KH
2011-08-03 22:00 ` [030/102] firewire: cdev: return -ENOTTY for unimplemented ioctls, not -EINVAL Greg KH
2011-08-03 22:00 ` [031/102] firewire: cdev: prevent race between first get_info ioctl and bus reset event queuing Greg KH
2011-08-03 22:00 ` [032/102] IB/srp: Avoid duplicate devices from LUN scan Greg KH
2011-08-03 22:00 ` [033/102] [SCSI] libsas: remove expander from dev list on error Greg KH
2011-08-03 22:00 ` [034/102] rtlwifi: rtl8192cu: Fix duplicate if test Greg KH
2011-08-03 22:00 ` [035/102] mac80211: Restart STA timers only on associated state Greg KH
2011-08-03 22:00 ` [036/102] irq_work, ppc: Fix up arch hooks Greg KH
2011-08-03 22:00 ` [037/102] perf tools, x86: Fix 32-bit compile on 64-bit system Greg KH
2011-08-03 22:00 ` [038/102] perf tools: Fix endian conversion reading event attr from file header Greg KH
2011-08-03 22:00 ` [039/102] x86, intel, power: Initialize MSR_IA32_ENERGY_PERF_BIAS Greg KH
2011-08-03 22:01 ` [040/102] perf: Fix software event overflow Greg KH
2011-08-03 22:01 ` [041/102] [SCSI] Blacklist Traxdata CDR4120 and IOMEGA Zip drive to avoid lock ups Greg KH
2011-08-03 22:01 ` [042/102] [SCSI] sr: check_events() ignore GET_EVENT when TUR says otherwise Greg KH
2011-08-03 22:01 ` [043/102] [SCSI] ses: requesting a fault indication Greg KH
2011-08-03 22:01 ` [044/102] [SCSI] fix crash in scsi_dispatch_cmd() Greg KH
2011-08-03 22:01 ` [045/102] [SCSI] pmcraid: reject negative request size Greg KH
2011-08-03 22:01 ` [046/102] [SCSI] hpsa: do not attempt to read from a write-only register Greg KH
2011-08-03 22:01 ` [047/102] drm/radeon/kms: fix i2c map for rv250/280 Greg KH
2011-08-03 22:01 ` [048/102] drm/radeon/kms: fix DP training for DPEncoderService revision bigger than 1.1 Greg KH
2011-08-03 22:01 ` [049/102] drm/radeon/kms: add missing vddci setting on NI+ Greg KH
2011-08-03 22:01 ` [050/102] ALSA: virtuoso: fix silent analog output on Xonar Essence ST Deluxe Greg KH
2011-08-03 22:01 ` [051/102] ALSA: hda - Fix duplicated DAC assignments for Realtek Greg KH
2011-08-03 22:01 ` [052/102] pnfs: save layoutcommit lwb at layout header Greg KH
2011-08-03 22:01 ` [053/102] pnfs: save layoutcommit cred at layout header init Greg KH
2011-08-03 22:01 ` [054/102] pnfs: let layoutcommit handle a list of lseg Greg KH
2011-08-03 22:01 ` [055/102] pnfs: use lwb as layoutcommit length Greg KH
2011-08-03 22:01 ` [056/102] kexec, x86: Fix incorrect jump back address if not preserving context Greg KH
2011-08-03 22:01 ` [057/102] oprofile, x86: Fix nmi-unsafe callgraph support Greg KH
2011-08-03 22:01 ` [058/102] powerpc/kdump: Fix timeout in crash_kexec_wait_realmode Greg KH
2011-08-03 22:01 ` [059/102] irq_work, alpha: Fix up arch hooks Greg KH
2011-08-03 22:01 ` [060/102] tracing: Fix bug when reading system filters on module removal Greg KH
2011-08-03 22:01 ` [061/102] tracing: Have "enable" file use refcounts like the "filter" file Greg KH
2011-08-03 22:01 ` [062/102] XZ: Fix missing <linux/kernel.h> include Greg KH
2011-08-03 22:01 ` [063/102] PCI: ARI is a PCIe v2 feature Greg KH
2011-08-03 22:01 ` [064/102] cciss: do not attempt to read from a write-only register Greg KH
2011-08-03 22:01 ` [065/102] drivers/firmware/sigma.c needs MODULE_LICENSE Greg KH
2011-08-03 22:01 ` [066/102] geode: reflect mfgpt dependency on mfd Greg KH
2011-08-03 22:01 ` [067/102] mm/futex: fix futex writes on archs with SW tracking of dirty & young Greg KH
2011-08-03 22:01 ` [068/102] mm/backing-dev.c: reset bdi min_ratio in bdi_unregister() Greg KH
2011-08-03 22:01 ` [069/102] xtensa: prevent arbitrary read in ptrace Greg KH
2011-08-03 22:01 ` [070/102] ext4: fix i_blocks/quota accounting when extent insertion fails Greg KH
2011-08-03 22:01 ` [071/102] ext4: free allocated and pre-allocated blocks when check_eofblocks_fl fails Greg KH
2011-08-03 22:01 ` [072/102] ext3: Fix oops in ext3_try_to_allocate_with_rsv() Greg KH
2011-08-03 22:01 ` [073/102] ecryptfs: Make inode bdi consistent with superblock bdi Greg KH
2011-08-03 22:01 ` [074/102] eCryptfs: Unlock keys needed by ecryptfsd Greg KH
2011-08-03 22:01 ` [075/102] nfsd: dont break lease on CLAIM_DELEGATE_CUR Greg KH
2011-08-03 22:01 ` [076/102] nfsd4: remember to put RW access on stateid destruction Greg KH
2011-08-03 22:01 ` [077/102] nfsd4: fix file leak on open_downgrade Greg KH
2011-08-03 22:01 ` [078/102] svcrpc: fix list-corrupting race on nfsd shutdown Greg KH
2011-08-03 22:01 ` [079/102] NFSv4: Dont use the delegation->inode in nfs_mark_return_delegation() Greg KH
2011-08-03 22:01 ` [080/102] NFS: Fix spurious readdir cookie loop messages Greg KH
2011-08-03 22:01 ` [081/102] proc: fix a race in do_io_accounting() Greg KH
2011-08-03 22:01 ` [082/102] n_gsm: fix the wrong FCS handling Greg KH
2011-08-03 22:01 ` [083/102] EHCI: only power off port if over-current is active Greg KH
2011-08-03 22:01 ` [084/102] EHCI: fix direction handling for interrupt data toggles Greg KH
2011-08-03 22:01 ` [085/102] cfg80211: really ignore the regulatory request Greg KH
2011-08-03 22:01 ` [086/102] memcg: fix behavior of mem_cgroup_resize_limit() Greg KH
2011-08-03 22:01 ` [087/102] tty/serial: Fix XSCALE serial ports, e.g. ce4100 Greg KH
2011-08-03 22:01 ` [088/102] SERIAL: SC26xx: Fix link error Greg KH
2011-08-03 22:01 ` [089/102] powerpc/pseries/hvconsole: Fix dropped console output Greg KH
2011-08-03 22:01 ` [090/102] hvc_console: Improve tty/console put_chars handling Greg KH
2011-08-03 22:01 ` [091/102] ipc/sem.c: fix race with concurrent semtimedop() timeouts and IPC_RMID Greg KH
2011-08-03 22:01 ` [092/102] AppArmor: Fix reference to rcu protected pointer outside of rcu_read_lock Greg KH
2011-08-03 22:01 ` [093/102] AppArmor: Fix masking of capabilities in complain mode Greg KH
2011-08-03 22:01 ` [094/102] oom: task->mm == NULL doesnt mean the memory was freed Greg KH
2011-08-03 22:01 ` [095/102] rt2x00: Add device ID for RT539F device Greg KH
2011-08-03 22:01 ` [096/102] GFS2: Fix mount hang caused by certain access pattern to sysfs files Greg KH
2011-08-03 22:01 ` [097/102] watchdog: shwdt: fix usage of mod_timer Greg KH
2011-08-03 22:01 ` [098/102] ALSA: sound/core/pcm_compat.c: adjust array index Greg KH
2011-08-03 22:01 ` [099/102] dm io: flush cpu cache with vmapped io Greg KH
2011-08-03 22:02 ` [100/102] dm snapshot: flush disk cache when merging Greg KH
2011-08-03 22:02 ` [101/102] dm mpath: fix potential NULL pointer in feature arg processing Greg KH
2011-08-03 22:02 ` [102/102] dm: fix idr leak on module removal Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110803221245.313472946@clark.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®