From: Greg Kroah-Hartman Date: Sun, 25 Jan 2015 14:14:25 +0000 (+0800) Subject: 3.18-stable patches X-Git-Tag: v3.10.66~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=465a9aca6fc3fc431d90e4de342b5166b0ef1301;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: arm-dts-berlin-correct-bg2q-s-sm-gpio-location.patch gpio-crystalcove-use-handle_nested_irq.patch gpio-fix-memory-and-reference-leaks-in-gpiochip_add-error-path.patch gpio-fix-memory-leak-and-sleep-while-atomic.patch gpio-fix-sleep-while-atomic-in-gpiochip_remove.patch gpio-sysfs-fix-gpio-chip-device-attribute-leak.patch gpio-sysfs-fix-gpio-device-attribute-leak.patch gpiolib-of-correct-error-handling-in-of_get_named_gpiod_flags.patch pinctrl-lantiq-remove-bogus-of_gpio_chip_add.patch reset-sunxi-fix-spinlock-initialization.patch uas-add-us_fl_no_ata_1x-for-2-more-seagate-disk-enclosures.patch uas-add-us_fl_no_ata_1x-for-seagate-devices-with-usb-id-0bc2-a013.patch uas-add-us_fl_no_report_opcodes-for-jmicron-jms566-with-usb-id-0bc2-a013.patch --- diff --git a/queue-3.18/arm-dts-berlin-correct-bg2q-s-sm-gpio-location.patch b/queue-3.18/arm-dts-berlin-correct-bg2q-s-sm-gpio-location.patch new file mode 100644 index 00000000000..4f0b9c42665 --- /dev/null +++ b/queue-3.18/arm-dts-berlin-correct-bg2q-s-sm-gpio-location.patch @@ -0,0 +1,112 @@ +From 5138d5c562e3bfe30964e20ab46eec9f8b89225d Mon Sep 17 00:00:00 2001 +From: Jisheng Zhang +Date: Fri, 26 Dec 2014 16:58:01 +0800 +Subject: ARM: dts: berlin: correct BG2Q's SM GPIO location. + +From: Jisheng Zhang + +commit 5138d5c562e3bfe30964e20ab46eec9f8b89225d upstream. + +The gpio4 and gpio5 are in 0xf7fc0000 apb which is located in the SM domain. +This patch moves gpio4 and gpio5 to the correct location. This patch also +renames them as the following to match the names we internally used in +marvell: + gpio4 -> sm_gpio1 + gpio5 -> sm_gpio0 + porte -> portf + portf -> porte + +This also matches what we did for BG2 and BG2CD's SM GPIO. + +Fixes: cedf57fc4f2f ("ARM: dts: berlin: add the BG2Q GPIO nodes") +Signed-off-by: Jisheng Zhang +Signed-off-by: Sebastian Hesselbarth +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/berlin2q.dtsi | 60 ++++++++++++++++++++-------------------- + 1 file changed, 30 insertions(+), 30 deletions(-) + +--- a/arch/arm/boot/dts/berlin2q.dtsi ++++ b/arch/arm/boot/dts/berlin2q.dtsi +@@ -315,36 +315,6 @@ + interrupt-parent = <&gic>; + interrupts = ; + }; +- +- gpio4: gpio@5000 { +- compatible = "snps,dw-apb-gpio"; +- reg = <0x5000 0x400>; +- #address-cells = <1>; +- #size-cells = <0>; +- +- porte: gpio-port@4 { +- compatible = "snps,dw-apb-gpio-port"; +- gpio-controller; +- #gpio-cells = <2>; +- snps,nr-gpios = <32>; +- reg = <0>; +- }; +- }; +- +- gpio5: gpio@c000 { +- compatible = "snps,dw-apb-gpio"; +- reg = <0xc000 0x400>; +- #address-cells = <1>; +- #size-cells = <0>; +- +- portf: gpio-port@5 { +- compatible = "snps,dw-apb-gpio-port"; +- gpio-controller; +- #gpio-cells = <2>; +- snps,nr-gpios = <32>; +- reg = <0>; +- }; +- }; + }; + + chip: chip-control@ea0000 { +@@ -373,6 +343,21 @@ + ranges = <0 0xfc0000 0x10000>; + interrupt-parent = <&sic>; + ++ sm_gpio1: gpio@5000 { ++ compatible = "snps,dw-apb-gpio"; ++ reg = <0x5000 0x400>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ portf: gpio-port@5 { ++ compatible = "snps,dw-apb-gpio-port"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ snps,nr-gpios = <32>; ++ reg = <0>; ++ }; ++ }; ++ + i2c2: i2c@7000 { + compatible = "snps,designware-i2c"; + #address-cells = <1>; +@@ -423,6 +408,21 @@ + status = "disabled"; + }; + ++ sm_gpio0: gpio@c000 { ++ compatible = "snps,dw-apb-gpio"; ++ reg = <0xc000 0x400>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ porte: gpio-port@4 { ++ compatible = "snps,dw-apb-gpio-port"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ snps,nr-gpios = <32>; ++ reg = <0>; ++ }; ++ }; ++ + sysctrl: pin-controller@d000 { + compatible = "marvell,berlin2q-system-ctrl"; + reg = <0xd000 0x100>; diff --git a/queue-3.18/gpio-crystalcove-use-handle_nested_irq.patch b/queue-3.18/gpio-crystalcove-use-handle_nested_irq.patch new file mode 100644 index 00000000000..11bb4de979d --- /dev/null +++ b/queue-3.18/gpio-crystalcove-use-handle_nested_irq.patch @@ -0,0 +1,66 @@ +From e733a2fb8cbcff0747108cb529ffb4e4a00465ac Mon Sep 17 00:00:00 2001 +From: Aaron Lu +Date: Mon, 12 Jan 2015 10:09:32 +0800 +Subject: gpio: crystalcove: use handle_nested_irq + +From: Aaron Lu + +commit e733a2fb8cbcff0747108cb529ffb4e4a00465ac upstream. + +The CrystalCove GPIO chip has can_sleep set so its demultiplexed irqs +will have IRQ_NESTED_THREAD flag set, thus we should use the nested +version handle_nested_irq in CrystalCove's irq handler instead of +handle_generic_irq, or the following warning will be hit and the +functionality is lost: + +[ 4089.639554] Hardware name: ASUSTeK COMPUTER INC. T100TA/T100TA, BIOS T100TA.313 08/13/2014 +[ 4089.639564] 00000002 00000000 c24fbdf4 c16e0257 c24fbe38 c24fbe28 c105390c c18ec480 +[ 4089.639596] c24fbe54 00000048 c18f8e3b 00000295 c10a60fc 00000295 c10a60fc f4464540 +[ 4089.639626] f446459c c278ad40 c24fbe40 c1053974 00000009 c24fbe38 c18ec480 c24fbe54 +[ 4089.639656] Call Trace: +[ 4089.639685] [] dump_stack+0x41/0x52 +[ 4089.639707] [] warn_slowpath_common+0x8c/0xc0 +[ 4089.639727] [] ? irq_nested_primary_handler+0x2c/0x30 +[ 4089.639744] [] ? irq_nested_primary_handler+0x2c/0x30 +[ 4089.639763] [] warn_slowpath_fmt+0x34/0x40 +[ 4089.639781] [] irq_nested_primary_handler+0x2c/0x30 +[ 4089.639800] [] handle_irq_event_percpu+0x76/0x190 +[ 4089.639818] [] ? regmap_format_10_14_write+0x30/0x30 +[ 4089.639836] [] ? _regmap_bus_raw_write+0x4c/0x70 +[ 4089.639854] [] handle_irq_event+0x31/0x50 +[ 4089.639872] [] handle_simple_irq+0x4b/0x70 +[ 4089.639889] [] generic_handle_irq+0x24/0x40 +[ 4089.639908] [] crystalcove_gpio_irq_handler+0xa7/0xc0 +[ 4089.639927] [] handle_nested_irq+0x77/0x190 +[ 4089.639947] [] regmap_irq_thread+0x1b1/0x360 +[ 4089.639966] [] irq_thread_fn+0x18/0x30 +[ 4089.639983] [] irq_thread+0xf6/0x110 +[ 4089.640001] [] ? irq_finalize_oneshot.part.30+0x1b0/0x1b0 +[ 4089.640019] [] ? irq_forced_thread_fn+0x50/0x50 +[ 4089.640037] [] ? irq_thread_check_affinity+0xc0/0xc0 +[ 4089.640054] [] kthread+0xa9/0xc0 +[ 4089.640074] [] ret_from_kernel_thread+0x21/0x30 +[ 4089.640091] [] ? kthread_create_on_node+0x110/0x110 +[ 4089.640105] ---[ end trace dca7946ad31eba7d ]--- + +Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=90521 +Reported-and-tested-by: Brian Loften +Signed-off-by: Aaron Lu +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpio-crystalcove.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpio/gpio-crystalcove.c ++++ b/drivers/gpio/gpio-crystalcove.c +@@ -272,7 +272,7 @@ static irqreturn_t crystalcove_gpio_irq_ + for (gpio = 0; gpio < CRYSTALCOVE_GPIO_NUM; gpio++) { + if (pending & BIT(gpio)) { + virq = irq_find_mapping(cg->chip.irqdomain, gpio); +- generic_handle_irq(virq); ++ handle_nested_irq(virq); + } + } + diff --git a/queue-3.18/gpio-fix-memory-and-reference-leaks-in-gpiochip_add-error-path.patch b/queue-3.18/gpio-fix-memory-and-reference-leaks-in-gpiochip_add-error-path.patch new file mode 100644 index 00000000000..8237bea2b78 --- /dev/null +++ b/queue-3.18/gpio-fix-memory-and-reference-leaks-in-gpiochip_add-error-path.patch @@ -0,0 +1,55 @@ +From 5539b3c938d64a60cb1fc442ac3ce9263d52de0c Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 12 Jan 2015 17:12:24 +0100 +Subject: gpio: fix memory and reference leaks in gpiochip_add error path + +From: Johan Hovold + +commit 5539b3c938d64a60cb1fc442ac3ce9263d52de0c upstream. + +Memory allocated and references taken by of_gpiochip_add and +acpi_gpiochip_add were never released on errors in gpiochip_add (e.g. +failure to find free gpio range). + +Fixes: 391c970c0dd1 ("of/gpio: add default of_xlate function if device +has a node pointer") +Fixes: 664e3e5ac64c ("gpio / ACPI: register to ACPI events +automatically") + +Signed-off-by: Johan Hovold +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpiolib.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +--- a/drivers/gpio/gpiolib.c ++++ b/drivers/gpio/gpiolib.c +@@ -268,6 +268,9 @@ int gpiochip_add(struct gpio_chip *chip) + + spin_unlock_irqrestore(&gpio_lock, flags); + ++ if (status) ++ goto fail; ++ + #ifdef CONFIG_PINCTRL + INIT_LIST_HEAD(&chip->pin_ranges); + #endif +@@ -275,12 +278,12 @@ int gpiochip_add(struct gpio_chip *chip) + of_gpiochip_add(chip); + acpi_gpiochip_add(chip); + +- if (status) +- goto fail; +- + status = gpiochip_export(chip); +- if (status) ++ if (status) { ++ acpi_gpiochip_remove(chip); ++ of_gpiochip_remove(chip); + goto fail; ++ } + + pr_debug("%s: registered GPIOs %d to %d on device: %s\n", __func__, + chip->base, chip->base + chip->ngpio - 1, diff --git a/queue-3.18/gpio-fix-memory-leak-and-sleep-while-atomic.patch b/queue-3.18/gpio-fix-memory-leak-and-sleep-while-atomic.patch new file mode 100644 index 00000000000..d8fba0b3870 --- /dev/null +++ b/queue-3.18/gpio-fix-memory-leak-and-sleep-while-atomic.patch @@ -0,0 +1,50 @@ +From 00acc3dc248063f982cfacfbe5e78c0d6797ffef Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 12 Jan 2015 17:12:27 +0100 +Subject: gpio: fix memory leak and sleep-while-atomic + +From: Johan Hovold + +commit 00acc3dc248063f982cfacfbe5e78c0d6797ffef upstream. + +Fix memory leak and sleep-while-atomic in gpiochip_remove. + +The memory leak was introduced by afa82fab5e13 ("gpio / ACPI: Move event +handling registration to gpiolib irqchip helpers") that moved the +release of acpi interrupt resources to gpiochip_irqchip_remove, but by +then the resources are no longer accessible as the acpi_gpio_chip has +already been freed by acpi_gpiochip_remove. + +Note that this also fixes a few potential sleep-while-atomics, which has +been around since 1425052097b5 ("gpio: add IRQ chip helpers in gpiolib") +when the call to gpiochip_irqchip_remove while holding a spinlock was +added (a couple of irq-domain paths can end up grabbing mutexes). + +Fixes: afa82fab5e13 ("gpio / ACPI: Move event handling registration to +gpiolib irqchip helpers") +Fixes: 1425052097b5 ("gpio: add IRQ chip helpers in gpiolib") + +Signed-off-by: Johan Hovold +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpiolib.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/gpio/gpiolib.c ++++ b/drivers/gpio/gpiolib.c +@@ -316,11 +316,12 @@ void gpiochip_remove(struct gpio_chip *c + unsigned long flags; + unsigned id; + ++ gpiochip_irqchip_remove(chip); ++ + acpi_gpiochip_remove(chip); + + spin_lock_irqsave(&gpio_lock, flags); + +- gpiochip_irqchip_remove(chip); + gpiochip_remove_pin_ranges(chip); + of_gpiochip_remove(chip); + diff --git a/queue-3.18/gpio-fix-sleep-while-atomic-in-gpiochip_remove.patch b/queue-3.18/gpio-fix-sleep-while-atomic-in-gpiochip_remove.patch new file mode 100644 index 00000000000..c021e93abc0 --- /dev/null +++ b/queue-3.18/gpio-fix-sleep-while-atomic-in-gpiochip_remove.patch @@ -0,0 +1,40 @@ +From 6798acaa0138d8b12f1c54402ebcb66fea3deb03 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 12 Jan 2015 17:12:28 +0100 +Subject: gpio: fix sleep-while-atomic in gpiochip_remove + +From: Johan Hovold + +commit 6798acaa0138d8b12f1c54402ebcb66fea3deb03 upstream. + +Move direct and indirect calls to gpiochip_remove_pin_ranges outside of +spin lock as they can end up taking a mutex in pinctrl_remove_gpio_range. + +Note that the pin ranges are already added outside of the lock. + +Fixes: 9ef0d6f7628b ("gpiolib: call pin removal in chip removal function") +Fixes: f23f1516b675 ("gpiolib: provide provision to register pin ranges") +Signed-off-by: Johan Hovold +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpiolib.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/gpio/gpiolib.c ++++ b/drivers/gpio/gpiolib.c +@@ -319,12 +319,10 @@ void gpiochip_remove(struct gpio_chip *c + gpiochip_irqchip_remove(chip); + + acpi_gpiochip_remove(chip); +- +- spin_lock_irqsave(&gpio_lock, flags); +- + gpiochip_remove_pin_ranges(chip); + of_gpiochip_remove(chip); + ++ spin_lock_irqsave(&gpio_lock, flags); + for (id = 0; id < chip->ngpio; id++) { + if (test_bit(FLAG_REQUESTED, &chip->desc[id].flags)) + dev_crit(chip->dev, "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n"); diff --git a/queue-3.18/gpio-sysfs-fix-gpio-chip-device-attribute-leak.patch b/queue-3.18/gpio-sysfs-fix-gpio-chip-device-attribute-leak.patch new file mode 100644 index 00000000000..65542613fd9 --- /dev/null +++ b/queue-3.18/gpio-sysfs-fix-gpio-chip-device-attribute-leak.patch @@ -0,0 +1,67 @@ +From 121b6a79955a3a3fd7bbb9b8cb88d5b9dad6283d Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Tue, 13 Jan 2015 13:00:04 +0100 +Subject: gpio: sysfs: fix gpio-chip device-attribute leak + +From: Johan Hovold + +commit 121b6a79955a3a3fd7bbb9b8cb88d5b9dad6283d upstream. + +The gpio-chip device attributes were never destroyed when the device was +removed. + +Fix by using device_create_with_groups() to create the device attributes +of the chip class device. + +Note that this also fixes the attribute-creation race with userspace. + +Fixes: d8f388d8dc8d ("gpio: sysfs interface") +Signed-off-by: Johan Hovold +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpiolib-sysfs.c | 19 ++++++++----------- + 1 file changed, 8 insertions(+), 11 deletions(-) + +--- a/drivers/gpio/gpiolib-sysfs.c ++++ b/drivers/gpio/gpiolib-sysfs.c +@@ -400,16 +400,13 @@ static ssize_t chip_ngpio_show(struct de + } + static DEVICE_ATTR(ngpio, 0444, chip_ngpio_show, NULL); + +-static const struct attribute *gpiochip_attrs[] = { ++static struct attribute *gpiochip_attrs[] = { + &dev_attr_base.attr, + &dev_attr_label.attr, + &dev_attr_ngpio.attr, + NULL, + }; +- +-static const struct attribute_group gpiochip_attr_group = { +- .attrs = (struct attribute **) gpiochip_attrs, +-}; ++ATTRIBUTE_GROUPS(gpiochip); + + /* + * /sys/class/gpio/export ... write-only +@@ -750,13 +747,13 @@ int gpiochip_export(struct gpio_chip *ch + + /* use chip->base for the ID; it's already known to be unique */ + mutex_lock(&sysfs_lock); +- dev = device_create(&gpio_class, chip->dev, MKDEV(0, 0), chip, +- "gpiochip%d", chip->base); +- if (!IS_ERR(dev)) { +- status = sysfs_create_group(&dev->kobj, +- &gpiochip_attr_group); +- } else ++ dev = device_create_with_groups(&gpio_class, chip->dev, MKDEV(0, 0), ++ chip, gpiochip_groups, ++ "gpiochip%d", chip->base); ++ if (IS_ERR(dev)) + status = PTR_ERR(dev); ++ else ++ status = 0; + chip->exported = (status == 0); + mutex_unlock(&sysfs_lock); + diff --git a/queue-3.18/gpio-sysfs-fix-gpio-device-attribute-leak.patch b/queue-3.18/gpio-sysfs-fix-gpio-device-attribute-leak.patch new file mode 100644 index 00000000000..5df33ae6222 --- /dev/null +++ b/queue-3.18/gpio-sysfs-fix-gpio-device-attribute-leak.patch @@ -0,0 +1,109 @@ +From 0915e6feb38de8d3601819992a5bd050201a56fa Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Tue, 13 Jan 2015 13:00:05 +0100 +Subject: gpio: sysfs: fix gpio device-attribute leak + +From: Johan Hovold + +commit 0915e6feb38de8d3601819992a5bd050201a56fa upstream. + +The gpio device attributes were never destroyed when the gpio was +unexported (or on export failures). + +Use device_create_with_groups() to create the default device attributes +of the gpio class device. Note that this also fixes the +attribute-creation race with userspace for these attributes. + +Remove contingent attributes in export error path and on unexport. + +Fixes: d8f388d8dc8d ("gpio: sysfs interface") +Signed-off-by: Johan Hovold +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpiolib-sysfs.c | 28 +++++++++++++--------------- + 1 file changed, 13 insertions(+), 15 deletions(-) + +--- a/drivers/gpio/gpiolib-sysfs.c ++++ b/drivers/gpio/gpiolib-sysfs.c +@@ -128,7 +128,7 @@ static ssize_t gpio_value_store(struct d + return status; + } + +-static const DEVICE_ATTR(value, 0644, ++static DEVICE_ATTR(value, 0644, + gpio_value_show, gpio_value_store); + + static irqreturn_t gpio_sysfs_irq(int irq, void *priv) +@@ -353,18 +353,15 @@ static ssize_t gpio_active_low_store(str + return status ? : size; + } + +-static const DEVICE_ATTR(active_low, 0644, ++static DEVICE_ATTR(active_low, 0644, + gpio_active_low_show, gpio_active_low_store); + +-static const struct attribute *gpio_attrs[] = { ++static struct attribute *gpio_attrs[] = { + &dev_attr_value.attr, + &dev_attr_active_low.attr, + NULL, + }; +- +-static const struct attribute_group gpio_attr_group = { +- .attrs = (struct attribute **) gpio_attrs, +-}; ++ATTRIBUTE_GROUPS(gpio); + + /* + * /sys/class/gpio/gpiochipN/ +@@ -561,18 +558,15 @@ int gpiod_export(struct gpio_desc *desc, + if (desc->chip->names && desc->chip->names[offset]) + ioname = desc->chip->names[offset]; + +- dev = device_create(&gpio_class, desc->chip->dev, MKDEV(0, 0), +- desc, ioname ? ioname : "gpio%u", +- desc_to_gpio(desc)); ++ dev = device_create_with_groups(&gpio_class, desc->chip->dev, ++ MKDEV(0, 0), desc, gpio_groups, ++ ioname ? ioname : "gpio%u", ++ desc_to_gpio(desc)); + if (IS_ERR(dev)) { + status = PTR_ERR(dev); + goto fail_unlock; + } + +- status = sysfs_create_group(&dev->kobj, &gpio_attr_group); +- if (status) +- goto fail_unregister_device; +- + if (direction_may_change) { + status = device_create_file(dev, &dev_attr_direction); + if (status) +@@ -583,13 +577,15 @@ int gpiod_export(struct gpio_desc *desc, + !test_bit(FLAG_IS_OUT, &desc->flags))) { + status = device_create_file(dev, &dev_attr_edge); + if (status) +- goto fail_unregister_device; ++ goto fail_remove_attr_direction; + } + + set_bit(FLAG_EXPORT, &desc->flags); + mutex_unlock(&sysfs_lock); + return 0; + ++fail_remove_attr_direction: ++ device_remove_file(dev, &dev_attr_direction); + fail_unregister_device: + device_unregister(dev); + fail_unlock: +@@ -723,6 +719,8 @@ void gpiod_unexport(struct gpio_desc *de + mutex_unlock(&sysfs_lock); + + if (dev) { ++ device_remove_file(dev, &dev_attr_edge); ++ device_remove_file(dev, &dev_attr_direction); + device_unregister(dev); + put_device(dev); + } diff --git a/queue-3.18/gpiolib-of-correct-error-handling-in-of_get_named_gpiod_flags.patch b/queue-3.18/gpiolib-of-correct-error-handling-in-of_get_named_gpiod_flags.patch new file mode 100644 index 00000000000..658ffa56e62 --- /dev/null +++ b/queue-3.18/gpiolib-of-correct-error-handling-in-of_get_named_gpiod_flags.patch @@ -0,0 +1,43 @@ +From 7b8792bbdffdff3abda704f89c6a45ea97afdc62 Mon Sep 17 00:00:00 2001 +From: Hans Holmberg +Date: Fri, 9 Jan 2015 09:40:43 +0100 +Subject: gpiolib: of: Correct error handling in of_get_named_gpiod_flags + +From: Hans Holmberg + +commit 7b8792bbdffdff3abda704f89c6a45ea97afdc62 upstream. + +of_get_named_gpiod_flags fails with -EPROBE_DEFER in cases +where the gpio chip is available and the GPIO translation fails. + +This causes drivers to be re-probed erroneusly, and hides the +real problem(i.e. the GPIO number being out of range). + +Signed-off-by: Hans Holmberg +Reviewed-by: Alexandre Courbot +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpiolib-of.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/drivers/gpio/gpiolib-of.c ++++ b/drivers/gpio/gpiolib-of.c +@@ -45,8 +45,14 @@ static int of_gpiochip_find_and_xlate(st + return false; + + ret = gc->of_xlate(gc, &gg_data->gpiospec, gg_data->flags); +- if (ret < 0) +- return false; ++ if (ret < 0) { ++ /* We've found the gpio chip, but the translation failed. ++ * Return true to stop looking and return the translation ++ * error via out_gpio ++ */ ++ gg_data->out_gpio = ERR_PTR(ret); ++ return true; ++ } + + gg_data->out_gpio = gpiochip_get_desc(gc, ret); + return true; diff --git a/queue-3.18/pinctrl-lantiq-remove-bogus-of_gpio_chip_add.patch b/queue-3.18/pinctrl-lantiq-remove-bogus-of_gpio_chip_add.patch new file mode 100644 index 00000000000..293f2800983 --- /dev/null +++ b/queue-3.18/pinctrl-lantiq-remove-bogus-of_gpio_chip_add.patch @@ -0,0 +1,38 @@ +From 41f632fe177bc4822c2e8236fe7c291e6e9eb6f8 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 12 Jan 2015 17:20:51 +0100 +Subject: pinctrl: lantiq: remove bogus of_gpio_chip_add + +From: Johan Hovold + +commit 41f632fe177bc4822c2e8236fe7c291e6e9eb6f8 upstream. + +Remove bogus call to of_gpiochip_add (and of_gpio_chip remove in error +path) which is also called when adding the gpio chip. + +This prevents adding the same pinctrl range twice. + +Fixes: 3f8c50c9b110 ("OF: pinctrl: MIPS: lantiq: implement lantiq/xway +pinctrl support") + +Signed-off-by: Johan Hovold +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pinctrl/pinctrl-xway.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/pinctrl/pinctrl-xway.c ++++ b/drivers/pinctrl/pinctrl-xway.c +@@ -798,10 +798,8 @@ static int pinmux_xway_probe(struct plat + + /* load the gpio chip */ + xway_chip.dev = &pdev->dev; +- of_gpiochip_add(&xway_chip); + ret = gpiochip_add(&xway_chip); + if (ret) { +- of_gpiochip_remove(&xway_chip); + dev_err(&pdev->dev, "Failed to register gpio chip\n"); + return ret; + } diff --git a/queue-3.18/reset-sunxi-fix-spinlock-initialization.patch b/queue-3.18/reset-sunxi-fix-spinlock-initialization.patch new file mode 100644 index 00000000000..5ea754d93f8 --- /dev/null +++ b/queue-3.18/reset-sunxi-fix-spinlock-initialization.patch @@ -0,0 +1,49 @@ +From 41544f9f38f19cb46dc9a8fa37c58677a0300899 Mon Sep 17 00:00:00 2001 +From: Tyler Baker +Date: Mon, 12 Jan 2015 07:54:46 -0800 +Subject: reset: sunxi: fix spinlock initialization + +From: Tyler Baker + +commit 41544f9f38f19cb46dc9a8fa37c58677a0300899 upstream. + +Call spin_lock_init() before the spinlocks are used, both in early init +and probe functions preventing a lockdep splat. + +I have been observing lockdep complaining [1] during boot on my a80 optimus [2] +when CONFIG_PROVE_LOCKING has been enabled. This patch resolves the splat, +and has been tested on a few other sunxi platforms without issue. + +[1] http://storage.kernelci.org/next/next-20150107/arm-multi_v7_defconfig+CONFIG_PROVE_LOCKING=y/lab-tbaker/boot-sun9i-a80-optimus.html +[2] http://kernelci.org/boot/?a80-optimus + +Signed-off-by: Tyler Baker +Acked-by: Philipp Zabel +Signed-off-by: Kevin Hilman +Signed-off-by: Olof Johansson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/reset/reset-sunxi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/reset/reset-sunxi.c ++++ b/drivers/reset/reset-sunxi.c +@@ -102,6 +102,8 @@ static int sunxi_reset_init(struct devic + goto err_alloc; + } + ++ spin_lock_init(&data->lock); ++ + data->rcdev.owner = THIS_MODULE; + data->rcdev.nr_resets = size * 32; + data->rcdev.ops = &sunxi_reset_ops; +@@ -157,6 +159,8 @@ static int sunxi_reset_probe(struct plat + if (IS_ERR(data->membase)) + return PTR_ERR(data->membase); + ++ spin_lock_init(&data->lock); ++ + data->rcdev.owner = THIS_MODULE; + data->rcdev.nr_resets = resource_size(res) * 32; + data->rcdev.ops = &sunxi_reset_ops; diff --git a/queue-3.18/series b/queue-3.18/series index c77d8b8795e..7ce31d3ab2c 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -124,3 +124,16 @@ ftrace-fix-updating-of-filters-for-shared-global_ops-filters.patch ftrace-check-both-notrace-and-filter-for-old-hash.patch nfsv4.1-fix-client-id-trunking-on-linux.patch mei-clean-reset-bit-before-reset.patch +uas-add-us_fl_no_ata_1x-for-seagate-devices-with-usb-id-0bc2-a013.patch +uas-add-us_fl_no_report_opcodes-for-jmicron-jms566-with-usb-id-0bc2-a013.patch +uas-add-us_fl_no_ata_1x-for-2-more-seagate-disk-enclosures.patch +reset-sunxi-fix-spinlock-initialization.patch +arm-dts-berlin-correct-bg2q-s-sm-gpio-location.patch +pinctrl-lantiq-remove-bogus-of_gpio_chip_add.patch +gpiolib-of-correct-error-handling-in-of_get_named_gpiod_flags.patch +gpio-crystalcove-use-handle_nested_irq.patch +gpio-fix-memory-and-reference-leaks-in-gpiochip_add-error-path.patch +gpio-fix-memory-leak-and-sleep-while-atomic.patch +gpio-fix-sleep-while-atomic-in-gpiochip_remove.patch +gpio-sysfs-fix-gpio-chip-device-attribute-leak.patch +gpio-sysfs-fix-gpio-device-attribute-leak.patch diff --git a/queue-3.18/uas-add-us_fl_no_ata_1x-for-2-more-seagate-disk-enclosures.patch b/queue-3.18/uas-add-us_fl_no_ata_1x-for-2-more-seagate-disk-enclosures.patch new file mode 100644 index 00000000000..75411cfbe7a --- /dev/null +++ b/queue-3.18/uas-add-us_fl_no_ata_1x-for-2-more-seagate-disk-enclosures.patch @@ -0,0 +1,49 @@ +From 3ca8c717429b90f621aed28af029da4c3da378bc Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 8 Jan 2015 15:15:15 +0100 +Subject: uas: Add US_FL_NO_ATA_1X for 2 more Seagate disk enclosures + +From: Hans de Goede + +commit 3ca8c717429b90f621aed28af029da4c3da378bc upstream. + +Just like all previous UAS capable Seagate disk enclosures, these need the +US_FL_NO_ATA_1X to not crash when udev probes them. + +Signed-off-by: Hans de Goede +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/unusual_uas.h | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -75,6 +75,13 @@ UNUSUAL_DEV(0x0bc2, 0xa013, 0x0000, 0x99 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_NO_ATA_1X), + ++/* Reported-by: Hans de Goede */ ++UNUSUAL_DEV(0x0bc2, 0xa0a4, 0x0000, 0x9999, ++ "Seagate", ++ "Backup Plus Desk", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_NO_ATA_1X), ++ + /* https://bbs.archlinux.org/viewtopic.php?id=183190 */ + UNUSUAL_DEV(0x0bc2, 0xab20, 0x0000, 0x9999, + "Seagate", +@@ -89,6 +96,13 @@ UNUSUAL_DEV(0x0bc2, 0xab21, 0x0000, 0x99 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_NO_ATA_1X), + ++/* Reported-by: G. Richard Bellamy */ ++UNUSUAL_DEV(0x0bc2, 0xab2a, 0x0000, 0x9999, ++ "Seagate", ++ "BUP Fast HDD", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_NO_ATA_1X), ++ + /* Reported-by: Claudio Bizzarri */ + UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999, + "JMicron", diff --git a/queue-3.18/uas-add-us_fl_no_ata_1x-for-seagate-devices-with-usb-id-0bc2-a013.patch b/queue-3.18/uas-add-us_fl_no_ata_1x-for-seagate-devices-with-usb-id-0bc2-a013.patch new file mode 100644 index 00000000000..9756b9c62e9 --- /dev/null +++ b/queue-3.18/uas-add-us_fl_no_ata_1x-for-seagate-devices-with-usb-id-0bc2-a013.patch @@ -0,0 +1,36 @@ +From e5797a3d079f3e5049140055d850691b5cc7d10a Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 5 Dec 2014 11:11:29 +0100 +Subject: uas: Add US_FL_NO_ATA_1X for Seagate devices with usb-id 0bc2:a013 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Hans de Goede + +commit e5797a3d079f3e5049140055d850691b5cc7d10a upstream. + +This is yet another Seagate device which needs the US_FL_NO_ATA_1X quirk + +Reported-by: Marcin Zajączkowski +Signed-off-by: Hans de Goede +Signed-off-by: Greg Kroah-Hartman + +diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h +index 18a283d6de1c..2918376a1979 100644 +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -68,6 +68,13 @@ UNUSUAL_DEV(0x0bc2, 0xa003, 0x0000, 0x9999, + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_NO_ATA_1X), + ++/* Reported-by: Marcin Zajączkowski */ ++UNUSUAL_DEV(0x0bc2, 0xa013, 0x0000, 0x9999, ++ "Seagate", ++ "Backup Plus", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_NO_ATA_1X), ++ + /* https://bbs.archlinux.org/viewtopic.php?id=183190 */ + UNUSUAL_DEV(0x0bc2, 0xab20, 0x0000, 0x9999, + "Seagate", diff --git a/queue-3.18/uas-add-us_fl_no_report_opcodes-for-jmicron-jms566-with-usb-id-0bc2-a013.patch b/queue-3.18/uas-add-us_fl_no_report_opcodes-for-jmicron-jms566-with-usb-id-0bc2-a013.patch new file mode 100644 index 00000000000..aeea7e2d3df --- /dev/null +++ b/queue-3.18/uas-add-us_fl_no_report_opcodes-for-jmicron-jms566-with-usb-id-0bc2-a013.patch @@ -0,0 +1,34 @@ +From c6fa3945c8b5baf62f2e849104ecd6f3a1e5e407 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 8 Dec 2014 09:50:47 +0100 +Subject: uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS566 with usb-id 0bc2:a013 + +From: Hans de Goede + +commit c6fa3945c8b5baf62f2e849104ecd6f3a1e5e407 upstream. + +Like the JMicron JMS567 enclosures with the JMS566 choke on report-opcodes, +so avoid it. + +Tested-and-reported-by: Takeo Nakayama +Signed-off-by: Hans de Goede +Signed-off-by: Greg Kroah-Hartman + +diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h +index 2918376a1979..2f0a3d35269a 100644 +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -111,6 +111,13 @@ UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999, + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_NO_ATA_1X), + ++/* Reported-by: Takeo Nakayama */ ++UNUSUAL_DEV(0x357d, 0x7788, 0x0000, 0x9999, ++ "JMicron", ++ "JMS566", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_NO_REPORT_OPCODES), ++ + /* Reported-by: Hans de Goede */ + UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999, + "Hitachi",