--- /dev/null
+From 4288d9b8edcec7289e00eecdad44f14c9ea1ba0e Mon Sep 17 00:00:00 2001
+From: Guenter Roeck <linux@roeck-us.net>
+Date: Fri, 22 Nov 2013 09:26:01 -0800
+Subject: extcon: gpio: Request gpio pin before modifying its state
+
+From: Guenter Roeck <linux@roeck-us.net>
+
+commit 4288d9b8edcec7289e00eecdad44f14c9ea1ba0e upstream.
+
+Commit 338de0ca (extcon: gpio: Use gpio driver/chip debounce if supported)
+introduced a call to gpio_set_debounce() before actually requesting the
+respective gpio pin from the gpio subsystem.
+
+The gpio subsystem expects that a gpio pin was requested before modifying its
+state. Not doing so results in a warning from gpiolib, and the gpio pin is
+auto-requested. This in turn causes the subsequent devm_gpio_request_one()
+to fail. So devm_gpio_request_one() must be called prior to calling
+gpio_set_debounce().
+
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
+Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/extcon/extcon-gpio.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+--- a/drivers/extcon/extcon-gpio.c
++++ b/drivers/extcon/extcon-gpio.c
+@@ -105,6 +105,12 @@ static int gpio_extcon_probe(struct plat
+ extcon_data->state_off = pdata->state_off;
+ if (pdata->state_on && pdata->state_off)
+ extcon_data->edev.print_state = extcon_gpio_print_state;
++
++ ret = devm_gpio_request_one(&pdev->dev, extcon_data->gpio, GPIOF_DIR_IN,
++ pdev->name);
++ if (ret < 0)
++ return ret;
++
+ if (pdata->debounce) {
+ ret = gpio_set_debounce(extcon_data->gpio,
+ pdata->debounce * 1000);
+@@ -117,11 +123,6 @@ static int gpio_extcon_probe(struct plat
+ if (ret < 0)
+ return ret;
+
+- ret = devm_gpio_request_one(&pdev->dev, extcon_data->gpio, GPIOF_DIR_IN,
+- pdev->name);
+- if (ret < 0)
+- goto err;
+-
+ INIT_DELAYED_WORK(&extcon_data->work, gpio_extcon_work);
+
+ extcon_data->irq = gpio_to_irq(extcon_data->gpio);
--- /dev/null
+From f92f455f67fef27929e6043499414605b0c94872 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert@linux-m68k.org>
+Date: Tue, 21 Jan 2014 15:48:47 -0800
+Subject: mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL
+
+From: Geert Uytterhoeven <geert@linux-m68k.org>
+
+commit f92f455f67fef27929e6043499414605b0c94872 upstream.
+
+{,set}page_address() are macros if WANT_PAGE_VIRTUAL. If
+!WANT_PAGE_VIRTUAL, they're plain C functions.
+
+If someone calls them with a void *, this pointer is auto-converted to
+struct page * if !WANT_PAGE_VIRTUAL, but causes a build failure on
+architectures using WANT_PAGE_VIRTUAL (arc, m68k and sparc64):
+
+ drivers/md/bcache/bset.c: In function `__btree_sort':
+ drivers/md/bcache/bset.c:1190: warning: dereferencing `void *' pointer
+ drivers/md/bcache/bset.c:1190: error: request for member `virtual' in something not a structure or union
+
+Convert them to static inline functions to fix this. There are already
+plenty of users of struct page members inside <linux/mm.h>, so there's
+no reason to keep them as macros.
+
+Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Acked-by: Michael S. Tsirkin <mst@redhat.com>
+Tested-by: Guenter Roeck <linux@roeck-us.net>
+Tested-by: David Rientjes <rientjes@google.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/mm.h | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+--- a/include/linux/mm.h
++++ b/include/linux/mm.h
+@@ -846,11 +846,14 @@ static __always_inline void *lowmem_page
+ #endif
+
+ #if defined(WANT_PAGE_VIRTUAL)
+-#define page_address(page) ((page)->virtual)
+-#define set_page_address(page, address) \
+- do { \
+- (page)->virtual = (address); \
+- } while(0)
++static inline void *page_address(const struct page *page)
++{
++ return page->virtual;
++}
++static inline void set_page_address(struct page *page, void *address)
++{
++ page->virtual = address;
++}
+ #define page_address_init() do { } while(0)
+ #endif
+
--- /dev/null
+From fe43390702a1b5741fdf217063b05c7612b38303 Mon Sep 17 00:00:00 2001
+From: Jon Medhurst <tixy@linaro.org>
+Date: Tue, 10 Dec 2013 10:18:58 +0000
+Subject: serial: amba-pl011: use port lock to guard control register access
+
+From: Jon Medhurst <tixy@linaro.org>
+
+commit fe43390702a1b5741fdf217063b05c7612b38303 upstream.
+
+When the pl011 is being used for a console, pl011_console_write forces
+the control register (CR) to enable the UART for transmission and then
+restores this to the original value afterwards. It does this while
+holding the port lock.
+
+Unfortunately, when the uart is started or shutdown - say in response to
+userland using the serial device for a terminal - then this updates the
+control register without any locking.
+
+This means we can have
+
+ pl011_console_write Save CR
+ pl011_startup Initialise CR, e.g. enable receive
+ pl011_console_write Restore old CR with receive not enabled
+
+this result is a serial port which doesn't respond to any input.
+
+A similar race in reverse could happen when the device is shutdown.
+
+We can fix these problems by taking the port lock when updating CR.
+
+Signed-off-by: Jon Medhurst <tixy@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/amba-pl011.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/tty/serial/amba-pl011.c
++++ b/drivers/tty/serial/amba-pl011.c
+@@ -1537,6 +1537,8 @@ static int pl011_startup(struct uart_por
+ /*
+ * Provoke TX FIFO interrupt into asserting.
+ */
++ spin_lock_irq(&uap->port.lock);
++
+ cr = UART01x_CR_UARTEN | UART011_CR_TXE | UART011_CR_LBE;
+ writew(cr, uap->port.membase + UART011_CR);
+ writew(0, uap->port.membase + UART011_FBRD);
+@@ -1561,6 +1563,8 @@ static int pl011_startup(struct uart_por
+ cr |= UART01x_CR_UARTEN | UART011_CR_RXE | UART011_CR_TXE;
+ writew(cr, uap->port.membase + UART011_CR);
+
++ spin_unlock_irq(&uap->port.lock);
++
+ /*
+ * initialise the old status of the modem signals
+ */
+@@ -1629,11 +1633,13 @@ static void pl011_shutdown(struct uart_p
+ * it during startup().
+ */
+ uap->autorts = false;
++ spin_lock_irq(&uap->port.lock);
+ cr = readw(uap->port.membase + UART011_CR);
+ uap->old_cr = cr;
+ cr &= UART011_CR_RTS | UART011_CR_DTR;
+ cr |= UART01x_CR_UARTEN | UART011_CR_TXE;
+ writew(cr, uap->port.membase + UART011_CR);
++ spin_unlock_irq(&uap->port.lock);
+
+ /*
+ * disable break condition and fifos
staging-comedi-fix-result-of-memdup_user-for-user-chanlist.patch
staging-comedi-addi_apci_1032-fix-subdevice-type-flags-bug.patch
staging-comedi-adl_pci9111-fix-incorrect-irq-passed-to-request_irq.patch
+mm-make-set-page_address-static-inline-if-want_page_virtual.patch
+serial-amba-pl011-use-port-lock-to-guard-control-register-access.patch
+extcon-gpio-request-gpio-pin-before-modifying-its-state.patch