+++ /dev/null
-From 2b76d9221a02fa69bbb8c1045616afb923fc6bad Mon Sep 17 00:00:00 2001
-From: David Daney <david.daney@cavium.com>
-Date: Fri, 24 May 2013 20:54:08 +0000
-Subject: [PATCH] MIPS: Declare emulate_load_store_microMIPS as a static
- function.
-
-commit 74338805ec6869594d583535f941cb478c94dd73 upstream.
-
-It is only used from within a single file, it should not be globally
-visible.
-
-Signed-off-by: David Daney <david.daney@cavium.com>
-Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>
-Cc: linux-mips@linux-mips.org
-Patchwork: https://patchwork.linux-mips.org/patch/5325/
-Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
----
- arch/mips/kernel/unaligned.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
---- a/arch/mips/kernel/unaligned.c
-+++ b/arch/mips/kernel/unaligned.c
-@@ -684,7 +684,8 @@ const int reg16to32[] = { 16, 17, 2, 3,
- /* Recode table from 16-bit STORE register notation to 32-bit GPR. */
- const int reg16to32st[] = { 0, 17, 2, 3, 4, 5, 6, 7 };
-
--void emulate_load_store_microMIPS(struct pt_regs *regs, void __user * addr)
-+static void emulate_load_store_microMIPS(struct pt_regs *regs,
-+ void __user *addr)
- {
- unsigned long value;
- unsigned int res;
+++ /dev/null
-From 15a051ad98309f71989f9bda4b020fff160f4022 Mon Sep 17 00:00:00 2001
-From: David Daney <david.daney@cavium.com>
-Date: Fri, 24 May 2013 20:54:10 +0000
-Subject: [PATCH 2/2] MIPS: Only set cpu_has_mmips if SYS_SUPPORTS_MICROMIPS
-
-commit 3ddc14add5e6341cf8ef4058c34c67ba7fd15317 upstream.
-
-As Jonas Gorske said in his patch:
-
- Disable cpu_has_mmips for everything but SEAD3 and MALTA. Most of
- these platforms are from before the micromips introduction, so they
- are very unlikely to implement it.
-
- Reduces an -Os compiled, uncompressed kernel image by 8KiB for
- BCM63XX.
-
-This patch taks a different approach than his, we gate the runtime
-test for microMIPS by the config symbol SYS_SUPPORTS_MICROMIPS.
-
-Signed-off-by: David Daney <david.daney@cavium.com>
-Cc: Jonas Gorski <jogo@openwrt.org>
-Cc: Steven J. Hill <Steven.Hill@imgtec.com>
-Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>
-Cc: linux-mips@linux-mips.org
-Patchwork: https://patchwork.linux-mips.org/patch/5327/
-Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
----
- arch/mips/include/asm/cpu-features.h | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
---- a/arch/mips/include/asm/cpu-features.h
-+++ b/arch/mips/include/asm/cpu-features.h
-@@ -99,7 +99,11 @@
- #define cpu_has_rixi (cpu_data[0].options & MIPS_CPU_RIXI)
- #endif
- #ifndef cpu_has_mmips
--#define cpu_has_mmips (cpu_data[0].options & MIPS_CPU_MICROMIPS)
-+# ifdef CONFIG_SYS_SUPPORTS_MICROMIPS
-+# define cpu_has_mmips (cpu_data[0].options & MIPS_CPU_MICROMIPS)
-+# else
-+# define cpu_has_mmips 0
-+# endif
- #endif
- #ifndef cpu_has_vtag_icache
- #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG)
--- /dev/null
+From 2b76d9221a02fa69bbb8c1045616afb923fc6bad Mon Sep 17 00:00:00 2001
+From: David Daney <david.daney@cavium.com>
+Date: Fri, 24 May 2013 20:54:08 +0000
+Subject: [PATCH] MIPS: Declare emulate_load_store_microMIPS as a static
+ function.
+
+commit 74338805ec6869594d583535f941cb478c94dd73 upstream.
+
+It is only used from within a single file, it should not be globally
+visible.
+
+Signed-off-by: David Daney <david.daney@cavium.com>
+Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>
+Cc: linux-mips@linux-mips.org
+Patchwork: https://patchwork.linux-mips.org/patch/5325/
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+---
+ arch/mips/kernel/unaligned.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/mips/kernel/unaligned.c
++++ b/arch/mips/kernel/unaligned.c
+@@ -684,7 +684,8 @@ const int reg16to32[] = { 16, 17, 2, 3,
+ /* Recode table from 16-bit STORE register notation to 32-bit GPR. */
+ const int reg16to32st[] = { 0, 17, 2, 3, 4, 5, 6, 7 };
+
+-void emulate_load_store_microMIPS(struct pt_regs *regs, void __user * addr)
++static void emulate_load_store_microMIPS(struct pt_regs *regs,
++ void __user *addr)
+ {
+ unsigned long value;
+ unsigned int res;
--- /dev/null
+From 15a051ad98309f71989f9bda4b020fff160f4022 Mon Sep 17 00:00:00 2001
+From: David Daney <david.daney@cavium.com>
+Date: Fri, 24 May 2013 20:54:10 +0000
+Subject: [PATCH 2/2] MIPS: Only set cpu_has_mmips if SYS_SUPPORTS_MICROMIPS
+
+commit 3ddc14add5e6341cf8ef4058c34c67ba7fd15317 upstream.
+
+As Jonas Gorske said in his patch:
+
+ Disable cpu_has_mmips for everything but SEAD3 and MALTA. Most of
+ these platforms are from before the micromips introduction, so they
+ are very unlikely to implement it.
+
+ Reduces an -Os compiled, uncompressed kernel image by 8KiB for
+ BCM63XX.
+
+This patch taks a different approach than his, we gate the runtime
+test for microMIPS by the config symbol SYS_SUPPORTS_MICROMIPS.
+
+Signed-off-by: David Daney <david.daney@cavium.com>
+Cc: Jonas Gorski <jogo@openwrt.org>
+Cc: Steven J. Hill <Steven.Hill@imgtec.com>
+Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>
+Cc: linux-mips@linux-mips.org
+Patchwork: https://patchwork.linux-mips.org/patch/5327/
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+---
+ arch/mips/include/asm/cpu-features.h | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/arch/mips/include/asm/cpu-features.h
++++ b/arch/mips/include/asm/cpu-features.h
+@@ -99,7 +99,11 @@
+ #define cpu_has_rixi (cpu_data[0].options & MIPS_CPU_RIXI)
+ #endif
+ #ifndef cpu_has_mmips
+-#define cpu_has_mmips (cpu_data[0].options & MIPS_CPU_MICROMIPS)
++# ifdef CONFIG_SYS_SUPPORTS_MICROMIPS
++# define cpu_has_mmips (cpu_data[0].options & MIPS_CPU_MICROMIPS)
++# else
++# define cpu_has_mmips 0
++# endif
+ #endif
+ #ifndef cpu_has_vtag_icache
+ #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG)
--- /dev/null
+From 45ab9702fb47d18dca116b3a0509efa19fbcb27a Mon Sep 17 00:00:00 2001
+From: Thierry Reding <thierry.reding@avionic-design.de>
+Date: Thu, 16 May 2013 17:55:18 +0200
+Subject: [PATCH] of/pci: Add of_pci_get_devfn() function
+
+commit 45ab9702fb47d18dca116b3a0509efa19fbcb27a upstream.
+
+This function can be used to parse the device and function number from a
+standard 5-cell PCI resource. PCI_SLOT() and PCI_FUNC() can be used on
+the returned value obtain the device and function numbers respectively.
+
+Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+---
+ drivers/of/of_pci.c | 34 +++++++++++++++++++++++++++++-----
+ include/linux/of_pci.h | 1 +
+ 2 files changed, 30 insertions(+), 5 deletions(-)
+
+--- a/drivers/of/of_pci.c
++++ b/drivers/of/of_pci.c
+@@ -5,14 +5,15 @@
+ #include <asm/prom.h>
+
+ static inline int __of_pci_pci_compare(struct device_node *node,
+- unsigned int devfn)
++ unsigned int data)
+ {
+- unsigned int size;
+- const __be32 *reg = of_get_property(node, "reg", &size);
++ int devfn;
+
+- if (!reg || size < 5 * sizeof(__be32))
++ devfn = of_pci_get_devfn(node);
++ if (devfn < 0)
+ return 0;
+- return ((be32_to_cpup(®[0]) >> 8) & 0xff) == devfn;
++
++ return devfn == data;
+ }
+
+ struct device_node *of_pci_find_child_device(struct device_node *parent,
+@@ -40,3 +41,26 @@ struct device_node *of_pci_find_child_de
+ return NULL;
+ }
+ EXPORT_SYMBOL_GPL(of_pci_find_child_device);
++
++/**
++ * of_pci_get_devfn() - Get device and function numbers for a device node
++ * @np: device node
++ *
++ * Parses a standard 5-cell PCI resource and returns an 8-bit value that can
++ * be passed to the PCI_SLOT() and PCI_FUNC() macros to extract the device
++ * and function numbers respectively. On error a negative error code is
++ * returned.
++ */
++int of_pci_get_devfn(struct device_node *np)
++{
++ unsigned int size;
++ const __be32 *reg;
++
++ reg = of_get_property(np, "reg", &size);
++
++ if (!reg || size < 5 * sizeof(__be32))
++ return -EINVAL;
++
++ return (be32_to_cpup(reg) >> 8) & 0xff;
++}
++EXPORT_SYMBOL_GPL(of_pci_get_devfn);
+--- a/include/linux/of_pci.h
++++ b/include/linux/of_pci.h
+@@ -10,5 +10,6 @@ int of_irq_map_pci(const struct pci_dev
+ struct device_node;
+ struct device_node *of_pci_find_child_device(struct device_node *parent,
+ unsigned int devfn);
++int of_pci_get_devfn(struct device_node *np);
+
+ #endif
--- /dev/null
+From 35e57e1b49a351aa804dab6010cd46ae6112a541 Mon Sep 17 00:00:00 2001
+From: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
+Date: Wed, 21 Aug 2013 01:43:07 -0700
+Subject: [PATCH] hso: Earlier catch of error condition
+
+commit 35e57e1b49a351aa804dab6010cd46ae6112a541 upstream.
+
+There is no need to get an interface specification if we know it's the
+wrong one.
+
+Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
+Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/usb/hso.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/usb/hso.c
++++ b/drivers/net/usb/hso.c
+@@ -2886,6 +2886,11 @@ static int hso_probe(struct usb_interfac
+ struct hso_shared_int *shared_int;
+ struct hso_device *tmp_dev = NULL;
+
++ if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
++ dev_err(&interface->dev, "Not our interface\n");
++ return -ENODEV;
++ }
++
+ if_num = interface->altsetting->desc.bInterfaceNumber;
+
+ /* Get the interface/port specification from either driver_info or from
+@@ -2895,10 +2900,6 @@ static int hso_probe(struct usb_interfac
+ else
+ port_spec = hso_get_config_data(interface);
+
+- if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
+- dev_err(&interface->dev, "Not our interface\n");
+- return -ENODEV;
+- }
+ /* Check if we need to switch to alt interfaces prior to port
+ * configuration */
+ if (interface->num_altsetting > 1)
--- /dev/null
+From e75dc677ff8d06ffa61bef6fee436227ae5440c6 Mon Sep 17 00:00:00 2001
+From: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
+Date: Wed, 21 Aug 2013 01:43:19 -0700
+Subject: [PATCH] hso: Fix stack corruption on some architectures
+
+commit e75dc677ff8d06ffa61bef6fee436227ae5440c6 upstream.
+
+As Sergei Shtylyov explained in the #mipslinux IRC channel:
+[Mon 2013-08-19 12:28:21 PM PDT] <headless> guys, are you sure it's not "DMA off stack" case?
+[Mon 2013-08-19 12:28:35 PM PDT] <headless> it's a known stack corruptor on non-coherent arches
+[Mon 2013-08-19 12:31:48 PM PDT] <DonkeyHotei> headless: for usb/ehci?
+[Mon 2013-08-19 12:34:11 PM PDT] <DonkeyHotei> headless: explain
+[Mon 2013-08-19 12:35:38 PM PDT] <headless> usb_control_msg() (or other such func) should not use buffer on stack. DMA from/to stack is prohibited
+[Mon 2013-08-19 12:35:58 PM PDT] <headless> and EHCI uses DMA on control xfers (as well as all the others)
+
+Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
+Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/usb/hso.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/usb/hso.c
++++ b/drivers/net/usb/hso.c
+@@ -2816,13 +2816,16 @@ exit:
+ static int hso_get_config_data(struct usb_interface *interface)
+ {
+ struct usb_device *usbdev = interface_to_usbdev(interface);
+- u8 config_data[17];
++ u8 *config_data = kmalloc(17, GFP_KERNEL);
+ u32 if_num = interface->altsetting->desc.bInterfaceNumber;
+ s32 result;
+
++ if (!config_data)
++ return -ENOMEM;
+ if (usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0),
+ 0x86, 0xC0, 0, 0, config_data, 17,
+ USB_CTRL_SET_TIMEOUT) != 0x11) {
++ kfree(config_data);
+ return -EIO;
+ }
+
+@@ -2873,6 +2876,7 @@ static int hso_get_config_data(struct us
+ if (config_data[16] & 0x1)
+ result |= HSO_INFO_CRC_BUG;
+
++ kfree(config_data);
+ return result;
+ }
+
+++ /dev/null
-From 45ab9702fb47d18dca116b3a0509efa19fbcb27a Mon Sep 17 00:00:00 2001
-From: Thierry Reding <thierry.reding@avionic-design.de>
-Date: Thu, 16 May 2013 17:55:18 +0200
-Subject: [PATCH] of/pci: Add of_pci_get_devfn() function
-
-commit 45ab9702fb47d18dca116b3a0509efa19fbcb27a upstream.
-
-This function can be used to parse the device and function number from a
-standard 5-cell PCI resource. PCI_SLOT() and PCI_FUNC() can be used on
-the returned value obtain the device and function numbers respectively.
-
-Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Signed-off-by: Jason Cooper <jason@lakedaemon.net>
----
- drivers/of/of_pci.c | 34 +++++++++++++++++++++++++++++-----
- include/linux/of_pci.h | 1 +
- 2 files changed, 30 insertions(+), 5 deletions(-)
-
---- a/drivers/of/of_pci.c
-+++ b/drivers/of/of_pci.c
-@@ -5,14 +5,15 @@
- #include <asm/prom.h>
-
- static inline int __of_pci_pci_compare(struct device_node *node,
-- unsigned int devfn)
-+ unsigned int data)
- {
-- unsigned int size;
-- const __be32 *reg = of_get_property(node, "reg", &size);
-+ int devfn;
-
-- if (!reg || size < 5 * sizeof(__be32))
-+ devfn = of_pci_get_devfn(node);
-+ if (devfn < 0)
- return 0;
-- return ((be32_to_cpup(®[0]) >> 8) & 0xff) == devfn;
-+
-+ return devfn == data;
- }
-
- struct device_node *of_pci_find_child_device(struct device_node *parent,
-@@ -40,3 +41,26 @@ struct device_node *of_pci_find_child_de
- return NULL;
- }
- EXPORT_SYMBOL_GPL(of_pci_find_child_device);
-+
-+/**
-+ * of_pci_get_devfn() - Get device and function numbers for a device node
-+ * @np: device node
-+ *
-+ * Parses a standard 5-cell PCI resource and returns an 8-bit value that can
-+ * be passed to the PCI_SLOT() and PCI_FUNC() macros to extract the device
-+ * and function numbers respectively. On error a negative error code is
-+ * returned.
-+ */
-+int of_pci_get_devfn(struct device_node *np)
-+{
-+ unsigned int size;
-+ const __be32 *reg;
-+
-+ reg = of_get_property(np, "reg", &size);
-+
-+ if (!reg || size < 5 * sizeof(__be32))
-+ return -EINVAL;
-+
-+ return (be32_to_cpup(reg) >> 8) & 0xff;
-+}
-+EXPORT_SYMBOL_GPL(of_pci_get_devfn);
---- a/include/linux/of_pci.h
-+++ b/include/linux/of_pci.h
-@@ -10,5 +10,6 @@ int of_irq_map_pci(const struct pci_dev
- struct device_node;
- struct device_node *of_pci_find_child_device(struct device_node *parent,
- unsigned int devfn);
-+int of_pci_get_devfn(struct device_node *np);
-
- #endif
+++ /dev/null
-From 35e57e1b49a351aa804dab6010cd46ae6112a541 Mon Sep 17 00:00:00 2001
-From: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
-Date: Wed, 21 Aug 2013 01:43:07 -0700
-Subject: [PATCH] hso: Earlier catch of error condition
-
-commit 35e57e1b49a351aa804dab6010cd46ae6112a541 upstream.
-
-There is no need to get an interface specification if we know it's the
-wrong one.
-
-Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
-Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- drivers/net/usb/hso.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
---- a/drivers/net/usb/hso.c
-+++ b/drivers/net/usb/hso.c
-@@ -2886,6 +2886,11 @@ static int hso_probe(struct usb_interfac
- struct hso_shared_int *shared_int;
- struct hso_device *tmp_dev = NULL;
-
-+ if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
-+ dev_err(&interface->dev, "Not our interface\n");
-+ return -ENODEV;
-+ }
-+
- if_num = interface->altsetting->desc.bInterfaceNumber;
-
- /* Get the interface/port specification from either driver_info or from
-@@ -2895,10 +2900,6 @@ static int hso_probe(struct usb_interfac
- else
- port_spec = hso_get_config_data(interface);
-
-- if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
-- dev_err(&interface->dev, "Not our interface\n");
-- return -ENODEV;
-- }
- /* Check if we need to switch to alt interfaces prior to port
- * configuration */
- if (interface->num_altsetting > 1)
+++ /dev/null
-From e75dc677ff8d06ffa61bef6fee436227ae5440c6 Mon Sep 17 00:00:00 2001
-From: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
-Date: Wed, 21 Aug 2013 01:43:19 -0700
-Subject: [PATCH] hso: Fix stack corruption on some architectures
-
-commit e75dc677ff8d06ffa61bef6fee436227ae5440c6 upstream.
-
-As Sergei Shtylyov explained in the #mipslinux IRC channel:
-[Mon 2013-08-19 12:28:21 PM PDT] <headless> guys, are you sure it's not "DMA off stack" case?
-[Mon 2013-08-19 12:28:35 PM PDT] <headless> it's a known stack corruptor on non-coherent arches
-[Mon 2013-08-19 12:31:48 PM PDT] <DonkeyHotei> headless: for usb/ehci?
-[Mon 2013-08-19 12:34:11 PM PDT] <DonkeyHotei> headless: explain
-[Mon 2013-08-19 12:35:38 PM PDT] <headless> usb_control_msg() (or other such func) should not use buffer on stack. DMA from/to stack is prohibited
-[Mon 2013-08-19 12:35:58 PM PDT] <headless> and EHCI uses DMA on control xfers (as well as all the others)
-
-Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
-Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- drivers/net/usb/hso.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
---- a/drivers/net/usb/hso.c
-+++ b/drivers/net/usb/hso.c
-@@ -2816,13 +2816,16 @@ exit:
- static int hso_get_config_data(struct usb_interface *interface)
- {
- struct usb_device *usbdev = interface_to_usbdev(interface);
-- u8 config_data[17];
-+ u8 *config_data = kmalloc(17, GFP_KERNEL);
- u32 if_num = interface->altsetting->desc.bInterfaceNumber;
- s32 result;
-
-+ if (!config_data)
-+ return -ENOMEM;
- if (usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0),
- 0x86, 0xC0, 0, 0, config_data, 17,
- USB_CTRL_SET_TIMEOUT) != 0x11) {
-+ kfree(config_data);
- return -EIO;
- }
-
-@@ -2873,6 +2876,7 @@ static int hso_get_config_data(struct us
- if (config_data[16] & 0x1)
- result |= HSO_INFO_CRC_BUG;
-
-+ kfree(config_data);
- return result;
- }
-