aboutsummaryrefslogtreecommitdiffstats
diff options
-rw-r--r--series8
-rw-r--r--tty/tty-add-extproc-support-for-linemode.patch728
-rw-r--r--tty/tty-implement-btm-as-mutex-instead-of-bkl.patch4
-rw-r--r--tty/tty-introduce-wait_event_interruptible_tty.patch2
-rw-r--r--tty/tty-make-vt-s-have-a-tty_port.patch4
-rw-r--r--tty/tty-move-the-vt_tty-field-from-the-vc_data-into-the-standard-tty_port.patch6
-rw-r--r--tty/tty-never-hold-btm-while-getting-tty_mutex.patch6
-rw-r--r--tty/tty-remove-tty_lock_nested.patch4
-rw-r--r--tty/tty-replace-bkl-with-a-new-tty_lock.patch4
-rw-r--r--tty/vc-locking-clean-up.patch4
-rw-r--r--tty/vt-console-try-harder-to-print-output-when-panicing.patch192
-rw-r--r--usb.current/usb-musb-enable-the-maximum-supported-burst-mode-for-dma.patch53
-rw-r--r--usb.current/usb-musb-fix-blackfin-ulpi-stubs.patch40
-rw-r--r--usb.current/usb-musb-make-non-omap-platforms-build-with-config_pm-y.patch58
-rw-r--r--usb.current/usb-musb_core-make-disconnect-and-suspend-interrupts-work-again.patch48
-rw-r--r--usb.current/usb-obey-the-sysfs-power-wakeup-setting.patch67
-rw-r--r--usb/usb-convert-usb_hcd-bitfields-into-atomic-flags.patch666
-rw-r--r--usb/usb-core-driver-fix-coding-styles.patch6
18 files changed, 1880 insertions, 20 deletions
diff --git a/series b/series
index 8b3e859dd030bb..4b8d83d7d7c77e 100644
--- a/series
+++ b/series
@@ -32,6 +32,11 @@ usb.current/usb-isp1362-hcd-fix-double-lock.patch
usb.current/usb-gadget-printer-fix-sleep-inside-atomic.patch
usb.current/usb-qcserial-fix-a-memory-leak-in-qcprobe-error-path.patch
usb.current/usb-gadget-eth-fix-calculate-crc32-in-eem.patch
+usb.current/usb-obey-the-sysfs-power-wakeup-setting.patch
+usb.current/usb-musb_core-make-disconnect-and-suspend-interrupts-work-again.patch
+usb.current/usb-musb-make-non-omap-platforms-build-with-config_pm-y.patch
+usb.current/usb-musb-fix-blackfin-ulpi-stubs.patch
+usb.current/usb-musb-enable-the-maximum-supported-burst-mode-for-dma.patch
#################################
# Staging patches for 2.6.35
@@ -84,6 +89,8 @@ tty/serial-replace-open-coded-mutex-with-a-real-mutex-in-mrst_max3110.c.patch
tty/serial-fix-wakup-races-in-the-mrst_max3110-driver.patch
tty/tty-remove-hayes-esp-ioctls.patch
tty/tty-remove-remaining-hayes-esp-ioctls.patch
+tty/tty-add-extproc-support-for-linemode.patch
+tty/vt-console-try-harder-to-print-output-when-panicing.patch
# tty bkl removal work
tty/stallion-prune-lock_kernel-calls.patch
@@ -172,6 +179,7 @@ usb/usb-gadget-g_multi-added-documentation-and-inf-files.patch
usb/usb-gadget-composite-added-disconnect-callback.patch
usb/usb-gadget-f_mass_storage-added-eject-callback.patch
usb/usb-gadget-section-mismatch-warning-fixed.patch
+usb/usb-convert-usb_hcd-bitfields-into-atomic-flags.patch
# staging stuff is now in the staging-next tree on git.kernel.org
diff --git a/tty/tty-add-extproc-support-for-linemode.patch b/tty/tty-add-extproc-support-for-linemode.patch
new file mode 100644
index 00000000000000..2ef016ed23f7f3
--- /dev/null
+++ b/tty/tty-add-extproc-support-for-linemode.patch
@@ -0,0 +1,728 @@
+From hyc@symas.com Thu Jun 24 14:34:33 2010
+From: hyc@symas.com
+Date: Tue, 22 Jun 2010 10:14:49 -0700
+Subject: tty: Add EXTPROC support for LINEMODE
+To: linux-kernel@vger.kernel.org
+Cc: alan@lxorguk.ukuu.org.uk, greg@kroah.com
+Message-ID: <E1OR73h-0004VN-JE@lirone.symas.net>
+
+
+This patch is against the 2.6.34 source.
+
+Paraphrased from the 1989 BSD patch by David Borman @ cray.com:
+
+ These are the changes needed for the kernel to support
+ LINEMODE in the server.
+
+ There is a new bit in the termios local flag word, EXTPROC.
+ When this bit is set, several aspects of the terminal driver
+ are disabled. Input line editing, character echo, and mapping
+ of signals are all disabled. This allows the telnetd to turn
+ off these functions when in linemode, but still keep track of
+ what state the user wants the terminal to be in.
+
+ New ioctl:
+ TIOCSIG Generate a signal to processes in the
+ current process group of the pty.
+
+ There is a new mode for packet driver, the TIOCPKT_IOCTL bit.
+ When packet mode is turned on in the pty, and the EXTPROC bit
+ is set, then whenever the state of the pty is changed, the
+ next read on the master side of the pty will have the TIOCPKT_IOCTL
+ bit set. This allows the process on the server side of the pty
+ to know when the state of the terminal has changed; it can then
+ issue the appropriate ioctl to retrieve the new state.
+
+Since the original BSD patches accompanied the source code for telnet
+I've left that reference here, but obviously the feature is useful for
+any remote terminal protocol, including ssh.
+
+The corresponding feature has existed in the BSD tty driver since 1989.
+For historical reference, a good copy of the relevant files can be found
+here:
+
+http://anonsvn.mit.edu/viewvc/krb5/trunk/src/appl/telnet/?pathrev=17741
+
+Signed-off-by: Howard Chu <hyc@symas.com>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ arch/alpha/include/asm/ioctls.h | 2 ++
+ arch/alpha/include/asm/termbits.h | 1 +
+ arch/arm/include/asm/ioctls.h | 2 ++
+ arch/arm/include/asm/termbits.h | 1 +
+ arch/avr32/include/asm/ioctls.h | 2 ++
+ arch/avr32/include/asm/termbits.h | 1 +
+ arch/cris/include/asm/ioctls.h | 2 ++
+ arch/cris/include/asm/termbits.h | 1 +
+ arch/frv/include/asm/ioctls.h | 2 ++
+ arch/frv/include/asm/termbits.h | 1 +
+ arch/h8300/include/asm/ioctls.h | 2 ++
+ arch/h8300/include/asm/termbits.h | 1 +
+ arch/ia64/include/asm/ioctls.h | 2 ++
+ arch/ia64/include/asm/termbits.h | 1 +
+ arch/m32r/include/asm/ioctls.h | 2 ++
+ arch/m32r/include/asm/termbits.h | 1 +
+ arch/m68k/include/asm/ioctls.h | 2 ++
+ arch/m68k/include/asm/termbits.h | 1 +
+ arch/mips/include/asm/ioctls.h | 3 ++-
+ arch/mips/include/asm/termbits.h | 1 +
+ arch/mn10300/include/asm/ioctls.h | 2 ++
+ arch/mn10300/include/asm/termbits.h | 1 +
+ arch/parisc/include/asm/ioctls.h | 2 ++
+ arch/parisc/include/asm/termbits.h | 1 +
+ arch/powerpc/include/asm/ioctls.h | 2 ++
+ arch/powerpc/include/asm/termbits.h | 1 +
+ arch/s390/include/asm/ioctls.h | 2 ++
+ arch/sh/include/asm/ioctls.h | 2 ++
+ arch/sparc/include/asm/ioctls.h | 2 ++
+ arch/sparc/include/asm/termbits.h | 1 +
+ arch/xtensa/include/asm/ioctls.h | 2 ++
+ arch/xtensa/include/asm/termbits.h | 1 +
+ drivers/char/n_tty.c | 17 ++++++++++++++---
+ drivers/char/pty.c | 21 +++++++++++++++++++++
+ drivers/char/tty_ioctl.c | 18 ++++++++++++------
+ fs/compat_ioctl.c | 1 +
+ include/asm-generic/ioctls.h | 2 ++
+ include/asm-generic/termbits.h | 1 +
+ include/linux/tty.h | 1 +
+ 39 files changed, 101 insertions(+), 10 deletions(-)
+
+--- a/arch/alpha/include/asm/ioctls.h
++++ b/arch/alpha/include/asm/ioctls.h
+@@ -80,6 +80,7 @@
+ # define TIOCPKT_START 8
+ # define TIOCPKT_NOSTOP 16
+ # define TIOCPKT_DOSTOP 32
++# define TIOCPKT_IOCTL 64
+
+
+ #define TIOCNOTTY 0x5422
+@@ -91,6 +92,7 @@
+ #define TIOCGSID 0x5429 /* Return the session ID of FD */
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define TIOCSERCONFIG 0x5453
+ #define TIOCSERGWILD 0x5454
+--- a/arch/alpha/include/asm/termbits.h
++++ b/arch/alpha/include/asm/termbits.h
+@@ -180,6 +180,7 @@ struct ktermios {
+ #define FLUSHO 0x00800000
+ #define PENDIN 0x20000000
+ #define IEXTEN 0x00000400
++#define EXTPROC 0x10000000
+
+ /* Values for the ACTION argument to `tcflow'. */
+ #define TCOOFF 0
+--- a/arch/arm/include/asm/ioctls.h
++++ b/arch/arm/include/asm/ioctls.h
+@@ -52,6 +52,7 @@
+ #define TCSETSF2 _IOW('T',0x2D, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define TIOCGRS485 0x542E
+ #define TIOCSRS485 0x542F
+@@ -81,6 +82,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/arch/arm/include/asm/termbits.h
++++ b/arch/arm/include/asm/termbits.h
+@@ -177,6 +177,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+ /* tcflow() and TCXONC use these */
+ #define TCOOFF 0
+--- a/arch/avr32/include/asm/ioctls.h
++++ b/arch/avr32/include/asm/ioctls.h
+@@ -53,6 +53,7 @@
+ #define TCSETSF2 _IOW('T',0x2D, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define FIONCLEX 0x5450
+ #define FIOCLEX 0x5451
+@@ -79,6 +80,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/arch/avr32/include/asm/termbits.h
++++ b/arch/avr32/include/asm/termbits.h
+@@ -175,6 +175,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+ /* tcflow() and TCXONC use these */
+ #define TCOOFF 0
+--- a/arch/cris/include/asm/ioctls.h
++++ b/arch/cris/include/asm/ioctls.h
+@@ -54,6 +54,7 @@
+ #define TCSETSF2 _IOW('T',0x2D, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
+ #define FIOCLEX 0x5451
+@@ -84,6 +85,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/arch/cris/include/asm/termbits.h
++++ b/arch/cris/include/asm/termbits.h
+@@ -214,6 +214,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+ /* tcflow() and TCXONC use these */
+ #define TCOOFF 0
+--- a/arch/frv/include/asm/ioctls.h
++++ b/arch/frv/include/asm/ioctls.h
+@@ -53,6 +53,7 @@
+ #define TCSETSF2 _IOW('T',0x2D, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
+ #define FIOCLEX 0x5451
+@@ -79,6 +80,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/arch/frv/include/asm/termbits.h
++++ b/arch/frv/include/asm/termbits.h
+@@ -180,6 +180,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+
+ /* tcflow() and TCXONC use these */
+--- a/arch/h8300/include/asm/ioctls.h
++++ b/arch/h8300/include/asm/ioctls.h
+@@ -53,6 +53,7 @@
+ #define TCSETSF2 _IOW('T',0x2D, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
+ #define FIOCLEX 0x5451
+@@ -79,6 +80,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/arch/h8300/include/asm/termbits.h
++++ b/arch/h8300/include/asm/termbits.h
+@@ -179,6 +179,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+
+ /* tcflow() and TCXONC use these */
+--- a/arch/ia64/include/asm/ioctls.h
++++ b/arch/ia64/include/asm/ioctls.h
+@@ -59,6 +59,7 @@
+ #define TCSETSF2 _IOW('T',0x2D, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
+ #define FIOCLEX 0x5451
+@@ -85,6 +86,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/arch/ia64/include/asm/termbits.h
++++ b/arch/ia64/include/asm/termbits.h
+@@ -187,6 +187,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+ /* tcflow() and TCXONC use these */
+ #define TCOOFF 0
+--- a/arch/m32r/include/asm/ioctls.h
++++ b/arch/m32r/include/asm/ioctls.h
+@@ -53,6 +53,7 @@
+ #define TCSETSF2 _IOW('T',0x2D, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define FIONCLEX 0x5450
+ #define FIOCLEX 0x5451
+@@ -79,6 +80,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/arch/m32r/include/asm/termbits.h
++++ b/arch/m32r/include/asm/termbits.h
+@@ -179,6 +179,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+ /* tcflow() and TCXONC use these */
+ #define TCOOFF 0
+--- a/arch/m68k/include/asm/ioctls.h
++++ b/arch/m68k/include/asm/ioctls.h
+@@ -52,6 +52,7 @@
+ #define TCSETSF2 _IOW('T',0x2D, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
+ #define FIOCLEX 0x5451
+@@ -78,6 +79,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/arch/m68k/include/asm/termbits.h
++++ b/arch/m68k/include/asm/termbits.h
+@@ -179,6 +179,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+
+ /* tcflow() and TCXONC use these */
+--- a/arch/mips/include/asm/ioctls.h
++++ b/arch/mips/include/asm/ioctls.h
+@@ -41,7 +41,7 @@
+ #define TIOCPKT_START 0x08 /* start output */
+ #define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
+ #define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
+-/* #define TIOCPKT_IOCTL 0x40 state change of pty driver */
++#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */
+ #define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
+ #define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
+ #define TIOCNOTTY 0x5471 /* void tty association */
+@@ -83,6 +83,7 @@
+ #define TCSETSF2 _IOW('T', 0x2D, struct termios2)
+ #define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T', 0x36, int) /* Generate signal on Pty slave */
+
+ /* I hope the range from 0x5480 on is free ... */
+ #define TIOCSCTTY 0x5480 /* become controlling tty */
+--- a/arch/mips/include/asm/termbits.h
++++ b/arch/mips/include/asm/termbits.h
+@@ -203,6 +203,7 @@ struct ktermios {
+ #define PENDIN 0040000 /* Retype pending input (state). */
+ #define TOSTOP 0100000 /* Send SIGTTOU for background output. */
+ #define ITOSTOP TOSTOP
++#define EXTPROC 0200000 /* External processing on pty */
+
+ /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+--- a/arch/mn10300/include/asm/ioctls.h
++++ b/arch/mn10300/include/asm/ioctls.h
+@@ -54,6 +54,7 @@
+ #define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number
+ * (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T', 0x36, int) /* Generate signal on Pty slave */
+
+ #define FIONCLEX 0x5450
+ #define FIOCLEX 0x5451
+@@ -80,6 +81,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/arch/mn10300/include/asm/termbits.h
++++ b/arch/mn10300/include/asm/termbits.h
+@@ -180,6 +180,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+ /* tcflow() and TCXONC use these */
+ #define TCOOFF 0
+--- a/arch/parisc/include/asm/ioctls.h
++++ b/arch/parisc/include/asm/ioctls.h
+@@ -52,6 +52,7 @@
+ #define TCSETSF2 _IOW('T',0x2D, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
+ #define FIOCLEX 0x5451
+@@ -82,6 +83,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/arch/parisc/include/asm/termbits.h
++++ b/arch/parisc/include/asm/termbits.h
+@@ -180,6 +180,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+ /* tcflow() and TCXONC use these */
+ #define TCOOFF 0
+--- a/arch/powerpc/include/asm/ioctls.h
++++ b/arch/powerpc/include/asm/ioctls.h
+@@ -80,6 +80,7 @@
+ # define TIOCPKT_START 8
+ # define TIOCPKT_NOSTOP 16
+ # define TIOCPKT_DOSTOP 32
++# define TIOCPKT_IOCTL 64
+
+
+ #define TIOCNOTTY 0x5422
+@@ -93,6 +94,7 @@
+ #define TIOCSRS485 0x542f
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define TIOCSERCONFIG 0x5453
+ #define TIOCSERGWILD 0x5454
+--- a/arch/powerpc/include/asm/termbits.h
++++ b/arch/powerpc/include/asm/termbits.h
+@@ -189,6 +189,7 @@ struct ktermios {
+ #define FLUSHO 0x00800000
+ #define PENDIN 0x20000000
+ #define IEXTEN 0x00000400
++#define EXTPROC 0x10000000
+
+ /* Values for the ACTION argument to `tcflow'. */
+ #define TCOOFF 0
+--- a/arch/s390/include/asm/ioctls.h
++++ b/arch/s390/include/asm/ioctls.h
+@@ -60,6 +60,7 @@
+ #define TCSETSF2 _IOW('T',0x2D, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
+ #define FIOCLEX 0x5451
+@@ -86,6 +87,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/arch/sh/include/asm/ioctls.h
++++ b/arch/sh/include/asm/ioctls.h
+@@ -69,6 +69,7 @@
+ # define TIOCPKT_START 8
+ # define TIOCPKT_NOSTOP 16
+ # define TIOCPKT_DOSTOP 32
++# define TIOCPKT_IOCTL 64
+
+
+ #define TIOCNOTTY _IO('T', 34) /* 0x5422 */
+@@ -84,6 +85,7 @@
+ #define TCSETSF2 _IOW('T', 45, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define TIOCSERCONFIG _IO('T', 83) /* 0x5453 */
+ #define TIOCSERGWILD _IOR('T', 84, int) /* 0x5454 */
+--- a/arch/sparc/include/asm/ioctls.h
++++ b/arch/sparc/include/asm/ioctls.h
+@@ -80,6 +80,7 @@
+ /* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */
+ #define TIOCGPTN _IOR('t', 134, unsigned int) /* Get Pty Number */
+ #define TIOCSPTLCK _IOW('t', 135, int) /* Lock/unlock PTY */
++#define TIOCSIG _IOW('t', 136, int) /* Generate signal on Pty slave */
+
+ /* Little f */
+ #define FIOCLEX _IO('f', 1)
+@@ -132,5 +133,6 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #endif /* !(_ASM_SPARC_IOCTLS_H) */
+--- a/arch/sparc/include/asm/termbits.h
++++ b/arch/sparc/include/asm/termbits.h
+@@ -225,6 +225,7 @@ struct ktermios {
+ #define FLUSHO 0x00002000
+ #define PENDIN 0x00004000
+ #define IEXTEN 0x00008000
++#define EXTPROC 0x00010000
+
+ /* modem lines */
+ #define TIOCM_LE 0x001
+--- a/arch/xtensa/include/asm/ioctls.h
++++ b/arch/xtensa/include/asm/ioctls.h
+@@ -81,6 +81,7 @@
+ # define TIOCPKT_START 8
+ # define TIOCPKT_NOSTOP 16
+ # define TIOCPKT_DOSTOP 32
++# define TIOCPKT_IOCTL 64
+
+
+ #define TIOCNOTTY _IO('T', 34)
+@@ -97,6 +98,7 @@
+ #define TCSETSF2 _IOW('T', 45, struct termios2)
+ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
++#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
+
+ #define TIOCSERCONFIG _IO('T', 83)
+ #define TIOCSERGWILD _IOR('T', 84, int)
+--- a/arch/xtensa/include/asm/termbits.h
++++ b/arch/xtensa/include/asm/termbits.h
+@@ -196,6 +196,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+ /* tcflow() and TCXONC use these */
+
+--- a/drivers/char/n_tty.c
++++ b/drivers/char/n_tty.c
+@@ -1102,6 +1102,11 @@ static inline void n_tty_receive_char(st
+ if (I_IUCLC(tty) && L_IEXTEN(tty))
+ c = tolower(c);
+
++ if (L_EXTPROC(tty)) {
++ put_tty_queue(c, tty);
++ return;
++ }
++
+ if (tty->stopped && !tty->flow_stopped && I_IXON(tty) &&
+ I_IXANY(tty) && c != START_CHAR(tty) && c != STOP_CHAR(tty) &&
+ c != INTR_CHAR(tty) && c != QUIT_CHAR(tty) && c != SUSP_CHAR(tty)) {
+@@ -1409,7 +1414,8 @@ static void n_tty_receive_buf(struct tty
+
+ n_tty_set_room(tty);
+
+- if (!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) {
++ if ((!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) ||
++ L_EXTPROC(tty)) {
+ kill_fasync(&tty->fasync, SIGIO, POLL_IN);
+ if (waitqueue_active(&tty->read_wait))
+ wake_up_interruptible(&tty->read_wait);
+@@ -1585,7 +1591,7 @@ static int n_tty_open(struct tty_struct
+ static inline int input_available_p(struct tty_struct *tty, int amt)
+ {
+ tty_flush_to_ldisc(tty);
+- if (tty->icanon) {
++ if (tty->icanon && !L_EXTPROC(tty)) {
+ if (tty->canon_data)
+ return 1;
+ } else if (tty->read_cnt >= (amt ? amt : 1))
+@@ -1632,6 +1638,11 @@ static int copy_from_read_buf(struct tty
+ spin_lock_irqsave(&tty->read_lock, flags);
+ tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1);
+ tty->read_cnt -= n;
++ /* Turn single EOF into zero-length read */
++ if (L_EXTPROC(tty) && tty->icanon && n == 1) {
++ if (!tty->read_cnt && (*b)[n-1] == EOF_CHAR(tty))
++ n--;
++ }
+ spin_unlock_irqrestore(&tty->read_lock, flags);
+ *b += n;
+ *nr -= n;
+@@ -1812,7 +1823,7 @@ do_it_again:
+ nr--;
+ }
+
+- if (tty->icanon) {
++ if (tty->icanon && !L_EXTPROC(tty)) {
+ /* N.B. avoid overrun if nr == 0 */
+ while (nr && tty->read_cnt) {
+ int eol;
+--- a/drivers/char/pty.c
++++ b/drivers/char/pty.c
+@@ -171,6 +171,23 @@ static int pty_set_lock(struct tty_struc
+ return 0;
+ }
+
++/* Send a signal to the slave */
++static int pty_signal(struct tty_struct *tty, int sig)
++{
++ unsigned long flags;
++ struct pid *pgrp;
++
++ if (tty->link) {
++ spin_lock_irqsave(&tty->link->ctrl_lock, flags);
++ pgrp = get_pid(tty->link->pgrp);
++ spin_unlock_irqrestore(&tty->link->ctrl_lock, flags);
++
++ kill_pgrp(pgrp, sig, 1);
++ put_pid(pgrp);
++ }
++ return 0;
++}
++
+ static void pty_flush_buffer(struct tty_struct *tty)
+ {
+ struct tty_struct *to = tty->link;
+@@ -321,6 +338,8 @@ static int pty_bsd_ioctl(struct tty_stru
+ switch (cmd) {
+ case TIOCSPTLCK: /* Set PT Lock (disallow slave open) */
+ return pty_set_lock(tty, (int __user *) arg);
++ case TIOCSIG: /* Send signal to other side of pty */
++ return pty_signal(tty, (int) arg);
+ }
+ return -ENOIOCTLCMD;
+ }
+@@ -476,6 +495,8 @@ static int pty_unix98_ioctl(struct tty_s
+ return pty_set_lock(tty, (int __user *)arg);
+ case TIOCGPTN: /* Get PT Number */
+ return put_user(tty->index, (unsigned int __user *)arg);
++ case TIOCSIG: /* Send signal to other side of pty */
++ return pty_signal(tty, (int) arg);
+ }
+
+ return -ENOIOCTLCMD;
+--- a/drivers/char/tty_ioctl.c
++++ b/drivers/char/tty_ioctl.c
+@@ -517,19 +517,25 @@ static void change_termios(struct tty_st
+
+ /* See if packet mode change of state. */
+ if (tty->link && tty->link->packet) {
++ int extproc = (old_termios.c_lflag & EXTPROC) |
++ (tty->termios->c_lflag & EXTPROC);
+ int old_flow = ((old_termios.c_iflag & IXON) &&
+ (old_termios.c_cc[VSTOP] == '\023') &&
+ (old_termios.c_cc[VSTART] == '\021'));
+ int new_flow = (I_IXON(tty) &&
+ STOP_CHAR(tty) == '\023' &&
+ START_CHAR(tty) == '\021');
+- if (old_flow != new_flow) {
++ if ((old_flow != new_flow) || extproc) {
+ spin_lock_irqsave(&tty->ctrl_lock, flags);
+- tty->ctrl_status &= ~(TIOCPKT_DOSTOP | TIOCPKT_NOSTOP);
+- if (new_flow)
+- tty->ctrl_status |= TIOCPKT_DOSTOP;
+- else
+- tty->ctrl_status |= TIOCPKT_NOSTOP;
++ if (old_flow != new_flow) {
++ tty->ctrl_status &= ~(TIOCPKT_DOSTOP | TIOCPKT_NOSTOP);
++ if (new_flow)
++ tty->ctrl_status |= TIOCPKT_DOSTOP;
++ else
++ tty->ctrl_status |= TIOCPKT_NOSTOP;
++ }
++ if (extproc)
++ tty->ctrl_status |= TIOCPKT_IOCTL;
+ spin_unlock_irqrestore(&tty->ctrl_lock, flags);
+ wake_up_interruptible(&tty->link->read_wait);
+ }
+--- a/fs/compat_ioctl.c
++++ b/fs/compat_ioctl.c
+@@ -966,6 +966,7 @@ COMPATIBLE_IOCTL(TIOCGPGRP)
+ COMPATIBLE_IOCTL(TIOCGPTN)
+ COMPATIBLE_IOCTL(TIOCSPTLCK)
+ COMPATIBLE_IOCTL(TIOCSERGETLSR)
++COMPATIBLE_IOCTL(TIOCSIG)
+ #ifdef TCGETS2
+ COMPATIBLE_IOCTL(TCGETS2)
+ COMPATIBLE_IOCTL(TCSETS2)
+--- a/include/asm-generic/ioctls.h
++++ b/include/asm-generic/ioctls.h
+@@ -69,6 +69,7 @@
+ #define TCSETX 0x5433
+ #define TCSETXF 0x5434
+ #define TCSETXW 0x5435
++#define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */
+
+ #define FIONCLEX 0x5450
+ #define FIOCLEX 0x5451
+@@ -102,6 +103,7 @@
+ #define TIOCPKT_START 8
+ #define TIOCPKT_NOSTOP 16
+ #define TIOCPKT_DOSTOP 32
++#define TIOCPKT_IOCTL 64
+
+ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+--- a/include/asm-generic/termbits.h
++++ b/include/asm-generic/termbits.h
+@@ -178,6 +178,7 @@ struct ktermios {
+ #define FLUSHO 0010000
+ #define PENDIN 0040000
+ #define IEXTEN 0100000
++#define EXTPROC 0200000
+
+ /* tcflow() and TCXONC use these */
+ #define TCOOFF 0
+--- a/include/linux/tty.h
++++ b/include/linux/tty.h
+@@ -179,6 +179,7 @@ struct tty_bufhead {
+ #define L_FLUSHO(tty) _L_FLAG((tty), FLUSHO)
+ #define L_PENDIN(tty) _L_FLAG((tty), PENDIN)
+ #define L_IEXTEN(tty) _L_FLAG((tty), IEXTEN)
++#define L_EXTPROC(tty) _L_FLAG((tty), EXTPROC)
+
+ struct device;
+ struct signal_struct;
diff --git a/tty/tty-implement-btm-as-mutex-instead-of-bkl.patch b/tty/tty-implement-btm-as-mutex-instead-of-bkl.patch
index ce84ae064e6b9a..e8e84b2cb1f629 100644
--- a/tty/tty-implement-btm-as-mutex-instead-of-bkl.patch
+++ b/tty/tty-implement-btm-as-mutex-instead-of-bkl.patch
@@ -95,7 +95,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+EXPORT_SYMBOL(tty_unlock);
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
-@@ -574,7 +574,14 @@ extern int vt_ioctl(struct tty_struct *t
+@@ -575,7 +575,14 @@ extern int vt_ioctl(struct tty_struct *t
extern long vt_compat_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned long arg);
@@ -110,7 +110,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
static inline void tty_lock(void) __acquires(kernel_lock)
{
#ifdef CONFIG_LOCK_KERNEL
-@@ -588,6 +595,7 @@ static inline void tty_unlock(void) __re
+@@ -589,6 +596,7 @@ static inline void tty_unlock(void) __re
unlock_kernel();
}
#define tty_locked() (kernel_locked())
diff --git a/tty/tty-introduce-wait_event_interruptible_tty.patch b/tty/tty-introduce-wait_event_interruptible_tty.patch
index 9ae7196530b725..589911f42bf028 100644
--- a/tty/tty-introduce-wait_event_interruptible_tty.patch
+++ b/tty/tty-introduce-wait_event_interruptible_tty.patch
@@ -155,7 +155,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return ((info->flags & ASYNC_HUP_NOTIFY) ?
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
-@@ -603,5 +603,47 @@ static inline void tty_unlock(void) __re
+@@ -604,5 +604,47 @@ static inline void tty_unlock(void) __re
}
#define tty_locked() (kernel_locked())
diff --git a/tty/tty-make-vt-s-have-a-tty_port.patch b/tty/tty-make-vt-s-have-a-tty_port.patch
index 2ae2becfbe6431..a2dfcc2caf8268 100644
--- a/tty/tty-make-vt-s-have-a-tty_port.patch
+++ b/tty/tty-make-vt-s-have-a-tty_port.patch
@@ -24,7 +24,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
-@@ -773,6 +773,7 @@ int vc_allocate(unsigned int currcons) /
+@@ -777,6 +777,7 @@ int vc_allocate(unsigned int currcons) /
if (!vc)
return -ENOMEM;
vc_cons[currcons].d = vc;
@@ -32,7 +32,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
visual_init(vc, currcons, 1);
if (!*vc->vc_uni_pagedir_loc)
-@@ -2910,6 +2911,7 @@ static int __init con_init(void)
+@@ -2914,6 +2915,7 @@ static int __init con_init(void)
for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) {
vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), GFP_NOWAIT);
INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
diff --git a/tty/tty-move-the-vt_tty-field-from-the-vc_data-into-the-standard-tty_port.patch b/tty/tty-move-the-vt_tty-field-from-the-vc_data-into-the-standard-tty_port.patch
index 47781353c35c88..db74155d7ef2af 100644
--- a/tty/tty-move-the-vt_tty-field-from-the-vc_data-into-the-standard-tty_port.patch
+++ b/tty/tty-move-the-vt_tty-field-from-the-vc_data-into-the-standard-tty_port.patch
@@ -72,7 +72,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/* No driver data? Strange. Okay we fix it then. */
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
-@@ -962,12 +962,12 @@ static int vc_do_resize(struct tty_struc
+@@ -966,12 +966,12 @@ static int vc_do_resize(struct tty_struc
* Resize a virtual console as seen from the console end of things. We
* use the common vc_do_resize methods to update the structures. The
* caller must hold the console sem to protect console internals and
@@ -87,7 +87,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
}
/**
-@@ -2796,12 +2796,12 @@ static int con_open(struct tty_struct *t
+@@ -2800,12 +2800,12 @@ static int con_open(struct tty_struct *t
struct vc_data *vc = vc_cons[currcons].d;
/* Still being freed */
@@ -102,7 +102,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
if (!tty->winsize.ws_row && !tty->winsize.ws_col) {
tty->winsize.ws_row = vc_cons[currcons].d->vc_rows;
-@@ -2829,7 +2829,7 @@ static void con_shutdown(struct tty_stru
+@@ -2833,7 +2833,7 @@ static void con_shutdown(struct tty_stru
struct vc_data *vc = tty->driver_data;
BUG_ON(vc == NULL);
acquire_console_sem();
diff --git a/tty/tty-never-hold-btm-while-getting-tty_mutex.patch b/tty/tty-never-hold-btm-while-getting-tty_mutex.patch
index 568d2747ee81ca..3b48e01bb8701c 100644
--- a/tty/tty-never-hold-btm-while-getting-tty_mutex.patch
+++ b/tty/tty-never-hold-btm-while-getting-tty_mutex.patch
@@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
-@@ -626,7 +626,7 @@ static const struct tty_operations pty_u
+@@ -647,7 +647,7 @@ static const struct tty_operations pty_u
* allocated_ptys_lock handles the list of free pty numbers
*/
@@ -34,7 +34,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
{
struct tty_struct *tty;
int retval;
-@@ -635,11 +635,14 @@ static int __ptmx_open(struct inode *ino
+@@ -656,11 +656,14 @@ static int __ptmx_open(struct inode *ino
nonseekable_open(inode, filp);
/* find a device that is not in use. */
@@ -49,7 +49,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
tty = tty_init_dev(ptm_driver, index, 1);
mutex_unlock(&tty_mutex);
-@@ -657,24 +660,19 @@ static int __ptmx_open(struct inode *ino
+@@ -678,24 +681,19 @@ static int __ptmx_open(struct inode *ino
goto out1;
retval = ptm_driver->ops->open(tty, filp);
diff --git a/tty/tty-remove-tty_lock_nested.patch b/tty/tty-remove-tty_lock_nested.patch
index 544676d2f12f76..43e79d5bfed07e 100644
--- a/tty/tty-remove-tty_lock_nested.patch
+++ b/tty/tty-remove-tty_lock_nested.patch
@@ -187,7 +187,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return 0;
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
-@@ -416,6 +416,7 @@ extern int is_ignored(int sig);
+@@ -417,6 +417,7 @@ extern int is_ignored(int sig);
extern int tty_signal(int sig, struct tty_struct *tty);
extern void tty_hangup(struct tty_struct *tty);
extern void tty_vhangup(struct tty_struct *tty);
@@ -195,7 +195,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
extern void tty_vhangup_self(void);
extern void tty_unhangup(struct file *filp);
extern int tty_hung_up_p(struct file *filp);
-@@ -574,21 +575,6 @@ extern long vt_compat_ioctl(struct tty_s
+@@ -575,21 +576,6 @@ extern long vt_compat_ioctl(struct tty_s
unsigned int cmd, unsigned long arg);
/* functions for preparation of BKL removal */
diff --git a/tty/tty-replace-bkl-with-a-new-tty_lock.patch b/tty/tty-replace-bkl-with-a-new-tty_lock.patch
index 2f262e2222f876..882497813118f7 100644
--- a/tty/tty-replace-bkl-with-a-new-tty_lock.patch
+++ b/tty/tty-replace-bkl-with-a-new-tty_lock.patch
@@ -236,7 +236,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
}
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
-@@ -671,9 +671,9 @@ static int ptmx_open(struct inode *inode
+@@ -692,9 +692,9 @@ static int ptmx_open(struct inode *inode
{
int ret;
@@ -1003,7 +1003,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
#include <asm/system.h>
-@@ -572,5 +573,35 @@ extern int vt_ioctl(struct tty_struct *t
+@@ -573,5 +574,35 @@ extern int vt_ioctl(struct tty_struct *t
extern long vt_compat_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned long arg);
diff --git a/tty/vc-locking-clean-up.patch b/tty/vc-locking-clean-up.patch
index 866122ce1597f2..3d3b26c0e0ed81 100644
--- a/tty/vc-locking-clean-up.patch
+++ b/tty/vc-locking-clean-up.patch
@@ -62,7 +62,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
scrollback_delta += lines;
schedule_console_callback();
}
-@@ -2605,8 +2609,6 @@ int tioclinux(struct tty_struct *tty, un
+@@ -2609,8 +2613,6 @@ int tioclinux(struct tty_struct *tty, un
return -EFAULT;
ret = 0;
@@ -71,7 +71,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
switch (type)
{
case TIOCL_SETSEL:
-@@ -2681,7 +2683,6 @@ int tioclinux(struct tty_struct *tty, un
+@@ -2685,7 +2687,6 @@ int tioclinux(struct tty_struct *tty, un
ret = -EINVAL;
break;
}
diff --git a/tty/vt-console-try-harder-to-print-output-when-panicing.patch b/tty/vt-console-try-harder-to-print-output-when-panicing.patch
new file mode 100644
index 00000000000000..a49fd99fd922f2
--- /dev/null
+++ b/tty/vt-console-try-harder-to-print-output-when-panicing.patch
@@ -0,0 +1,192 @@
+From akpm@linux-foundation.org Thu Jun 24 14:36:12 2010
+From: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date: Wed, 23 Jun 2010 12:56:12 -0700
+Subject: vt/console: try harder to print output when panicing
+To: mm-commits@vger.kernel.org
+Cc: jbarnes@virtuousgeek.org, airlied@redhat.com, alan@lxorguk.ukuu.org.uk, greg@kroah.com, jsimmons@infradead.org
+Message-ID: <201006231956.o5NJuC9U028343@imap1.linux-foundation.org>
+
+From: Jesse Barnes <jbarnes@virtuousgeek.org>
+
+Jesse's initial patch commit said:
+
+"At panic time (i.e. when oops_in_progress is set) we should try a bit
+harder to update the screen and make sure output gets to the VT, since
+some drivers are capable of flipping back to it.
+
+So make sure we try to unblank and update the display if called from a
+panic context."
+
+I've enhanced this to add a flag to the vc that console layer can set to
+indicate they want this behaviour to occur. This also adds support to
+fbcon for that flag and adds an fb flag for drivers to indicate they want
+to use the support. It enables this for KMS drivers.
+
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
+Acked-by: James Simmons <jsimmons@infradead.org>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/char/vt.c | 13 +++++++++----
+ drivers/gpu/drm/i915/intel_fb.c | 4 +---
+ drivers/gpu/drm/nouveau/nouveau_fbcon.c | 1 +
+ drivers/gpu/drm/radeon/radeon_fb.c | 2 +-
+ drivers/video/console/fbcon.c | 4 +++-
+ include/linux/console_struct.h | 1 +
+ include/linux/fb.h | 4 ++++
+ include/linux/vt_kern.h | 7 +++++++
+ 8 files changed, 27 insertions(+), 9 deletions(-)
+
+--- a/drivers/char/vt.c
++++ b/drivers/char/vt.c
+@@ -699,7 +699,10 @@ void redraw_screen(struct vc_data *vc, i
+ update_attr(vc);
+ clear_buffer_attributes(vc);
+ }
+- if (update && vc->vc_mode != KD_GRAPHICS)
++
++ /* Forcibly update if we're panicing */
++ if ((update && vc->vc_mode != KD_GRAPHICS) ||
++ vt_force_oops_output(vc))
+ do_update_region(vc, vc->vc_origin, vc->vc_screenbuf_size / 2);
+ }
+ set_cursor(vc);
+@@ -737,6 +740,7 @@ static void visual_init(struct vc_data *
+ vc->vc_hi_font_mask = 0;
+ vc->vc_complement_mask = 0;
+ vc->vc_can_do_color = 0;
++ vc->vc_panic_force_write = false;
+ vc->vc_sw->con_init(vc, init);
+ if (!vc->vc_complement_mask)
+ vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
+@@ -2499,7 +2503,7 @@ static void vt_console_print(struct cons
+ goto quit;
+ }
+
+- if (vc->vc_mode != KD_TEXT)
++ if (vc->vc_mode != KD_TEXT && !vt_force_oops_output(vc))
+ goto quit;
+
+ /* undraw cursor first */
+@@ -3704,7 +3708,8 @@ void do_unblank_screen(int leaving_gfx)
+ return;
+ }
+ vc = vc_cons[fg_console].d;
+- if (vc->vc_mode != KD_TEXT)
++ /* Try to unblank in oops case too */
++ if (vc->vc_mode != KD_TEXT && !vt_force_oops_output(vc))
+ return; /* but leave console_blanked != 0 */
+
+ if (blankinterval) {
+@@ -3713,7 +3718,7 @@ void do_unblank_screen(int leaving_gfx)
+ }
+
+ console_blanked = 0;
+- if (vc->vc_sw->con_blank(vc, 0, leaving_gfx))
++ if (vc->vc_sw->con_blank(vc, 0, leaving_gfx) || vt_force_oops_output(vc))
+ /* Low-level driver cannot restore -> do it ourselves */
+ update_screen(vc);
+ if (console_blank_hook)
+--- a/drivers/gpu/drm/i915/intel_fb.c
++++ b/drivers/gpu/drm/i915/intel_fb.c
+@@ -128,7 +128,7 @@ static int intelfb_create(struct intel_f
+
+ strcpy(info->fix.id, "inteldrmfb");
+
+- info->flags = FBINFO_DEFAULT;
++ info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
+ info->fbops = &intelfb_ops;
+
+ /* setup aperture base/size for vesafb takeover */
+@@ -146,8 +146,6 @@ static int intelfb_create(struct intel_f
+ info->fix.smem_start = dev->mode_config.fb_base + obj_priv->gtt_offset;
+ info->fix.smem_len = size;
+
+- info->flags = FBINFO_DEFAULT;
+-
+ info->screen_base = ioremap_wc(dev->agp->base + obj_priv->gtt_offset,
+ size);
+ if (!info->screen_base) {
+--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
++++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+@@ -250,6 +250,7 @@ nouveau_fbcon_create(struct nouveau_fbde
+ info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA |
+ FBINFO_HWACCEL_FILLRECT |
+ FBINFO_HWACCEL_IMAGEBLIT;
++ info->flags |= FBINFO_CAN_FORCE_OUTPUT;
+ info->fbops = &nouveau_fbcon_ops;
+ info->fix.smem_start = dev->mode_config.fb_base + nvbo->bo.offset -
+ dev_priv->vm_vram_base;
+--- a/drivers/gpu/drm/radeon/radeon_fb.c
++++ b/drivers/gpu/drm/radeon/radeon_fb.c
+@@ -224,7 +224,7 @@ static int radeonfb_create(struct radeon
+
+ drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
+
+- info->flags = FBINFO_DEFAULT;
++ info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
+ info->fbops = &radeonfb_ops;
+
+ tmp = radeon_bo_gpu_offset(rbo) - rdev->mc.vram_start;
+--- a/drivers/video/console/fbcon.c
++++ b/drivers/video/console/fbcon.c
+@@ -283,7 +283,8 @@ static inline int fbcon_is_inactive(stru
+ struct fbcon_ops *ops = info->fbcon_par;
+
+ return (info->state != FBINFO_STATE_RUNNING ||
+- vc->vc_mode != KD_TEXT || ops->graphics);
++ vc->vc_mode != KD_TEXT || ops->graphics) &&
++ !vt_force_oops_output(vc);
+ }
+
+ static inline int get_color(struct vc_data *vc, struct fb_info *info,
+@@ -1073,6 +1074,7 @@ static void fbcon_init(struct vc_data *v
+ if (p->userfont)
+ charcnt = FNTCHARCNT(p->fontdata);
+
++ vc->vc_panic_force_write = !!(info->flags & FBINFO_CAN_FORCE_OUTPUT);
+ vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1);
+ vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
+ if (charcnt == 256) {
+--- a/include/linux/console_struct.h
++++ b/include/linux/console_struct.h
+@@ -105,6 +105,7 @@ struct vc_data {
+ struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
+ unsigned long vc_uni_pagedir;
+ unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
++ bool vc_panic_force_write; /* when oops/panic this VC can accept forced output/blanking */
+ /* additional information is in vt_kern.h */
+ };
+
+--- a/include/linux/fb.h
++++ b/include/linux/fb.h
+@@ -812,6 +812,10 @@ struct fb_tile_ops {
+ */
+ #define FBINFO_BE_MATH 0x100000
+
++/* report to the VT layer that this fb driver can accept forced console
++ output like oopses */
++#define FBINFO_CAN_FORCE_OUTPUT 0x200000
++
+ struct fb_info {
+ int node;
+ int flags;
+--- a/include/linux/vt_kern.h
++++ b/include/linux/vt_kern.h
+@@ -100,6 +100,13 @@ extern int unbind_con_driver(const struc
+ int deflt);
+ int vty_init(const struct file_operations *console_fops);
+
++static inline bool vt_force_oops_output(struct vc_data *vc)
++{
++ if (oops_in_progress && vc->vc_panic_force_write)
++ return true;
++ return false;
++}
++
+ /*
+ * vc_screen.c shares this temporary buffer with the console write code so that
+ * we can easily avoid touching user space while holding the console spinlock.
diff --git a/usb.current/usb-musb-enable-the-maximum-supported-burst-mode-for-dma.patch b/usb.current/usb-musb-enable-the-maximum-supported-burst-mode-for-dma.patch
new file mode 100644
index 00000000000000..e97c95b10ecadf
--- /dev/null
+++ b/usb.current/usb-musb-enable-the-maximum-supported-burst-mode-for-dma.patch
@@ -0,0 +1,53 @@
+From gadiyar@ti.com Thu Jun 24 14:38:20 2010
+From: Hema HK <hemahk@ti.com>
+Date: Thu, 24 Jun 2010 23:07:09 +0530
+Subject: USB: musb: Enable the maximum supported burst mode for DMA
+To: linux-usb@vger.kernel.org
+Cc: Greg KH <gregkh@suse.de>, Felipe Balbi <felipe.balbi@nokia.com>, Ajay Kumar Gupta <ajay.gupta@ti.com>, Hema HK <hemahk@ti.com>, Anand Gadiyar <gadiyar@ti.com>
+Message-ID: <1277401029-13761-5-git-send-email-gadiyar@ti.com>
+
+
+From: Hema HK <hemahk@ti.com>
+
+Setting MUSB Burst Mode 3 automatically enables support for
+lower burst modes (BURST4, BURST8, BURST16 or bursts of unspecified
+length). There is no need to set these burst modes based on the
+packet size. Also enable the burst mode for both mode1 and mode0.
+
+This is a fix for buggy hardware - having the lower burst modes
+enabled can potentially cause lockups of the DMA engine used in
+OMAP2/3/4 chips.
+
+Signed-off-by: Hema HK <hemahk@ti.com>
+Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
+Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
+Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/musb/musbhsdma.c | 13 ++-----------
+ 1 file changed, 2 insertions(+), 11 deletions(-)
+
+--- a/drivers/usb/musb/musbhsdma.c
++++ b/drivers/usb/musb/musbhsdma.c
+@@ -132,18 +132,9 @@ static void configure_channel(struct dma
+ if (mode) {
+ csr |= 1 << MUSB_HSDMA_MODE1_SHIFT;
+ BUG_ON(len < packet_sz);
+-
+- if (packet_sz >= 64) {
+- csr |= MUSB_HSDMA_BURSTMODE_INCR16
+- << MUSB_HSDMA_BURSTMODE_SHIFT;
+- } else if (packet_sz >= 32) {
+- csr |= MUSB_HSDMA_BURSTMODE_INCR8
+- << MUSB_HSDMA_BURSTMODE_SHIFT;
+- } else if (packet_sz >= 16) {
+- csr |= MUSB_HSDMA_BURSTMODE_INCR4
+- << MUSB_HSDMA_BURSTMODE_SHIFT;
+- }
+ }
++ csr |= MUSB_HSDMA_BURSTMODE_INCR16
++ << MUSB_HSDMA_BURSTMODE_SHIFT;
+
+ csr |= (musb_channel->epnum << MUSB_HSDMA_ENDPOINT_SHIFT)
+ | (1 << MUSB_HSDMA_ENABLE_SHIFT)
diff --git a/usb.current/usb-musb-fix-blackfin-ulpi-stubs.patch b/usb.current/usb-musb-fix-blackfin-ulpi-stubs.patch
new file mode 100644
index 00000000000000..a58c456de24a93
--- /dev/null
+++ b/usb.current/usb-musb-fix-blackfin-ulpi-stubs.patch
@@ -0,0 +1,40 @@
+From gadiyar@ti.com Thu Jun 24 14:37:59 2010
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 24 Jun 2010 23:07:08 +0530
+Subject: USB: musb: fix Blackfin ulpi stubs
+To: linux-usb@vger.kernel.org
+Cc: Greg KH <gregkh@suse.de>, Felipe Balbi <felipe.balbi@nokia.com>, Ajay Kumar Gupta <ajay.gupta@ti.com>, Mike Frysinger <vapier@gentoo.org>
+Message-ID: <1277401029-13761-4-git-send-email-gadiyar@ti.com>
+
+
+From: Mike Frysinger <vapier@gentoo.org>
+
+The new ulpi code defines fallback stubs for the Blackfin arch, but does
+so incorrectly leading to a build failure:
+drivers/usb/musb/musb_core.c:227: error: 'musb_ulpi_read' undeclared here (not in a function)
+drivers/usb/musb/musb_core.c:228: error: 'musb_ulpi_write' undeclared here (not in a function)
+
+Tweak the fallback stubs so that they do work as intended.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
+Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/musb/musb_core.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -219,8 +219,8 @@ static int musb_ulpi_write(struct otg_tr
+ return 0;
+ }
+ #else
+-#define musb_ulpi_read(a, b) NULL
+-#define musb_ulpi_write(a, b, c) NULL
++#define musb_ulpi_read NULL
++#define musb_ulpi_write NULL
+ #endif
+
+ static struct otg_io_access_ops musb_ulpi_access = {
diff --git a/usb.current/usb-musb-make-non-omap-platforms-build-with-config_pm-y.patch b/usb.current/usb-musb-make-non-omap-platforms-build-with-config_pm-y.patch
new file mode 100644
index 00000000000000..0d838296eea571
--- /dev/null
+++ b/usb.current/usb-musb-make-non-omap-platforms-build-with-config_pm-y.patch
@@ -0,0 +1,58 @@
+From gadiyar@ti.com Thu Jun 24 14:37:31 2010
+From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
+Date: Thu, 24 Jun 2010 23:07:07 +0530
+Subject: USB: MUSB: make non-OMAP platforms build with CONFIG_PM=y
+To: linux-usb@vger.kernel.org
+Cc: Greg KH <gregkh@suse.de>, Felipe Balbi <felipe.balbi@nokia.com>, Ajay Kumar Gupta <ajay.gupta@ti.com>, Sergei Shtylyov <sshtylyov@ru.mvista.com>
+Message-ID: <1277401029-13761-3-git-send-email-gadiyar@ti.com>
+
+From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
+
+Attempt to build MUSB driver with CONFIG_PM=y (e.g. in the OTG mode) on DaVinci
+results in these link errors:
+
+drivers/built-in.o: In function `musb_restore_context':
+led-triggers.c:(.text+0x714d8): undefined reference to
+`musb_platform_restore_context'
+drivers/built-in.o: In function `musb_save_context':
+led-triggers.c:(.text+0x71788): undefined reference to
+`musb_platform_save_context'
+
+This turned out to be caused by commit 9957dd97ec5e98dd334f87ade1d9a0b24d1f86eb
+(usb: musb: Fix compile error for omaps for musb_hdrc). Revert it, taking into
+account the rename of CONFIG_ARCH_OMAP34XX into CONFIG_ARCH_OMAP3 (which that
+commit fixed in a completely inappropriate way) and the recent addition of
+OMAP4 support.
+
+Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
+Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
+Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/musb/musb_core.h | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/musb/musb_core.h
++++ b/drivers/usb/musb/musb_core.h
+@@ -470,7 +470,8 @@ struct musb_csr_regs {
+
+ struct musb_context_registers {
+
+-#ifdef CONFIG_PM
++#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
++ defined(CONFIG_ARCH_OMAP4)
+ u32 otg_sysconfig, otg_forcestandby;
+ #endif
+ u8 power;
+@@ -484,7 +485,8 @@ struct musb_context_registers {
+ struct musb_csr_regs index_regs[MUSB_C_NUM_EPS];
+ };
+
+-#ifdef CONFIG_PM
++#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
++ defined(CONFIG_ARCH_OMAP4)
+ extern void musb_platform_save_context(struct musb *musb,
+ struct musb_context_registers *musb_context);
+ extern void musb_platform_restore_context(struct musb *musb,
diff --git a/usb.current/usb-musb_core-make-disconnect-and-suspend-interrupts-work-again.patch b/usb.current/usb-musb_core-make-disconnect-and-suspend-interrupts-work-again.patch
new file mode 100644
index 00000000000000..44846b6ce76245
--- /dev/null
+++ b/usb.current/usb-musb_core-make-disconnect-and-suspend-interrupts-work-again.patch
@@ -0,0 +1,48 @@
+From gadiyar@ti.com Thu Jun 24 14:36:43 2010
+From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
+Date: Thu, 24 Jun 2010 23:07:06 +0530
+Subject: USB: musb_core: make disconnect and suspend interrupts work again
+To: linux-usb@vger.kernel.org
+Cc: Greg KH <gregkh@suse.de>, Felipe Balbi <felipe.balbi@nokia.com>, Ajay Kumar Gupta <ajay.gupta@ti.com>, Sergei Shtylyov <sshtylyov@ru.mvista.com>, stable@kernel.org
+Message-ID: <1277401029-13761-2-git-send-email-gadiyar@ti.com>
+
+
+From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
+
+Commit 1c25fda4a09e8229800979986ef399401053b46e (usb: musb: handle irqs in the
+order dictated by programming guide) forgot to get rid of the old 'STAGE0_MASK'
+filter for calling musb_stage0_irq(), so now disconnect and suspend interrupts
+are effectively ignored...
+
+Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
+Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/musb/musb_core.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -451,10 +451,6 @@ void musb_hnp_stop(struct musb *musb)
+ * @param power
+ */
+
+-#define STAGE0_MASK (MUSB_INTR_RESUME | MUSB_INTR_SESSREQ \
+- | MUSB_INTR_VBUSERROR | MUSB_INTR_CONNECT \
+- | MUSB_INTR_RESET)
+-
+ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ u8 devctl, u8 power)
+ {
+@@ -1598,7 +1594,7 @@ irqreturn_t musb_interrupt(struct musb *
+ /* the core can interrupt us for multiple reasons; docs have
+ * a generic interrupt flowchart to follow
+ */
+- if (musb->int_usb & STAGE0_MASK)
++ if (musb->int_usb)
+ retval |= musb_stage0_irq(musb, musb->int_usb,
+ devctl, power);
+
diff --git a/usb.current/usb-obey-the-sysfs-power-wakeup-setting.patch b/usb.current/usb-obey-the-sysfs-power-wakeup-setting.patch
new file mode 100644
index 00000000000000..4e40090dc26da5
--- /dev/null
+++ b/usb.current/usb-obey-the-sysfs-power-wakeup-setting.patch
@@ -0,0 +1,67 @@
+From stern@rowland.harvard.edu Thu Jun 24 14:33:30 2010
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Tue, 22 Jun 2010 16:14:48 -0400 (EDT)
+Subject: USB: obey the sysfs power/wakeup setting
+To: Greg KH <greg@kroah.com>
+Message-ID: <Pine.LNX.4.44L0.1006221603330.1322-100000@iolanthe.rowland.org>
+
+
+This patch (as1403) is a partial reversion of an earlier change
+(commit 5f677f1d45b2bf08085bbba7394392dfa586fa8e "USB: fix remote
+wakeup settings during system sleep"). After hearing from a user, I
+realized that remote wakeup should be enabled during system sleep
+whenever userspace allows it, and not only if a driver requests it
+too.
+
+Indeed, there could be a device with no driver, that does nothing but
+generate a wakeup request when the user presses a button. Such a
+device should be allowed to do its job.
+
+The problem fixed by the earlier patch -- device generating a wakeup
+request for no reason, causing system suspend to abort -- was also
+addressed by a later patch ("USB: don't enable remote wakeup by
+default", accepted but not yet merged into mainline). The device
+won't be able to generate the bogus wakeup requests because it will be
+disabled for remote wakeup by default. Hence this reversion will not
+re-introduce any old problems.
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Cc: stable <stable@kernel.org> [.34]
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ drivers/usb/core/driver.c | 13 +++----------
+ 1 file changed, 3 insertions(+), 10 deletions(-)
+
+--- a/drivers/usb/core/driver.c
++++ b/drivers/usb/core/driver.c
+@@ -1272,8 +1272,7 @@ static int usb_resume_both(struct usb_de
+
+ static void choose_wakeup(struct usb_device *udev, pm_message_t msg)
+ {
+- int w, i;
+- struct usb_interface *intf;
++ int w;
+
+ /* Remote wakeup is needed only when we actually go to sleep.
+ * For things like FREEZE and QUIESCE, if the device is already
+@@ -1285,16 +1284,10 @@ static void choose_wakeup(struct usb_dev
+ return;
+ }
+
+- /* If remote wakeup is permitted, see whether any interface drivers
++ /* Enable remote wakeup if it is allowed, even if no interface drivers
+ * actually want it.
+ */
+- w = 0;
+- if (device_may_wakeup(&udev->dev) && udev->actconfig) {
+- for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
+- intf = udev->actconfig->interface[i];
+- w |= intf->needs_remote_wakeup;
+- }
+- }
++ w = device_may_wakeup(&udev->dev);
+
+ /* If the device is autosuspended with the wrong wakeup setting,
+ * autoresume now so the setting can be changed.
diff --git a/usb/usb-convert-usb_hcd-bitfields-into-atomic-flags.patch b/usb/usb-convert-usb_hcd-bitfields-into-atomic-flags.patch
new file mode 100644
index 00000000000000..85b5fa43045f05
--- /dev/null
+++ b/usb/usb-convert-usb_hcd-bitfields-into-atomic-flags.patch
@@ -0,0 +1,666 @@
+From stern@rowland.harvard.edu Thu Jun 24 14:33:59 2010
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Tue, 22 Jun 2010 16:39:10 -0400 (EDT)
+Subject: USB: convert usb_hcd bitfields into atomic flags
+To: Greg KH <greg@kroah.com>
+Message-ID: <Pine.LNX.4.44L0.1006221637380.1322-100000@iolanthe.rowland.org>
+
+
+This patch (as1393) converts several of the single-bit fields in
+struct usb_hcd to atomic flags. This is for safety's sake; not all
+CPUs can update bitfield values atomically, and these flags are used
+in multiple contexts.
+
+The flag fields that are set only during registration or removal can
+remain as they are, since non-atomic accesses at those times will not
+cause any problems.
+
+(Strictly speaking, the authorized_default flag should become atomic
+as well. I didn't bother with it because it gets changed only via
+sysfs. It can be done later, if anyone wants.)
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/usbip/vhci_hcd.c | 6 +++---
+ drivers/usb/c67x00/c67x00-hcd.c | 4 ++--
+ drivers/usb/core/hcd.c | 26 ++++++++++++--------------
+ drivers/usb/gadget/dummy_hcd.c | 6 +++---
+ drivers/usb/host/ehci-dbg.c | 2 +-
+ drivers/usb/host/ehci-hcd.c | 1 -
+ drivers/usb/host/ehci-hub.c | 2 +-
+ drivers/usb/host/ehci-q.c | 3 +--
+ drivers/usb/host/ehci-sched.c | 9 +++------
+ drivers/usb/host/hwa-hc.c | 4 ++--
+ drivers/usb/host/isp1760-hcd.c | 3 +--
+ drivers/usb/host/ohci-dbg.c | 4 ++--
+ drivers/usb/host/ohci-hcd.c | 6 +++---
+ drivers/usb/host/ohci-hub.c | 16 ++++++++++------
+ drivers/usb/host/oxu210hp-hcd.c | 7 ++-----
+ drivers/usb/host/uhci-hcd.c | 21 ++++++++++++---------
+ drivers/usb/host/uhci-hub.c | 4 ++--
+ drivers/usb/host/whci/hcd.c | 2 +-
+ drivers/usb/host/xhci.c | 3 +--
+ drivers/usb/musb/musb_virthub.c | 2 +-
+ include/linux/usb/hcd.h | 22 +++++++++++++++++-----
+ 21 files changed, 80 insertions(+), 73 deletions(-)
+
+--- a/drivers/staging/usbip/vhci_hcd.c
++++ b/drivers/staging/usbip/vhci_hcd.c
+@@ -215,7 +215,7 @@ static int vhci_hub_status(struct usb_hc
+ vhci = hcd_to_vhci(hcd);
+
+ spin_lock_irqsave(&vhci->lock, flags);
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
++ if (!HCD_HW_ACCESSIBLE(hcd)) {
+ usbip_dbg_vhci_rh("hw accessible flag in on?\n");
+ goto done;
+ }
+@@ -269,7 +269,7 @@ static int vhci_hub_control(struct usb_h
+
+ u32 prev_port_status[VHCI_NPORTS];
+
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
++ if (!HCD_HW_ACCESSIBLE(hcd))
+ return -ETIMEDOUT;
+
+ /*
+@@ -1041,7 +1041,7 @@ static int vhci_bus_resume(struct usb_hc
+ dev_dbg(&hcd->self.root_hub->dev, "%s\n", __func__);
+
+ spin_lock_irq(&vhci->lock);
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
++ if (!HCD_HW_ACCESSIBLE(hcd)) {
+ rc = -ESHUTDOWN;
+ } else {
+ /* vhci->rh_state = DUMMY_RH_RUNNING;
+--- a/drivers/usb/c67x00/c67x00-hcd.c
++++ b/drivers/usb/c67x00/c67x00-hcd.c
+@@ -264,7 +264,7 @@ static void c67x00_hcd_irq(struct c67x00
+ if (unlikely(hcd->state == HC_STATE_HALT))
+ return;
+
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
++ if (!HCD_HW_ACCESSIBLE(hcd))
+ return;
+
+ /* Handle Start of frame events */
+@@ -282,7 +282,7 @@ static int c67x00_hcd_start(struct usb_h
+ {
+ hcd->uses_new_polling = 1;
+ hcd->state = HC_STATE_RUNNING;
+- hcd->poll_rh = 1;
++ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+
+ return 0;
+ }
+--- a/drivers/usb/core/hcd.c
++++ b/drivers/usb/core/hcd.c
+@@ -679,7 +679,7 @@ void usb_hcd_poll_rh_status(struct usb_h
+ spin_lock_irqsave(&hcd_root_hub_lock, flags);
+ urb = hcd->status_urb;
+ if (urb) {
+- hcd->poll_pending = 0;
++ clear_bit(HCD_FLAG_POLL_PENDING, &hcd->flags);
+ hcd->status_urb = NULL;
+ urb->actual_length = length;
+ memcpy(urb->transfer_buffer, buffer, length);
+@@ -690,7 +690,7 @@ void usb_hcd_poll_rh_status(struct usb_h
+ spin_lock(&hcd_root_hub_lock);
+ } else {
+ length = 0;
+- hcd->poll_pending = 1;
++ set_bit(HCD_FLAG_POLL_PENDING, &hcd->flags);
+ }
+ spin_unlock_irqrestore(&hcd_root_hub_lock, flags);
+ }
+@@ -699,7 +699,7 @@ void usb_hcd_poll_rh_status(struct usb_h
+ * exceed that limit if HZ is 100. The math is more clunky than
+ * maybe expected, this is to make sure that all timers for USB devices
+ * fire at the same time to give the CPU a break inbetween */
+- if (hcd->uses_new_polling ? hcd->poll_rh :
++ if (hcd->uses_new_polling ? HCD_POLL_RH(hcd) :
+ (length == 0 && hcd->status_urb != NULL))
+ mod_timer (&hcd->rh_timer, (jiffies/(HZ/4) + 1) * (HZ/4));
+ }
+@@ -736,7 +736,7 @@ static int rh_queue_status (struct usb_h
+ mod_timer(&hcd->rh_timer, (jiffies/(HZ/4) + 1) * (HZ/4));
+
+ /* If a status change has already occurred, report it ASAP */
+- else if (hcd->poll_pending)
++ else if (HCD_POLL_PENDING(hcd))
+ mod_timer(&hcd->rh_timer, jiffies);
+ retval = 0;
+ done:
+@@ -1150,8 +1150,7 @@ int usb_hcd_check_unlink_urb(struct usb_
+ * finish unlinking the initial failed usb_set_address()
+ * or device descriptor fetch.
+ */
+- if (!test_bit(HCD_FLAG_SAW_IRQ, &hcd->flags) &&
+- !is_root_hub(urb->dev)) {
++ if (!HCD_SAW_IRQ(hcd) && !is_root_hub(urb->dev)) {
+ dev_warn(hcd->self.controller, "Unlink after no-IRQ? "
+ "Controller is probably using the wrong IRQ.\n");
+ set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
+@@ -2063,8 +2062,7 @@ irqreturn_t usb_hcd_irq (int irq, void *
+ */
+ local_irq_save(flags);
+
+- if (unlikely(hcd->state == HC_STATE_HALT ||
+- !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) {
++ if (unlikely(hcd->state == HC_STATE_HALT || !HCD_HW_ACCESSIBLE(hcd))) {
+ rc = IRQ_NONE;
+ } else if (hcd->driver->irq(hcd) == IRQ_NONE) {
+ rc = IRQ_NONE;
+@@ -2098,7 +2096,7 @@ void usb_hc_died (struct usb_hcd *hcd)
+
+ spin_lock_irqsave (&hcd_root_hub_lock, flags);
+ if (hcd->rh_registered) {
+- hcd->poll_rh = 0;
++ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+
+ /* make khubd clean up old urbs and devices */
+ usb_set_device_state (hcd->self.root_hub,
+@@ -2301,7 +2299,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
+ retval);
+ goto error_create_attr_group;
+ }
+- if (hcd->uses_new_polling && hcd->poll_rh)
++ if (hcd->uses_new_polling && HCD_POLL_RH(hcd))
+ usb_hcd_poll_rh_status(hcd);
+ return retval;
+
+@@ -2320,11 +2318,11 @@ error_create_attr_group:
+ mutex_unlock(&usb_bus_list_lock);
+ err_register_root_hub:
+ hcd->rh_pollable = 0;
+- hcd->poll_rh = 0;
++ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+ del_timer_sync(&hcd->rh_timer);
+ hcd->driver->stop(hcd);
+ hcd->state = HC_STATE_HALT;
+- hcd->poll_rh = 0;
++ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+ del_timer_sync(&hcd->rh_timer);
+ err_hcd_driver_start:
+ if (hcd->irq >= 0)
+@@ -2380,14 +2378,14 @@ void usb_remove_hcd(struct usb_hcd *hcd)
+ * the hub_status_data() callback.
+ */
+ hcd->rh_pollable = 0;
+- hcd->poll_rh = 0;
++ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+ del_timer_sync(&hcd->rh_timer);
+
+ hcd->driver->stop(hcd);
+ hcd->state = HC_STATE_HALT;
+
+ /* In case the HCD restarted the timer, stop it again. */
+- hcd->poll_rh = 0;
++ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+ del_timer_sync(&hcd->rh_timer);
+
+ if (hcd->irq >= 0)
+--- a/drivers/usb/gadget/dummy_hcd.c
++++ b/drivers/usb/gadget/dummy_hcd.c
+@@ -1542,7 +1542,7 @@ static int dummy_hub_status (struct usb_
+ dum = hcd_to_dummy (hcd);
+
+ spin_lock_irqsave (&dum->lock, flags);
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
++ if (!HCD_HW_ACCESSIBLE(hcd))
+ goto done;
+
+ if (dum->resuming && time_after_eq (jiffies, dum->re_timeout)) {
+@@ -1588,7 +1588,7 @@ static int dummy_hub_control (
+ int retval = 0;
+ unsigned long flags;
+
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
++ if (!HCD_HW_ACCESSIBLE(hcd))
+ return -ETIMEDOUT;
+
+ dum = hcd_to_dummy (hcd);
+@@ -1739,7 +1739,7 @@ static int dummy_bus_resume (struct usb_
+ dev_dbg (&hcd->self.root_hub->dev, "%s\n", __func__);
+
+ spin_lock_irq (&dum->lock);
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
++ if (!HCD_HW_ACCESSIBLE(hcd)) {
+ rc = -ESHUTDOWN;
+ } else {
+ dum->rh_state = DUMMY_RH_RUNNING;
+--- a/drivers/usb/host/ehci-dbg.c
++++ b/drivers/usb/host/ehci-dbg.c
+@@ -712,7 +712,7 @@ static ssize_t fill_registers_buffer(str
+
+ spin_lock_irqsave (&ehci->lock, flags);
+
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
++ if (!HCD_HW_ACCESSIBLE(hcd)) {
+ size = scnprintf (next, size,
+ "bus %s, device %s\n"
+ "%s\n"
+--- a/drivers/usb/host/ehci-hcd.c
++++ b/drivers/usb/host/ehci-hcd.c
+@@ -642,7 +642,6 @@ static int ehci_run (struct usb_hcd *hcd
+ u32 hcc_params;
+
+ hcd->uses_new_polling = 1;
+- hcd->poll_rh = 0;
+
+ /* EHCI spec section 4.1 */
+ if ((retval = ehci_reset(ehci)) != 0) {
+--- a/drivers/usb/host/ehci-hub.c
++++ b/drivers/usb/host/ehci-hub.c
+@@ -316,7 +316,7 @@ static int ehci_bus_resume (struct usb_h
+ if (time_before (jiffies, ehci->next_statechange))
+ msleep(5);
+ spin_lock_irq (&ehci->lock);
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
++ if (!HCD_HW_ACCESSIBLE(hcd)) {
+ spin_unlock_irq(&ehci->lock);
+ return -ESHUTDOWN;
+ }
+--- a/drivers/usb/host/ehci-q.c
++++ b/drivers/usb/host/ehci-q.c
+@@ -1126,8 +1126,7 @@ submit_async (
+ #endif
+
+ spin_lock_irqsave (&ehci->lock, flags);
+- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+- &ehci_to_hcd(ehci)->flags))) {
++ if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {
+ rc = -ESHUTDOWN;
+ goto done;
+ }
+--- a/drivers/usb/host/ehci-sched.c
++++ b/drivers/usb/host/ehci-sched.c
+@@ -880,8 +880,7 @@ static int intr_submit (
+
+ spin_lock_irqsave (&ehci->lock, flags);
+
+- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+- &ehci_to_hcd(ehci)->flags))) {
++ if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {
+ status = -ESHUTDOWN;
+ goto done_not_linked;
+ }
+@@ -1815,8 +1814,7 @@ static int itd_submit (struct ehci_hcd *
+
+ /* schedule ... need to lock */
+ spin_lock_irqsave (&ehci->lock, flags);
+- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+- &ehci_to_hcd(ehci)->flags))) {
++ if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {
+ status = -ESHUTDOWN;
+ goto done_not_linked;
+ }
+@@ -2201,8 +2199,7 @@ static int sitd_submit (struct ehci_hcd
+
+ /* schedule ... need to lock */
+ spin_lock_irqsave (&ehci->lock, flags);
+- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+- &ehci_to_hcd(ehci)->flags))) {
++ if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {
+ status = -ESHUTDOWN;
+ goto done_not_linked;
+ }
+--- a/drivers/usb/host/hwa-hc.c
++++ b/drivers/usb/host/hwa-hc.c
+@@ -159,7 +159,7 @@ static int hwahc_op_start(struct usb_hcd
+ goto error_set_cluster_id;
+
+ usb_hcd->uses_new_polling = 1;
+- usb_hcd->poll_rh = 1;
++ set_bit(HCD_FLAG_POLL_RH, &usb_hcd->flags);
+ usb_hcd->state = HC_STATE_RUNNING;
+ result = 0;
+ out:
+@@ -776,7 +776,7 @@ static int hwahc_probe(struct usb_interf
+ goto error_alloc;
+ }
+ usb_hcd->wireless = 1;
+- usb_hcd->flags |= HCD_FLAG_SAW_IRQ;
++ set_bit(HCD_FLAG_SAW_IRQ, &usb_hcd->flags);
+ wusbhc = usb_hcd_to_wusbhc(usb_hcd);
+ hwahc = container_of(wusbhc, struct hwahc, wusbhc);
+ hwahc_init(hwahc);
+--- a/drivers/usb/host/isp1760-hcd.c
++++ b/drivers/usb/host/isp1760-hcd.c
+@@ -482,7 +482,6 @@ static int isp1760_run(struct usb_hcd *h
+ u32 chipid;
+
+ hcd->uses_new_polling = 1;
+- hcd->poll_rh = 0;
+
+ hcd->state = HC_STATE_RUNNING;
+ isp1760_enable_interrupts(hcd);
+@@ -1450,7 +1449,7 @@ static int isp1760_prepare_enqueue(struc
+ epnum = urb->ep->desc.bEndpointAddress;
+
+ spin_lock_irqsave(&priv->lock, flags);
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &priv_to_hcd(priv)->flags)) {
++ if (!HCD_HW_ACCESSIBLE(priv_to_hcd(priv))) {
+ rc = -ESHUTDOWN;
+ goto done;
+ }
+--- a/drivers/usb/host/ohci-dbg.c
++++ b/drivers/usb/host/ohci-dbg.c
+@@ -645,7 +645,7 @@ static ssize_t fill_registers_buffer(str
+ hcd->product_desc,
+ hcd_name);
+
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
++ if (!HCD_HW_ACCESSIBLE(hcd)) {
+ size -= scnprintf (next, size,
+ "SUSPENDED (no register access)\n");
+ goto done;
+@@ -687,7 +687,7 @@ static ssize_t fill_registers_buffer(str
+ next += temp;
+
+ temp = scnprintf (next, size, "hub poll timer %s\n",
+- ohci_to_hcd(ohci)->poll_rh ? "ON" : "off");
++ HCD_POLL_RH(ohci_to_hcd(ohci)) ? "ON" : "off");
+ size -= temp;
+ next += temp;
+
+--- a/drivers/usb/host/ohci-hcd.c
++++ b/drivers/usb/host/ohci-hcd.c
+@@ -212,7 +212,7 @@ static int ohci_urb_enqueue (
+ spin_lock_irqsave (&ohci->lock, flags);
+
+ /* don't submit to a dead HC */
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
++ if (!HCD_HW_ACCESSIBLE(hcd)) {
+ retval = -ENODEV;
+ goto fail;
+ }
+@@ -685,7 +685,7 @@ retry:
+ }
+
+ /* use rhsc irqs after khubd is fully initialized */
+- hcd->poll_rh = 1;
++ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+ hcd->uses_new_polling = 1;
+
+ /* start controller operations */
+@@ -822,7 +822,7 @@ static irqreturn_t ohci_irq (struct usb_
+ else if (ints & OHCI_INTR_RD) {
+ ohci_vdbg(ohci, "resume detect\n");
+ ohci_writel(ohci, OHCI_INTR_RD, &regs->intrstatus);
+- hcd->poll_rh = 1;
++ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+ if (ohci->autostop) {
+ spin_lock (&ohci->lock);
+ ohci_rh_resume (ohci);
+--- a/drivers/usb/host/ohci-hub.c
++++ b/drivers/usb/host/ohci-hub.c
+@@ -284,7 +284,7 @@ static int ohci_bus_suspend (struct usb_
+
+ spin_lock_irq (&ohci->lock);
+
+- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
++ if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
+ rc = -ESHUTDOWN;
+ else
+ rc = ohci_rh_suspend (ohci, 0);
+@@ -302,7 +302,7 @@ static int ohci_bus_resume (struct usb_h
+
+ spin_lock_irq (&ohci->lock);
+
+- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
++ if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
+ rc = -ESHUTDOWN;
+ else
+ rc = ohci_rh_resume (ohci);
+@@ -489,7 +489,7 @@ ohci_hub_status_data (struct usb_hcd *hc
+ unsigned long flags;
+
+ spin_lock_irqsave (&ohci->lock, flags);
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
++ if (!HCD_HW_ACCESSIBLE(hcd))
+ goto done;
+
+ /* undocumented erratum seen on at least rev D */
+@@ -533,8 +533,12 @@ ohci_hub_status_data (struct usb_hcd *hc
+ }
+ }
+
+- hcd->poll_rh = ohci_root_hub_state_changes(ohci, changed,
+- any_connected, rhsc_status);
++ if (ohci_root_hub_state_changes(ohci, changed,
++ any_connected, rhsc_status))
++ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
++ else
++ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
++
+
+ done:
+ spin_unlock_irqrestore (&ohci->lock, flags);
+@@ -701,7 +705,7 @@ static int ohci_hub_control (
+ u32 temp;
+ int retval = 0;
+
+- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
++ if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
+ return -ESHUTDOWN;
+
+ switch (typeReq) {
+--- a/drivers/usb/host/oxu210hp-hcd.c
++++ b/drivers/usb/host/oxu210hp-hcd.c
+@@ -1641,8 +1641,7 @@ static int submit_async(struct oxu_hcd *
+ #endif
+
+ spin_lock_irqsave(&oxu->lock, flags);
+- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+- &oxu_to_hcd(oxu)->flags))) {
++ if (unlikely(!HCD_HW_ACCESSIBLE(oxu_to_hcd(oxu)))) {
+ rc = -ESHUTDOWN;
+ goto done;
+ }
+@@ -2209,8 +2208,7 @@ static int intr_submit(struct oxu_hcd *o
+
+ spin_lock_irqsave(&oxu->lock, flags);
+
+- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+- &oxu_to_hcd(oxu)->flags))) {
++ if (unlikely(!HCD_HW_ACCESSIBLE(oxu_to_hcd(oxu)))) {
+ status = -ESHUTDOWN;
+ goto done;
+ }
+@@ -2715,7 +2713,6 @@ static int oxu_run(struct usb_hcd *hcd)
+ u32 temp, hcc_params;
+
+ hcd->uses_new_polling = 1;
+- hcd->poll_rh = 0;
+
+ /* EHCI spec section 4.1 */
+ retval = ehci_reset(oxu);
+--- a/drivers/usb/host/uhci-hcd.c
++++ b/drivers/usb/host/uhci-hcd.c
+@@ -140,7 +140,7 @@ static void finish_reset(struct uhci_hcd
+ uhci->rh_state = UHCI_RH_RESET;
+ uhci->is_stopped = UHCI_IS_STOPPED;
+ uhci_to_hcd(uhci)->state = HC_STATE_HALT;
+- uhci_to_hcd(uhci)->poll_rh = 0;
++ clear_bit(HCD_FLAG_POLL_RH, &uhci_to_hcd(uhci)->flags);
+
+ uhci->dead = 0; /* Full reset resurrects the controller */
+ }
+@@ -344,7 +344,10 @@ __acquires(uhci->lock)
+ /* If interrupts don't work and remote wakeup is enabled then
+ * the suspended root hub needs to be polled.
+ */
+- uhci_to_hcd(uhci)->poll_rh = (!int_enable && wakeup_enable);
++ if (!int_enable && wakeup_enable)
++ set_bit(HCD_FLAG_POLL_RH, &uhci_to_hcd(uhci)->flags);
++ else
++ clear_bit(HCD_FLAG_POLL_RH, &uhci_to_hcd(uhci)->flags);
+
+ uhci_scan_schedule(uhci);
+ uhci_fsbr_off(uhci);
+@@ -363,7 +366,7 @@ static void start_rh(struct uhci_hcd *uh
+ uhci->io_addr + USBINTR);
+ mb();
+ uhci->rh_state = UHCI_RH_RUNNING;
+- uhci_to_hcd(uhci)->poll_rh = 1;
++ set_bit(HCD_FLAG_POLL_RH, &uhci_to_hcd(uhci)->flags);
+ }
+
+ static void wakeup_rh(struct uhci_hcd *uhci)
+@@ -733,7 +736,7 @@ static void uhci_stop(struct usb_hcd *hc
+ struct uhci_hcd *uhci = hcd_to_uhci(hcd);
+
+ spin_lock_irq(&uhci->lock);
+- if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) && !uhci->dead)
++ if (HCD_HW_ACCESSIBLE(hcd) && !uhci->dead)
+ uhci_hc_died(uhci);
+ uhci_scan_schedule(uhci);
+ spin_unlock_irq(&uhci->lock);
+@@ -750,7 +753,7 @@ static int uhci_rh_suspend(struct usb_hc
+ int rc = 0;
+
+ spin_lock_irq(&uhci->lock);
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
++ if (!HCD_HW_ACCESSIBLE(hcd))
+ rc = -ESHUTDOWN;
+ else if (uhci->dead)
+ ; /* Dead controllers tell no tales */
+@@ -777,7 +780,7 @@ static int uhci_rh_resume(struct usb_hcd
+ int rc = 0;
+
+ spin_lock_irq(&uhci->lock);
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
++ if (!HCD_HW_ACCESSIBLE(hcd))
+ rc = -ESHUTDOWN;
+ else if (!uhci->dead)
+ wakeup_rh(uhci);
+@@ -793,7 +796,7 @@ static int uhci_pci_suspend(struct usb_h
+ dev_dbg(uhci_dev(uhci), "%s\n", __func__);
+
+ spin_lock_irq(&uhci->lock);
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) || uhci->dead)
++ if (!HCD_HW_ACCESSIBLE(hcd) || uhci->dead)
+ goto done_okay; /* Already suspended or dead */
+
+ if (uhci->rh_state > UHCI_RH_SUSPENDED) {
+@@ -807,7 +810,7 @@ static int uhci_pci_suspend(struct usb_h
+ */
+ pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP, 0);
+ mb();
+- hcd->poll_rh = 0;
++ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+
+ /* FIXME: Enable non-PME# remote wakeup? */
+
+@@ -860,7 +863,7 @@ static int uhci_pci_resume(struct usb_hc
+ * the suspended root hub needs to be polled.
+ */
+ if (!uhci->RD_enable && hcd->self.root_hub->do_remote_wakeup) {
+- hcd->poll_rh = 1;
++ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+ usb_hcd_poll_rh_status(hcd);
+ }
+ return 0;
+--- a/drivers/usb/host/uhci-hub.c
++++ b/drivers/usb/host/uhci-hub.c
+@@ -190,7 +190,7 @@ static int uhci_hub_status_data(struct u
+ spin_lock_irqsave(&uhci->lock, flags);
+
+ uhci_scan_schedule(uhci);
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) || uhci->dead)
++ if (!HCD_HW_ACCESSIBLE(hcd) || uhci->dead)
+ goto done;
+ uhci_check_ports(uhci);
+
+@@ -246,7 +246,7 @@ static int uhci_hub_control(struct usb_h
+ u16 wPortChange, wPortStatus;
+ unsigned long flags;
+
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) || uhci->dead)
++ if (!HCD_HW_ACCESSIBLE(hcd) || uhci->dead)
+ return -ETIMEDOUT;
+
+ spin_lock_irqsave(&uhci->lock, flags);
+--- a/drivers/usb/host/whci/hcd.c
++++ b/drivers/usb/host/whci/hcd.c
+@@ -68,7 +68,7 @@ static int whc_start(struct usb_hcd *usb
+ whc_write_wusbcmd(whc, WUSBCMD_RUN, WUSBCMD_RUN);
+
+ usb_hcd->uses_new_polling = 1;
+- usb_hcd->poll_rh = 1;
++ set_bit(HCD_FLAG_POLL_RH, &usb_hcd->flags);
+ usb_hcd->state = HC_STATE_RUNNING;
+
+ out:
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -427,7 +427,6 @@ int xhci_run(struct usb_hcd *hcd)
+ void (*doorbell)(struct xhci_hcd *) = NULL;
+
+ hcd->uses_new_polling = 1;
+- hcd->poll_rh = 0;
+
+ xhci_dbg(xhci, "xhci_run\n");
+ #if 0 /* FIXME: MSI not setup yet */
+@@ -733,7 +732,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd
+ ret = -EINVAL;
+ goto exit;
+ }
+- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
++ if (!HCD_HW_ACCESSIBLE(hcd)) {
+ if (!in_interrupt())
+ xhci_dbg(xhci, "urb submitted during PCI suspend\n");
+ ret = -ESHUTDOWN;
+--- a/drivers/usb/musb/musb_virthub.c
++++ b/drivers/usb/musb/musb_virthub.c
+@@ -244,7 +244,7 @@ int musb_hub_control(
+
+ spin_lock_irqsave(&musb->lock, flags);
+
+- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) {
++ if (unlikely(!HCD_HW_ACCESSIBLE(hcd))) {
+ spin_unlock_irqrestore(&musb->lock, flags);
+ return -ESHUTDOWN;
+ }
+--- a/include/linux/usb/hcd.h
++++ b/include/linux/usb/hcd.h
+@@ -89,19 +89,31 @@ struct usb_hcd {
+ */
+ const struct hc_driver *driver; /* hw-specific hooks */
+
+- /* Flags that need to be manipulated atomically */
++ /* Flags that need to be manipulated atomically because they can
++ * change while the host controller is running. Always use
++ * set_bit() or clear_bit() to change their values.
++ */
+ unsigned long flags;
+-#define HCD_FLAG_HW_ACCESSIBLE 0x00000001
+-#define HCD_FLAG_SAW_IRQ 0x00000002
++#define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */
++#define HCD_FLAG_SAW_IRQ 1
++#define HCD_FLAG_POLL_RH 2 /* poll for rh status? */
++#define HCD_FLAG_POLL_PENDING 3 /* status has changed? */
++
++ /* The flags can be tested using these macros; they are likely to
++ * be slightly faster than test_bit().
++ */
++#define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE))
++#define HCD_SAW_IRQ(hcd) ((hcd)->flags & (1U << HCD_FLAG_SAW_IRQ))
++#define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH))
++#define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING))
+
++ /* Flags that get set only during HCD registration or removal. */
+ unsigned rh_registered:1;/* is root hub registered? */
+ unsigned rh_pollable:1; /* may we poll the root hub? */
+
+ /* The next flag is a stopgap, to be removed when all the HCDs
+ * support the new root-hub polling mechanism. */
+ unsigned uses_new_polling:1;
+- unsigned poll_rh:1; /* poll for rh status? */
+- unsigned poll_pending:1; /* status has changed? */
+ unsigned wireless:1; /* Wireless USB HCD */
+ unsigned authorized_default:1;
+ unsigned has_tt:1; /* Integrated TT in root hub */
diff --git a/usb/usb-core-driver-fix-coding-styles.patch b/usb/usb-core-driver-fix-coding-styles.patch
index 29cb0c4093f3f9..c0985481d91703 100644
--- a/usb/usb-core-driver-fix-coding-styles.patch
+++ b/usb/usb-core-driver-fix-coding-styles.patch
@@ -18,7 +18,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
-@@ -1749,9 +1749,8 @@ static int usb_runtime_suspend(struct de
+@@ -1742,9 +1742,8 @@ static int usb_runtime_suspend(struct de
}
/* Prevent the parent from suspending immediately after */
@@ -29,7 +29,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
}
/* Runtime suspend for a USB interface doesn't mean anything. */
-@@ -1793,7 +1792,7 @@ static int usb_runtime_idle(struct devic
+@@ -1786,7 +1785,7 @@ static int usb_runtime_idle(struct devic
return 0;
}
@@ -38,7 +38,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
.runtime_suspend = usb_runtime_suspend,
.runtime_resume = usb_runtime_resume,
.runtime_idle = usb_runtime_idle,
-@@ -1801,7 +1800,7 @@ static struct dev_pm_ops usb_bus_pm_ops
+@@ -1794,7 +1793,7 @@ static struct dev_pm_ops usb_bus_pm_ops
#else