From: Greg Kroah-Hartman Date: Wed, 22 Jan 2014 21:29:44 +0000 (-0800) Subject: 3.13-stable patches X-Git-Tag: v3.10.28~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d89fbd8d9ee1a2a100a901549fbf35a78a87649b;p=thirdparty%2Fkernel%2Fstable-queue.git 3.13-stable patches added patches: extcon-gpio-request-gpio-pin-before-modifying-its-state.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 --- diff --git a/queue-3.13/extcon-gpio-request-gpio-pin-before-modifying-its-state.patch b/queue-3.13/extcon-gpio-request-gpio-pin-before-modifying-its-state.patch new file mode 100644 index 00000000000..addd21141fe --- /dev/null +++ b/queue-3.13/extcon-gpio-request-gpio-pin-before-modifying-its-state.patch @@ -0,0 +1,55 @@ +From 4288d9b8edcec7289e00eecdad44f14c9ea1ba0e Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Fri, 22 Nov 2013 09:26:01 -0800 +Subject: extcon: gpio: Request gpio pin before modifying its state + +From: Guenter Roeck + +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 +Acked-by: MyungJoo Ham +Signed-off-by: Chanwoo Choi +Signed-off-by: Greg Kroah-Hartman + +--- + 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); diff --git a/queue-3.13/mm-make-set-page_address-static-inline-if-want_page_virtual.patch b/queue-3.13/mm-make-set-page_address-static-inline-if-want_page_virtual.patch new file mode 100644 index 00000000000..24d10e53968 --- /dev/null +++ b/queue-3.13/mm-make-set-page_address-static-inline-if-want_page_virtual.patch @@ -0,0 +1,58 @@ +From f92f455f67fef27929e6043499414605b0c94872 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Tue, 21 Jan 2014 15:48:47 -0800 +Subject: mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL + +From: Geert Uytterhoeven + +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 , so there's +no reason to keep them as macros. + +Signed-off-by: Geert Uytterhoeven +Acked-by: Michael S. Tsirkin +Tested-by: Guenter Roeck +Tested-by: David Rientjes +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + 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 + diff --git a/queue-3.13/serial-amba-pl011-use-port-lock-to-guard-control-register-access.patch b/queue-3.13/serial-amba-pl011-use-port-lock-to-guard-control-register-access.patch new file mode 100644 index 00000000000..c31a3c2bacc --- /dev/null +++ b/queue-3.13/serial-amba-pl011-use-port-lock-to-guard-control-register-access.patch @@ -0,0 +1,71 @@ +From fe43390702a1b5741fdf217063b05c7612b38303 Mon Sep 17 00:00:00 2001 +From: Jon Medhurst +Date: Tue, 10 Dec 2013 10:18:58 +0000 +Subject: serial: amba-pl011: use port lock to guard control register access + +From: Jon Medhurst + +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 +Signed-off-by: Greg Kroah-Hartman + +--- + 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 diff --git a/queue-3.13/series b/queue-3.13/series index 184837a750c..47ccab369ee 100644 --- a/queue-3.13/series +++ b/queue-3.13/series @@ -2,3 +2,6 @@ gfs2-increase-i_writecount-during-gfs2_setattr_chown.patch 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