--- /dev/null
+From 70c3250ac1374688d7963e562fe58b23f70bcba9 Mon Sep 17 00:00:00 2001
+From: Krzysztof Kozlowski <krzk@kernel.org>
+Date: Sat, 21 Apr 2018 20:26:41 +0200
+Subject: ARM: dts: exynos: Fix invalid node referenced by i2c20 alias in Peach Pit and Pi
+
+From: Krzysztof Kozlowski <krzk@kernel.org>
+
+commit 70c3250ac1374688d7963e562fe58b23f70bcba9 upstream.
+
+After moving all nodes under "soc" node in commit 5d99cc59a3c6 ("ARM:
+dts: exynos: Move Exynos5250 and Exynos5420 nodes under soc"), the i2c20
+alias in Peach Pit and Peach Pi stopped pointing to proper node:
+
+ arch/arm/boot/dts/exynos5420-peach-pit.dtb: Warning (alias_paths):
+ /aliases:i2c20: aliases property is not a valid node (/spi@12d40000/cros-ec@0/i2c-tunnel)
+ arch/arm/boot/dts/exynos5800-peach-pi.dtb: Warning (alias_paths):
+ /aliases:i2c20: aliases property is not a valid node (/spi@12d40000/cros-ec@0/i2c-tunnel)
+
+Fixes: 5d99cc59a3c6 ("ARM: dts: exynos: Move Exynos5250 and Exynos5420 nodes under soc")
+Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/exynos5420-peach-pit.dts | 4 ++--
+ arch/arm/boot/dts/exynos5800-peach-pi.dts | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/arch/arm/boot/dts/exynos5420-peach-pit.dts
++++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts
+@@ -31,7 +31,7 @@
+
+ aliases {
+ /* Assign 20 so we don't get confused w/ builtin ones */
+- i2c20 = "/spi@12d40000/cros-ec@0/i2c-tunnel";
++ i2c20 = &i2c_tunnel;
+ };
+
+ backlight: backlight {
+@@ -952,7 +952,7 @@
+ samsung,spi-feedback-delay = <1>;
+ };
+
+- i2c-tunnel {
++ i2c_tunnel: i2c-tunnel {
+ compatible = "google,cros-ec-i2c-tunnel";
+ #address-cells = <1>;
+ #size-cells = <0>;
+--- a/arch/arm/boot/dts/exynos5800-peach-pi.dts
++++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts
+@@ -29,7 +29,7 @@
+
+ aliases {
+ /* Assign 20 so we don't get confused w/ builtin ones */
+- i2c20 = "/spi@12d40000/cros-ec@0/i2c-tunnel";
++ i2c20 = &i2c_tunnel;
+ };
+
+ backlight: backlight {
+@@ -921,7 +921,7 @@
+ samsung,spi-feedback-delay = <1>;
+ };
+
+- i2c-tunnel {
++ i2c_tunnel: i2c-tunnel {
+ compatible = "google,cros-ec-i2c-tunnel";
+ #address-cells = <1>;
+ #size-cells = <0>;
--- /dev/null
+From 5b23fceec1ff94305c5d1accde018cae27448005 Mon Sep 17 00:00:00 2001
+From: Marek Szyprowski <m.szyprowski@samsung.com>
+Date: Tue, 13 Mar 2018 11:46:12 +0100
+Subject: clk: samsung: exynos5250: Add missing clocks for FIMC LITE SYSMMU devices
+
+From: Marek Szyprowski <m.szyprowski@samsung.com>
+
+commit 5b23fceec1ff94305c5d1accde018cae27448005 upstream.
+
+FIMC LITE SYSMMU devices are defined in exynos5250.dtsi, but clocks for
+them are not instantiated by Exynos5250 clock provider driver. Add needed
+definitions for those clocks to fix IOMMU probe failure:
+
+ERROR: could not get clock /soc/sysmmu@13c40000:sysmmu(0)
+exynos-sysmmu 13c40000.sysmmu: Failed to get device clock(s)!
+exynos-sysmmu: probe of 13c40000.sysmmu failed with error -38
+ERROR: could not get clock /soc/sysmmu@13c50000:sysmmu(0)
+exynos-sysmmu 13c50000.sysmmu: Failed to get device clock(s)!
+exynos-sysmmu: probe of 13c50000.sysmmu failed with error -38
+
+Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
+Fixes: bfed1074f213 ("clk: exynos5250: Add missing sysmmu clocks for DISP and ISP blocks")
+Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
+Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/clk/samsung/clk-exynos5250.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/clk/samsung/clk-exynos5250.c
++++ b/drivers/clk/samsung/clk-exynos5250.c
+@@ -560,6 +560,8 @@ static const struct samsung_gate_clock e
+ 0),
+ GATE(CLK_GSCL3, "gscl3", "mout_aclk266_gscl_sub", GATE_IP_GSCL, 3, 0,
+ 0),
++ GATE(CLK_CAMIF_TOP, "camif_top", "mout_aclk266_gscl_sub",
++ GATE_IP_GSCL, 4, 0, 0),
+ GATE(CLK_GSCL_WA, "gscl_wa", "div_gscl_wa", GATE_IP_GSCL, 5, 0, 0),
+ GATE(CLK_GSCL_WB, "gscl_wb", "div_gscl_wb", GATE_IP_GSCL, 6, 0, 0),
+ GATE(CLK_SMMU_GSCL0, "smmu_gscl0", "mout_aclk266_gscl_sub",
+@@ -570,6 +572,10 @@ static const struct samsung_gate_clock e
+ GATE_IP_GSCL, 9, 0, 0),
+ GATE(CLK_SMMU_GSCL3, "smmu_gscl3", "mout_aclk266_gscl_sub",
+ GATE_IP_GSCL, 10, 0, 0),
++ GATE(CLK_SMMU_FIMC_LITE0, "smmu_fimc_lite0", "mout_aclk266_gscl_sub",
++ GATE_IP_GSCL, 11, 0, 0),
++ GATE(CLK_SMMU_FIMC_LITE1, "smmu_fimc_lite1", "mout_aclk266_gscl_sub",
++ GATE_IP_GSCL, 12, 0, 0),
+
+ GATE(CLK_FIMD1, "fimd1", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 0, 0,
+ 0),
--- /dev/null
+From 2ec16150179888b81717d1d3ce84e634f4736af2 Mon Sep 17 00:00:00 2001
+From: Jeffy Chen <jeffy.chen@rock-chips.com>
+Date: Fri, 20 Oct 2017 20:01:01 +0800
+Subject: driver core: Move device_links_purge() after bus_remove_device()
+
+From: Jeffy Chen <jeffy.chen@rock-chips.com>
+
+commit 2ec16150179888b81717d1d3ce84e634f4736af2 upstream.
+
+The current ordering of code in device_del() triggers a WARN_ON()
+in device_links_purge(), because of an unexpected link status.
+
+The device_links_unbind_consumers() call in device_release_driver()
+has to take place before device_links_purge() for the status of all
+links to be correct, so move the device_links_purge() call in
+device_del() after the invocation of bus_remove_device() which calls
+device_release_driver().
+
+Fixes: 9ed9895370ae (driver core: Functional dependencies tracking support)
+Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
+Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/base/core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/base/core.c
++++ b/drivers/base/core.c
+@@ -1973,7 +1973,6 @@ void device_del(struct device *dev)
+ blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
+ BUS_NOTIFY_DEL_DEVICE, dev);
+
+- device_links_purge(dev);
+ dpm_sysfs_remove(dev);
+ if (parent)
+ klist_del(&dev->p->knode_parent);
+@@ -2001,6 +2000,7 @@ void device_del(struct device *dev)
+ device_pm_remove(dev);
+ driver_deferred_probe_del(dev);
+ device_remove_properties(dev);
++ device_links_purge(dev);
+
+ /* Notify the platform of the removal, in case they
+ * need to do anything...
--- /dev/null
+From 5a7189d529cd146cd5838af97b32fcac4122b471 Mon Sep 17 00:00:00 2001
+From: Mustafa Ismail <mustafa.ismail@intel.com>
+Date: Mon, 7 May 2018 12:52:17 -0500
+Subject: i40iw: Fix memory leak in error path of create QP
+
+From: Mustafa Ismail <mustafa.ismail@intel.com>
+
+commit 5a7189d529cd146cd5838af97b32fcac4122b471 upstream.
+
+If i40iw_allocate_dma_mem fails when creating a QP, the
+memory allocated for the QP structure using kzalloc is not
+freed because iwqp->allocated_buffer is used to free the
+memory and it is not setup until later. Fix this by setting
+iwqp->allocated_buffer before allocating the dma memory.
+
+Fixes: d37498417947 ("i40iw: add files for iwarp interface")
+Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
+Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
+Signed-off-by: Doug Ledford <dledford@redhat.com>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/infiniband/hw/i40iw/i40iw_verbs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
++++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
+@@ -631,6 +631,7 @@ static struct ib_qp *i40iw_create_qp(str
+ return ERR_PTR(-ENOMEM);
+
+ iwqp = (struct i40iw_qp *)mem;
++ iwqp->allocated_buffer = mem;
+ qp = &iwqp->sc_qp;
+ qp->back_qp = (void *)iwqp;
+ qp->push_idx = I40IW_INVALID_PUSH_PAGE_INDEX;
+@@ -659,7 +660,6 @@ static struct ib_qp *i40iw_create_qp(str
+ goto error;
+ }
+
+- iwqp->allocated_buffer = mem;
+ iwqp->iwdev = iwdev;
+ iwqp->iwpd = iwpd;
+ iwqp->ibqp.qp_num = qp_num;
--- /dev/null
+From 66e839030fd698586734e017fd55c4f2a89dba0b Mon Sep 17 00:00:00 2001
+From: Matt Chen <matt.chen@intel.com>
+Date: Fri, 3 Aug 2018 14:29:20 +0800
+Subject: iwlwifi: fix wrong WGDS_WIFI_DATA_SIZE
+
+From: Matt Chen <matt.chen@intel.com>
+
+commit 66e839030fd698586734e017fd55c4f2a89dba0b upstream.
+
+From coreboot/BIOS:
+Name ("WGDS", Package() {
+ Revision,
+ Package() {
+ DomainType, // 0x7:WiFi ==> We miss this one.
+ WgdsWiFiSarDeltaGroup1PowerMax1, // Group 1 FCC 2400 Max
+ WgdsWiFiSarDeltaGroup1PowerChainA1, // Group 1 FCC 2400 A Offset
+ WgdsWiFiSarDeltaGroup1PowerChainB1, // Group 1 FCC 2400 B Offset
+ WgdsWiFiSarDeltaGroup1PowerMax2, // Group 1 FCC 5200 Max
+ WgdsWiFiSarDeltaGroup1PowerChainA2, // Group 1 FCC 5200 A Offset
+ WgdsWiFiSarDeltaGroup1PowerChainB2, // Group 1 FCC 5200 B Offset
+ WgdsWiFiSarDeltaGroup2PowerMax1, // Group 2 EC Jap 2400 Max
+ WgdsWiFiSarDeltaGroup2PowerChainA1, // Group 2 EC Jap 2400 A Offset
+ WgdsWiFiSarDeltaGroup2PowerChainB1, // Group 2 EC Jap 2400 B Offset
+ WgdsWiFiSarDeltaGroup2PowerMax2, // Group 2 EC Jap 5200 Max
+ WgdsWiFiSarDeltaGroup2PowerChainA2, // Group 2 EC Jap 5200 A Offset
+ WgdsWiFiSarDeltaGroup2PowerChainB2, // Group 2 EC Jap 5200 B Offset
+ WgdsWiFiSarDeltaGroup3PowerMax1, // Group 3 ROW 2400 Max
+ WgdsWiFiSarDeltaGroup3PowerChainA1, // Group 3 ROW 2400 A Offset
+ WgdsWiFiSarDeltaGroup3PowerChainB1, // Group 3 ROW 2400 B Offset
+ WgdsWiFiSarDeltaGroup3PowerMax2, // Group 3 ROW 5200 Max
+ WgdsWiFiSarDeltaGroup3PowerChainA2, // Group 3 ROW 5200 A Offset
+ WgdsWiFiSarDeltaGroup3PowerChainB2, // Group 3 ROW 5200 B Offset
+ }
+})
+
+When read the ACPI data to find out the WGDS, the DATA_SIZE is never
+matched.
+From the above format, it gives 19 numbers, but our driver is hardcode
+as 18.
+Fix it to pass then can parse the data into our wgds table.
+Then we will see:
+iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init Sending GEO_TX_POWER_LIMIT
+iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[0]
+Band[0]: chain A = 68 chain B = 69 max_tx_power = 54
+iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[0]
+Band[1]: chain A = 48 chain B = 49 max_tx_power = 70
+iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[1]
+Band[0]: chain A = 51 chain B = 67 max_tx_power = 50
+iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[1]
+Band[1]: chain A = 69 chain B = 70 max_tx_power = 68
+iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[2]
+Band[0]: chain A = 49 chain B = 50 max_tx_power = 48
+iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[2]
+Band[1]: chain A = 52 chain B = 53 max_tx_power = 51
+
+Cc: stable@vger.kernel.org # 4.12+
+Fixes: a6bff3cb19b7 ("iwlwifi: mvm: add GEO_TX_POWER_LIMIT cmd for geographic tx power table")
+Signed-off-by: Matt Chen <matt.chen@intel.com>
+Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+@@ -590,7 +590,7 @@ static int iwl_mvm_config_ltr(struct iwl
+ #define ACPI_WRDS_WIFI_DATA_SIZE (IWL_MVM_SAR_TABLE_SIZE + 2)
+ #define ACPI_EWRD_WIFI_DATA_SIZE ((IWL_MVM_SAR_PROFILE_NUM - 1) * \
+ IWL_MVM_SAR_TABLE_SIZE + 3)
+-#define ACPI_WGDS_WIFI_DATA_SIZE 18
++#define ACPI_WGDS_WIFI_DATA_SIZE 19
+ #define ACPI_WGDS_NUM_BANDS 2
+ #define ACPI_WGDS_TABLE_SIZE 3
+
+@@ -964,7 +964,7 @@ static int iwl_mvm_sar_geo_init(struct i
+ IWL_DEBUG_RADIO(mvm, "Sending GEO_TX_POWER_LIMIT\n");
+
+ BUILD_BUG_ON(IWL_NUM_GEO_PROFILES * ACPI_WGDS_NUM_BANDS *
+- ACPI_WGDS_TABLE_SIZE != ACPI_WGDS_WIFI_DATA_SIZE);
++ ACPI_WGDS_TABLE_SIZE + 1 != ACPI_WGDS_WIFI_DATA_SIZE);
+
+ for (i = 0; i < IWL_NUM_GEO_PROFILES; i++) {
+ struct iwl_per_chain_offset *chain =
--- /dev/null
+From ef8c4ed9db80261f397f0c0bf723684601ae3b52 Mon Sep 17 00:00:00 2001
+From: Stefan Agner <stefan@agner.ch>
+Date: Mon, 17 Sep 2018 19:31:57 -0700
+Subject: kbuild: allow to use GCC toolchain not in Clang search path
+
+From: Stefan Agner <stefan@agner.ch>
+
+commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream.
+
+When using a GCC cross toolchain which is not in a compiled in
+Clang search path, Clang reverts to the system assembler and
+linker. This leads to assembler or linker errors, depending on
+which tool is first used for a given architecture.
+
+It seems that Clang is not searching $PATH for a matching
+assembler or linker.
+
+Make sure that Clang picks up the correct assembler or linker by
+passing the cross compilers bin directory as search path.
+
+This allows to use Clang provided by distributions with GCC
+toolchains not in /usr/bin.
+
+Link: https://github.com/ClangBuiltLinux/linux/issues/78
+Signed-off-by: Stefan Agner <stefan@agner.ch>
+Reviewed-and-tested-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+[nc: Adjust context]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Makefile | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -480,13 +480,15 @@ endif
+ ifeq ($(cc-name),clang)
+ ifneq ($(CROSS_COMPILE),)
+ CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
+-GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
++GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
++CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR)
++GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
+ endif
+ ifneq ($(GCC_TOOLCHAIN),)
+ CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
+ endif
+-KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
+-KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
++KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
++KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+ KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
+ KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
+ endif
--- /dev/null
+From 0bb9fc4f5429ac970181c073aa32e521e20f7b73 Mon Sep 17 00:00:00 2001
+From: Eran Ben Elisha <eranbe@mellanox.com>
+Date: Wed, 13 Dec 2017 18:12:10 +0200
+Subject: net/mlx4_core: Fix wrong calculation of free counters
+
+From: Eran Ben Elisha <eranbe@mellanox.com>
+
+commit 0bb9fc4f5429ac970181c073aa32e521e20f7b73 upstream.
+
+The field res_free indicates the total number of counters which are
+available for allocation (reserved and unreserved). Fixed a bug where
+the reserved counters were subtracted from res_free before any
+allocation was performed.
+
+Before this fix, free counters which were not reserved could not be
+allocated.
+
+Fixes: 9de92c60beaa ("net/mlx4_core: Adjust counter grant policy in the resource tracker")
+Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
+Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
+Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
++++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+@@ -611,7 +611,6 @@ int mlx4_init_resource_tracker(struct ml
+ MLX4_MAX_PORTS;
+ else
+ res_alloc->guaranteed[t] = 0;
+- res_alloc->res_free -= res_alloc->guaranteed[t];
+ break;
+ default:
+ break;
--- /dev/null
+From 0c47cd7a9b6c9c36c08113e594e9ad017fb17865 Mon Sep 17 00:00:00 2001
+From: Niklas Cassel <niklas.cassel@axis.com>
+Date: Thu, 14 Dec 2017 14:01:45 +0100
+Subject: PCI: endpoint: Populate func_no before calling pci_epc_add_epf()
+
+From: Niklas Cassel <niklas.cassel@axis.com>
+
+commit 0c47cd7a9b6c9c36c08113e594e9ad017fb17865 upstream.
+
+func_no is a member of struct pci_epf.
+
+Since struct pci_epf is used as an argument to pci_epc_add_epf() (to
+bind an endpoint function to a controller), struct pci_epf.func_no
+should be populated before calling pci_epc_add_epf().
+
+Initialize the struct pci_epf.func_no member before calling
+pci_epc_add_epf(), to fix the endpoint function binding to
+an endpoint controller.
+
+Fixes: d74679911610 ("PCI: endpoint: Introduce configfs entry for configuring EP functions")
+Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
+[lorenzo.pieralisi@arm.com: rewrote the commit log]
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Suggested-by: Kishon Vijay Abraham I <kishon@ti.com>
+Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/pci/endpoint/pci-ep-cfs.c | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+--- a/drivers/pci/endpoint/pci-ep-cfs.c
++++ b/drivers/pci/endpoint/pci-ep-cfs.c
+@@ -97,16 +97,10 @@ static int pci_epc_epf_link(struct confi
+ {
+ int ret;
+ u32 func_no = 0;
+- struct pci_epc *epc;
+- struct pci_epf *epf;
+ struct pci_epf_group *epf_group = to_pci_epf_group(epf_item);
+ struct pci_epc_group *epc_group = to_pci_epc_group(epc_item);
+-
+- epc = epc_group->epc;
+- epf = epf_group->epf;
+- ret = pci_epc_add_epf(epc, epf);
+- if (ret)
+- goto err_add_epf;
++ struct pci_epc *epc = epc_group->epc;
++ struct pci_epf *epf = epf_group->epf;
+
+ func_no = find_first_zero_bit(&epc_group->function_num_map,
+ BITS_PER_LONG);
+@@ -116,6 +110,10 @@ static int pci_epc_epf_link(struct confi
+ set_bit(func_no, &epc_group->function_num_map);
+ epf->func_no = func_no;
+
++ ret = pci_epc_add_epf(epc, epf);
++ if (ret)
++ goto err_add_epf;
++
+ ret = pci_epf_bind(epf);
+ if (ret)
+ goto err_epf_bind;
--- /dev/null
+From 26e480f7bb7840fc0daa9c3af7c4501b2cf5902f Mon Sep 17 00:00:00 2001
+From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
+Date: Fri, 13 Oct 2017 00:06:44 +0200
+Subject: rtc: omap: fix error path when pinctrl_register fails
+
+From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
+
+commit 26e480f7bb7840fc0daa9c3af7c4501b2cf5902f upstream.
+
+If pinctrl_register() fails probe will return with an error without locking
+the RTC and disabling pm_runtime.
+Set ret and jump to err instead.
+
+Fixes: 97ea1906b3c2 ("rtc: omap: Support ext_wakeup configuration")
+Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/rtc/rtc-omap.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/rtc/rtc-omap.c
++++ b/drivers/rtc/rtc-omap.c
+@@ -823,7 +823,8 @@ static int omap_rtc_probe(struct platfor
+ rtc->pctldev = pinctrl_register(&rtc_pinctrl_desc, &pdev->dev, rtc);
+ if (IS_ERR(rtc->pctldev)) {
+ dev_err(&pdev->dev, "Couldn't register pinctrl driver\n");
+- return PTR_ERR(rtc->pctldev);
++ ret = PTR_ERR(rtc->pctldev);
++ goto err;
+ }
+
+ if (rtc->is_pmic_controller) {
input-xpad-fix-some-coding-style-issues.patch
input-xpad-avoid-using-__set_bit-for-capabilities.patch
input-xpad-add-support-for-xbox1-pdp-camo-series-gam.patch
+iwlwifi-fix-wrong-wgds_wifi_data_size.patch
+kbuild-allow-to-use-gcc-toolchain-not-in-clang-search-path.patch
+pci-endpoint-populate-func_no-before-calling-pci_epc_add_epf.patch
+net-mlx4_core-fix-wrong-calculation-of-free-counters.patch
+i40iw-fix-memory-leak-in-error-path-of-create-qp.patch
+rtc-omap-fix-error-path-when-pinctrl_register-fails.patch
+clk-samsung-exynos5250-add-missing-clocks-for-fimc-lite-sysmmu-devices.patch
+arm-dts-exynos-fix-invalid-node-referenced-by-i2c20-alias-in-peach-pit-and-pi.patch
+driver-core-move-device_links_purge-after-bus_remove_device.patch