--- /dev/null
+From 5138d5c562e3bfe30964e20ab46eec9f8b89225d Mon Sep 17 00:00:00 2001
+From: Jisheng Zhang <jszhang@marvell.com>
+Date: Fri, 26 Dec 2014 16:58:01 +0800
+Subject: ARM: dts: berlin: correct BG2Q's SM GPIO location.
+
+From: Jisheng Zhang <jszhang@marvell.com>
+
+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 <jszhang@marvell.com>
+Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+ };
+-
+- 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>;
--- /dev/null
+From e733a2fb8cbcff0747108cb529ffb4e4a00465ac Mon Sep 17 00:00:00 2001
+From: Aaron Lu <aaron.lu@intel.com>
+Date: Mon, 12 Jan 2015 10:09:32 +0800
+Subject: gpio: crystalcove: use handle_nested_irq
+
+From: Aaron Lu <aaron.lu@intel.com>
+
+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] [<c16e0257>] dump_stack+0x41/0x52
+[ 4089.639707] [<c105390c>] warn_slowpath_common+0x8c/0xc0
+[ 4089.639727] [<c10a60fc>] ? irq_nested_primary_handler+0x2c/0x30
+[ 4089.639744] [<c10a60fc>] ? irq_nested_primary_handler+0x2c/0x30
+[ 4089.639763] [<c1053974>] warn_slowpath_fmt+0x34/0x40
+[ 4089.639781] [<c10a60fc>] irq_nested_primary_handler+0x2c/0x30
+[ 4089.639800] [<c10a5c56>] handle_irq_event_percpu+0x76/0x190
+[ 4089.639818] [<c1461570>] ? regmap_format_10_14_write+0x30/0x30
+[ 4089.639836] [<c1464f4c>] ? _regmap_bus_raw_write+0x4c/0x70
+[ 4089.639854] [<c10a5da1>] handle_irq_event+0x31/0x50
+[ 4089.639872] [<c10a83eb>] handle_simple_irq+0x4b/0x70
+[ 4089.639889] [<c10a5384>] generic_handle_irq+0x24/0x40
+[ 4089.639908] [<c1366d87>] crystalcove_gpio_irq_handler+0xa7/0xc0
+[ 4089.639927] [<c10a85a7>] handle_nested_irq+0x77/0x190
+[ 4089.639947] [<c1469801>] regmap_irq_thread+0x1b1/0x360
+[ 4089.639966] [<c10a6ae8>] irq_thread_fn+0x18/0x30
+[ 4089.639983] [<c10a6906>] irq_thread+0xf6/0x110
+[ 4089.640001] [<c10a6ad0>] ? irq_finalize_oneshot.part.30+0x1b0/0x1b0
+[ 4089.640019] [<c10a6b50>] ? irq_forced_thread_fn+0x50/0x50
+[ 4089.640037] [<c10a6810>] ? irq_thread_check_affinity+0xc0/0xc0
+[ 4089.640054] [<c106f389>] kthread+0xa9/0xc0
+[ 4089.640074] [<c16e6401>] ret_from_kernel_thread+0x21/0x30
+[ 4089.640091] [<c106f2e0>] ? 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 <bloften80@gmail.com>
+Signed-off-by: Aaron Lu <aaron.lu@intel.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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);
+ }
+ }
+
--- /dev/null
+From 5539b3c938d64a60cb1fc442ac3ce9263d52de0c Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Mon, 12 Jan 2015 17:12:24 +0100
+Subject: gpio: fix memory and reference leaks in gpiochip_add error path
+
+From: Johan Hovold <johan@kernel.org>
+
+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 <johan@kernel.org>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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,
--- /dev/null
+From 00acc3dc248063f982cfacfbe5e78c0d6797ffef Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Mon, 12 Jan 2015 17:12:27 +0100
+Subject: gpio: fix memory leak and sleep-while-atomic
+
+From: Johan Hovold <johan@kernel.org>
+
+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 <johan@kernel.org>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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);
+
--- /dev/null
+From 6798acaa0138d8b12f1c54402ebcb66fea3deb03 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Mon, 12 Jan 2015 17:12:28 +0100
+Subject: gpio: fix sleep-while-atomic in gpiochip_remove
+
+From: Johan Hovold <johan@kernel.org>
+
+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 <johan@kernel.org>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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");
--- /dev/null
+From 121b6a79955a3a3fd7bbb9b8cb88d5b9dad6283d Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Tue, 13 Jan 2015 13:00:04 +0100
+Subject: gpio: sysfs: fix gpio-chip device-attribute leak
+
+From: Johan Hovold <johan@kernel.org>
+
+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 <johan@kernel.org>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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);
+
--- /dev/null
+From 0915e6feb38de8d3601819992a5bd050201a56fa Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Tue, 13 Jan 2015 13:00:05 +0100
+Subject: gpio: sysfs: fix gpio device-attribute leak
+
+From: Johan Hovold <johan@kernel.org>
+
+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 <johan@kernel.org>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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);
+ }
--- /dev/null
+From 7b8792bbdffdff3abda704f89c6a45ea97afdc62 Mon Sep 17 00:00:00 2001
+From: Hans Holmberg <hans.holmberg@intel.com>
+Date: Fri, 9 Jan 2015 09:40:43 +0100
+Subject: gpiolib: of: Correct error handling in of_get_named_gpiod_flags
+
+From: Hans Holmberg <hans.holmberg@intel.com>
+
+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 <hans.holmberg@intel.com>
+Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
--- /dev/null
+From 41f632fe177bc4822c2e8236fe7c291e6e9eb6f8 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Mon, 12 Jan 2015 17:20:51 +0100
+Subject: pinctrl: lantiq: remove bogus of_gpio_chip_add
+
+From: Johan Hovold <johan@kernel.org>
+
+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 <johan@kernel.org>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
+ }
--- /dev/null
+From 41544f9f38f19cb46dc9a8fa37c58677a0300899 Mon Sep 17 00:00:00 2001
+From: Tyler Baker <tyler.baker@linaro.org>
+Date: Mon, 12 Jan 2015 07:54:46 -0800
+Subject: reset: sunxi: fix spinlock initialization
+
+From: Tyler Baker <tyler.baker@linaro.org>
+
+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 <tyler.baker@linaro.org>
+Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
+Signed-off-by: Kevin Hilman <khilman@linaro.org>
+Signed-off-by: Olof Johansson <olof@lixom.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
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
--- /dev/null
+From 3ca8c717429b90f621aed28af029da4c3da378bc Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+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 <hdegoede@redhat.com>
+
+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 <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 <hdegoede@redhat.com> */
++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 <rbellamy@pteradigm.com> */
++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 <claudio.bizzarri@gmail.com> */
+ UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999,
+ "JMicron",
--- /dev/null
+From e5797a3d079f3e5049140055d850691b5cc7d10a Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+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 <hdegoede@redhat.com>
+
+commit e5797a3d079f3e5049140055d850691b5cc7d10a upstream.
+
+This is yet another Seagate device which needs the US_FL_NO_ATA_1X quirk
+
+Reported-by: Marcin Zajączkowski <mszpak@wp.pl>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+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 <mszpak@wp.pl> */
++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",
--- /dev/null
+From c6fa3945c8b5baf62f2e849104ecd6f3a1e5e407 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+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 <hdegoede@redhat.com>
+
+commit c6fa3945c8b5baf62f2e849104ecd6f3a1e5e407 upstream.
+
+Like the JMicron JMS567 enclosures with the JMS566 choke on report-opcodes,
+so avoid it.
+
+Tested-and-reported-by: Takeo Nakayama <javhera@gmx.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+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 <javhera@gmx.com> */
++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 <hdegoede@redhat.com> */
+ UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999,
+ "Hitachi",