All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for 4.9 02/59] drm: bridge: add DT bindings for TI ths8135
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 03/59] GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next Levin, Alexander (Sasha Levin)
                   ` (56 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Bartosz Golaszewski, Archit Taneja, Levin, Alexander (Sasha Levin)

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

[ Upstream commit 2e644be30fcc08c736f66b60f4898d274d4873ab ]

THS8135 is a configurable video DAC. Add DT bindings for this chip.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1481623759-12786-3-git-send-email-bgolaszewski@baylibre.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 .../bindings/display/bridge/ti,ths8135.txt         | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/ti,ths8135.txt

diff --git a/Documentation/devicetree/bindings/display/bridge/ti,ths8135.txt b/Documentation/devicetree/bindings/display/bridge/ti,ths8135.txt
new file mode 100644
index 000000000000..6ec1a880ac18
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/bridge/ti,ths8135.txt
@@ -0,0 +1,46 @@
+THS8135 Video DAC
+-----------------
+
+This is the binding for Texas Instruments THS8135 Video DAC bridge.
+
+Required properties:
+
+- compatible: Must be "ti,ths8135"
+
+Required nodes:
+
+This device has two video ports. Their connections are modelled using the OF
+graph bindings specified in Documentation/devicetree/bindings/graph.txt.
+
+- Video port 0 for RGB input
+- Video port 1 for VGA output
+
+Example
+-------
+
+vga-bridge {
+	compatible = "ti,ths8135";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port@0 {
+			reg = <0>;
+
+			vga_bridge_in: endpoint {
+				remote-endpoint = <&lcdc_out_vga>;
+			};
+		};
+
+		port@1 {
+			reg = <1>;
+
+			vga_bridge_out: endpoint {
+				remote-endpoint = <&vga_con_in>;
+			};
+		};
+	};
+};
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 03/59] GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 02/59] drm: bridge: add DT bindings for TI ths8135 Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 07/59] clk: sunxi-ng: set the parent rate when adjustin CPUX clock on A33 Levin, Alexander (Sasha Levin)
                   ` (55 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Dan Carpenter, Bob Peterson, Levin, Alexander (Sasha Levin)

From: Dan Carpenter <dan.carpenter@oracle.com>

[ Upstream commit 14d37564fa3dc4e5d4c6828afcd26ac14e6796c5 ]

This patch fixes a place where function gfs2_glock_iter_next can
reference an invalid error pointer.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 fs/gfs2/glock.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 7bff6f46f5da..95bc0ae71d81 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1820,16 +1820,18 @@ void gfs2_glock_exit(void)
 
 static void gfs2_glock_iter_next(struct gfs2_glock_iter *gi)
 {
-	do {
-		gi->gl = rhashtable_walk_next(&gi->hti);
+	while ((gi->gl = rhashtable_walk_next(&gi->hti))) {
 		if (IS_ERR(gi->gl)) {
 			if (PTR_ERR(gi->gl) == -EAGAIN)
 				continue;
 			gi->gl = NULL;
+			return;
 		}
-	/* Skip entries for other sb and dead entries */
-	} while ((gi->gl) && ((gi->sdp != gi->gl->gl_name.ln_sbd) ||
-			      __lockref_is_dead(&gi->gl->gl_lockref)));
+		/* Skip entries for other sb and dead entries */
+		if (gi->sdp == gi->gl->gl_name.ln_sbd &&
+		    !__lockref_is_dead(&gi->gl->gl_lockref))
+			return;
+	}
 }
 
 static void *gfs2_glock_seq_start(struct seq_file *seq, loff_t *pos)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define
@ 2017-09-14 15:51 Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 02/59] drm: bridge: add DT bindings for TI ths8135 Levin, Alexander (Sasha Levin)
                   ` (57 more replies)
  0 siblings, 58 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Kristian H. Kristensen, Kristian H . Kristensen, Daniel Vetter,
	Levin, Alexander (Sasha Levin)

From: "Kristian H. Kristensen" <hoegsberg@gmail.com>

[ Upstream commit af913418261d6d3e7a29f06cf35f04610ead667c ]

We need to define DRM_FORMAT_MOD_VENDOR_NONE for the fourcc_mod_code()
macro to work correctly.

Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1481657272-25975-1-git-send-email-hoegsberg@google.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 include/uapi/drm/drm_fourcc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index a5890bf44c0a..d1601a621929 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -154,6 +154,7 @@ extern "C" {
 
 /* Vendor Ids: */
 #define DRM_FORMAT_MOD_NONE           0
+#define DRM_FORMAT_MOD_VENDOR_NONE    0
 #define DRM_FORMAT_MOD_VENDOR_INTEL   0x01
 #define DRM_FORMAT_MOD_VENDOR_AMD     0x02
 #define DRM_FORMAT_MOD_VENDOR_NV      0x03
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 07/59] clk: sunxi-ng: set the parent rate when adjustin CPUX clock on A33
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 02/59] drm: bridge: add DT bindings for TI ths8135 Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 03/59] GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-15  2:02   ` icenowy
  2017-09-14 15:51 ` [PATCH for 4.9 05/59] ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime Levin, Alexander (Sasha Levin)
                   ` (54 subsequent siblings)
  57 siblings, 1 reply; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Icenowy Zheng, Maxime Ripard, Levin, Alexander (Sasha Levin)

From: Icenowy Zheng <icenowy@aosc.xyz>

[ Upstream commit bb021cda2ccf45ee9470bf0f8c55323ad1c761ae ]

The CPUX clock on A33, which is for the Cortex-A7 cores, is designed to
be changeable by changing the rate of PLL_CPUX.

Add CLK_SET_RATE_PARENT flag to this clock.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-a33.c b/drivers/clk/sunxi-ng/ccu-sun8i-a33.c
index 9bd1f78a0547..d54e5db3959a 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-a33.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-a33.c
@@ -170,7 +170,7 @@ static SUNXI_CCU_N_WITH_GATE_LOCK(pll_ddr1_clk, "pll-ddr1",
 static const char * const cpux_parents[] = { "osc32k", "osc24M",
 					     "pll-cpux" , "pll-cpux" };
 static SUNXI_CCU_MUX(cpux_clk, "cpux", cpux_parents,
-		     0x050, 16, 2, CLK_IS_CRITICAL);
+		     0x050, 16, 2, CLK_IS_CRITICAL | CLK_SET_RATE_PARENT);
 
 static SUNXI_CCU_M(axi_clk, "axi", "cpux", 0x050, 0, 2, 0);
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 05/59] ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (2 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 07/59] clk: sunxi-ng: set the parent rate when adjustin CPUX clock on A33 Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 06/59] clk: sunxi-ng: fix PLL_CPUX adjusting on H3 Levin, Alexander (Sasha Levin)
                   ` (53 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Bartlomiej Zolnierkiewicz, Doug Anderson, Andreas Faerber,
	Thomas Abraham, Tobias Jakobi, Ben Gamari, Krzysztof Kozlowski,
	Levin, Alexander (Sasha Levin)

From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

[ Upstream commit 80b7a2e2498bcffb1a79980dfbeb7a1275577b28 ]

Add CPU operating points for Exynos4412 Prime (it supports
additional 1704MHz & 1600MHz OPPs and 1500MHz OPP is just
a regular non-turbo OPP on this SoC).  Also update relevant
cooling maps to account for new OPPs.

ODROID-X2/U2/U3 boards use Exynos4412 Prime SoC version so
update their board files accordingly.

Based on Hardkernel's kernel for ODROID-X2/U2/U3 boards.

Cc: Doug Anderson <dianders@chromium.org>
Cc: Andreas Faerber <afaerber@suse.de>
Cc: Thomas Abraham <thomas.ab@samsung.com>
Cc: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Cc: Ben Gamari <ben@smart-cactus.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  4 +--
 arch/arm/boot/dts/exynos4412-odroidu3.dts       |  5 +--
 arch/arm/boot/dts/exynos4412-odroidx2.dts       |  1 +
 arch/arm/boot/dts/exynos4412-prime.dtsi         | 41 +++++++++++++++++++++++++
 arch/arm/boot/dts/exynos4412.dtsi               |  2 +-
 5 files changed, 48 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/boot/dts/exynos4412-prime.dtsi

diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
index 8aa19ba14436..5282d69e55bd 100644
--- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
+++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
@@ -97,11 +97,11 @@
 	thermal-zones {
 		cpu_thermal: cpu-thermal {
 			cooling-maps {
-				map0 {
+				cooling_map0: map0 {
 				     /* Corresponds to 800MHz at freq_table */
 				     cooling-device = <&cpu0 7 7>;
 				};
-				map1 {
+				cooling_map1: map1 {
 				     /* Corresponds to 200MHz at freq_table */
 				     cooling-device = <&cpu0 13 13>;
 			       };
diff --git a/arch/arm/boot/dts/exynos4412-odroidu3.dts b/arch/arm/boot/dts/exynos4412-odroidu3.dts
index 99634c54dca9..7504a5aa538e 100644
--- a/arch/arm/boot/dts/exynos4412-odroidu3.dts
+++ b/arch/arm/boot/dts/exynos4412-odroidu3.dts
@@ -13,6 +13,7 @@
 
 /dts-v1/;
 #include "exynos4412-odroid-common.dtsi"
+#include "exynos4412-prime.dtsi"
 
 / {
 	model = "Hardkernel ODROID-U3 board based on Exynos4412";
@@ -47,11 +48,11 @@
 			cooling-maps {
 				map0 {
 				     trip = <&cpu_alert1>;
-				     cooling-device = <&cpu0 7 7>;
+				     cooling-device = <&cpu0 9 9>;
 				};
 				map1 {
 				     trip = <&cpu_alert2>;
-				     cooling-device = <&cpu0 13 13>;
+				     cooling-device = <&cpu0 15 15>;
 				};
 				map2 {
 				     trip = <&cpu_alert0>;
diff --git a/arch/arm/boot/dts/exynos4412-odroidx2.dts b/arch/arm/boot/dts/exynos4412-odroidx2.dts
index 4d228858f172..d6e92ebc3874 100644
--- a/arch/arm/boot/dts/exynos4412-odroidx2.dts
+++ b/arch/arm/boot/dts/exynos4412-odroidx2.dts
@@ -12,6 +12,7 @@
 */
 
 #include "exynos4412-odroidx.dts"
+#include "exynos4412-prime.dtsi"
 
 / {
 	model = "Hardkernel ODROID-X2 board based on Exynos4412";
diff --git a/arch/arm/boot/dts/exynos4412-prime.dtsi b/arch/arm/boot/dts/exynos4412-prime.dtsi
new file mode 100644
index 000000000000..e75bc170c89c
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4412-prime.dtsi
@@ -0,0 +1,41 @@
+/*
+ * Samsung's Exynos4412 Prime SoC device tree source
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * Exynos4412 Prime SoC revision supports higher CPU frequencies than
+ * non-Prime version.  Therefore we need to update OPPs table and
+ * thermal maps accordingly.
+ */
+
+&cpu0_opp_1500 {
+	/delete-property/turbo-mode;
+};
+
+&cpu0_opp_table {
+	opp@1600000000 {
+		opp-hz = /bits/ 64 <1600000000>;
+		opp-microvolt = <1350000>;
+		clock-latency-ns = <200000>;
+	};
+	opp@1704000000 {
+		opp-hz = /bits/ 64 <1704000000>;
+		opp-microvolt = <1350000>;
+		clock-latency-ns = <200000>;
+	};
+};
+
+&cooling_map0 {
+	cooling-device = <&cpu0 9 9>;
+};
+
+&cooling_map1 {
+	cooling-device = <&cpu0 15 15>;
+};
diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi
index 40beede46e55..3ebdf01d814c 100644
--- a/arch/arm/boot/dts/exynos4412.dtsi
+++ b/arch/arm/boot/dts/exynos4412.dtsi
@@ -130,7 +130,7 @@
 			opp-microvolt = <1287500>;
 			clock-latency-ns = <200000>;
 		};
-		opp@1500000000 {
+		cpu0_opp_1500: opp@1500000000 {
 			opp-hz = /bits/ 64 <1500000000>;
 			opp-microvolt = <1350000>;
 			clock-latency-ns = <200000>;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 04/59] drm/i915: Fix the overlay frontbuffer tracking
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (4 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 06/59] clk: sunxi-ng: fix PLL_CPUX adjusting on H3 Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 10/59] MIPS: Ensure bss section ends on a long-aligned address Levin, Alexander (Sasha Levin)
                   ` (51 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Ville Syrjälä, Levin, Alexander (Sasha Levin)

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

[ Upstream commit 58d09ebdb4edf5d3ab3a2aee851ab0168bc83ec6 ]

Do the overlay frontbuffer tracking properly so that it matches
the state of the overlay on/off/continue requests.

One slight problem is that intel_frontbuffer_flip_complete()
may get delayed by an arbitrarily liong time due to the fact that
the overlay code likes to bail out when a signal occurs. So the
flip may not get completed until the ioctl is restarted. But fixing
that would require bigger surgery, so I decided to ignore it for now.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1481131693-27993-5-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/i915/intel_overlay.c | 64 +++++++++++++++++++++++-------------
 1 file changed, 41 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index a2655cd5a84e..8ab6f30dc23c 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -272,8 +272,30 @@ static int intel_overlay_on(struct intel_overlay *overlay)
 	return intel_overlay_do_wait_request(overlay, req, NULL);
 }
 
+static void intel_overlay_flip_prepare(struct intel_overlay *overlay,
+				       struct i915_vma *vma)
+{
+	enum pipe pipe = overlay->crtc->pipe;
+
+	WARN_ON(overlay->old_vma);
+
+	i915_gem_track_fb(overlay->vma ? overlay->vma->obj : NULL,
+			  vma ? vma->obj : NULL,
+			  INTEL_FRONTBUFFER_OVERLAY(pipe));
+
+	intel_frontbuffer_flip_prepare(overlay->i915,
+				       INTEL_FRONTBUFFER_OVERLAY(pipe));
+
+	overlay->old_vma = overlay->vma;
+	if (vma)
+		overlay->vma = i915_vma_get(vma);
+	else
+		overlay->vma = NULL;
+}
+
 /* overlay needs to be enabled in OCMD reg */
 static int intel_overlay_continue(struct intel_overlay *overlay,
+				  struct i915_vma *vma,
 				  bool load_polyphase_filter)
 {
 	struct drm_i915_private *dev_priv = overlay->i915;
@@ -308,43 +330,44 @@ static int intel_overlay_continue(struct intel_overlay *overlay,
 	intel_ring_emit(ring, flip_addr);
 	intel_ring_advance(ring);
 
+	intel_overlay_flip_prepare(overlay, vma);
+
 	intel_overlay_submit_request(overlay, req, NULL);
 
 	return 0;
 }
 
-static void intel_overlay_release_old_vid_tail(struct i915_gem_active *active,
-					       struct drm_i915_gem_request *req)
+static void intel_overlay_release_old_vma(struct intel_overlay *overlay)
 {
-	struct intel_overlay *overlay =
-		container_of(active, typeof(*overlay), last_flip);
 	struct i915_vma *vma;
 
 	vma = fetch_and_zero(&overlay->old_vma);
 	if (WARN_ON(!vma))
 		return;
 
-	i915_gem_track_fb(vma->obj, NULL,
-			  INTEL_FRONTBUFFER_OVERLAY(overlay->crtc->pipe));
+	intel_frontbuffer_flip_complete(overlay->i915,
+					INTEL_FRONTBUFFER_OVERLAY(overlay->crtc->pipe));
 
 	i915_gem_object_unpin_from_display_plane(vma);
 	i915_vma_put(vma);
 }
 
+static void intel_overlay_release_old_vid_tail(struct i915_gem_active *active,
+					       struct drm_i915_gem_request *req)
+{
+	struct intel_overlay *overlay =
+		container_of(active, typeof(*overlay), last_flip);
+
+	intel_overlay_release_old_vma(overlay);
+}
+
 static void intel_overlay_off_tail(struct i915_gem_active *active,
 				   struct drm_i915_gem_request *req)
 {
 	struct intel_overlay *overlay =
 		container_of(active, typeof(*overlay), last_flip);
-	struct i915_vma *vma;
-
-	/* never have the overlay hw on without showing a frame */
-	vma = fetch_and_zero(&overlay->vma);
-	if (WARN_ON(!vma))
-		return;
 
-	i915_gem_object_unpin_from_display_plane(vma);
-	i915_vma_put(vma);
+	intel_overlay_release_old_vma(overlay);
 
 	overlay->crtc->overlay = NULL;
 	overlay->crtc = NULL;
@@ -398,6 +421,8 @@ static int intel_overlay_off(struct intel_overlay *overlay)
 	}
 	intel_ring_advance(ring);
 
+	intel_overlay_flip_prepare(overlay, NULL);
+
 	return intel_overlay_do_wait_request(overlay, req,
 					     intel_overlay_off_tail);
 }
@@ -836,18 +861,10 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
 
 	intel_overlay_unmap_regs(overlay, regs);
 
-	ret = intel_overlay_continue(overlay, scale_changed);
+	ret = intel_overlay_continue(overlay, vma, scale_changed);
 	if (ret)
 		goto out_unpin;
 
-	i915_gem_track_fb(overlay->vma ? overlay->vma->obj : NULL,
-			  vma->obj, INTEL_FRONTBUFFER_OVERLAY(pipe));
-
-	overlay->old_vma = overlay->vma;
-	overlay->vma = vma;
-
-	intel_frontbuffer_flip(dev_priv, INTEL_FRONTBUFFER_OVERLAY(pipe));
-
 	return 0;
 
 out_unpin:
@@ -1215,6 +1232,7 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
 
 	mutex_unlock(&dev->struct_mutex);
 	drm_modeset_unlock_all(dev);
+	i915_gem_object_put(new_bo);
 
 	kfree(params);
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 06/59] clk: sunxi-ng: fix PLL_CPUX adjusting on H3
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (3 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 05/59] ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 04/59] drm/i915: Fix the overlay frontbuffer tracking Levin, Alexander (Sasha Levin)
                   ` (52 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Ondrej Jirman, Maxime Ripard, Levin, Alexander (Sasha Levin)

From: Ondrej Jirman <megous@megous.com>

[ Upstream commit a43c96427e713bea94e9ef50e8be1f493afc0691 ]

When adjusting PLL_CPUX on H3, the PLL is temporarily driven
too high, and the system becomes unstable (oopses or hangs).

Add a notifier to avoid this situation by temporarily switching
to a known stable 24 MHz oscillator.

Signed-off-by: Ondrej Jirman <megous@megous.com>
Tested-by: Lutz Sammer <johns98@gmx.net>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
index 21c427d86f28..a26c8a19fe93 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
@@ -803,6 +803,13 @@ static const struct sunxi_ccu_desc sun8i_h3_ccu_desc = {
 	.num_resets	= ARRAY_SIZE(sun8i_h3_ccu_resets),
 };
 
+static struct ccu_mux_nb sun8i_h3_cpu_nb = {
+	.common		= &cpux_clk.common,
+	.cm		= &cpux_clk.mux,
+	.delay_us	= 1, /* > 8 clock cycles at 24 MHz */
+	.bypass_index	= 1, /* index of 24 MHz oscillator */
+};
+
 static void __init sun8i_h3_ccu_setup(struct device_node *node)
 {
 	void __iomem *reg;
@@ -821,6 +828,9 @@ static void __init sun8i_h3_ccu_setup(struct device_node *node)
 	writel(val | (3 << 16), reg + SUN8I_H3_PLL_AUDIO_REG);
 
 	sunxi_ccu_probe(node, reg, &sun8i_h3_ccu_desc);
+
+	ccu_mux_notifier_register(pll_cpux_clk.common.hw.clk,
+				  &sun8i_h3_cpu_nb);
 }
 CLK_OF_DECLARE(sun8i_h3_ccu, "allwinner,sun8i-h3-ccu",
 	       sun8i_h3_ccu_setup);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 10/59] MIPS: Ensure bss section ends on a long-aligned address
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (5 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 04/59] drm/i915: Fix the overlay frontbuffer tracking Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 09/59] ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes Levin, Alexander (Sasha Levin)
                   ` (50 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Paul Burton, linux-mips, Ralf Baechle, Levin, Alexander (Sasha Levin)

From: Paul Burton <paul.burton@imgtec.com>

[ Upstream commit 3f00f4d8f083bc61005d0a1ef592b149f5c88bbd ]

When clearing the .bss section in kernel_entry we do so using LONG_S
instructions, and branch whilst the current write address doesn't equal
the end of the .bss section minus the size of a long integer. The .bss
section always begins at a long-aligned address and we always increment
the write pointer by the size of a long integer - we therefore rely upon
the .bss section ending at a long-aligned address. If this is not the
case then the long-aligned write address can never be equal to the
non-long-aligned end address & we will continue to increment past the
end of the .bss section, attempting to zero the rest of memory.

Despite this requirement that .bss end at a long-aligned address we pass
0 as the end alignment requirement to the BSS_SECTION macro and thus
don't guarantee any particular alignment, allowing us to hit the error
condition described above.

Fix this by instead passing 8 bytes as the end alignment argument to
the BSS_SECTION macro, ensuring that the end of the .bss section is
always at least long-aligned.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14526/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/mips/kernel/vmlinux.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index d5de67591735..f0a0e6d62be3 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -182,7 +182,7 @@ SECTIONS
 	 * Force .bss to 64K alignment so that .bss..swapper_pg_dir
 	 * gets that alignment.	 .sbss should be empty, so there will be
 	 * no holes after __init_end. */
-	BSS_SECTION(0, 0x10000, 0)
+	BSS_SECTION(0, 0x10000, 8)
 
 	_end = . ;
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 08/59] RDS: RDMA: Fix the composite message user notification
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (8 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 15/59] power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error Levin, Alexander (Sasha Levin)
                   ` (47 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Santosh Shilimkar, Levin, Alexander (Sasha Levin)

From: Santosh Shilimkar <santosh.shilimkar@oracle.com>

[ Upstream commit 941f8d55f6d613a460a5e080d25a38509f45eb75 ]

When application sends an RDS RDMA composite message consist of
RDMA transfer to be followed up by non RDMA payload, it expect to
be notified *only* when the full message gets delivered. RDS RDMA
notification doesn't behave this way though.

Thanks to Venkat for debug and root casuing the issue
where only first part of the message(RDMA) was
successfully delivered but remainder payload delivery failed.
In that case, application should not be notified with
a false positive of message delivery success.

Fix this case by making sure the user gets notified only after
the full message delivery.

Reviewed-by: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 net/rds/ib_send.c | 25 +++++++++++++++----------
 net/rds/rdma.c    | 10 ++++++++++
 net/rds/rds.h     |  1 +
 net/rds/send.c    |  4 +++-
 4 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index 84d90c97332f..191098173018 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -69,16 +69,6 @@ static void rds_ib_send_complete(struct rds_message *rm,
 	complete(rm, notify_status);
 }
 
-static void rds_ib_send_unmap_data(struct rds_ib_connection *ic,
-				   struct rm_data_op *op,
-				   int wc_status)
-{
-	if (op->op_nents)
-		ib_dma_unmap_sg(ic->i_cm_id->device,
-				op->op_sg, op->op_nents,
-				DMA_TO_DEVICE);
-}
-
 static void rds_ib_send_unmap_rdma(struct rds_ib_connection *ic,
 				   struct rm_rdma_op *op,
 				   int wc_status)
@@ -139,6 +129,21 @@ static void rds_ib_send_unmap_atomic(struct rds_ib_connection *ic,
 		rds_ib_stats_inc(s_ib_atomic_fadd);
 }
 
+static void rds_ib_send_unmap_data(struct rds_ib_connection *ic,
+				   struct rm_data_op *op,
+				   int wc_status)
+{
+	struct rds_message *rm = container_of(op, struct rds_message, data);
+
+	if (op->op_nents)
+		ib_dma_unmap_sg(ic->i_cm_id->device,
+				op->op_sg, op->op_nents,
+				DMA_TO_DEVICE);
+
+	if (rm->rdma.op_active && rm->data.op_notify)
+		rds_ib_send_unmap_rdma(ic, &rm->rdma, wc_status);
+}
+
 /*
  * Unmap the resources associated with a struct send_work.
  *
diff --git a/net/rds/rdma.c b/net/rds/rdma.c
index 4c93badeabf2..8d3a851a3476 100644
--- a/net/rds/rdma.c
+++ b/net/rds/rdma.c
@@ -626,6 +626,16 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
 		}
 		op->op_notifier->n_user_token = args->user_token;
 		op->op_notifier->n_status = RDS_RDMA_SUCCESS;
+
+		/* Enable rmda notification on data operation for composite
+		 * rds messages and make sure notification is enabled only
+		 * for the data operation which follows it so that application
+		 * gets notified only after full message gets delivered.
+		 */
+		if (rm->data.op_sg) {
+			rm->rdma.op_notify = 0;
+			rm->data.op_notify = !!(args->flags & RDS_RDMA_NOTIFY_ME);
+		}
 	}
 
 	/* The cookie contains the R_Key of the remote memory region, and
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 67ba67c058b1..f107a968ddff 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -414,6 +414,7 @@ struct rds_message {
 		} rdma;
 		struct rm_data_op {
 			unsigned int		op_active:1;
+			unsigned int		op_notify:1;
 			unsigned int		op_nents;
 			unsigned int		op_count;
 			unsigned int		op_dmasg;
diff --git a/net/rds/send.c b/net/rds/send.c
index 896626b9a0ef..f28651b6ae83 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -475,12 +475,14 @@ void rds_rdma_send_complete(struct rds_message *rm, int status)
 	struct rm_rdma_op *ro;
 	struct rds_notifier *notifier;
 	unsigned long flags;
+	unsigned int notify = 0;
 
 	spin_lock_irqsave(&rm->m_rs_lock, flags);
 
+	notify =  rm->rdma.op_notify | rm->data.op_notify;
 	ro = &rm->rdma;
 	if (test_bit(RDS_MSG_ON_SOCK, &rm->m_flags) &&
-	    ro->op_active && ro->op_notify && ro->op_notifier) {
+	    ro->op_active && notify && ro->op_notifier) {
 		notifier = ro->op_notifier;
 		rs = rm->m_rs;
 		sock_hold(rds_rs_to_sk(rs));
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (7 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 09/59] ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 18:59   ` Mathieu Malaterre
  2017-09-14 15:51 ` [PATCH for 4.9 08/59] RDS: RDMA: Fix the composite message user notification Levin, Alexander (Sasha Levin)
                   ` (48 subsequent siblings)
  57 siblings, 1 reply; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Marcin Nowakowski, linux-mips, Ralf Baechle, Levin,
	Alexander (Sasha Levin)

From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>

[ Upstream commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411 ]

When a memory offset is specified through the commandline, add the
memory in range PHYS_OFFSET:Y as reserved memory area.
Otherwise the bootmem allocator is initialised with low page equal to
min_low_pfn = PHYS_OFFSET, and in free_all_bootmem will process pages
starting from min_low_pfn instead of PFN(Y).

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14613/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/mips/kernel/setup.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index f66e5ce505b2..38697f25d168 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -589,6 +589,10 @@ static int __init early_parse_mem(char *p)
 		start = memparse(p + 1, &p);
 
 	add_memory_region(start, size, BOOT_MEM_RAM);
+
+	if (start && start > PHYS_OFFSET)
+		add_memory_region(PHYS_OFFSET, start - PHYS_OFFSET,
+				BOOT_MEM_RESERVED);
 	return 0;
 }
 early_param("mem", early_parse_mem);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 09/59] ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (6 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 10/59] MIPS: Ensure bss section ends on a long-aligned address Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing Levin, Alexander (Sasha Levin)
                   ` (49 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Simon Horman, Levin, Alexander (Sasha Levin)

From: Simon Horman <horms+renesas@verge.net.au>

[ Upstream commit 654450baf2afba86cf328e1849ccac61ec4630af ]

Use recently added R-Car Gen 2 fallback binding for msiof nodes in
DT for r8a7790 SoC.

This has no run-time effect for the current driver as the initialisation
sequence is the same for the SoC-specific binding for r8a7790 and the
fallback binding for R-Car Gen 2.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/arm/boot/dts/r8a7790.dtsi | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 351fcc2f87df..b6c6410ca384 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -1493,7 +1493,8 @@
 	};
 
 	msiof0: spi@e6e20000 {
-		compatible = "renesas,msiof-r8a7790";
+		compatible = "renesas,msiof-r8a7790",
+			     "renesas,rcar-gen2-msiof";
 		reg = <0 0xe6e20000 0 0x0064>;
 		interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp0_clks R8A7790_CLK_MSIOF0>;
@@ -1507,7 +1508,8 @@
 	};
 
 	msiof1: spi@e6e10000 {
-		compatible = "renesas,msiof-r8a7790";
+		compatible = "renesas,msiof-r8a7790",
+			     "renesas,rcar-gen2-msiof";
 		reg = <0 0xe6e10000 0 0x0064>;
 		interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp2_clks R8A7790_CLK_MSIOF1>;
@@ -1521,7 +1523,8 @@
 	};
 
 	msiof2: spi@e6e00000 {
-		compatible = "renesas,msiof-r8a7790";
+		compatible = "renesas,msiof-r8a7790",
+			     "renesas,rcar-gen2-msiof";
 		reg = <0 0xe6e00000 0 0x0064>;
 		interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp2_clks R8A7790_CLK_MSIOF2>;
@@ -1535,7 +1538,8 @@
 	};
 
 	msiof3: spi@e6c90000 {
-		compatible = "renesas,msiof-r8a7790";
+		compatible = "renesas,msiof-r8a7790",
+			     "renesas,rcar-gen2-msiof";
 		reg = <0 0xe6c90000 0 0x0064>;
 		interrupts = <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp2_clks R8A7790_CLK_MSIOF3>;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 13/59] MIPS: ralink: Fix a typo in the pinmux setup.
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (11 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 12/59] MIPS: kexec: Do not reserve invalid crashkernel memory on boot Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 14/59] MIPS: ralink: Fix incorrect assignment on ralink_soc Levin, Alexander (Sasha Levin)
                   ` (44 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: John Crispin, linux-mips, Ralf Baechle, Levin, Alexander (Sasha Levin)

From: John Crispin <john@phrozen.org>

[ Upstream commit 58181a117d353427127a2e7afc7cf1ab44759828 ]

There is a typo inside the pinmux setup code. The function is really
called utif and not util. This was recently discovered when people were
trying to make the UTIF interface work.

Signed-off-by: John Crispin <john@phrozen.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14899/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/mips/ralink/mt7620.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c
index 3c7c9bf57bf3..6f892c1f3ad7 100644
--- a/arch/mips/ralink/mt7620.c
+++ b/arch/mips/ralink/mt7620.c
@@ -176,7 +176,7 @@ static struct rt2880_pmx_func spi_cs1_grp_mt7628[] = {
 
 static struct rt2880_pmx_func spis_grp_mt7628[] = {
 	FUNC("pwm_uart2", 3, 14, 4),
-	FUNC("util", 2, 14, 4),
+	FUNC("utif", 2, 14, 4),
 	FUNC("gpio", 1, 14, 4),
 	FUNC("spis", 0, 14, 4),
 };
@@ -190,28 +190,28 @@ static struct rt2880_pmx_func gpio_grp_mt7628[] = {
 
 static struct rt2880_pmx_func p4led_kn_grp_mt7628[] = {
 	FUNC("jtag", 3, 30, 1),
-	FUNC("util", 2, 30, 1),
+	FUNC("utif", 2, 30, 1),
 	FUNC("gpio", 1, 30, 1),
 	FUNC("p4led_kn", 0, 30, 1),
 };
 
 static struct rt2880_pmx_func p3led_kn_grp_mt7628[] = {
 	FUNC("jtag", 3, 31, 1),
-	FUNC("util", 2, 31, 1),
+	FUNC("utif", 2, 31, 1),
 	FUNC("gpio", 1, 31, 1),
 	FUNC("p3led_kn", 0, 31, 1),
 };
 
 static struct rt2880_pmx_func p2led_kn_grp_mt7628[] = {
 	FUNC("jtag", 3, 32, 1),
-	FUNC("util", 2, 32, 1),
+	FUNC("utif", 2, 32, 1),
 	FUNC("gpio", 1, 32, 1),
 	FUNC("p2led_kn", 0, 32, 1),
 };
 
 static struct rt2880_pmx_func p1led_kn_grp_mt7628[] = {
 	FUNC("jtag", 3, 33, 1),
-	FUNC("util", 2, 33, 1),
+	FUNC("utif", 2, 33, 1),
 	FUNC("gpio", 1, 33, 1),
 	FUNC("p1led_kn", 0, 33, 1),
 };
@@ -232,28 +232,28 @@ static struct rt2880_pmx_func wled_kn_grp_mt7628[] = {
 
 static struct rt2880_pmx_func p4led_an_grp_mt7628[] = {
 	FUNC("jtag", 3, 39, 1),
-	FUNC("util", 2, 39, 1),
+	FUNC("utif", 2, 39, 1),
 	FUNC("gpio", 1, 39, 1),
 	FUNC("p4led_an", 0, 39, 1),
 };
 
 static struct rt2880_pmx_func p3led_an_grp_mt7628[] = {
 	FUNC("jtag", 3, 40, 1),
-	FUNC("util", 2, 40, 1),
+	FUNC("utif", 2, 40, 1),
 	FUNC("gpio", 1, 40, 1),
 	FUNC("p3led_an", 0, 40, 1),
 };
 
 static struct rt2880_pmx_func p2led_an_grp_mt7628[] = {
 	FUNC("jtag", 3, 41, 1),
-	FUNC("util", 2, 41, 1),
+	FUNC("utif", 2, 41, 1),
 	FUNC("gpio", 1, 41, 1),
 	FUNC("p2led_an", 0, 41, 1),
 };
 
 static struct rt2880_pmx_func p1led_an_grp_mt7628[] = {
 	FUNC("jtag", 3, 42, 1),
-	FUNC("util", 2, 42, 1),
+	FUNC("utif", 2, 42, 1),
 	FUNC("gpio", 1, 42, 1),
 	FUNC("p1led_an", 0, 42, 1),
 };
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 14/59] MIPS: ralink: Fix incorrect assignment on ralink_soc
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (12 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 13/59] MIPS: ralink: Fix a typo in the pinmux setup Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 17/59] ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event Levin, Alexander (Sasha Levin)
                   ` (43 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Colin Ian King, John Crispin, linux-mips, Ralf Baechle, Levin,
	Alexander (Sasha Levin)

From: Colin Ian King <colin.king@canonical.com>

[ Upstream commit 08d90c81b714482dceb5323d14f6617bcf55ee61 ]

ralink_soc sould be assigned to RT3883_SOC, replace incorrect
comparision with assignment.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Fixes: 418d29c87061 ("MIPS: ralink: Unify SoC id handling")
Cc: John Crispin <john@phrozen.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14903/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/mips/ralink/rt3883.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/ralink/rt3883.c b/arch/mips/ralink/rt3883.c
index 9e4631acfcb5..3e68e35daf21 100644
--- a/arch/mips/ralink/rt3883.c
+++ b/arch/mips/ralink/rt3883.c
@@ -145,5 +145,5 @@ void prom_soc_init(struct ralink_soc_info *soc_info)
 
 	rt2880_pinmux_data = rt3883_pinmux_data;
 
-	ralink_soc == RT3883_SOC;
+	ralink_soc = RT3883_SOC;
 }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 15/59] power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (9 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 08/59] RDS: RDMA: Fix the composite message user notification Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 12/59] MIPS: kexec: Do not reserve invalid crashkernel memory on boot Levin, Alexander (Sasha Levin)
                   ` (46 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Hans de Goede, Sebastian Reichel, Levin, Alexander (Sasha Levin)

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit 6f074bc878dc9b00c0df0bf3a8cb1d9e294cd881 ]

If reading the register fails, return the actual error code, instead
of the uninitialized val variable;

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/power/supply/axp288_fuel_gauge.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
index 5bdde692f724..f62f9dfea984 100644
--- a/drivers/power/supply/axp288_fuel_gauge.c
+++ b/drivers/power/supply/axp288_fuel_gauge.c
@@ -169,8 +169,10 @@ static int fuel_gauge_reg_readb(struct axp288_fg_info *info, int reg)
 			break;
 	}
 
-	if (ret < 0)
+	if (ret < 0) {
 		dev_err(&info->pdev->dev, "axp288 reg read err:%d\n", ret);
+		return ret;
+	}
 
 	return val;
 }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 12/59] MIPS: kexec: Do not reserve invalid crashkernel memory on boot
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (10 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 15/59] power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 13/59] MIPS: ralink: Fix a typo in the pinmux setup Levin, Alexander (Sasha Levin)
                   ` (45 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Marcin Nowakowski, linux-mips, Ralf Baechle, Levin,
	Alexander (Sasha Levin)

From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>

[ Upstream commit a8f108d70c74d83574c157648383eb2e4285a190 ]

Do not reserve memory for the crashkernel if the commandline argument
points to a wrong location. This can happen if the location is specified
wrong or if the same commandline is reused when starting the crashkernel
- in the latter case the reserved memory would point to the location
from which the crashkernel is executing.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14612/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/mips/kernel/setup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 38697f25d168..d64ee5d3cc89 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -668,6 +668,11 @@ static void __init mips_parse_crashkernel(void)
 	if (ret != 0 || crash_size <= 0)
 		return;
 
+	if (!memory_region_available(crash_base, crash_size)) {
+		pr_warn("Invalid memory region reserved for crash kernel\n");
+		return;
+	}
+
 	crashk_res.start = crash_base;
 	crashk_res.end	 = crash_base + crash_size - 1;
 }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 17/59] ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (13 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 14/59] MIPS: ralink: Fix incorrect assignment on ralink_soc Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 16/59] scsi: be2iscsi: Add checks to validate CID alloc/free Levin, Alexander (Sasha Levin)
                   ` (42 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Marcin Niestroj, Tony Lindgren, Levin, Alexander (Sasha Levin)

From: Marcin Niestroj <m.niestroj@grinn-global.com>

[ Upstream commit ca244a83ecc7f0a9242ee2116e622cb6d7ec2a90 ]

On chiliSOM TPS65217 nWAKEUP pin is connected to AM335x internal RTC
EXT_WAKEUP input. In RTC-only state TPS65217 is notifying about power on
events (such as power buton presses) by setting nWAKEUP output
low. After that it waits 5s for proper device boot. Currently it doesn't
happen, as the processor doesn't listen for such events. Consequently
TPS65217 changes state from SLEEP (RTC-only state) to OFF.

Enable EXT_WAKEUP input of AM335x's RTC, so the processor can properly
detect power on events and recover immediately from RTC-only states,
without powering off RTC and losing time.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/arm/boot/dts/am335x-chilisom.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-chilisom.dtsi b/arch/arm/boot/dts/am335x-chilisom.dtsi
index f9ee5859c154..1b43ebd08b38 100644
--- a/arch/arm/boot/dts/am335x-chilisom.dtsi
+++ b/arch/arm/boot/dts/am335x-chilisom.dtsi
@@ -124,6 +124,14 @@
 
 &rtc {
 	system-power-controller;
+
+	pinctrl-0 = <&ext_wakeup>;
+	pinctrl-names = "default";
+
+	ext_wakeup: ext-wakeup {
+		pins = "ext_wakeup0";
+		input-enable;
+	};
 };
 
 /* NAND Flash */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 16/59] scsi: be2iscsi: Add checks to validate CID alloc/free
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (14 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 17/59] ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 19/59] extcon: axp288: Use vbus-valid instead of -present to determine cable presence Levin, Alexander (Sasha Levin)
                   ` (41 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jitendra Bhivare, Martin K . Petersen, Levin, Alexander (Sasha Levin)

From: Jitendra Bhivare <jitendra.bhivare@broadcom.com>

[ Upstream commit 413f365657a8b9669bd0ba3628e9fde9ce63604e ]

Set CID slot to 0xffff to indicate empty.
Check if connection already exists in conn_table before binding.
Check if endpoint already NULL before putting back CID.
Break ep->conn link in free_ep to ignore completions after freeing.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/scsi/be2iscsi/be_iscsi.c | 163 ++++++++++++++++++++-------------------
 drivers/scsi/be2iscsi/be_main.c  |   7 +-
 drivers/scsi/be2iscsi/be_main.h  |   1 +
 3 files changed, 87 insertions(+), 84 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index ba258217614e..963c732a3d24 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -166,33 +166,6 @@ beiscsi_conn_create(struct iscsi_cls_session *cls_session, u32 cid)
 }
 
 /**
- * beiscsi_bindconn_cid - Bind the beiscsi_conn with phba connection table
- * @beiscsi_conn: The pointer to  beiscsi_conn structure
- * @phba: The phba instance
- * @cid: The cid to free
- */
-static int beiscsi_bindconn_cid(struct beiscsi_hba *phba,
-				struct beiscsi_conn *beiscsi_conn,
-				unsigned int cid)
-{
-	uint16_t cri_index = BE_GET_CRI_FROM_CID(cid);
-
-	if (phba->conn_table[cri_index]) {
-		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
-			    "BS_%d : Connection table already occupied. Detected clash\n");
-
-		return -EINVAL;
-	} else {
-		beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
-			    "BS_%d : phba->conn_table[%d]=%p(beiscsi_conn)\n",
-			    cri_index, beiscsi_conn);
-
-		phba->conn_table[cri_index] = beiscsi_conn;
-	}
-	return 0;
-}
-
-/**
  * beiscsi_conn_bind - Binds iscsi session/connection with TCP connection
  * @cls_session: pointer to iscsi cls session
  * @cls_conn: pointer to iscsi cls conn
@@ -212,6 +185,7 @@ int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,
 	struct hwi_wrb_context *pwrb_context;
 	struct beiscsi_endpoint *beiscsi_ep;
 	struct iscsi_endpoint *ep;
+	uint16_t cri_index;
 
 	ep = iscsi_lookup_endpoint(transport_fd);
 	if (!ep)
@@ -229,20 +203,34 @@ int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,
 
 		return -EEXIST;
 	}
-
-	pwrb_context = &phwi_ctrlr->wrb_context[BE_GET_CRI_FROM_CID(
-						beiscsi_ep->ep_cid)];
+	cri_index = BE_GET_CRI_FROM_CID(beiscsi_ep->ep_cid);
+	if (phba->conn_table[cri_index]) {
+		if (beiscsi_conn != phba->conn_table[cri_index] ||
+		    beiscsi_ep != phba->conn_table[cri_index]->ep) {
+			__beiscsi_log(phba, KERN_ERR,
+				      "BS_%d : conn_table not empty at %u: cid %u conn %p:%p\n",
+				      cri_index,
+				      beiscsi_ep->ep_cid,
+				      beiscsi_conn,
+				      phba->conn_table[cri_index]);
+			return -EINVAL;
+		}
+	}
 
 	beiscsi_conn->beiscsi_conn_cid = beiscsi_ep->ep_cid;
 	beiscsi_conn->ep = beiscsi_ep;
 	beiscsi_ep->conn = beiscsi_conn;
+	/**
+	 * Each connection is associated with a WRBQ kept in wrb_context.
+	 * Store doorbell offset for transmit path.
+	 */
+	pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
 	beiscsi_conn->doorbell_offset = pwrb_context->doorbell_offset;
-
 	beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
-		    "BS_%d : beiscsi_conn=%p conn=%p ep_cid=%d\n",
-		    beiscsi_conn, conn, beiscsi_ep->ep_cid);
-
-	return beiscsi_bindconn_cid(phba, beiscsi_conn, beiscsi_ep->ep_cid);
+		    "BS_%d : cid %d phba->conn_table[%u]=%p\n",
+		    beiscsi_ep->ep_cid, cri_index, beiscsi_conn);
+	phba->conn_table[cri_index] = beiscsi_conn;
+	return 0;
 }
 
 static int beiscsi_iface_create_ipv4(struct beiscsi_hba *phba)
@@ -973,9 +961,9 @@ int beiscsi_conn_start(struct iscsi_cls_conn *cls_conn)
  */
 static int beiscsi_get_cid(struct beiscsi_hba *phba)
 {
-	unsigned short cid = 0xFFFF, cid_from_ulp;
-	struct ulp_cid_info *cid_info = NULL;
 	uint16_t cid_avlbl_ulp0, cid_avlbl_ulp1;
+	unsigned short cid, cid_from_ulp;
+	struct ulp_cid_info *cid_info;
 
 	/* Find the ULP which has more CID available */
 	cid_avlbl_ulp0 = (phba->cid_array_info[BEISCSI_ULP0]) ?
@@ -984,20 +972,27 @@ static int beiscsi_get_cid(struct beiscsi_hba *phba)
 			  BEISCSI_ULP1_AVLBL_CID(phba) : 0;
 	cid_from_ulp = (cid_avlbl_ulp0 > cid_avlbl_ulp1) ?
 			BEISCSI_ULP0 : BEISCSI_ULP1;
-
-	if (test_bit(cid_from_ulp, (void *)&phba->fw_config.ulp_supported)) {
-		cid_info = phba->cid_array_info[cid_from_ulp];
-		if (!cid_info->avlbl_cids)
-			return cid;
-
-		cid = cid_info->cid_array[cid_info->cid_alloc++];
-
-		if (cid_info->cid_alloc == BEISCSI_GET_CID_COUNT(
-					   phba, cid_from_ulp))
-			cid_info->cid_alloc = 0;
-
-		cid_info->avlbl_cids--;
+	/**
+	 * If iSCSI protocol is loaded only on ULP 0, and when cid_avlbl_ulp
+	 * is ZERO for both, ULP 1 is returned.
+	 * Check if ULP is loaded before getting new CID.
+	 */
+	if (!test_bit(cid_from_ulp, (void *)&phba->fw_config.ulp_supported))
+		return BE_INVALID_CID;
+
+	cid_info = phba->cid_array_info[cid_from_ulp];
+	cid = cid_info->cid_array[cid_info->cid_alloc];
+	if (!cid_info->avlbl_cids || cid == BE_INVALID_CID) {
+		__beiscsi_log(phba, KERN_ERR,
+				"BS_%d : failed to get cid: available %u:%u\n",
+				cid_info->avlbl_cids, cid_info->cid_free);
+		return BE_INVALID_CID;
 	}
+	/* empty the slot */
+	cid_info->cid_array[cid_info->cid_alloc++] = BE_INVALID_CID;
+	if (cid_info->cid_alloc == BEISCSI_GET_CID_COUNT(phba, cid_from_ulp))
+		cid_info->cid_alloc = 0;
+	cid_info->avlbl_cids--;
 	return cid;
 }
 
@@ -1008,22 +1003,28 @@ static int beiscsi_get_cid(struct beiscsi_hba *phba)
  */
 static void beiscsi_put_cid(struct beiscsi_hba *phba, unsigned short cid)
 {
-	uint16_t cid_post_ulp;
-	struct hwi_controller *phwi_ctrlr;
-	struct hwi_wrb_context *pwrb_context;
-	struct ulp_cid_info *cid_info = NULL;
 	uint16_t cri_index = BE_GET_CRI_FROM_CID(cid);
+	struct hwi_wrb_context *pwrb_context;
+	struct hwi_controller *phwi_ctrlr;
+	struct ulp_cid_info *cid_info;
+	uint16_t cid_post_ulp;
 
 	phwi_ctrlr = phba->phwi_ctrlr;
 	pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
 	cid_post_ulp = pwrb_context->ulp_num;
 
 	cid_info = phba->cid_array_info[cid_post_ulp];
-	cid_info->avlbl_cids++;
-
+	/* fill only in empty slot */
+	if (cid_info->cid_array[cid_info->cid_free] != BE_INVALID_CID) {
+		__beiscsi_log(phba, KERN_ERR,
+			      "BS_%d : failed to put cid %u: available %u:%u\n",
+			      cid, cid_info->avlbl_cids, cid_info->cid_free);
+		return;
+	}
 	cid_info->cid_array[cid_info->cid_free++] = cid;
 	if (cid_info->cid_free == BEISCSI_GET_CID_COUNT(phba, cid_post_ulp))
 		cid_info->cid_free = 0;
+	cid_info->avlbl_cids++;
 }
 
 /**
@@ -1037,8 +1038,8 @@ static void beiscsi_free_ep(struct beiscsi_endpoint *beiscsi_ep)
 
 	beiscsi_put_cid(phba, beiscsi_ep->ep_cid);
 	beiscsi_ep->phba = NULL;
-	phba->ep_array[BE_GET_CRI_FROM_CID
-		       (beiscsi_ep->ep_cid)] = NULL;
+	/* clear this to track freeing in beiscsi_ep_disconnect */
+	phba->ep_array[BE_GET_CRI_FROM_CID(beiscsi_ep->ep_cid)] = NULL;
 
 	/**
 	 * Check if any connection resource allocated by driver
@@ -1049,6 +1050,11 @@ static void beiscsi_free_ep(struct beiscsi_endpoint *beiscsi_ep)
 		return;
 
 	beiscsi_conn = beiscsi_ep->conn;
+	/**
+	 * Break ep->conn link here so that completions after
+	 * this are ignored.
+	 */
+	beiscsi_ep->conn = NULL;
 	if (beiscsi_conn->login_in_progress) {
 		beiscsi_free_mgmt_task_handles(beiscsi_conn,
 					       beiscsi_conn->task);
@@ -1079,7 +1085,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
 		    "BS_%d : In beiscsi_open_conn\n");
 
 	beiscsi_ep->ep_cid = beiscsi_get_cid(phba);
-	if (beiscsi_ep->ep_cid == 0xFFFF) {
+	if (beiscsi_ep->ep_cid == BE_INVALID_CID) {
 		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
 			    "BS_%d : No free cid available\n");
 		return ret;
@@ -1285,26 +1291,6 @@ static int beiscsi_close_conn(struct  beiscsi_endpoint *beiscsi_ep, int flag)
 }
 
 /**
- * beiscsi_unbind_conn_to_cid - Unbind the beiscsi_conn from phba conn table
- * @phba: The phba instance
- * @cid: The cid to free
- */
-static int beiscsi_unbind_conn_to_cid(struct beiscsi_hba *phba,
-				      unsigned int cid)
-{
-	uint16_t cri_index = BE_GET_CRI_FROM_CID(cid);
-
-	if (phba->conn_table[cri_index])
-		phba->conn_table[cri_index] = NULL;
-	else {
-		beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
-			    "BS_%d : Connection table Not occupied.\n");
-		return -EINVAL;
-	}
-	return 0;
-}
-
-/**
  * beiscsi_ep_disconnect - Tears down the TCP connection
  * @ep:	endpoint to be used
  *
@@ -1318,13 +1304,23 @@ void beiscsi_ep_disconnect(struct iscsi_endpoint *ep)
 	unsigned int tag;
 	uint8_t mgmt_invalidate_flag, tcp_upload_flag;
 	unsigned short savecfg_flag = CMD_ISCSI_SESSION_SAVE_CFG_ON_FLASH;
+	uint16_t cri_index;
 
 	beiscsi_ep = ep->dd_data;
 	phba = beiscsi_ep->phba;
 	beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
-		    "BS_%d : In beiscsi_ep_disconnect for ep_cid = %d\n",
+		    "BS_%d : In beiscsi_ep_disconnect for ep_cid = %u\n",
 		    beiscsi_ep->ep_cid);
 
+	cri_index = BE_GET_CRI_FROM_CID(beiscsi_ep->ep_cid);
+	if (!phba->ep_array[cri_index]) {
+		__beiscsi_log(phba, KERN_ERR,
+			      "BS_%d : ep_array at %u cid %u empty\n",
+			      cri_index,
+			      beiscsi_ep->ep_cid);
+		return;
+	}
+
 	if (beiscsi_ep->conn) {
 		beiscsi_conn = beiscsi_ep->conn;
 		iscsi_suspend_queue(beiscsi_conn->conn);
@@ -1356,7 +1352,12 @@ void beiscsi_ep_disconnect(struct iscsi_endpoint *ep)
 free_ep:
 	msleep(BEISCSI_LOGOUT_SYNC_DELAY);
 	beiscsi_free_ep(beiscsi_ep);
-	beiscsi_unbind_conn_to_cid(phba, beiscsi_ep->ep_cid);
+	if (!phba->conn_table[cri_index])
+		__beiscsi_log(phba, KERN_ERR,
+				"BS_%d : conn_table empty at %u: cid %u\n",
+				cri_index,
+				beiscsi_ep->ep_cid);
+	phba->conn_table[cri_index] = NULL;
 	iscsi_destroy_endpoint(beiscsi_ep->openiscsi_ep);
 }
 
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index d9239c2d49b1..741cc96379cb 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -4085,9 +4085,10 @@ static int hba_setup_cid_tbls(struct beiscsi_hba *phba)
 			}
 
 			/* Allocate memory for CID array */
-			ptr_cid_info->cid_array = kzalloc(sizeof(void *) *
-						  BEISCSI_GET_CID_COUNT(phba,
-						  ulp_num), GFP_KERNEL);
+			ptr_cid_info->cid_array =
+				kcalloc(BEISCSI_GET_CID_COUNT(phba, ulp_num),
+					sizeof(*ptr_cid_info->cid_array),
+					GFP_KERNEL);
 			if (!ptr_cid_info->cid_array) {
 				beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
 					    "BM_%d : Failed to allocate memory"
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index 6376657e45f7..02d00ab6d981 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -358,6 +358,7 @@ struct beiscsi_hba {
 	unsigned int age;
 	struct list_head hba_queue;
 #define BE_MAX_SESSION 2048
+#define BE_INVALID_CID 0xffff
 #define BE_SET_CID_TO_CRI(cri_index, cid) \
 			  (phba->cid_to_cri_map[cid] = cri_index)
 #define BE_GET_CRI_FROM_CID(cid) (phba->cid_to_cri_map[cid])
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 19/59] extcon: axp288: Use vbus-valid instead of -present to determine cable presence
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (15 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 16/59] scsi: be2iscsi: Add checks to validate CID alloc/free Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 18/59] igb: re-assign hw address pointer on reset after PCI error Levin, Alexander (Sasha Levin)
                   ` (40 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Hans de Goede, Chanwoo Choi, Levin, Alexander (Sasha Levin)

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit 5757aca10146061befd168dab37fb0db1ccd8f73 ]

The vbus-present bit in the power status register also gets set to 1
when a usb-host cable (id-pin shorted to ground) is plugged in and a 5v
boost converter is supplying 5v to the otg usb bus.

This causes a "disconnect or unknown or ID event" warning in dmesg as
well as the extcon device to report the last detected charger cable
type as being connected even though none is connected.

This commit switches to checking the vbus-valid bit instead, which is
only 1 when both vbus is present and the vbus-path is enabled in the
vbus-path control register (the vbus-path gets disabled when a usb-host
cable is detected, to avoid the pmic drawing power from the 5v boost
converter).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/extcon/extcon-axp288.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index 42f41e808292..27f67c28e700 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -168,7 +168,7 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
 		return ret;
 	}
 
-	vbus_attach = (pwr_stat & PS_STAT_VBUS_PRESENT);
+	vbus_attach = (pwr_stat & PS_STAT_VBUS_VALID);
 	if (!vbus_attach)
 		goto notify_otg;
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 20/59] reset: ti_syscon: fix a ti_syscon_reset_status issue
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (18 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 21/59] sh_eth: use correct name for ECMR_MPDE bit Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 23/59] clk: wm831x: fix usleep_range with bad range Levin, Alexander (Sasha Levin)
                   ` (37 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jiancheng Xue, Philipp Zabel, Levin, Alexander (Sasha Levin)

From: Jiancheng Xue <xuejiancheng@hisilicon.com>

[ Upstream commit 5987b4bf512101137fa60c5c0ccac3db51541221 ]

If STATUS_SET was not set, ti_syscon_reset_status would always return 0
no matter whether the status_bit was set or not.

Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com>
Fixes: cc7c2bb1493c ("reset: add TI SYSCON based reset driver")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/reset/reset-ti-syscon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/reset/reset-ti-syscon.c b/drivers/reset/reset-ti-syscon.c
index 47f0ffd3b013..1799fd423901 100644
--- a/drivers/reset/reset-ti-syscon.c
+++ b/drivers/reset/reset-ti-syscon.c
@@ -154,8 +154,8 @@ static int ti_syscon_reset_status(struct reset_controller_dev *rcdev,
 	if (ret)
 		return ret;
 
-	return (reset_state & BIT(control->status_bit)) &&
-			(control->flags & STATUS_SET);
+	return !(reset_state & BIT(control->status_bit)) ==
+		!(control->flags & STATUS_SET);
 }
 
 static struct reset_control_ops ti_syscon_reset_ops = {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 21/59] sh_eth: use correct name for ECMR_MPDE bit
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (17 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 18/59] igb: re-assign hw address pointer on reset after PCI error Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 20/59] reset: ti_syscon: fix a ti_syscon_reset_status issue Levin, Alexander (Sasha Levin)
                   ` (38 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Niklas Söderlund, David S . Miller, Levin, Alexander (Sasha Levin)

From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

[ Upstream commit 6dcf45e514974a1ff10755015b5e06746a033e5f ]

This bit was wrongly named due to a typo, Sergei checked the SH7734/63
manuals and this bit should be named MPDE.

Suggested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/renesas/sh_eth.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index d050f37f3e0f..5024280f5af2 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -339,7 +339,7 @@ enum FELIC_MODE_BIT {
 	ECMR_DPAD = 0x00200000, ECMR_RZPF = 0x00100000,
 	ECMR_ZPF = 0x00080000, ECMR_PFR = 0x00040000, ECMR_RXF = 0x00020000,
 	ECMR_TXF = 0x00010000, ECMR_MCT = 0x00002000, ECMR_PRCEF = 0x00001000,
-	ECMR_PMDE = 0x00000200, ECMR_RE = 0x00000040, ECMR_TE = 0x00000020,
+	ECMR_MPDE = 0x00000200, ECMR_RE = 0x00000040, ECMR_TE = 0x00000020,
 	ECMR_RTM = 0x00000010, ECMR_ILB = 0x00000008, ECMR_ELB = 0x00000004,
 	ECMR_DM = 0x00000002, ECMR_PRM = 0x00000001,
 };
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 18/59] igb: re-assign hw address pointer on reset after PCI error
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (16 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 19/59] extcon: axp288: Use vbus-valid instead of -present to determine cable presence Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 21/59] sh_eth: use correct name for ECMR_MPDE bit Levin, Alexander (Sasha Levin)
                   ` (39 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Guilherme G Piccoli, Jeff Kirsher, Levin, Alexander (Sasha Levin)

From: Guilherme G Piccoli <gpiccoli@linux.vnet.ibm.com>

[ Upstream commit 69b97cf6dbce7403845a28bbc75d57f5be7b12ac ]

Whenever the igb driver detects the result of a read operation returns
a value composed only by F's (like 0xFFFFFFFF), it will detach the
net_device, clear the hw_addr pointer and warn to the user that adapter's
link is lost - those steps happen on igb_rd32().

In case a PCI error happens on Power architecture, there's a recovery
mechanism called EEH, that will reset the PCI slot and call driver's
handlers to reset the adapter and network functionality as well.

We observed that once hw_addr is NULL after the error is detected on
igb_rd32(), it's never assigned back, so in the process of resetting
the network functionality we got a NULL pointer dereference in both
igb_configure_tx_ring() and igb_configure_rx_ring(). In order to avoid
such bug, this patch re-assigns the hw_addr value in the slot_reset
handler.

Reported-by: Anthony H Thai <ahthai@us.ibm.com>
Reported-by: Harsha Thyagaraja <hathyaga@in.ibm.com>
Signed-off-by: Guilherme G Piccoli <gpiccoli@linux.vnet.ibm.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 9affd7c198bd..6a62447fe377 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7882,6 +7882,11 @@ static pci_ers_result_t igb_io_slot_reset(struct pci_dev *pdev)
 		pci_enable_wake(pdev, PCI_D3hot, 0);
 		pci_enable_wake(pdev, PCI_D3cold, 0);
 
+		/* In case of PCI error, adapter lose its HW address
+		 * so we should re-assign it here.
+		 */
+		hw->hw_addr = adapter->io_addr;
+
 		igb_reset(adapter);
 		wr32(E1000_WUS, ~0);
 		result = PCI_ERS_RESULT_RECOVERED;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 22/59] clk/axs10x: Clear init field in driver probe
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51   ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 03/59] GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next Levin, Alexander (Sasha Levin)
                     ` (56 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jose Abreu, Jose Abreu, Carlos Palminha, Stephen Boyd,
	Michael Turquette, linux-clk, Levin, Alexander (Sasha Levin)

From: Jose Abreu <Jose.Abreu@synopsys.com>

[ Upstream commit 6205406cf6f282d622f31de25036e6d1ab3a2ff5 ]

Init field must be cleared in driver probe as this structure is not
dinamically allocated. If not, wrong flags can be passed to core.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Fixes: 923587aafc2c ("clk/axs10x: Add I2S PLL clock driver")
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/040cc9afdfa0e95ce7a01c406ff427ef7dc0c0fd.1481540717.git.joabreu@synopsys.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/clk/axs10x/i2s_pll_clock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/axs10x/i2s_pll_clock.c b/drivers/clk/axs10x/i2s_pll_clock.c
index 411310d29581..02d3bcd6216c 100644
--- a/drivers/clk/axs10x/i2s_pll_clock.c
+++ b/drivers/clk/axs10x/i2s_pll_clock.c
@@ -182,6 +182,7 @@ static int i2s_pll_clk_probe(struct platform_device *pdev)
 	if (IS_ERR(pll_clk->base))
 		return PTR_ERR(pll_clk->base);
 
+	memset(&init, 0, sizeof(init));
 	clk_name = node->name;
 	init.name = clk_name;
 	init.ops = &i2s_pll_ops;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 23/59] clk: wm831x: fix usleep_range with bad range
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (19 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 20/59] reset: ti_syscon: fix a ti_syscon_reset_status issue Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51   ` Levin, Alexander (Sasha Levin)
                   ` (36 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Nicholas Mc Guire, Stephen Boyd, Levin, Alexander (Sasha Levin)

From: Nicholas Mc Guire <hofrat@osadl.org>

[ Upstream commit ed784c532a3d0959db488f40a96c5127f63d42dc ]

The delay here is not in atomic context and does not seem critical with
respect to precision, but usleep_range(min,max) with min==max results in
giving the timer subsystem no room to optimize uncritical delays. Fix
this by setting the range to 2000,3000 us.

Fixes: commit f05259a6ffa4 ("clk: wm831x: Add initial WM831x clock driver")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/clk/clk-wm831x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-wm831x.c b/drivers/clk/clk-wm831x.c
index 0621fbfb4beb..a47960aacfa5 100644
--- a/drivers/clk/clk-wm831x.c
+++ b/drivers/clk/clk-wm831x.c
@@ -97,7 +97,8 @@ static int wm831x_fll_prepare(struct clk_hw *hw)
 	if (ret != 0)
 		dev_crit(wm831x->dev, "Failed to enable FLL: %d\n", ret);
 
-	usleep_range(2000, 2000);
+	/* wait 2-3 ms for new frequency taking effect */
+	usleep_range(2000, 3000);
 
 	return ret;
 }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 24/59] usb: make the MTK XHCI driver compile for older MIPS SoCs
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (22 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 25/59] hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 27/59] iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications Levin, Alexander (Sasha Levin)
                   ` (33 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: John Crispin, Greg Kroah-Hartman, Levin, Alexander (Sasha Levin)

From: John Crispin <john@phrozen.org>

[ Upstream commit 808cf33d4817c730008de9b2736b357708a3d7f6 ]

The MIPS based MT7621 shares the same XHCI core as the newer generation of
ARM based SoCs. The driver works out of the box and we only need to make it
buildable in Kconfig.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/usb/host/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 0b80cee30da4..eb121b2a55d4 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -45,9 +45,9 @@ config USB_XHCI_PLATFORM
 	  If unsure, say N.
 
 config USB_XHCI_MTK
-	tristate "xHCI support for Mediatek MT65xx"
+	tristate "xHCI support for Mediatek MT65xx/MT7621"
 	select MFD_SYSCON
-	depends on ARCH_MEDIATEK || COMPILE_TEST
+	depends on (MIPS && SOC_MT7621) || ARCH_MEDIATEK || COMPILE_TEST
 	---help---
 	  Say 'Y' to enable the support for the xHCI host controller
 	  found in Mediatek MT65xx SoCs.
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 25/59] hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (21 preceding siblings ...)
  2017-09-14 15:51   ` Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 24/59] usb: make the MTK XHCI driver compile for older MIPS SoCs Levin, Alexander (Sasha Levin)
                   ` (34 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Guenter Roeck, Levin, Alexander (Sasha Levin)

From: Guenter Roeck <linux@roeck-us.net>

[ Upstream commit 87cdfa9d60f4f40e6d71b04b10b36d9df3c89282 ]

Writes into limit attributes can overflow due to multplications and
additions with unbound input values. Writing into fan limit attributes
can result in a crash with a division by zero if very large values are
written and the fan divider is larger than 1.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/hwmon/gl520sm.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/hwmon/gl520sm.c b/drivers/hwmon/gl520sm.c
index dee93ec87d02..84e0994aafdd 100644
--- a/drivers/hwmon/gl520sm.c
+++ b/drivers/hwmon/gl520sm.c
@@ -208,11 +208,13 @@ static ssize_t get_cpu_vid(struct device *dev, struct device_attribute *attr,
 }
 static DEVICE_ATTR(cpu0_vid, S_IRUGO, get_cpu_vid, NULL);
 
-#define VDD_FROM_REG(val) (((val) * 95 + 2) / 4)
-#define VDD_TO_REG(val) clamp_val((((val) * 4 + 47) / 95), 0, 255)
+#define VDD_FROM_REG(val)	DIV_ROUND_CLOSEST((val) * 95, 4)
+#define VDD_CLAMP(val)		clamp_val(val, 0, 255 * 95 / 4)
+#define VDD_TO_REG(val)		DIV_ROUND_CLOSEST(VDD_CLAMP(val) * 4, 95)
 
-#define IN_FROM_REG(val) ((val) * 19)
-#define IN_TO_REG(val) clamp_val((((val) + 9) / 19), 0, 255)
+#define IN_FROM_REG(val)	((val) * 19)
+#define IN_CLAMP(val)		clamp_val(val, 0, 255 * 19)
+#define IN_TO_REG(val)		DIV_ROUND_CLOSEST(IN_CLAMP(val), 19)
 
 static ssize_t get_in_input(struct device *dev, struct device_attribute *attr,
 			    char *buf)
@@ -349,8 +351,13 @@ static SENSOR_DEVICE_ATTR(in4_max, S_IRUGO | S_IWUSR,
 
 #define DIV_FROM_REG(val) (1 << (val))
 #define FAN_FROM_REG(val, div) ((val) == 0 ? 0 : (480000 / ((val) << (div))))
-#define FAN_TO_REG(val, div) ((val) <= 0 ? 0 : \
-	clamp_val((480000 + ((val) << ((div)-1))) / ((val) << (div)), 1, 255))
+
+#define FAN_BASE(div)		(480000 >> (div))
+#define FAN_CLAMP(val, div)	clamp_val(val, FAN_BASE(div) / 255, \
+					  FAN_BASE(div))
+#define FAN_TO_REG(val, div)	((val) == 0 ? 0 : \
+				 DIV_ROUND_CLOSEST(480000, \
+						FAN_CLAMP(val, div) << (div)))
 
 static ssize_t get_fan_input(struct device *dev, struct device_attribute *attr,
 			     char *buf)
@@ -513,9 +520,9 @@ static SENSOR_DEVICE_ATTR(fan2_div, S_IRUGO | S_IWUSR,
 static DEVICE_ATTR(fan1_off, S_IRUGO | S_IWUSR,
 		get_fan_off, set_fan_off);
 
-#define TEMP_FROM_REG(val) (((val) - 130) * 1000)
-#define TEMP_TO_REG(val) clamp_val(((((val) < 0 ? \
-			(val) - 500 : (val) + 500) / 1000) + 130), 0, 255)
+#define TEMP_FROM_REG(val)	(((val) - 130) * 1000)
+#define TEMP_CLAMP(val)		clamp_val(val, -130000, 125000)
+#define TEMP_TO_REG(val)	(DIV_ROUND_CLOSEST(TEMP_CLAMP(val), 1000) + 130)
 
 static ssize_t get_temp_input(struct device *dev, struct device_attribute *attr,
 			      char *buf)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 22/59] clk/axs10x: Clear init field in driver probe
@ 2017-09-14 15:51   ` Levin, Alexander (Sasha Levin)
  0 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jose Abreu, Jose Abreu, Carlos Palminha, Stephen Boyd,
	Michael Turquette, linux-clk, Levin, Alexander (Sasha Levin)

From: Jose Abreu <Jose.Abreu@synopsys.com>

[ Upstream commit 6205406cf6f282d622f31de25036e6d1ab3a2ff5 ]

Init field must be cleared in driver probe as this structure is not
dinamically allocated. If not, wrong flags can be passed to core.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Fixes: 923587aafc2c ("clk/axs10x: Add I2S PLL clock driver")
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/040cc9afdfa0e95ce7a01c406ff427ef7dc0c0fd.1481540717=
.git.joabreu@synopsys.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/clk/axs10x/i2s_pll_clock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/axs10x/i2s_pll_clock.c b/drivers/clk/axs10x/i2s_pl=
l_clock.c
index 411310d29581..02d3bcd6216c 100644
--- a/drivers/clk/axs10x/i2s_pll_clock.c
+++ b/drivers/clk/axs10x/i2s_pll_clock.c
@@ -182,6 +182,7 @@ static int i2s_pll_clk_probe(struct platform_device *pd=
ev)
 	if (IS_ERR(pll_clk->base))
 		return PTR_ERR(pll_clk->base);
=20
+	memset(&init, 0, sizeof(init));
 	clk_name =3D node->name;
 	init.name =3D clk_name;
 	init.ops =3D &i2s_pll_ops;
--=20
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 29/59] IB/rxe: Add a runtime check in alloc_index()
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (24 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 27/59] iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 28/59] iio: adc: hx711: Add DT binding for avia,hx711 Levin, Alexander (Sasha Levin)
                   ` (31 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Bart Van Assche, Moni Shoua, Doug Ledford, Levin,
	Alexander (Sasha Levin)

From: Bart Van Assche <bart.vanassche@sandisk.com>

[ Upstream commit 642c7cbcaf2ffc1e27f67eda3dc47347ac5aff37 ]

Since index values equal to or above 'range' can trigger memory
corruption, complain if index >= range.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Andrew Boyer <andrew.boyer@dell.com>
Cc: Moni Shoua <monis@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/infiniband/sw/rxe/rxe_pool.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/sw/rxe/rxe_pool.c b/drivers/infiniband/sw/rxe/rxe_pool.c
index 6bac0717c540..ee26a1b1b4ed 100644
--- a/drivers/infiniband/sw/rxe/rxe_pool.c
+++ b/drivers/infiniband/sw/rxe/rxe_pool.c
@@ -274,6 +274,7 @@ static u32 alloc_index(struct rxe_pool *pool)
 	if (index >= range)
 		index = find_first_zero_bit(pool->table, range);
 
+	WARN_ON_ONCE(index >= range);
 	set_bit(index, pool->table);
 	pool->last = index;
 	return index + pool->min_index;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 27/59] iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (23 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 24/59] usb: make the MTK XHCI driver compile for older MIPS SoCs Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 29/59] IB/rxe: Add a runtime check in alloc_index() Levin, Alexander (Sasha Levin)
                   ` (32 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Hans de Goede, Jonathan Cameron, Levin, Alexander (Sasha Levin)

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit fa2849e9649b5180ffc4cb3c3b005261c403093a ]

For some reason the axp288_adc driver was modifying the
AXP288_ADC_TS_PIN_CTRL register, changing bits 0-1 depending on
whether the GP_ADC channel or another channel was written.

These bits control when a bias current is send to the TS_PIN, the
GP_ADC has its own pin and a separate bit in another register to
control the bias current.

Not only does changing when to enable the TS_PIN bias current
(always or only when sampling) when reading the GP_ADC make no sense
at all, the code is modifying these bits is writing the entire register,
assuming that all the other bits have their default value.

So if the firmware has configured a different bias-current for either
pin, then that change gets clobbered by the write, likewise if the
firmware has set bit 2 to indicate that the battery has no thermal sensor,
this will get clobbered by the write.

This commit fixes all this, by simply removing all writes to the
AXP288_ADC_TS_PIN_CTRL register, they are not needed to read the
GP_ADC pin, and can actually be harmful.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/iio/adc/axp288_adc.c | 32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

diff --git a/drivers/iio/adc/axp288_adc.c b/drivers/iio/adc/axp288_adc.c
index 7fd24949c0c1..64799ad7ebad 100644
--- a/drivers/iio/adc/axp288_adc.c
+++ b/drivers/iio/adc/axp288_adc.c
@@ -28,8 +28,6 @@
 #include <linux/iio/driver.h>
 
 #define AXP288_ADC_EN_MASK		0xF1
-#define AXP288_ADC_TS_PIN_GPADC		0xF2
-#define AXP288_ADC_TS_PIN_ON		0xF3
 
 enum axp288_adc_id {
 	AXP288_ADC_TS,
@@ -123,16 +121,6 @@ static int axp288_adc_read_channel(int *val, unsigned long address,
 	return IIO_VAL_INT;
 }
 
-static int axp288_adc_set_ts(struct regmap *regmap, unsigned int mode,
-				unsigned long address)
-{
-	/* channels other than GPADC do not need to switch TS pin */
-	if (address != AXP288_GP_ADC_H)
-		return 0;
-
-	return regmap_write(regmap, AXP288_ADC_TS_PIN_CTRL, mode);
-}
-
 static int axp288_adc_read_raw(struct iio_dev *indio_dev,
 			struct iio_chan_spec const *chan,
 			int *val, int *val2, long mask)
@@ -143,16 +131,7 @@ static int axp288_adc_read_raw(struct iio_dev *indio_dev,
 	mutex_lock(&indio_dev->mlock);
 	switch (mask) {
 	case IIO_CHAN_INFO_RAW:
-		if (axp288_adc_set_ts(info->regmap, AXP288_ADC_TS_PIN_GPADC,
-					chan->address)) {
-			dev_err(&indio_dev->dev, "GPADC mode\n");
-			ret = -EINVAL;
-			break;
-		}
 		ret = axp288_adc_read_channel(val, chan->address, info->regmap);
-		if (axp288_adc_set_ts(info->regmap, AXP288_ADC_TS_PIN_ON,
-						chan->address))
-			dev_err(&indio_dev->dev, "TS pin restore\n");
 		break;
 	default:
 		ret = -EINVAL;
@@ -162,15 +141,6 @@ static int axp288_adc_read_raw(struct iio_dev *indio_dev,
 	return ret;
 }
 
-static int axp288_adc_set_state(struct regmap *regmap)
-{
-	/* ADC should be always enabled for internal FG to function */
-	if (regmap_write(regmap, AXP288_ADC_TS_PIN_CTRL, AXP288_ADC_TS_PIN_ON))
-		return -EIO;
-
-	return regmap_write(regmap, AXP20X_ADC_EN1, AXP288_ADC_EN_MASK);
-}
-
 static const struct iio_info axp288_adc_iio_info = {
 	.read_raw = &axp288_adc_read_raw,
 	.driver_module = THIS_MODULE,
@@ -199,7 +169,7 @@ static int axp288_adc_probe(struct platform_device *pdev)
 	 * Set ADC to enabled state at all time, including system suspend.
 	 * otherwise internal fuel gauge functionality may be affected.
 	 */
-	ret = axp288_adc_set_state(axp20x->regmap);
+	ret = regmap_write(info->regmap, AXP20X_ADC_EN1, AXP288_ADC_EN_MASK);
 	if (ret) {
 		dev_err(&pdev->dev, "unable to enable ADC device\n");
 		return ret;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 26/59] iio: adc: imx25-gcq: Fix module autoload
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (26 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 28/59] iio: adc: hx711: Add DT binding for avia,hx711 Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 32/59] drm/i915/psr: disable psr2 for resolution greater than 32X20 Levin, Alexander (Sasha Levin)
                   ` (29 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Javier Martinez Canillas, Jonathan Cameron, Levin,
	Alexander (Sasha Levin)

From: Javier Martinez Canillas <javier@osg.samsung.com>

[ Upstream commit 8f0d7daf53972da0004f7a5a4d938c85333db300 ]

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/iio/adc/fsl-imx25-gcq.ko | grep alias
$

After this patch:

$ modinfo drivers/iio/adc/fsl-imx25-gcq.ko | grep alias
alias:          of:N*T*Cfsl,imx25-gcqC*
alias:          of:N*T*Cfsl,imx25-gcq

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/iio/adc/fsl-imx25-gcq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
index 72b32c1ab257..ea264fa9e567 100644
--- a/drivers/iio/adc/fsl-imx25-gcq.c
+++ b/drivers/iio/adc/fsl-imx25-gcq.c
@@ -401,6 +401,7 @@ static const struct of_device_id mx25_gcq_ids[] = {
 	{ .compatible = "fsl,imx25-gcq", },
 	{ /* Sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, mx25_gcq_ids);
 
 static struct platform_driver mx25_gcq_driver = {
 	.driver		= {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 28/59] iio: adc: hx711: Add DT binding for avia,hx711
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (25 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 29/59] IB/rxe: Add a runtime check in alloc_index() Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 26/59] iio: adc: imx25-gcq: Fix module autoload Levin, Alexander (Sasha Levin)
                   ` (30 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Andreas Klinger, Jonathan Cameron, Levin, Alexander (Sasha Levin)

From: Andreas Klinger <ak@it-klinger.de>

[ Upstream commit ff1293f67734da68e23fecb6ecdae7112b8c43f9 ]

Add DT bindings for avia,hx711
Add vendor avia to vendor list

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 .../devicetree/bindings/iio/adc/avia-hx711.txt         | 18 ++++++++++++++++++
 Documentation/devicetree/bindings/vendor-prefixes.txt  |  1 +
 2 files changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/avia-hx711.txt

diff --git a/Documentation/devicetree/bindings/iio/adc/avia-hx711.txt b/Documentation/devicetree/bindings/iio/adc/avia-hx711.txt
new file mode 100644
index 000000000000..b3629405f568
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/avia-hx711.txt
@@ -0,0 +1,18 @@
+* AVIA HX711 ADC chip for weight cells
+  Bit-banging driver
+
+Required properties:
+ - compatible:	Should be "avia,hx711"
+ - sck-gpios:	Definition of the GPIO for the clock
+ - dout-gpios:	Definition of the GPIO for data-out
+		See Documentation/devicetree/bindings/gpio/gpio.txt
+ - avdd-supply:	Definition of the regulator used as analog supply
+
+Example:
+weight@0 {
+	compatible = "avia,hx711";
+	sck-gpios = <&gpio3 10 GPIO_ACTIVE_HIGH>;
+	dout-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
+	avdd-suppy = <&avdd>;
+};
+
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index f0a48ea78659..bceffffb7502 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -38,6 +38,7 @@ atmel	Atmel Corporation
 auo	AU Optronics Corporation
 auvidea Auvidea GmbH
 avago	Avago Technologies
+avia	avia semiconductor
 avic	Shanghai AVIC Optoelectronics Co., Ltd.
 axis	Axis Communications AB
 boe	BOE Technology Group Co., Ltd.
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 33/59] serial: 8250: moxa: Store num_ports in brd
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (28 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 32/59] drm/i915/psr: disable psr2 for resolution greater than 32X20 Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 31/59] ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM Levin, Alexander (Sasha Levin)
                   ` (27 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Matwey V. Kornilov, Greg Kroah-Hartman, Levin, Alexander (Sasha Levin)

From: "Matwey V. Kornilov" <matwey@sai.msu.ru>

[ Upstream commit 9c4b60fe5313c125b1bf68ef04b0010512c27f2d ]

When struct moxa8250_board is allocated, then num_ports should
be initialized in order to use it later in moxa8250_remove.

Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/tty/serial/8250/8250_moxa.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/8250/8250_moxa.c b/drivers/tty/serial/8250/8250_moxa.c
index 26eb5393a263..d5069b2d4d79 100644
--- a/drivers/tty/serial/8250/8250_moxa.c
+++ b/drivers/tty/serial/8250/8250_moxa.c
@@ -68,6 +68,7 @@ static int moxa8250_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			   sizeof(unsigned int) * nr_ports, GFP_KERNEL);
 	if (!brd)
 		return -ENOMEM;
+	brd->num_ports = nr_ports;
 
 	memset(&uart, 0, sizeof(struct uart_8250_port));
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 31/59] ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (29 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 33/59] serial: 8250: moxa: Store num_ports in brd Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 30/59] IB/rxe: Fix a MR reference leak in check_rkey() Levin, Alexander (Sasha Levin)
                   ` (26 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Afzal Mohammed, Russell King, Levin, Alexander (Sasha Levin)

From: Afzal Mohammed <afzal.mohd.ma@gmail.com>

[ Upstream commit 8a792e9afbce84a0fdaf213fe42bb97382487094 ]

REMAP_VECTORS_TO_RAM depends on DRAM_BASE, but since DRAM_BASE is a
hex, REMAP_VECTORS_TO_RAM could never get enabled. Also depending on
DRAM_BASE is redundant as whenever REMAP_VECTORS_TO_RAM makes itself
available to Kconfig, DRAM_BASE also is available as the Kconfig
gets sourced on !MMU.

Signed-off-by: Afzal Mohammed <afzal.mohd.ma@gmail.com>
Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/arm/Kconfig-nommu | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig-nommu b/arch/arm/Kconfig-nommu
index aed66d5df7f1..b7576349528c 100644
--- a/arch/arm/Kconfig-nommu
+++ b/arch/arm/Kconfig-nommu
@@ -34,8 +34,7 @@ config PROCESSOR_ID
 	  used instead of the auto-probing which utilizes the register.
 
 config REMAP_VECTORS_TO_RAM
-	bool 'Install vectors to the beginning of RAM' if DRAM_BASE
-	depends on DRAM_BASE
+	bool 'Install vectors to the beginning of RAM'
 	help
 	  The kernel needs to change the hardware exception vectors.
 	  In nommu mode, the hardware exception vectors are normally
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 32/59] drm/i915/psr: disable psr2 for resolution greater than 32X20
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (27 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 26/59] iio: adc: imx25-gcq: Fix module autoload Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 33/59] serial: 8250: moxa: Store num_ports in brd Levin, Alexander (Sasha Levin)
                   ` (28 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Nagaraju, Vathsala, Rodrigo Vivi, Jim Bride, Levin,
	Alexander (Sasha Levin)

From: "Nagaraju, Vathsala" <vathsala.nagaraju@intel.com>

[ Upstream commit acf45d11050abd751dcec986ab121cb2367dcbba ]

PSR2 is restricted to work with panel resolutions upto 3200x2000,
move the check to intel_psr_match_conditions and fully block psr.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Jim Bride <jim.bride@linux.intel.com>
Suggested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Vathsala Nagaraju <vathsala.nagaraju@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1484031746-20874-1-git-send-email-vathsala.nagaraju@intel.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/i915/intel_psr.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index 9b307cee3008..dff478498f05 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -387,6 +387,13 @@ static bool intel_psr_match_conditions(struct intel_dp *intel_dp)
 		return false;
 	}
 
+	/* PSR2 is restricted to work with panel resolutions upto 3200x2000 */
+	if (intel_crtc->config->pipe_src_w > 3200 ||
+				intel_crtc->config->pipe_src_h > 2000) {
+		dev_priv->psr.psr2_support = false;
+		return false;
+	}
+
 	dev_priv->psr.source_ok = true;
 	return true;
 }
@@ -425,7 +432,6 @@ void intel_psr_enable(struct intel_dp *intel_dp)
 	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
 	struct drm_device *dev = intel_dig_port->base.base.dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
-	struct intel_crtc *crtc = to_intel_crtc(intel_dig_port->base.base.crtc);
 
 	if (!HAS_PSR(dev)) {
 		DRM_DEBUG_KMS("PSR not supported on this platform\n");
@@ -452,12 +458,7 @@ void intel_psr_enable(struct intel_dp *intel_dp)
 		hsw_psr_setup_vsc(intel_dp);
 
 		if (dev_priv->psr.psr2_support) {
-			/* PSR2 is restricted to work with panel resolutions upto 3200x2000 */
-			if (crtc->config->pipe_src_w > 3200 ||
-				crtc->config->pipe_src_h > 2000)
-				dev_priv->psr.psr2_support = false;
-			else
-				skl_psr_setup_su_vsc(intel_dp);
+			skl_psr_setup_su_vsc(intel_dp);
 		}
 
 		/*
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 30/59] IB/rxe: Fix a MR reference leak in check_rkey()
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (30 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 31/59] ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 37/59] IB/ipoib: rtnl_unlock can not come after free_netdev Levin, Alexander (Sasha Levin)
                   ` (25 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Bart Van Assche, Moni Shoua, Doug Ledford, Levin,
	Alexander (Sasha Levin)

From: Bart Van Assche <bart.vanassche@sandisk.com>

[ Upstream commit b3a459961014b14c267544c327db033669493295 ]

Avoid that calling check_rkey() for mem->state == RXE_MEM_STATE_FREE
triggers an MR reference leak.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Andrew Boyer <andrew.boyer@dell.com>
Cc: Moni Shoua <monis@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/infiniband/sw/rxe/rxe_resp.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index ccf624763565..69ed4e0d7a0d 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -418,7 +418,7 @@ static enum resp_states check_length(struct rxe_qp *qp,
 static enum resp_states check_rkey(struct rxe_qp *qp,
 				   struct rxe_pkt_info *pkt)
 {
-	struct rxe_mem *mem;
+	struct rxe_mem *mem = NULL;
 	u64 va;
 	u32 rkey;
 	u32 resid;
@@ -452,38 +452,38 @@ static enum resp_states check_rkey(struct rxe_qp *qp,
 	mem = lookup_mem(qp->pd, access, rkey, lookup_remote);
 	if (!mem) {
 		state = RESPST_ERR_RKEY_VIOLATION;
-		goto err1;
+		goto err;
 	}
 
 	if (unlikely(mem->state == RXE_MEM_STATE_FREE)) {
 		state = RESPST_ERR_RKEY_VIOLATION;
-		goto err1;
+		goto err;
 	}
 
 	if (mem_check_range(mem, va, resid)) {
 		state = RESPST_ERR_RKEY_VIOLATION;
-		goto err2;
+		goto err;
 	}
 
 	if (pkt->mask & RXE_WRITE_MASK)	 {
 		if (resid > mtu) {
 			if (pktlen != mtu || bth_pad(pkt)) {
 				state = RESPST_ERR_LENGTH;
-				goto err2;
+				goto err;
 			}
 
 			qp->resp.resid = mtu;
 		} else {
 			if (pktlen != resid) {
 				state = RESPST_ERR_LENGTH;
-				goto err2;
+				goto err;
 			}
 			if ((bth_pad(pkt) != (0x3 & (-resid)))) {
 				/* This case may not be exactly that
 				 * but nothing else fits.
 				 */
 				state = RESPST_ERR_LENGTH;
-				goto err2;
+				goto err;
 			}
 		}
 	}
@@ -493,9 +493,9 @@ static enum resp_states check_rkey(struct rxe_qp *qp,
 	qp->resp.mr = mem;
 	return RESPST_EXECUTE;
 
-err2:
-	rxe_drop_ref(mem);
-err1:
+err:
+	if (mem)
+		rxe_drop_ref(mem);
 	return state;
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 34/59] tty: goldfish: Fix a parameter of a call to free_irq
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (32 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 37/59] IB/ipoib: rtnl_unlock can not come after free_netdev Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 35/59] serial: 8250_port: Remove dangerous pr_debug() Levin, Alexander (Sasha Levin)
                   ` (23 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Christophe JAILLET, Greg Kroah-Hartman, Levin, Alexander (Sasha Levin)

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[ Upstream commit 1a5c2d1de7d35f5eb9793266237903348989502b ]

'request_irq()' and 'free_irq()' should be called with the same dev_id.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/tty/goldfish.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c
index 3fc912373adf..996bd473dd03 100644
--- a/drivers/tty/goldfish.c
+++ b/drivers/tty/goldfish.c
@@ -300,7 +300,7 @@ static int goldfish_tty_probe(struct platform_device *pdev)
 	return 0;
 
 err_tty_register_device_failed:
-	free_irq(irq, pdev);
+	free_irq(irq, qtty);
 err_request_irq_failed:
 	goldfish_tty_current_line_count--;
 	if (goldfish_tty_current_line_count == 0)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 35/59] serial: 8250_port: Remove dangerous pr_debug()
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (33 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 34/59] tty: goldfish: Fix a parameter of a call to free_irq Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 36/59] IB/ipoib: Fix deadlock over vlan_mutex Levin, Alexander (Sasha Levin)
                   ` (22 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Alexey Brodkin, Alexey Brodkin, Jiri Slaby, Peter Hurley,
	Phillip Raffeck, Anton Wuerfel, Matwey V. Kornilov,
	Yegor Yefremov, Thor Thayer, Greg Kroah-Hartman, Levin,
	Alexander (Sasha Levin)

From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>

[ Upstream commit 699a11ba7ec869b006623182881f2f1f5b4aea53 ]

With CONFIG_DYNAMIC_DEBUG if dyndbg enables debug output in
8250_port.c deadlock happens inevitably on UART IRQ handling.

That's the problematic execution path:
---------------------------->8------------------------
UART IRQ:
  serial8250_interrupt() ->
    serial8250_handle_irq(): lock "port->lock" ->
      pr_debug() ->
        serial8250_console_write(): bump in locked "port->lock".

      OR (if above pr_debug() gets removed):
      serial8250_tx_chars() ->
        pr_debug() ->
          serial8250_console_write(): bump in locked "port->lock".
---------------------------->8------------------------

So let's get rid of those not that much useful debug entries.

Discussed problem could be easily reproduced with QEMU for x86_64.
As well as this fix could be mimicked with muting of dynamic debug for
the problematic lines as simple as:
---------------------------->8------------------------
dyndbg="+p; file 8250_port.c line 1756 -p; file 8250_port.c line 1822 -p"
---------------------------->8------------------------

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Phillip Raffeck <phillip.raffeck@fau.de>
Cc: Anton Wuerfel <anton.wuerfel@fau.de>
Cc: "Matwey V. Kornilov" <matwey@sai.msu.ru>
Cc: Yegor Yefremov <yegorslists@googlemail.com>
Cc: Thor Thayer <tthayer@opensource.altera.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/tty/serial/8250/8250_port.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index f24d3030b98c..1ef31e3ee4a1 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -1751,8 +1751,6 @@ void serial8250_tx_chars(struct uart_8250_port *up)
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
 		uart_write_wakeup(port);
 
-	pr_debug("%s: THRE\n", __func__);
-
 	/*
 	 * With RPM enabled, we have to wait until the FIFO is empty before the
 	 * HW can go idle. So we get here once again with empty FIFO and disable
@@ -1817,8 +1815,6 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
 
 	status = serial_port_in(port, UART_LSR);
 
-	pr_debug("%s: status = %x\n", __func__, status);
-
 	if (status & (UART_LSR_DR | UART_LSR_BI)) {
 		if (!up->dma || handle_rx_dma(up, iir))
 			status = serial8250_rx_chars(up, status);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 37/59] IB/ipoib: rtnl_unlock can not come after free_netdev
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (31 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 30/59] IB/rxe: Fix a MR reference leak in check_rkey() Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 34/59] tty: goldfish: Fix a parameter of a call to free_irq Levin, Alexander (Sasha Levin)
                   ` (24 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Feras Daoud, Or Gerlitz, Erez Shitrit, Leon Romanovsky,
	Doug Ledford, Levin, Alexander (Sasha Levin)

From: Feras Daoud <ferasda@mellanox.com>

[ Upstream commit 89a3987ab7a923c047c6dec008e60ad6f41fac22 ]

The ipoib_vlan_add function calls rtnl_unlock after free_netdev,
rtnl_unlock not only releases the lock, but also calls netdev_run_todo.
The latter function browses the net_todo_list array and completes the
unregistration of all its net_device instances. If we call free_netdev
before rtnl_unlock, then netdev_run_todo call over the freed device causes
panic.
To fix, move rtnl_unlock call before free_netdev call.

Fixes: 9baa0b036410 ("IB/ipoib: Add rtnl_link_ops support")
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
index 8151d1a6acb1..93b50be14438 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
@@ -165,11 +165,11 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey)
 out:
 	up_write(&ppriv->vlan_rwsem);
 
+	rtnl_unlock();
+
 	if (result)
 		free_netdev(priv->dev);
 
-	rtnl_unlock();
-
 	return result;
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 36/59] IB/ipoib: Fix deadlock over vlan_mutex
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (34 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 35/59] serial: 8250_port: Remove dangerous pr_debug() Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 39/59] arm: dts: mt2701: Add subsystem clock controller device nodes Levin, Alexander (Sasha Levin)
                   ` (21 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Feras Daoud, Erez Shitrit, Leon Romanovsky, Doug Ledford, Levin,
	Alexander (Sasha Levin)

From: Feras Daoud <ferasda@mellanox.com>

[ Upstream commit 1c3098cdb05207e740715857df7b0998e372f527 ]

This patch fixes Deadlock while executing ipoib_vlan_delete.

The function takes the vlan_rwsem semaphore and calls
unregister_netdevice. The later function calls
ipoib_mcast_stop_thread that cause workqueue flush.

When the queue has one of the ipoib_ib_dev_flush_xxx events,
a deadlock occur because these events also tries to catch the
same vlan_rwsem semaphore.

To fix, unregister_netdevice should be called after releasing
the semaphore.

Fixes: cbbe1efa4972 ("IPoIB: Fix deadlock between ipoib_open() and child interface create")
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Reviewed-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
index 57eadd2b7a71..8151d1a6acb1 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
@@ -193,7 +193,6 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey)
 	list_for_each_entry_safe(priv, tpriv, &ppriv->child_intfs, list) {
 		if (priv->pkey == pkey &&
 		    priv->child_type == IPOIB_LEGACY_CHILD) {
-			unregister_netdevice(priv->dev);
 			list_del(&priv->list);
 			dev = priv->dev;
 			break;
@@ -201,6 +200,11 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey)
 	}
 	up_write(&ppriv->vlan_rwsem);
 
+	if (dev) {
+		ipoib_dbg(ppriv, "delete child vlan %s\n", dev->name);
+		unregister_netdevice(dev);
+	}
+
 	rtnl_unlock();
 
 	if (dev) {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 41/59] USB: serial: mos7720: fix control-message error handling
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (36 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 39/59] arm: dts: mt2701: Add subsystem clock controller device nodes Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 38/59] IB/ipoib: Replace list_del of the neigh->list with list_del_init Levin, Alexander (Sasha Levin)
                   ` (19 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Levin, Alexander (Sasha Levin)

From: Johan Hovold <johan@kernel.org>

[ Upstream commit 0d130367abf582e7cbf60075c2a7ab53817b1d14 ]

Make sure to log an error on short transfers when reading a device
register.

Also clear the provided buffer (which if often an uninitialised
automatic variable) on errors as the driver currently does not bother to
check for errors.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/usb/serial/mos7720.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 136ff5e1b7c1..135eb04368f9 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -234,11 +234,16 @@ static int read_mos_reg(struct usb_serial *serial, unsigned int serial_portnum,
 
 	status = usb_control_msg(usbdev, pipe, request, requesttype, value,
 				     index, buf, 1, MOS_WDR_TIMEOUT);
-	if (status == 1)
+	if (status == 1) {
 		*data = *buf;
-	else if (status < 0)
+	} else {
 		dev_err(&usbdev->dev,
 			"mos7720: usb_control_msg() failed: %d\n", status);
+		if (status >= 0)
+			status = -EIO;
+		*data = 0;
+	}
+
 	kfree(buf);
 
 	return status;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 40/59] drm/amdkfd: fix improper return value on error
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (38 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 38/59] IB/ipoib: Replace list_del of the neigh->list with list_del_init Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 45/59] partitions/efi: Fix integer overflow in GPT size calculation Levin, Alexander (Sasha Levin)
                   ` (17 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Pan Bian, Oded Gabbay, Levin, Alexander (Sasha Levin)

From: Pan Bian <bianpan2016@163.com>

[ Upstream commit 8bf793883da213864efc50c274d2b38ec0ca58b2 ]

In function kfd_wait_on_events(), when the call to copy_from_user()
fails, the value of return variable ret is 0. 0 indicates success, which
is inconsistent with the execution status. This patch fixes the bug by
assigning "-EFAULT" to ret when copy_from_user() returns an unexpected
value.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_events.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
index a6a4b2b1c0d9..6a3470f84998 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
@@ -739,8 +739,10 @@ int kfd_wait_on_events(struct kfd_process *p,
 		struct kfd_event_data event_data;
 
 		if (copy_from_user(&event_data, &events[i],
-				sizeof(struct kfd_event_data)))
+				sizeof(struct kfd_event_data))) {
+			ret = -EFAULT;
 			goto fail;
+		}
 
 		ret = init_event_waiter(p, &event_waiters[i],
 				event_data.event_id, i);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 39/59] arm: dts: mt2701: Add subsystem clock controller device nodes
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (35 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 36/59] IB/ipoib: Fix deadlock over vlan_mutex Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-15 11:15   ` Matthias Brugger
  2017-09-14 15:51 ` [PATCH for 4.9 41/59] USB: serial: mos7720: fix control-message error handling Levin, Alexander (Sasha Levin)
                   ` (20 subsequent siblings)
  57 siblings, 1 reply; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: James Liao, Matthias Brugger, Levin, Alexander (Sasha Levin)

From: James Liao <jamesjj.liao@mediatek.com>

[ Upstream commit f235c7e7a75325f28a33559a71f25a0eca6112db ]

Add MT2701 subsystem clock controllers, inlcude mmsys, imgsys,
vdecsys, hifsys, ethsys and bdpsys.

Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/arm/boot/dts/mt2701.dtsi | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi
index 18596a2c58a1..77c6b931dc24 100644
--- a/arch/arm/boot/dts/mt2701.dtsi
+++ b/arch/arm/boot/dts/mt2701.dtsi
@@ -174,4 +174,40 @@
 		clocks = <&uart_clk>;
 		status = "disabled";
 	};
+
+	mmsys: syscon@14000000 {
+		compatible = "mediatek,mt2701-mmsys", "syscon";
+		reg = <0 0x14000000 0 0x1000>;
+		#clock-cells = <1>;
+	};
+
+	imgsys: syscon@15000000 {
+		compatible = "mediatek,mt2701-imgsys", "syscon";
+		reg = <0 0x15000000 0 0x1000>;
+		#clock-cells = <1>;
+	};
+
+	vdecsys: syscon@16000000 {
+		compatible = "mediatek,mt2701-vdecsys", "syscon";
+		reg = <0 0x16000000 0 0x1000>;
+		#clock-cells = <1>;
+	};
+
+	hifsys: syscon@1a000000 {
+		compatible = "mediatek,mt2701-hifsys", "syscon";
+		reg = <0 0x1a000000 0 0x1000>;
+		#clock-cells = <1>;
+	};
+
+	ethsys: syscon@1b000000 {
+		compatible = "mediatek,mt2701-ethsys", "syscon";
+		reg = <0 0x1b000000 0 0x1000>;
+		#clock-cells = <1>;
+	};
+
+	bdpsys: syscon@1c000000 {
+		compatible = "mediatek,mt2701-bdpsys", "syscon";
+		reg = <0 0x1c000000 0 0x1000>;
+		#clock-cells = <1>;
+	};
 };
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 38/59] IB/ipoib: Replace list_del of the neigh->list with list_del_init
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (37 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 41/59] USB: serial: mos7720: fix control-message error handling Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 40/59] drm/amdkfd: fix improper return value on error Levin, Alexander (Sasha Levin)
                   ` (18 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Feras Daoud, Erez Shitrit, Leon Romanovsky, Doug Ledford, Levin,
	Alexander (Sasha Levin)

From: Feras Daoud <ferasda@mellanox.com>

[ Upstream commit c586071d1dc8227a7182179b8e50ee92cc43f6d2 ]

In order to resolve a situation where a few process delete
the same list element in sequence and cause panic, list_del
is replaced with list_del_init. In this case if the first
process that calls list_del releases the lock before acquiring
it again, other processes who can acquire the lock will call
list_del_init.

Fixes: b63b70d87741 ("IPoIB: Use a private hash table for path lookup")
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Reviewed-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 08c4b0287304..183db0cd849e 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1302,7 +1302,7 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv)
 						   rcu_dereference_protected(neigh->hnext,
 									     lockdep_is_held(&priv->lock)));
 				/* remove from path/mc list */
-				list_del(&neigh->list);
+				list_del_init(&neigh->list);
 				call_rcu(&neigh->rcu, ipoib_neigh_reclaim);
 			} else {
 				np = &neigh->hnext;
@@ -1466,7 +1466,7 @@ void ipoib_neigh_free(struct ipoib_neigh *neigh)
 					   rcu_dereference_protected(neigh->hnext,
 								     lockdep_is_held(&priv->lock)));
 			/* remove from parent list */
-			list_del(&neigh->list);
+			list_del_init(&neigh->list);
 			call_rcu(&neigh->rcu, ipoib_neigh_reclaim);
 			return;
 		} else {
@@ -1551,7 +1551,7 @@ void ipoib_del_neighs_by_gid(struct net_device *dev, u8 *gid)
 						   rcu_dereference_protected(neigh->hnext,
 									     lockdep_is_held(&priv->lock)));
 				/* remove from parent list */
-				list_del(&neigh->list);
+				list_del_init(&neigh->list);
 				call_rcu(&neigh->rcu, ipoib_neigh_reclaim);
 			} else {
 				np = &neigh->hnext;
@@ -1593,7 +1593,7 @@ static void ipoib_flush_neighs(struct ipoib_dev_priv *priv)
 					   rcu_dereference_protected(neigh->hnext,
 								     lockdep_is_held(&priv->lock)));
 			/* remove from path/mc list */
-			list_del(&neigh->list);
+			list_del_init(&neigh->list);
 			call_rcu(&neigh->rcu, ipoib_neigh_reclaim);
 		}
 	}
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 44/59] pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show()
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (40 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 45/59] partitions/efi: Fix integer overflow in GPT size calculation Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 42/59] USB: serial: mos7840: fix control-message error handling Levin, Alexander (Sasha Levin)
                   ` (15 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Markus Elfring, Linus Walleij, Levin, Alexander (Sasha Levin)

From: Markus Elfring <elfring@users.sourceforge.net>

[ Upstream commit 420dc61642920849d824a0de2aa853db59f5244f ]

Strings which did not contain data format specifications should be put
into a sequence. Thus use the corresponding function "seq_puts".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/pinctrl/mvebu/pinctrl-mvebu.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
index b6ec6db78351..ac8a2ab9b35e 100644
--- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c
+++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
@@ -195,11 +195,12 @@ static void mvebu_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
 				seq_printf(s, "o");
 			seq_printf(s, ")");
 		}
-	} else
-		seq_printf(s, "current: UNKNOWN");
+	} else {
+		seq_puts(s, "current: UNKNOWN");
+	}
 
 	if (grp->num_settings > 1) {
-		seq_printf(s, ", available = [");
+		seq_puts(s, ", available = [");
 		for (n = 0; n < grp->num_settings; n++) {
 			if (curr == &grp->settings[n])
 				continue;
@@ -222,7 +223,7 @@ static void mvebu_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
 				seq_printf(s, ")");
 			}
 		}
-		seq_printf(s, " ]");
+		seq_puts(s, " ]");
 	}
 	return;
 }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 42/59] USB: serial: mos7840: fix control-message error handling
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (41 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 44/59] pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show() Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 43/59] sfc: get PIO buffer size from the NIC Levin, Alexander (Sasha Levin)
                   ` (14 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Levin, Alexander (Sasha Levin)

From: Johan Hovold <johan@kernel.org>

[ Upstream commit cd8db057e93ddaacbec025b567490555d2bca280 ]

Make sure to detect short transfers when reading a device register.

The modem-status handling had sufficient error checks in place, but move
handling of short transfers into the register accessor function itself
for consistency.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/usb/serial/mos7840.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 5c4fc3abf6a7..6baacf64b21e 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -285,9 +285,15 @@ static int mos7840_get_reg_sync(struct usb_serial_port *port, __u16 reg,
 	ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), MCS_RDREQ,
 			      MCS_RD_RTYPE, 0, reg, buf, VENDOR_READ_LENGTH,
 			      MOS_WDR_TIMEOUT);
+	if (ret < VENDOR_READ_LENGTH) {
+		if (ret >= 0)
+			ret = -EIO;
+		goto out;
+	}
+
 	*val = buf[0];
 	dev_dbg(&port->dev, "%s offset is %x, return val %x\n", __func__, reg, *val);
-
+out:
 	kfree(buf);
 	return ret;
 }
@@ -353,8 +359,13 @@ static int mos7840_get_uart_reg(struct usb_serial_port *port, __u16 reg,
 	ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), MCS_RDREQ,
 			      MCS_RD_RTYPE, Wval, reg, buf, VENDOR_READ_LENGTH,
 			      MOS_WDR_TIMEOUT);
+	if (ret < VENDOR_READ_LENGTH) {
+		if (ret >= 0)
+			ret = -EIO;
+		goto out;
+	}
 	*val = buf[0];
-
+out:
 	kfree(buf);
 	return ret;
 }
@@ -1490,10 +1501,10 @@ static int mos7840_tiocmget(struct tty_struct *tty)
 		return -ENODEV;
 
 	status = mos7840_get_uart_reg(port, MODEM_STATUS_REGISTER, &msr);
-	if (status != 1)
+	if (status < 0)
 		return -EIO;
 	status = mos7840_get_uart_reg(port, MODEM_CONTROL_REGISTER, &mcr);
-	if (status != 1)
+	if (status < 0)
 		return -EIO;
 	result = ((mcr & MCR_DTR) ? TIOCM_DTR : 0)
 	    | ((mcr & MCR_RTS) ? TIOCM_RTS : 0)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 45/59] partitions/efi: Fix integer overflow in GPT size calculation
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (39 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 40/59] drm/amdkfd: fix improper return value on error Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 44/59] pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show() Levin, Alexander (Sasha Levin)
                   ` (16 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Alden Tondettar, Jens Axboe, Levin, Alexander (Sasha Levin)

From: Alden Tondettar <alden.tondettar@gmail.com>

[ Upstream commit c5082b70adfe8e1ea1cf4a8eff92c9f260e364d2 ]

If a GUID Partition Table claims to have more than 2**25 entries, the
calculation of the partition table size in alloc_read_gpt_entries() will
overflow a 32-bit integer and not enough space will be allocated for the
table.

Nothing seems to get written out of bounds, but later efi_partition() will
read up to 32768 bytes from a 128 byte buffer, possibly OOPSing or exposing
information to /proc/partitions and uevents.

The problem exists on both 64-bit and 32-bit platforms.

Fix the overflow and also print a meaningful debug message if the table
size is too large.

Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 block/partitions/efi.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/block/partitions/efi.c b/block/partitions/efi.c
index bcd86e5cd546..39f70d968754 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -293,7 +293,7 @@ static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state,
 	if (!gpt)
 		return NULL;
 
-	count = le32_to_cpu(gpt->num_partition_entries) *
+	count = (size_t)le32_to_cpu(gpt->num_partition_entries) *
                 le32_to_cpu(gpt->sizeof_partition_entry);
 	if (!count)
 		return NULL;
@@ -352,7 +352,7 @@ static int is_gpt_valid(struct parsed_partitions *state, u64 lba,
 			gpt_header **gpt, gpt_entry **ptes)
 {
 	u32 crc, origcrc;
-	u64 lastlba;
+	u64 lastlba, pt_size;
 
 	if (!ptes)
 		return 0;
@@ -434,13 +434,20 @@ static int is_gpt_valid(struct parsed_partitions *state, u64 lba,
 		goto fail;
 	}
 
+	/* Sanity check partition table size */
+	pt_size = (u64)le32_to_cpu((*gpt)->num_partition_entries) *
+		le32_to_cpu((*gpt)->sizeof_partition_entry);
+	if (pt_size > KMALLOC_MAX_SIZE) {
+		pr_debug("GUID Partition Table is too large: %llu > %lu bytes\n",
+			 (unsigned long long)pt_size, KMALLOC_MAX_SIZE);
+		goto fail;
+	}
+
 	if (!(*ptes = alloc_read_gpt_entries(state, *gpt)))
 		goto fail;
 
 	/* Check the GUID Partition Entry Array CRC */
-	crc = efi_crc32((const unsigned char *) (*ptes),
-			le32_to_cpu((*gpt)->num_partition_entries) *
-			le32_to_cpu((*gpt)->sizeof_partition_entry));
+	crc = efi_crc32((const unsigned char *) (*ptes), pt_size);
 
 	if (crc != le32_to_cpu((*gpt)->partition_entry_array_crc32)) {
 		pr_debug("GUID Partition Entry Array CRC check failed.\n");
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 43/59] sfc: get PIO buffer size from the NIC
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (42 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 42/59] USB: serial: mos7840: fix control-message error handling Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 48/59] ath10k: prevent sta pointer rcu violation Levin, Alexander (Sasha Levin)
                   ` (13 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Edward Cree, David S . Miller, Levin, Alexander (Sasha Levin)

From: Edward Cree <ecree@solarflare.com>

[ Upstream commit c634700f7eec3c0da46e299cd0a0ae8b594f9b55 ]

The 8000 series SFC NICs have 4K PIO buffers, rather than the 2K of
 the 7000 series.  Rather than having a hard-coded PIO buffer size
 (ER_DZ_TX_PIOBUF_SIZE), read it from the GET_CAPABILITIES_V2 MCDI
 response.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/sfc/ef10.c | 16 ++++++++++------
 drivers/net/ethernet/sfc/nic.h  |  2 ++
 drivers/net/ethernet/sfc/tx.c   |  1 -
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index c4ada7227f40..1d85109cb8ed 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -197,11 +197,15 @@ static int efx_ef10_init_datapath_caps(struct efx_nic *efx)
 	nic_data->datapath_caps =
 		MCDI_DWORD(outbuf, GET_CAPABILITIES_OUT_FLAGS1);
 
-	if (outlen >= MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)
+	if (outlen >= MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) {
 		nic_data->datapath_caps2 = MCDI_DWORD(outbuf,
 				GET_CAPABILITIES_V2_OUT_FLAGS2);
-	else
+		nic_data->piobuf_size = MCDI_WORD(outbuf,
+				GET_CAPABILITIES_V2_OUT_SIZE_PIO_BUFF);
+	} else {
 		nic_data->datapath_caps2 = 0;
+		nic_data->piobuf_size = ER_DZ_TX_PIOBUF_SIZE;
+	}
 
 	/* record the DPCPU firmware IDs to determine VEB vswitching support.
 	 */
@@ -825,8 +829,8 @@ static int efx_ef10_link_piobufs(struct efx_nic *efx)
 			offset = ((efx->tx_channel_offset + efx->n_tx_channels -
 				   tx_queue->channel->channel - 1) *
 				  efx_piobuf_size);
-			index = offset / ER_DZ_TX_PIOBUF_SIZE;
-			offset = offset % ER_DZ_TX_PIOBUF_SIZE;
+			index = offset / nic_data->piobuf_size;
+			offset = offset % nic_data->piobuf_size;
 
 			/* When the host page size is 4K, the first
 			 * host page in the WC mapping may be within
@@ -1161,11 +1165,11 @@ static int efx_ef10_dimension_resources(struct efx_nic *efx)
 	 * functions of the controller.
 	 */
 	if (efx_piobuf_size != 0 &&
-	    ER_DZ_TX_PIOBUF_SIZE / efx_piobuf_size * EF10_TX_PIOBUF_COUNT >=
+	    nic_data->piobuf_size / efx_piobuf_size * EF10_TX_PIOBUF_COUNT >=
 	    efx->n_tx_channels) {
 		unsigned int n_piobufs =
 			DIV_ROUND_UP(efx->n_tx_channels,
-				     ER_DZ_TX_PIOBUF_SIZE / efx_piobuf_size);
+				     nic_data->piobuf_size / efx_piobuf_size);
 
 		rc = efx_ef10_alloc_piobufs(efx, n_piobufs);
 		if (rc)
diff --git a/drivers/net/ethernet/sfc/nic.h b/drivers/net/ethernet/sfc/nic.h
index 73bee7ea332a..73028f21a2d7 100644
--- a/drivers/net/ethernet/sfc/nic.h
+++ b/drivers/net/ethernet/sfc/nic.h
@@ -500,6 +500,7 @@ enum {
  * @pio_write_base: Base address for writing PIO buffers
  * @pio_write_vi_base: Relative VI number for @pio_write_base
  * @piobuf_handle: Handle of each PIO buffer allocated
+ * @piobuf_size: size of a single PIO buffer
  * @must_restore_piobufs: Flag: PIO buffers have yet to be restored after MC
  *	reboot
  * @rx_rss_context: Firmware handle for our RSS context
@@ -537,6 +538,7 @@ struct efx_ef10_nic_data {
 	void __iomem *wc_membase, *pio_write_base;
 	unsigned int pio_write_vi_base;
 	unsigned int piobuf_handle[EF10_TX_PIOBUF_COUNT];
+	u16 piobuf_size;
 	bool must_restore_piobufs;
 	u32 rx_rss_context;
 	bool rx_rss_context_exclusive;
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index 233778911557..6f26acd0aa61 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -27,7 +27,6 @@
 
 #ifdef EFX_USE_PIO
 
-#define EFX_PIOBUF_SIZE_MAX ER_DZ_TX_PIOBUF_SIZE
 #define EFX_PIOBUF_SIZE_DEF ALIGN(256, L1_CACHE_BYTES)
 unsigned int efx_piobuf_size __read_mostly = EFX_PIOBUF_SIZE_DEF;
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 47/59] audit: log 32-bit socketcalls
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (45 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 46/59] ASoC: dapm: handle probe deferrals Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 49/59] spi: pxa2xx: Add support for Intel Gemini Lake Levin, Alexander (Sasha Levin)
                   ` (10 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Richard Guy Briggs, Paul Moore, Levin, Alexander (Sasha Levin)

From: Richard Guy Briggs <rgb@redhat.com>

[ Upstream commit 62bc306e2083436675e33b5bdeb6a77907d35971 ]

32-bit socketcalls were not being logged by audit on x86_64 systems.
Log them.  This is basically a duplicate of the call from
net/socket.c:sys_socketcall(), but it addresses the impedance mismatch
between 32-bit userspace process and 64-bit kernel audit.

See: https://github.com/linux-audit/audit-kernel/issues/14

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 include/linux/audit.h | 20 ++++++++++++++++++++
 net/compat.c          | 17 ++++++++++++++---
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/include/linux/audit.h b/include/linux/audit.h
index 9d4443f93db6..2be99b276d29 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -387,6 +387,20 @@ static inline int audit_socketcall(int nargs, unsigned long *args)
 		return __audit_socketcall(nargs, args);
 	return 0;
 }
+
+static inline int audit_socketcall_compat(int nargs, u32 *args)
+{
+	unsigned long a[AUDITSC_ARGS];
+	int i;
+
+	if (audit_dummy_context())
+		return 0;
+
+	for (i = 0; i < nargs; i++)
+		a[i] = (unsigned long)args[i];
+	return __audit_socketcall(nargs, a);
+}
+
 static inline int audit_sockaddr(int len, void *addr)
 {
 	if (unlikely(!audit_dummy_context()))
@@ -513,6 +527,12 @@ static inline int audit_socketcall(int nargs, unsigned long *args)
 {
 	return 0;
 }
+
+static inline int audit_socketcall_compat(int nargs, u32 *args)
+{
+	return 0;
+}
+
 static inline void audit_fd_pair(int fd1, int fd2)
 { }
 static inline int audit_sockaddr(int len, void *addr)
diff --git a/net/compat.c b/net/compat.c
index 1cd2ec046164..a96fd2f3507b 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -22,6 +22,7 @@
 #include <linux/filter.h>
 #include <linux/compat.h>
 #include <linux/security.h>
+#include <linux/audit.h>
 #include <linux/export.h>
 
 #include <net/scm.h>
@@ -781,14 +782,24 @@ COMPAT_SYSCALL_DEFINE5(recvmmsg, int, fd, struct compat_mmsghdr __user *, mmsg,
 
 COMPAT_SYSCALL_DEFINE2(socketcall, int, call, u32 __user *, args)
 {
-	int ret;
-	u32 a[6];
+	u32 a[AUDITSC_ARGS];
+	unsigned int len;
 	u32 a0, a1;
+	int ret;
 
 	if (call < SYS_SOCKET || call > SYS_SENDMMSG)
 		return -EINVAL;
-	if (copy_from_user(a, args, nas[call]))
+	len = nas[call];
+	if (len > sizeof(a))
+		return -EINVAL;
+
+	if (copy_from_user(a, args, len))
 		return -EFAULT;
+
+	ret = audit_socketcall_compat(len / sizeof(a[0]), a);
+	if (ret)
+		return ret;
+
 	a0 = a[0];
 	a1 = a[1];
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 46/59] ASoC: dapm: handle probe deferrals
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (44 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 48/59] ath10k: prevent sta pointer rcu violation Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 47/59] audit: log 32-bit socketcalls Levin, Alexander (Sasha Levin)
                   ` (11 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Linus Walleij, Mark Brown, Levin, Alexander (Sasha Levin)

From: Linus Walleij <linus.walleij@linaro.org>

[ Upstream commit 37e1df8c95e2c8a57c77eafc097648f6e40a60ff ]

This starts to handle probe deferrals on regulators and clocks
on the ASoC DAPM.

I came to this patch after audio stopped working on Ux500 ages
ago and I finally looked into it to see what is wrong. I had
messages like this in the console since a while back:

ab8500-codec.0: ASoC: Failed to request audioclk: -517
ab8500-codec.0: ASoC: Failed to create DAPM control audioclk
ab8500-codec.0: Failed to create new controls -12
snd-soc-mop500.0: ASoC: failed to instantiate card -12
snd-soc-mop500.0: Error: snd_soc_register_card failed (-12)!
snd-soc-mop500: probe of snd-soc-mop500.0 failed with error -12

Apparently because the widget table for the codec looks like
this (sound/soc/codecs/ab8500-codec.c):

static const struct snd_soc_dapm_widget ab8500_dapm_widgets[] = {

        /* Clocks */
        SND_SOC_DAPM_CLOCK_SUPPLY("audioclk"),

        /* Regulators */
        SND_SOC_DAPM_REGULATOR_SUPPLY("V-AUD", 0, 0),
        SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC1", 0, 0),
        SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC2", 0, 0),
        SND_SOC_DAPM_REGULATOR_SUPPLY("V-DMIC", 0, 0),

So when we call snd_soc_register_codec() and any of these widgets
get a deferred probe we do not get an -EPROBE_DEFER (-517) back as
we should and instead we just fail. Apparently the code assumes
that clocks and regulators must be available at this point and
not defer.

After this patch it rather looks like this:

ab8500-codec.0: Failed to create new controls -517
snd-soc-mop500.0: ASoC: failed to instantiate card -517
snd-soc-mop500.0: Error: snd_soc_register_card failed (-517)!
(...)
abx500-clk.0: registered clocks for ab850x
snd-soc-mop500.0: ab8500-codec-dai.0 <-> ux500-msp-i2s.1 mapping ok
snd-soc-mop500.0: ab8500-codec-dai.1 <-> ux500-msp-i2s.3 mapping ok

I'm pretty happy about the patch as it it, but I'm a bit
uncertain on how to proceed: there are a lot of users of the
external functions snd_soc_dapm_new_control() (111 sites)
and that will now return an occassional error pointer, which
is not handled in the calling sites.

I want an indication from the maintainers whether I should just
go in and augment all these call sites, or if deferred probe
is frowned upon when it leads to this much overhead.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 sound/soc/soc-dapm.c     | 42 ++++++++++++++++++++++++++++++++++++++++++
 sound/soc/soc-topology.c |  9 +++++++++
 2 files changed, 51 insertions(+)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 3bbe32ee4630..411f7574dd0b 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -358,6 +358,10 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
 				snd_soc_dapm_new_control_unlocked(widget->dapm,
 				&template);
 			kfree(name);
+			if (IS_ERR(data->widget)) {
+				ret = PTR_ERR(data->widget);
+				goto err_data;
+			}
 			if (!data->widget) {
 				ret = -ENOMEM;
 				goto err_data;
@@ -392,6 +396,10 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
 			data->widget = snd_soc_dapm_new_control_unlocked(
 						widget->dapm, &template);
 			kfree(name);
+			if (IS_ERR(data->widget)) {
+				ret = PTR_ERR(data->widget);
+				goto err_data;
+			}
 			if (!data->widget) {
 				ret = -ENOMEM;
 				goto err_data;
@@ -3311,11 +3319,22 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
 
 	mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
 	w = snd_soc_dapm_new_control_unlocked(dapm, widget);
+	/* Do not nag about probe deferrals */
+	if (IS_ERR(w)) {
+		int ret = PTR_ERR(w);
+
+		if (ret != -EPROBE_DEFER)
+			dev_err(dapm->dev,
+				"ASoC: Failed to create DAPM control %s (%d)\n",
+				widget->name, ret);
+		goto out_unlock;
+	}
 	if (!w)
 		dev_err(dapm->dev,
 			"ASoC: Failed to create DAPM control %s\n",
 			widget->name);
 
+out_unlock:
 	mutex_unlock(&dapm->card->dapm_mutex);
 	return w;
 }
@@ -3338,6 +3357,8 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
 		w->regulator = devm_regulator_get(dapm->dev, w->name);
 		if (IS_ERR(w->regulator)) {
 			ret = PTR_ERR(w->regulator);
+			if (ret == -EPROBE_DEFER)
+				return ERR_PTR(ret);
 			dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n",
 				w->name, ret);
 			return NULL;
@@ -3356,6 +3377,8 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
 		w->clk = devm_clk_get(dapm->dev, w->name);
 		if (IS_ERR(w->clk)) {
 			ret = PTR_ERR(w->clk);
+			if (ret == -EPROBE_DEFER)
+				return ERR_PTR(ret);
 			dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n",
 				w->name, ret);
 			return NULL;
@@ -3474,6 +3497,16 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
 	mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
 	for (i = 0; i < num; i++) {
 		w = snd_soc_dapm_new_control_unlocked(dapm, widget);
+		if (IS_ERR(w)) {
+			ret = PTR_ERR(w);
+			/* Do not nag about probe deferrals */
+			if (ret == -EPROBE_DEFER)
+				break;
+			dev_err(dapm->dev,
+				"ASoC: Failed to create DAPM control %s (%d)\n",
+				widget->name, ret);
+			break;
+		}
 		if (!w) {
 			dev_err(dapm->dev,
 				"ASoC: Failed to create DAPM control %s\n",
@@ -3750,6 +3783,15 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
 	dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name);
 
 	w = snd_soc_dapm_new_control_unlocked(&card->dapm, &template);
+	if (IS_ERR(w)) {
+		ret = PTR_ERR(w);
+		/* Do not nag about probe deferrals */
+		if (ret != -EPROBE_DEFER)
+			dev_err(card->dev,
+				"ASoC: Failed to create %s widget (%d)\n",
+				link_name, ret);
+		goto outfree_kcontrol_news;
+	}
 	if (!w) {
 		dev_err(card->dev, "ASoC: Failed to create %s widget\n",
 			link_name);
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 6b05047a4134..8a758c994506 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1473,6 +1473,15 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,
 		widget = snd_soc_dapm_new_control(dapm, &template);
 	else
 		widget = snd_soc_dapm_new_control_unlocked(dapm, &template);
+	if (IS_ERR(widget)) {
+		ret = PTR_ERR(widget);
+		/* Do not nag about probe deferrals */
+		if (ret != -EPROBE_DEFER)
+			dev_err(tplg->dev,
+				"ASoC: failed to create widget %s controls (%d)\n",
+				w->name, ret);
+		goto hdr_err;
+	}
 	if (widget == NULL) {
 		dev_err(tplg->dev, "ASoC: failed to create widget %s controls\n",
 			w->name);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 49/59] spi: pxa2xx: Add support for Intel Gemini Lake
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (46 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 47/59] audit: log 32-bit socketcalls Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 50/59] iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged' Levin, Alexander (Sasha Levin)
                   ` (9 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: David E. Box, Jarkko Nikula, Mark Brown, Levin, Alexander (Sasha Levin)

From: "David E. Box" <david.e.box@linux.intel.com>

[ Upstream commit e18a80acd1365e91e3efcd69942d9073936cf851 ]

Gemini Lake reuses the same LPSS SPI configuration as Broxton

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/spi/spi-pxa2xx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index d6239fa718be..3f3751e2b521 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1458,6 +1458,10 @@ static const struct pci_device_id pxa2xx_spi_pci_compound_match[] = {
 	{ PCI_VDEVICE(INTEL, 0x1ac2), LPSS_BXT_SSP },
 	{ PCI_VDEVICE(INTEL, 0x1ac4), LPSS_BXT_SSP },
 	{ PCI_VDEVICE(INTEL, 0x1ac6), LPSS_BXT_SSP },
+	/* GLK */
+	{ PCI_VDEVICE(INTEL, 0x31c2), LPSS_BXT_SSP },
+	{ PCI_VDEVICE(INTEL, 0x31c4), LPSS_BXT_SSP },
+	{ PCI_VDEVICE(INTEL, 0x31c6), LPSS_BXT_SSP },
 	/* APL */
 	{ PCI_VDEVICE(INTEL, 0x5ac2), LPSS_BXT_SSP },
 	{ PCI_VDEVICE(INTEL, 0x5ac4), LPSS_BXT_SSP },
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 48/59] ath10k: prevent sta pointer rcu violation
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (43 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 43/59] sfc: get PIO buffer size from the NIC Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 46/59] ASoC: dapm: handle probe deferrals Levin, Alexander (Sasha Levin)
                   ` (12 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Michal Kazior, Kalle Valo, Levin, Alexander (Sasha Levin)

From: Michal Kazior <michal.kazior@tieto.com>

[ Upstream commit 0a744d927406389e00687560d9ce3c5ab0e58db9 ]

Station pointers are RCU protected so driver must
be extra careful if it tries to store them
internally for later use outside of the RCU
section it obtained it in.

It was possible for station teardown to race with
some htt events. The possible outcome could be a
use-after-free and a crash.

Only peer-flow-control capable firmware was
affected (so hardware-wise qca99x0 and qca4019).

This could be done in sta_state() itself via
explicit synchronize_net() call but there's
already a convenient sta_pre_rcu_remove() op that
can be hooked up to avoid extra rcu stall.

The peer->sta pointer itself can't be set to
NULL/ERR_PTR because it is later used in
sta_state() for extra sanity checks.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/wireless/ath/ath10k/core.h |  1 +
 drivers/net/wireless/ath/ath10k/mac.c  | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index be5b527472f9..90c0c4a7175d 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -314,6 +314,7 @@ struct ath10k_peer {
 	struct ieee80211_vif *vif;
 	struct ieee80211_sta *sta;
 
+	bool removed;
 	int vdev_id;
 	u8 addr[ETH_ALEN];
 	DECLARE_BITMAP(peer_ids, ATH10K_MAX_NUM_PEER_IDS);
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index f2e85eb22afe..30e98afa2e68 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3738,6 +3738,9 @@ struct ieee80211_txq *ath10k_mac_txq_lookup(struct ath10k *ar,
 	if (!peer)
 		return NULL;
 
+	if (peer->removed)
+		return NULL;
+
 	if (peer->sta)
 		return peer->sta->txq[tid];
 	else if (peer->vif)
@@ -7422,6 +7425,20 @@ ath10k_mac_op_switch_vif_chanctx(struct ieee80211_hw *hw,
 	return 0;
 }
 
+static void ath10k_mac_op_sta_pre_rcu_remove(struct ieee80211_hw *hw,
+					     struct ieee80211_vif *vif,
+					     struct ieee80211_sta *sta)
+{
+	struct ath10k *ar;
+	struct ath10k_peer *peer;
+
+	ar = hw->priv;
+
+	list_for_each_entry(peer, &ar->peers, list)
+		if (peer->sta == sta)
+			peer->removed = true;
+}
+
 static const struct ieee80211_ops ath10k_ops = {
 	.tx				= ath10k_mac_op_tx,
 	.wake_tx_queue			= ath10k_mac_op_wake_tx_queue,
@@ -7462,6 +7479,7 @@ static const struct ieee80211_ops ath10k_ops = {
 	.assign_vif_chanctx		= ath10k_mac_op_assign_vif_chanctx,
 	.unassign_vif_chanctx		= ath10k_mac_op_unassign_vif_chanctx,
 	.switch_vif_chanctx		= ath10k_mac_op_switch_vif_chanctx,
+	.sta_pre_rcu_remove		= ath10k_mac_op_sta_pre_rcu_remove,
 
 	CFG80211_TESTMODE_CMD(ath10k_tm_cmd)
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 51/59] usb: chipidea: vbus event may exist before starting gadget
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (50 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 53/59] ASoC: dapm: fix some pointer error handling Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 57/59] MIPS: Lantiq: Fix another request_mem_region() return code check Levin, Alexander (Sasha Levin)
                   ` (5 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Peter Chen, Levin, Alexander (Sasha Levin)

From: Peter Chen <peter.chen@nxp.com>

[ Upstream commit c3b674a04b8ab62a1d35e86714d466af0a0ecc18 ]

At some situations, the vbus may already be there before starting
gadget. So we need to check vbus event after switching to gadget in
order to handle missing vbus event. The typical use cases are plugging
vbus cable before driver load or the vbus has already been there
after stopping host but before starting gadget.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Tested-by: Stephen Boyd <stephen.boyd@linaro.org>
Reported-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/usb/chipidea/otg.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
index 0cf149edddd8..f36a1ac3bfbd 100644
--- a/drivers/usb/chipidea/otg.c
+++ b/drivers/usb/chipidea/otg.c
@@ -134,9 +134,9 @@ void ci_handle_vbus_change(struct ci_hdrc *ci)
 	if (!ci->is_otg)
 		return;
 
-	if (hw_read_otgsc(ci, OTGSC_BSV))
+	if (hw_read_otgsc(ci, OTGSC_BSV) && !ci->vbus_active)
 		usb_gadget_vbus_connect(&ci->gadget);
-	else
+	else if (!hw_read_otgsc(ci, OTGSC_BSV) && ci->vbus_active)
 		usb_gadget_vbus_disconnect(&ci->gadget);
 }
 
@@ -175,14 +175,21 @@ static void ci_handle_id_switch(struct ci_hdrc *ci)
 
 		ci_role_stop(ci);
 
-		if (role == CI_ROLE_GADGET)
+		if (role == CI_ROLE_GADGET &&
+				IS_ERR(ci->platdata->vbus_extcon.edev))
 			/*
-			 * wait vbus lower than OTGSC_BSV before connecting
-			 * to host
+			 * Wait vbus lower than OTGSC_BSV before connecting
+			 * to host. If connecting status is from an external
+			 * connector instead of register, we don't need to
+			 * care vbus on the board, since it will not affect
+			 * external connector status.
 			 */
 			hw_wait_vbus_lower_bsv(ci);
 
 		ci_role_start(ci, role);
+		/* vbus change may have already occurred */
+		if (role == CI_ROLE_GADGET)
+			ci_handle_vbus_change(ci);
 	}
 }
 /**
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 52/59] rtl8xxxu: Add additional USB IDs for rtl8192eu devices
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (48 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 50/59] iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged' Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 53/59] ASoC: dapm: fix some pointer error handling Levin, Alexander (Sasha Levin)
                   ` (7 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Axel Köllhofer, Jes Sorensen, Kalle Valo, Levin,
	Alexander (Sasha Levin)

From: Axel Köllhofer <AxelKoellhofer@web.de>

[ Upstream commit 5407fd7de69f3352aed659244d4bef18e3cabf5c ]

These IDs originate from the vendor driver

Signed-off-by: Axel Köllhofer <AxelKoellhofer@web.de>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 82d949ede294..4e725d165aa6 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -6316,6 +6316,13 @@ static struct usb_device_id dev_table[] = {
 	.driver_info = (unsigned long)&rtl8192cu_fops},
 {USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0x7822, 0xff, 0xff, 0xff),
 	.driver_info = (unsigned long)&rtl8192cu_fops},
+/* found in rtl8192eu vendor driver */
+{USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0107, 0xff, 0xff, 0xff),
+	.driver_info = (unsigned long)&rtl8192eu_fops},
+{USB_DEVICE_AND_INTERFACE_INFO(0x2019, 0xab33, 0xff, 0xff, 0xff),
+	.driver_info = (unsigned long)&rtl8192eu_fops},
+{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x818c, 0xff, 0xff, 0xff),
+	.driver_info = (unsigned long)&rtl8192eu_fops},
 #endif
 { }
 };
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 50/59] iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged'
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (47 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 49/59] spi: pxa2xx: Add support for Intel Gemini Lake Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 52/59] rtl8xxxu: Add additional USB IDs for rtl8192eu devices Levin, Alexander (Sasha Levin)
                   ` (8 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Sricharan R, Will Deacon, Levin, Alexander (Sasha Levin)

From: Sricharan R <sricharan@codeaurora.org>

[ Upstream commit e19898077cfb642fe151ba22981e795c74d9e114 ]

Currently the driver sets all the device transactions privileges
to UNPRIVILEGED, but there are cases where the iommu masters wants
to isolate privileged supervisor and unprivileged user.
So don't override the privileged setting to unprivileged, instead
set it to default as incoming and let it be controlled by the pagetable
settings.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/iommu/arm-smmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 8f7281444551..5a9a4416f467 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1211,7 +1211,7 @@ static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain,
 			continue;
 
 		s2cr[idx].type = type;
-		s2cr[idx].privcfg = S2CR_PRIVCFG_UNPRIV;
+		s2cr[idx].privcfg = S2CR_PRIVCFG_DEFAULT;
 		s2cr[idx].cbndx = cbndx;
 		arm_smmu_write_s2cr(smmu, idx);
 	}
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 53/59] ASoC: dapm: fix some pointer error handling
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (49 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 52/59] rtl8xxxu: Add additional USB IDs for rtl8192eu devices Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 51/59] usb: chipidea: vbus event may exist before starting gadget Levin, Alexander (Sasha Levin)
                   ` (6 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Linus Walleij, Mark Brown, Levin, Alexander (Sasha Levin)

From: Linus Walleij <linus.walleij@linaro.org>

[ Upstream commit 639467c8f26d834c934215e8b59129ce442475fe ]

commit 66feeec9322132689d42723df2537d60f96f8e44
"RFC: ASoC: dapm: handle probe deferrals"
forgot a to update some two sites where the call
was used. The static codechecks quickly found them.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 66feeec93221 ("RFC: ASoC: dapm: handle probe deferrals")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 sound/soc/soc-dapm.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 411f7574dd0b..6780eba55ec2 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3843,6 +3843,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
 			template.name);
 
 		w = snd_soc_dapm_new_control_unlocked(dapm, &template);
+		if (IS_ERR(w)) {
+			int ret = PTR_ERR(w);
+
+			/* Do not nag about probe deferrals */
+			if (ret != -EPROBE_DEFER)
+				dev_err(dapm->dev,
+				"ASoC: Failed to create %s widget (%d)\n",
+				dai->driver->playback.stream_name, ret);
+			return ret;
+		}
 		if (!w) {
 			dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
 				dai->driver->playback.stream_name);
@@ -3862,6 +3872,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
 			template.name);
 
 		w = snd_soc_dapm_new_control_unlocked(dapm, &template);
+		if (IS_ERR(w)) {
+			int ret = PTR_ERR(w);
+
+			/* Do not nag about probe deferrals */
+			if (ret != -EPROBE_DEFER)
+				dev_err(dapm->dev,
+				"ASoC: Failed to create %s widget (%d)\n",
+				dai->driver->playback.stream_name, ret);
+			return ret;
+		}
 		if (!w) {
 			dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
 				dai->driver->capture.stream_name);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 57/59] MIPS: Lantiq: Fix another request_mem_region() return code check
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (51 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 51/59] usb: chipidea: vbus event may exist before starting gadget Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 55/59] drm: mali-dp: Fix transposed horizontal/vertical flip Levin, Alexander (Sasha Levin)
                   ` (4 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Arnd Bergmann, John Crispin, linux-mips, Ralf Baechle, Levin,
	Alexander (Sasha Levin)

From: Arnd Bergmann <arnd@arndb.de>

[ Upstream commit 98ea51cb0c8ce009d9da1fd7b48f0ff1d7a9bbb0 ]

Hauke already fixed a couple of them, but one instance remains
that checks for a negative integer when it should check
for a NULL pointer:

arch/mips/lantiq/xway/sysctrl.c: In function 'ltq_soc_init':
arch/mips/lantiq/xway/sysctrl.c:473:19: error: ordered comparison of pointer with integer zero [-Werror=extra]

Fixes: 6e807852676a ("MIPS: Lantiq: Fix check for return value of request_mem_region()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: John Crispin <john@phrozen.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/15043/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/mips/lantiq/xway/sysctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c
index 90565477dfbd..95bec460b651 100644
--- a/arch/mips/lantiq/xway/sysctrl.c
+++ b/arch/mips/lantiq/xway/sysctrl.c
@@ -469,8 +469,8 @@ void __init ltq_soc_init(void)
 			panic("Failed to load xbar nodes from devicetree");
 		if (of_address_to_resource(np_xbar, 0, &res_xbar))
 			panic("Failed to get xbar resources");
-		if (request_mem_region(res_xbar.start, resource_size(&res_xbar),
-			res_xbar.name) < 0)
+		if (!request_mem_region(res_xbar.start, resource_size(&res_xbar),
+			res_xbar.name))
 			panic("Failed to get xbar resources");
 
 		ltq_xbar_membase = ioremap_nocache(res_xbar.start,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 54/59] drm: mali-dp: Fix destination size handling when rotating
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (54 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 56/59] HID: wacom: release the resources before leaving despite devm Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 59/59] lkdtm: Fix Oops when unloading the module Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 58/59] mips: ath79: clock:- Unmap region obtained by of_iomap Levin, Alexander (Sasha Levin)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Brian Starkey, Liviu Dudau, Levin, Alexander (Sasha Levin)

From: Brian Starkey <brian.starkey@arm.com>

[ Upstream commit edabb3c4cd2d035bc93a3d67b25a304ea6217301 ]

The destination rectangle provided by userspace in the CRTC_X/Y/W/H
properties is already expressed as the dimensions after rotation.
This means we shouldn't swap the width and height ourselves when a
90/270 degree rotation is requested, so remove the code doing the swap.

Fixes: ad49f8602fe8 ("drm/arm: Add support for Mali Display Processors")

Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/arm/malidp_planes.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 82c193e5e0d6..a6bdd91d6c9e 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -150,13 +150,8 @@ static void malidp_de_plane_update(struct drm_plane *plane,
 	/* convert src values from Q16 fixed point to integer */
 	src_w = plane->state->src_w >> 16;
 	src_h = plane->state->src_h >> 16;
-	if (plane->state->rotation & MALIDP_ROTATED_MASK) {
-		dest_w = plane->state->crtc_h;
-		dest_h = plane->state->crtc_w;
-	} else {
-		dest_w = plane->state->crtc_w;
-		dest_h = plane->state->crtc_h;
-	}
+	dest_w = plane->state->crtc_w;
+	dest_h = plane->state->crtc_h;
 
 	malidp_hw_write(mp->hwdev, format_id, mp->layer->base);
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 55/59] drm: mali-dp: Fix transposed horizontal/vertical flip
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (52 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 57/59] MIPS: Lantiq: Fix another request_mem_region() return code check Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 56/59] HID: wacom: release the resources before leaving despite devm Levin, Alexander (Sasha Levin)
                   ` (3 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Brian Starkey, Liviu Dudau, Levin, Alexander (Sasha Levin)

From: Brian Starkey <brian.starkey@arm.com>

[ Upstream commit 7916efe5b57505080b3cebf5bdb228b4eda008ea ]

The horizontal and vertical flip flags were the wrong way around,
causing reflect-x to result in reflect-y being applied and vice-versa.
Fix them.

Fixes: ad49f8602fe8 ("drm/arm: Add support for Mali Display Processors")

Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/arm/malidp_planes.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index a6bdd91d6c9e..afe0480d95c9 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -184,9 +184,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,
 	if (plane->state->rotation & DRM_ROTATE_MASK)
 		val = ilog2(plane->state->rotation & DRM_ROTATE_MASK) << LAYER_ROT_OFFSET;
 	if (plane->state->rotation & DRM_REFLECT_X)
-		val |= LAYER_V_FLIP;
-	if (plane->state->rotation & DRM_REFLECT_Y)
 		val |= LAYER_H_FLIP;
+	if (plane->state->rotation & DRM_REFLECT_Y)
+		val |= LAYER_V_FLIP;
 
 	/* set the 'enable layer' bit */
 	val |= LAYER_ENABLE;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 56/59] HID: wacom: release the resources before leaving despite devm
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (53 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 55/59] drm: mali-dp: Fix transposed horizontal/vertical flip Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 54/59] drm: mali-dp: Fix destination size handling when rotating Levin, Alexander (Sasha Levin)
                   ` (2 subsequent siblings)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Benjamin Tissoires, Jiri Kosina, Levin, Alexander (Sasha Levin)

From: Benjamin Tissoires <benjamin.tissoires@redhat.com>

[ Upstream commit 5b779fc52020ac6f5beea31c5eafc3d25cf70dc1 ]

In the general case, the resources are properly released by devm without
needing to do anything. However, when unplugging the wireless receiver,
the kernel segfaults from time to time while calling devres_release_all().

I think in that case the resources attempt to access hid_get_drvdata(hdev)
which has been set to null while leaving wacom_remove().

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/hid/wacom_sys.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 0c535d0f3b95..53ac19b3727a 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -2433,6 +2433,8 @@ static void wacom_remove(struct hid_device *hdev)
 	if (hdev->bus == BUS_BLUETOOTH)
 		device_remove_file(&hdev->dev, &dev_attr_speed);
 
+	wacom_release_resources(wacom);
+
 	hid_set_drvdata(hdev, NULL);
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 58/59] mips: ath79: clock:- Unmap region obtained by of_iomap
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (56 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 59/59] lkdtm: Fix Oops when unloading the module Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Arvind Yadav, antonynpavlov, albeu, hackpascal, sboyd,
	linux-mips, Ralf Baechle, Levin, Alexander (Sasha Levin)

From: Arvind Yadav <arvind.yadav.cs@gmail.com>

[ Upstream commit b3d91db3f71d5f70ea60d900425a3f96aeb3d065 ]

Free memory mapping, if ath79_clocks_init_dt_ng is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Fixes: 3bdf1071ba7d ("MIPS: ath79: update devicetree clock support for AR9132")
Cc: antonynpavlov@gmail.com
Cc: albeu@free.fr
Cc: hackpascal@gmail.com
Cc: sboyd@codeaurora.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14915/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/mips/ath79/clock.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c
index cc3a1e33a600..7e2bb12b64ea 100644
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
@@ -508,16 +508,19 @@ static void __init ath79_clocks_init_dt_ng(struct device_node *np)
 		ar9330_clk_init(ref_clk, pll_base);
 	else {
 		pr_err("%s: could not find any appropriate clk_init()\n", dnfn);
-		goto err_clk;
+		goto err_iounmap;
 	}
 
 	if (of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data)) {
 		pr_err("%s: could not register clk provider\n", dnfn);
-		goto err_clk;
+		goto err_iounmap;
 	}
 
 	return;
 
+err_iounmap:
+	iounmap(pll_base);
+
 err_clk:
 	clk_put(ref_clk);
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH for 4.9 59/59] lkdtm: Fix Oops when unloading the module
  2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
                   ` (55 preceding siblings ...)
  2017-09-14 15:51 ` [PATCH for 4.9 54/59] drm: mali-dp: Fix destination size handling when rotating Levin, Alexander (Sasha Levin)
@ 2017-09-14 15:51 ` Levin, Alexander (Sasha Levin)
  2017-09-14 15:51 ` [PATCH for 4.9 58/59] mips: ath79: clock:- Unmap region obtained by of_iomap Levin, Alexander (Sasha Levin)
  57 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 15:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Juerg Haefliger, Greg Kroah-Hartman, Levin, Alexander (Sasha Levin)

From: Juerg Haefliger <juerg.haefliger@hpe.com>

[ Upstream commit 9ba60573638e2006170ebcc5489fb1e068afbc8f ]

No jprobe is registered when the module is loaded without specifying a
crashpoint that uses a jprobe. At the moment, we unconditionally try to
unregister the jprobe on module unload which results in an Oops. Add a
check to fix this.

Signed-off-by: Juerg Haefliger <juerg.haefliger@hpe.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/misc/lkdtm_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/lkdtm_core.c b/drivers/misc/lkdtm_core.c
index f9154b8d67f6..b2989f2d3126 100644
--- a/drivers/misc/lkdtm_core.c
+++ b/drivers/misc/lkdtm_core.c
@@ -533,7 +533,9 @@ static void __exit lkdtm_module_exit(void)
 	/* Handle test-specific clean-up. */
 	lkdtm_usercopy_exit();
 
-	unregister_jprobe(lkdtm_jprobe);
+	if (lkdtm_jprobe != NULL)
+		unregister_jprobe(lkdtm_jprobe);
+
 	pr_info("Crash point unregistered\n");
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing
  2017-09-14 15:51 ` [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing Levin, Alexander (Sasha Levin)
@ 2017-09-14 18:59   ` Mathieu Malaterre
  2017-09-14 19:11       ` Levin, Alexander (Sasha Levin)
  0 siblings, 1 reply; 72+ messages in thread
From: Mathieu Malaterre @ 2017-09-14 18:59 UTC (permalink / raw)
  To: Levin, Alexander (Sasha Levin)
  Cc: linux-kernel, stable, Marcin Nowakowski, linux-mips, Ralf Baechle

On Thu, Sep 14, 2017 at 5:51 PM, Levin, Alexander (Sasha Levin)
<alexander.levin@verizon.com> wrote:
> From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>
> [ Upstream commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411 ]
>
> When a memory offset is specified through the commandline, add the
> memory in range PHYS_OFFSET:Y as reserved memory area.
> Otherwise the bootmem allocator is initialised with low page equal to
> min_low_pfn = PHYS_OFFSET, and in free_all_bootmem will process pages
> starting from min_low_pfn instead of PFN(Y).
>
> Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
> Cc: linux-mips@linux-mips.org
> Patchwork: https://patchwork.linux-mips.org/patch/14613/
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
> ---
>  arch/mips/kernel/setup.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index f66e5ce505b2..38697f25d168 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -589,6 +589,10 @@ static int __init early_parse_mem(char *p)
>                 start = memparse(p + 1, &p);
>
>         add_memory_region(start, size, BOOT_MEM_RAM);
> +
> +       if (start && start > PHYS_OFFSET)
> +               add_memory_region(PHYS_OFFSET, start - PHYS_OFFSET,
> +                               BOOT_MEM_RESERVED);
>         return 0;
>  }
>  early_param("mem", early_parse_mem);

Does not work on MIPS Creator CI20. See:

https://www.spinics.net/lists/stable/msg187229.html

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing
  2017-09-14 18:59   ` Mathieu Malaterre
@ 2017-09-14 19:11       ` Levin, Alexander (Sasha Levin)
  0 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 19:11 UTC (permalink / raw)
  To: Mathieu Malaterre
  Cc: linux-kernel, stable, Marcin Nowakowski, linux-mips, Ralf Baechle

On Thu, Sep 14, 2017 at 08:59:05PM +0200, Mathieu Malaterre wrote:
>On Thu, Sep 14, 2017 at 5:51 PM, Levin, Alexander (Sasha Levin)
><alexander.levin@verizon.com> wrote:
>> From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>>
>> [ Upstream commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411 ]
>>
>> When a memory offset is specified through the commandline, add the
>> memory in range PHYS_OFFSET:Y as reserved memory area.
>> Otherwise the bootmem allocator is initialised with low page equal to
>> min_low_pfn = PHYS_OFFSET, and in free_all_bootmem will process pages
>> starting from min_low_pfn instead of PFN(Y).
>>
>> Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>> Cc: linux-mips@linux-mips.org
>> Patchwork: https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.linux-2Dmips.org_patch_14613_&d=DwIBaQ&c=udBTRvFvXC5Dhqg7UHpJlPps3mZ3LRxpb6__0PomBTQ&r=bUtaaC9mlBij4OjEG_D-KPul_335azYzfC4Rjgomobo&m=6siOw0e29CYMhuJcboVwEeX-LcC1yJjtnGPVl_1tClQ&s=rP-QGn8HHjuow4b4qd6sfl_EEPoAKkxAffkh1zEq-kc&e=
>> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
>> ---
>>  arch/mips/kernel/setup.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
>> index f66e5ce505b2..38697f25d168 100644
>> --- a/arch/mips/kernel/setup.c
>> +++ b/arch/mips/kernel/setup.c
>> @@ -589,6 +589,10 @@ static int __init early_parse_mem(char *p)
>>                 start = memparse(p + 1, &p);
>>
>>         add_memory_region(start, size, BOOT_MEM_RAM);
>> +
>> +       if (start && start > PHYS_OFFSET)
>> +               add_memory_region(PHYS_OFFSET, start - PHYS_OFFSET,
>> +                               BOOT_MEM_RESERVED);
>>         return 0;
>>  }
>>  early_param("mem", early_parse_mem);
>
>Does not work on MIPS Creator CI20. See:

Hm, so upstream is actually broken right now?

-- 

Thanks,
Sasha

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing
@ 2017-09-14 19:11       ` Levin, Alexander (Sasha Levin)
  0 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-14 19:11 UTC (permalink / raw)
  To: Mathieu Malaterre
  Cc: linux-kernel, stable, Marcin Nowakowski, linux-mips, Ralf Baechle

On Thu, Sep 14, 2017 at 08:59:05PM +0200, Mathieu Malaterre wrote:
>On Thu, Sep 14, 2017 at 5:51 PM, Levin, Alexander (Sasha Levin)
><alexander.levin@verizon.com> wrote:
>> From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>>
>> [ Upstream commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411 ]
>>
>> When a memory offset is specified through the commandline, add the
>> memory in range PHYS_OFFSET:Y as reserved memory area.
>> Otherwise the bootmem allocator is initialised with low page equal to
>> min_low_pfn = PHYS_OFFSET, and in free_all_bootmem will process pages
>> starting from min_low_pfn instead of PFN(Y).
>>
>> Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>> Cc: linux-mips@linux-mips.org
>> Patchwork: https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.linux-2Dmips.org_patch_14613_&d=DwIBaQ&c=udBTRvFvXC5Dhqg7UHpJlPps3mZ3LRxpb6__0PomBTQ&r=bUtaaC9mlBij4OjEG_D-KPul_335azYzfC4Rjgomobo&m=6siOw0e29CYMhuJcboVwEeX-LcC1yJjtnGPVl_1tClQ&s=rP-QGn8HHjuow4b4qd6sfl_EEPoAKkxAffkh1zEq-kc&e=
>> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
>> ---
>>  arch/mips/kernel/setup.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
>> index f66e5ce505b2..38697f25d168 100644
>> --- a/arch/mips/kernel/setup.c
>> +++ b/arch/mips/kernel/setup.c
>> @@ -589,6 +589,10 @@ static int __init early_parse_mem(char *p)
>>                 start = memparse(p + 1, &p);
>>
>>         add_memory_region(start, size, BOOT_MEM_RAM);
>> +
>> +       if (start && start > PHYS_OFFSET)
>> +               add_memory_region(PHYS_OFFSET, start - PHYS_OFFSET,
>> +                               BOOT_MEM_RESERVED);
>>         return 0;
>>  }
>>  early_param("mem", early_parse_mem);
>
>Does not work on MIPS Creator CI20. See:

Hm, so upstream is actually broken right now?

-- 

Thanks,
Sasha
From mathieu.malaterre@gmail.com Thu Sep 14 21:18:10 2017
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 14 Sep 2017 21:18:16 +0200 (CEST)
Received: from mail-ua0-x241.google.com ([IPv6:2607:f8b0:400c:c08::241]:35681
        "EHLO mail-ua0-x241.google.com" rhost-flags-OK-OK-OK-OK)
        by eddie.linux-mips.org with ESMTP id S23994231AbdINTSJtSti9 convert rfc822-to-8bit
        (ORCPT <rfc822;linux-mips@linux-mips.org>);
        Thu, 14 Sep 2017 21:18:09 +0200
Received: by mail-ua0-x241.google.com with SMTP id g47so87893uad.2;
        Thu, 14 Sep 2017 12:18:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:sender:in-reply-to:references:from:date:message-id
         :subject:to:cc:content-transfer-encoding;
        bh=FEiY6ICQ99ZTVIBKLMra871P8RYcStvdADrR/bdKXm0=;
        b=eYY/6eFb4mLW12AHP1aeQYiUfuUJBJyT386AWfmqWIK5kWruq40ZO8tUeqChtaMIyw
         Bo3kAPtFsQ8tdfEhFnPionP5Uvu4Cg5gI9pg+POOHIuU4htYlSbZZYH9+VVxYOAAdwAs
         9nDUkBJNo8gZd0MK5HEaQZ+RYjn5xa69cKpTwSB2wwoOEve3tDg1AJH9elGbqHcsj4Yp
         hH3grpJNNvYgg3iCvzthGmOYU+LAWS8PlUW1HHcSjjXXjcRMpkatBD+s55Fni61Wh+ns
         doSsH0FOtFKrHj+kFaI8fg3VJ+B63A9B/3yRmgePlDyLkHyrPrrJcq4MMqgG7pgyBJCA
         ihRA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
         :date:message-id:subject:to:cc:content-transfer-encoding;
        bh=FEiY6ICQ99ZTVIBKLMra871P8RYcStvdADrR/bdKXm0=;
        b=cTtTGD7uT5UEaqnUOQElKIWjtGrezvV12dF9Xc1U6SCm7EjdSLYRhmGeXxozYmEKxP
         jGi1RqoqhD7cQ0sowyu8jb8eGjPhZnT0Q0sdEeblrGs/64GQT5OuZzp85CM8oELDFXgD
         E2uvlFupTWF7jrOnSOapZVHZWW9kTTfDSo5bIG0G3j7GimVrUJ5LqiCBBgLvdeDoTi3t
         o+rupYB3Es6XgIM1Gf70eyGgjg5MhmGP1Tbw1ITGiROJfBfo0/HKChyEfvM5DTdvP+NA
         rgQx+co3zQxZo/oqqgtdIGvWviXu93E9zOVkRhHG1z3y+uZGZEtlK9NvwONiLRXkkMpI
         A/gA==
X-Gm-Message-State: AHPjjUivumeOPnny8frD7LmYfvSLoi3KoF83+KkKF5vHlfN99pE/JyZ6
        x3B1rPkfwiGBFDb2goqqtmLz0r5v807pZkv8SFc=
X-Google-Smtp-Source: ADKCNb6qpw7ofSxR4xOOVd0McbN6Y9f8Y4Ejja8bO8i//0jnC9uxEwEPp0AA+0xnf3YF1a/uBcwP52hPgALSJhYYP2Y=
X-Received: by 10.176.30.196 with SMTP id p4mr10449417uak.17.1505416683248;
 Thu, 14 Sep 2017 12:18:03 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.176.95.81 with HTTP; Thu, 14 Sep 2017 12:17:42 -0700 (PDT)
In-Reply-To: <20170914191119.y554znlpcnsershp@sasha-lappy>
References: <20170914155051.8289-1-alexander.levin@verizon.com>
 <20170914155051.8289-11-alexander.levin@verizon.com> <CA+7wUszvyofkuLPb6K+E5ngJ7=e0CiCh1s+WQUBX0cG_MfnU7w@mail.gmail.com>
 <20170914191119.y554znlpcnsershp@sasha-lappy>
From:   Mathieu Malaterre <malat@debian.org>
Date:   Thu, 14 Sep 2017 21:17:42 +0200
X-Google-Sender-Auth: cLxkbG5WmcmXYKRn2G7RsWAGRfY
Message-ID: <CA+7wUsy7X_3ST0hgnyxWMiC45ZeM8A_oafzn9PuufETkcKN+Xw@mail.gmail.com>
Subject: Re: [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing
To:     "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Cc:     "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
        "stable@vger.kernel.org" <stable@vger.kernel.org>,
        Marcin Nowakowski <marcin.nowakowski@imgtec.com>,
        "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
        Ralf Baechle <ralf@linux-mips.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8BIT
Return-Path: <mathieu.malaterre@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 60006
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: malat@debian.org
Precedence: bulk
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
List-software: Ecartis version 1.0.0
List-Id: linux-mips <linux-mips.eddie.linux-mips.org>
X-List-ID: linux-mips <linux-mips.eddie.linux-mips.org>
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
X-list: linux-mips

On Thu, Sep 14, 2017 at 9:11 PM, Levin, Alexander (Sasha Levin)
<alexander.levin@verizon.com> wrote:
> On Thu, Sep 14, 2017 at 08:59:05PM +0200, Mathieu Malaterre wrote:
>>On Thu, Sep 14, 2017 at 5:51 PM, Levin, Alexander (Sasha Levin)
>><alexander.levin@verizon.com> wrote:
>>> From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>>>
>>> [ Upstream commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411 ]
>>>
>>> When a memory offset is specified through the commandline, add the
>>> memory in range PHYS_OFFSET:Y as reserved memory area.
>>> Otherwise the bootmem allocator is initialised with low page equal to
>>> min_low_pfn = PHYS_OFFSET, and in free_all_bootmem will process pages
>>> starting from min_low_pfn instead of PFN(Y).
>>>
>>> Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>>> Cc: linux-mips@linux-mips.org
>>> Patchwork: https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.linux-2Dmips.org_patch_14613_&d=DwIBaQ&c=udBTRvFvXC5Dhqg7UHpJlPps3mZ3LRxpb6__0PomBTQ&r=bUtaaC9mlBij4OjEG_D-KPul_335azYzfC4Rjgomobo&m=6siOw0e29CYMhuJcboVwEeX-LcC1yJjtnGPVl_1tClQ&s=rP-QGn8HHjuow4b4qd6sfl_EEPoAKkxAffkh1zEq-kc&e=
>>> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>>> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
>>> ---
>>>  arch/mips/kernel/setup.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
>>> index f66e5ce505b2..38697f25d168 100644
>>> --- a/arch/mips/kernel/setup.c
>>> +++ b/arch/mips/kernel/setup.c
>>> @@ -589,6 +589,10 @@ static int __init early_parse_mem(char *p)
>>>                 start = memparse(p + 1, &p);
>>>
>>>         add_memory_region(start, size, BOOT_MEM_RAM);
>>> +
>>> +       if (start && start > PHYS_OFFSET)
>>> +               add_memory_region(PHYS_OFFSET, start - PHYS_OFFSET,
>>> +                               BOOT_MEM_RESERVED);
>>>         return 0;
>>>  }
>>>  early_param("mem", early_parse_mem);
>>
>>Does not work on MIPS Creator CI20. See:
>
> Hm, so upstream is actually broken right now?

Yes, at least on Creator CI20. You need to clear out all your mem=X@Y
from your boot command line, or apply the new patch I mentionned
above, or revert 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411.

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing
  2017-09-14 19:11       ` Levin, Alexander (Sasha Levin)
  (?)
@ 2017-09-14 19:17       ` Mathieu Malaterre
  2017-09-15  5:44         ` Marcin Nowakowski
  -1 siblings, 1 reply; 72+ messages in thread
From: Mathieu Malaterre @ 2017-09-14 19:17 UTC (permalink / raw)
  To: Levin, Alexander (Sasha Levin)
  Cc: linux-kernel, stable, Marcin Nowakowski, linux-mips, Ralf Baechle

On Thu, Sep 14, 2017 at 9:11 PM, Levin, Alexander (Sasha Levin)
<alexander.levin@verizon.com> wrote:
> On Thu, Sep 14, 2017 at 08:59:05PM +0200, Mathieu Malaterre wrote:
>>On Thu, Sep 14, 2017 at 5:51 PM, Levin, Alexander (Sasha Levin)
>><alexander.levin@verizon.com> wrote:
>>> From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>>>
>>> [ Upstream commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411 ]
>>>
>>> When a memory offset is specified through the commandline, add the
>>> memory in range PHYS_OFFSET:Y as reserved memory area.
>>> Otherwise the bootmem allocator is initialised with low page equal to
>>> min_low_pfn = PHYS_OFFSET, and in free_all_bootmem will process pages
>>> starting from min_low_pfn instead of PFN(Y).
>>>
>>> Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>>> Cc: linux-mips@linux-mips.org
>>> Patchwork: https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.linux-2Dmips.org_patch_14613_&d=DwIBaQ&c=udBTRvFvXC5Dhqg7UHpJlPps3mZ3LRxpb6__0PomBTQ&r=bUtaaC9mlBij4OjEG_D-KPul_335azYzfC4Rjgomobo&m=6siOw0e29CYMhuJcboVwEeX-LcC1yJjtnGPVl_1tClQ&s=rP-QGn8HHjuow4b4qd6sfl_EEPoAKkxAffkh1zEq-kc&e=
>>> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>>> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
>>> ---
>>>  arch/mips/kernel/setup.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
>>> index f66e5ce505b2..38697f25d168 100644
>>> --- a/arch/mips/kernel/setup.c
>>> +++ b/arch/mips/kernel/setup.c
>>> @@ -589,6 +589,10 @@ static int __init early_parse_mem(char *p)
>>>                 start = memparse(p + 1, &p);
>>>
>>>         add_memory_region(start, size, BOOT_MEM_RAM);
>>> +
>>> +       if (start && start > PHYS_OFFSET)
>>> +               add_memory_region(PHYS_OFFSET, start - PHYS_OFFSET,
>>> +                               BOOT_MEM_RESERVED);
>>>         return 0;
>>>  }
>>>  early_param("mem", early_parse_mem);
>>
>>Does not work on MIPS Creator CI20. See:
>
> Hm, so upstream is actually broken right now?

Yes, at least on Creator CI20. You need to clear out all your mem=X@Y
from your boot command line, or apply the new patch I mentionned
above, or revert 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411.

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 07/59] clk: sunxi-ng: set the parent rate when adjustin CPUX clock on A33
  2017-09-14 15:51 ` [PATCH for 4.9 07/59] clk: sunxi-ng: set the parent rate when adjustin CPUX clock on A33 Levin, Alexander (Sasha Levin)
@ 2017-09-15  2:02   ` icenowy
  2017-09-15  2:08     ` Levin, Alexander (Sasha Levin)
  0 siblings, 1 reply; 72+ messages in thread
From: icenowy @ 2017-09-15  2:02 UTC (permalink / raw)
  To: Levin, Alexander (Sasha Levin)
  Cc: linux-kernel, stable, Icenowy Zheng, Maxime Ripard

在 2017-09-14 23:51,Levin, Alexander (Sasha Levin) 写道:
> From: Icenowy Zheng <icenowy@aosc.xyz>
> 
> [ Upstream commit bb021cda2ccf45ee9470bf0f8c55323ad1c761ae ]

As DVFS for A33 doesn't exist in 4.9, this patch doesn't affect 4.9
at all.

> 
> The CPUX clock on A33, which is for the Cortex-A7 cores, is designed to
> be changeable by changing the rate of PLL_CPUX.
> 
> Add CLK_SET_RATE_PARENT flag to this clock.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
> ---
>  drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-a33.c
> b/drivers/clk/sunxi-ng/ccu-sun8i-a33.c
> index 9bd1f78a0547..d54e5db3959a 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun8i-a33.c
> +++ b/drivers/clk/sunxi-ng/ccu-sun8i-a33.c
> @@ -170,7 +170,7 @@ static SUNXI_CCU_N_WITH_GATE_LOCK(pll_ddr1_clk, 
> "pll-ddr1",
>  static const char * const cpux_parents[] = { "osc32k", "osc24M",
>  					     "pll-cpux" , "pll-cpux" };
>  static SUNXI_CCU_MUX(cpux_clk, "cpux", cpux_parents,
> -		     0x050, 16, 2, CLK_IS_CRITICAL);
> +		     0x050, 16, 2, CLK_IS_CRITICAL | CLK_SET_RATE_PARENT);
> 
>  static SUNXI_CCU_M(axi_clk, "axi", "cpux", 0x050, 0, 2, 0);

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 07/59] clk: sunxi-ng: set the parent rate when adjustin CPUX clock on A33
  2017-09-15  2:02   ` icenowy
@ 2017-09-15  2:08     ` Levin, Alexander (Sasha Levin)
  0 siblings, 0 replies; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-15  2:08 UTC (permalink / raw)
  To: icenowy; +Cc: linux-kernel, stable, Icenowy Zheng, Maxime Ripard

On Fri, Sep 15, 2017 at 10:02:04AM +0800, icenowy@aosc.io wrote:
>在 2017-09-14 23:51,Levin, Alexander (Sasha Levin) 写道:
>>From: Icenowy Zheng <icenowy@aosc.xyz>
>>
>>[ Upstream commit bb021cda2ccf45ee9470bf0f8c55323ad1c761ae ]
>
>As DVFS for A33 doesn't exist in 4.9, this patch doesn't affect 4.9
>at all.

Dropped, thanks!

-- 

Thanks,
Sasha

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing
  2017-09-14 19:17       ` Mathieu Malaterre
@ 2017-09-15  5:44         ` Marcin Nowakowski
  2017-09-15 17:03             ` Paul Burton
  0 siblings, 1 reply; 72+ messages in thread
From: Marcin Nowakowski @ 2017-09-15  5:44 UTC (permalink / raw)
  To: Mathieu Malaterre, Levin, Alexander (Sasha Levin)
  Cc: linux-kernel, stable, linux-mips, Ralf Baechle

Hi,

On 14.09.2017 21:17, Mathieu Malaterre wrote:
> On Thu, Sep 14, 2017 at 9:11 PM, Levin, Alexander (Sasha Levin)
> <alexander.levin@verizon.com> wrote:
>> On Thu, Sep 14, 2017 at 08:59:05PM +0200, Mathieu Malaterre wrote:
>>> On Thu, Sep 14, 2017 at 5:51 PM, Levin, Alexander (Sasha Levin)
>>> <alexander.levin@verizon.com> wrote:
>>>> From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>>>>
>>>> [ Upstream commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411 ]
>>>>
>>>> When a memory offset is specified through the commandline, add the
>>>> memory in range PHYS_OFFSET:Y as reserved memory area.
>>>> Otherwise the bootmem allocator is initialised with low page equal to
>>>> min_low_pfn = PHYS_OFFSET, and in free_all_bootmem will process pages
>>>> starting from min_low_pfn instead of PFN(Y).
>>>>
>>>> Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>>>> Cc: linux-mips@linux-mips.org
>>>> Patchwork: https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.linux-2Dmips.org_patch_14613_&d=DwIBaQ&c=udBTRvFvXC5Dhqg7UHpJlPps3mZ3LRxpb6__0PomBTQ&r=bUtaaC9mlBij4OjEG_D-KPul_335azYzfC4Rjgomobo&m=6siOw0e29CYMhuJcboVwEeX-LcC1yJjtnGPVl_1tClQ&s=rP-QGn8HHjuow4b4qd6sfl_EEPoAKkxAffkh1zEq-kc&e=
>>>> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>>>> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
>>>> ---
>>>>   arch/mips/kernel/setup.c | 4 ++++
>>>>   1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
>>>> index f66e5ce505b2..38697f25d168 100644
>>>> --- a/arch/mips/kernel/setup.c
>>>> +++ b/arch/mips/kernel/setup.c
>>>> @@ -589,6 +589,10 @@ static int __init early_parse_mem(char *p)
>>>>                  start = memparse(p + 1, &p);
>>>>
>>>>          add_memory_region(start, size, BOOT_MEM_RAM);
>>>> +
>>>> +       if (start && start > PHYS_OFFSET)
>>>> +               add_memory_region(PHYS_OFFSET, start - PHYS_OFFSET,
>>>> +                               BOOT_MEM_RESERVED);
>>>>          return 0;
>>>>   }
>>>>   early_param("mem", early_parse_mem);
>>>
>>> Does not work on MIPS Creator CI20. See:
>>
>> Hm, so upstream is actually broken right now?
> 
> Yes, at least on Creator CI20. You need to clear out all your mem=X@Y
> from your boot command line, or apply the new patch I mentionned
> above, or revert 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411.

Yes, there is this issue that Mathieu discovered that upstream suffers 
from. My patch that fixes it has not yet been merged - but hopefully 
will be included in the next release.
Luckily the issue is only seen with a specific set of commandline 
arguments which are not even required - but are set as defaults by the 
CI20 bootloader.

For this reason it's probably better not to include this patch in the 
stable series without the followup fix (without it the kernel is also 
subtly broken, just in a different way and that fault is less likely to 
be seen by the users).

Marcin

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 39/59] arm: dts: mt2701: Add subsystem clock controller device nodes
  2017-09-14 15:51 ` [PATCH for 4.9 39/59] arm: dts: mt2701: Add subsystem clock controller device nodes Levin, Alexander (Sasha Levin)
@ 2017-09-15 11:15   ` Matthias Brugger
  2017-09-17 23:20     ` Levin, Alexander (Sasha Levin)
  0 siblings, 1 reply; 72+ messages in thread
From: Matthias Brugger @ 2017-09-15 11:15 UTC (permalink / raw)
  To: Levin, Alexander (Sasha Levin), linux-kernel, stable; +Cc: James Liao



On 09/14/2017 05:51 PM, Levin, Alexander (Sasha Levin) wrote:
> From: James Liao <jamesjj.liao@mediatek.com>
> 
> [ Upstream commit f235c7e7a75325f28a33559a71f25a0eca6112db ]
> 
> Add MT2701 subsystem clock controllers, inlcude mmsys, imgsys,
> vdecsys, hifsys, ethsys and bdpsys.
> 
> Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
> ---
>   arch/arm/boot/dts/mt2701.dtsi | 36 ++++++++++++++++++++++++++++++++++++
>   1 file changed, 36 insertions(+)
> 

It's not clear to me which bug in v4.9.y you are fixing with this. Can you 
please explain.

Thanks,
Matthias

> diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi
> index 18596a2c58a1..77c6b931dc24 100644
> --- a/arch/arm/boot/dts/mt2701.dtsi
> +++ b/arch/arm/boot/dts/mt2701.dtsi
> @@ -174,4 +174,40 @@
>   		clocks = <&uart_clk>;
>   		status = "disabled";
>   	};
> +
> +	mmsys: syscon@14000000 {
> +		compatible = "mediatek,mt2701-mmsys", "syscon";
> +		reg = <0 0x14000000 0 0x1000>;
> +		#clock-cells = <1>;
> +	};
> +
> +	imgsys: syscon@15000000 {
> +		compatible = "mediatek,mt2701-imgsys", "syscon";
> +		reg = <0 0x15000000 0 0x1000>;
> +		#clock-cells = <1>;
> +	};
> +
> +	vdecsys: syscon@16000000 {
> +		compatible = "mediatek,mt2701-vdecsys", "syscon";
> +		reg = <0 0x16000000 0 0x1000>;
> +		#clock-cells = <1>;
> +	};
> +
> +	hifsys: syscon@1a000000 {
> +		compatible = "mediatek,mt2701-hifsys", "syscon";
> +		reg = <0 0x1a000000 0 0x1000>;
> +		#clock-cells = <1>;
> +	};
> +
> +	ethsys: syscon@1b000000 {
> +		compatible = "mediatek,mt2701-ethsys", "syscon";
> +		reg = <0 0x1b000000 0 0x1000>;
> +		#clock-cells = <1>;
> +	};
> +
> +	bdpsys: syscon@1c000000 {
> +		compatible = "mediatek,mt2701-bdpsys", "syscon";
> +		reg = <0 0x1c000000 0 0x1000>;
> +		#clock-cells = <1>;
> +	};
>   };
> 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing
@ 2017-09-15 17:03             ` Paul Burton
  0 siblings, 0 replies; 72+ messages in thread
From: Paul Burton @ 2017-09-15 17:03 UTC (permalink / raw)
  To: Marcin Nowakowski
  Cc: linux-mips, Mathieu Malaterre, Levin, Alexander (Sasha Levin),
	linux-kernel, stable, Ralf Baechle

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

Hi Marcin,

On Thursday, 14 September 2017 22:44:18 PDT Marcin Nowakowski wrote:
> >>> Does not work on MIPS Creator CI20. See:
> >> Hm, so upstream is actually broken right now?
> > 
> > Yes, at least on Creator CI20. You need to clear out all your mem=X@Y
> > from your boot command line, or apply the new patch I mentionned
> > above, or revert 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411.
> 
> Yes, there is this issue that Mathieu discovered that upstream suffers
> from. My patch that fixes it has not yet been merged - but hopefully
> will be included in the next release.
> Luckily the issue is only seen with a specific set of commandline
> arguments which are not even required - but are set as defaults by the
> CI20 bootloader.

FYI the mem= arguments were required for the older v3.0 kernels which derived 
from Ingenic's android kernels, and up until now have been harmless for newer 
kernels so they generally make sense for the bootloader to provide in case 
people want to run anything using the older kernels.

Thanks,
    Paul

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing
@ 2017-09-15 17:03             ` Paul Burton
  0 siblings, 0 replies; 72+ messages in thread
From: Paul Burton @ 2017-09-15 17:03 UTC (permalink / raw)
  To: Marcin Nowakowski
  Cc: linux-mips, Mathieu Malaterre, Levin, Alexander (Sasha Levin),
	linux-kernel, stable, Ralf Baechle

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

Hi Marcin,

On Thursday, 14 September 2017 22:44:18 PDT Marcin Nowakowski wrote:
> >>> Does not work on MIPS Creator CI20. See:
> >> Hm, so upstream is actually broken right now?
> > 
> > Yes, at least on Creator CI20. You need to clear out all your mem=X@Y
> > from your boot command line, or apply the new patch I mentionned
> > above, or revert 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411.
> 
> Yes, there is this issue that Mathieu discovered that upstream suffers
> from. My patch that fixes it has not yet been merged - but hopefully
> will be included in the next release.
> Luckily the issue is only seen with a specific set of commandline
> arguments which are not even required - but are set as defaults by the
> CI20 bootloader.

FYI the mem= arguments were required for the older v3.0 kernels which derived 
from Ingenic's android kernels, and up until now have been harmless for newer 
kernels so they generally make sense for the bootloader to provide in case 
people want to run anything using the older kernels.

Thanks,
    Paul

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 39/59] arm: dts: mt2701: Add subsystem clock controller device nodes
  2017-09-15 11:15   ` Matthias Brugger
@ 2017-09-17 23:20     ` Levin, Alexander (Sasha Levin)
  2017-09-18 10:28       ` Matthias Brugger
  0 siblings, 1 reply; 72+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-17 23:20 UTC (permalink / raw)
  To: Matthias Brugger; +Cc: linux-kernel, stable, James Liao

On Fri, Sep 15, 2017 at 01:15:43PM +0200, Matthias Brugger wrote:
>On 09/14/2017 05:51 PM, Levin, Alexander (Sasha Levin) wrote:
>>From: James Liao <jamesjj.liao@mediatek.com>
>>
>>[ Upstream commit f235c7e7a75325f28a33559a71f25a0eca6112db ]
>>
>>Add MT2701 subsystem clock controllers, inlcude mmsys, imgsys,
>>vdecsys, hifsys, ethsys and bdpsys.
>>
>>Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
>>Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>>Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
>>---
>>  arch/arm/boot/dts/mt2701.dtsi | 36 ++++++++++++++++++++++++++++++++++++
>>  1 file changed, 36 insertions(+)
>>
>
>It's not clear to me which bug in v4.9.y you are fixing with this. Can 
>you please explain.

Hi Matthias,

Note that beyond bug fixes, stable kernel rules also allow for:

"""
 - New device IDs and quirks are also accepted.
"""

In general, patches that enable devices which use existing in-kernel drivers are also accepted to the stable kernel tree.

If this is not the case here, or you have a reason to keep it out, please let me know.


-- 

Thanks,
Sasha

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH for 4.9 39/59] arm: dts: mt2701: Add subsystem clock controller device nodes
  2017-09-17 23:20     ` Levin, Alexander (Sasha Levin)
@ 2017-09-18 10:28       ` Matthias Brugger
  0 siblings, 0 replies; 72+ messages in thread
From: Matthias Brugger @ 2017-09-18 10:28 UTC (permalink / raw)
  To: Levin, Alexander (Sasha Levin); +Cc: linux-kernel, stable, James Liao



On 09/18/2017 01:20 AM, Levin, Alexander (Sasha Levin) wrote:
> On Fri, Sep 15, 2017 at 01:15:43PM +0200, Matthias Brugger wrote:
>> On 09/14/2017 05:51 PM, Levin, Alexander (Sasha Levin) wrote:
>>> From: James Liao <jamesjj.liao@mediatek.com>
>>>
>>> [ Upstream commit f235c7e7a75325f28a33559a71f25a0eca6112db ]
>>>
>>> Add MT2701 subsystem clock controllers, inlcude mmsys, imgsys,
>>> vdecsys, hifsys, ethsys and bdpsys.
>>>
>>> Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
>>> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>>> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
>>> ---
>>>   arch/arm/boot/dts/mt2701.dtsi | 36 ++++++++++++++++++++++++++++++++++++
>>>   1 file changed, 36 insertions(+)
>>>
>>
>> It's not clear to me which bug in v4.9.y you are fixing with this. Can
>> you please explain.
> 
> Hi Matthias,
> 
> Note that beyond bug fixes, stable kernel rules also allow for:
> 
> """
>   - New device IDs and quirks are also accepted.
> """
> 
> In general, patches that enable devices which use existing in-kernel drivers are also accepted to the stable kernel tree.
> 
> If this is not the case here, or you have a reason to keep it out, please let me know.
> 
Hm, I checked linux-4.9.y and it lacks commit:
e9862118272a ("clk: mediatek: Add MT2701 clock support")

Which got's merged in v4.10, so this patch has no effect at all.
What do I miss?

Regards,
Matthias

^ permalink raw reply	[flat|nested] 72+ messages in thread

end of thread, other threads:[~2017-09-18 10:28 UTC | newest]

Thread overview: 72+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 02/59] drm: bridge: add DT bindings for TI ths8135 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 03/59] GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 07/59] clk: sunxi-ng: set the parent rate when adjustin CPUX clock on A33 Levin, Alexander (Sasha Levin)
2017-09-15  2:02   ` icenowy
2017-09-15  2:08     ` Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 05/59] ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 06/59] clk: sunxi-ng: fix PLL_CPUX adjusting on H3 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 04/59] drm/i915: Fix the overlay frontbuffer tracking Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 10/59] MIPS: Ensure bss section ends on a long-aligned address Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 09/59] ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing Levin, Alexander (Sasha Levin)
2017-09-14 18:59   ` Mathieu Malaterre
2017-09-14 19:11     ` Levin, Alexander (Sasha Levin)
2017-09-14 19:11       ` Levin, Alexander (Sasha Levin)
2017-09-14 19:17       ` Mathieu Malaterre
2017-09-15  5:44         ` Marcin Nowakowski
2017-09-15 17:03           ` Paul Burton
2017-09-15 17:03             ` Paul Burton
2017-09-14 15:51 ` [PATCH for 4.9 08/59] RDS: RDMA: Fix the composite message user notification Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 15/59] power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 12/59] MIPS: kexec: Do not reserve invalid crashkernel memory on boot Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 13/59] MIPS: ralink: Fix a typo in the pinmux setup Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 14/59] MIPS: ralink: Fix incorrect assignment on ralink_soc Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 17/59] ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 16/59] scsi: be2iscsi: Add checks to validate CID alloc/free Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 19/59] extcon: axp288: Use vbus-valid instead of -present to determine cable presence Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 18/59] igb: re-assign hw address pointer on reset after PCI error Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 21/59] sh_eth: use correct name for ECMR_MPDE bit Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 20/59] reset: ti_syscon: fix a ti_syscon_reset_status issue Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 23/59] clk: wm831x: fix usleep_range with bad range Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 22/59] clk/axs10x: Clear init field in driver probe Levin, Alexander (Sasha Levin)
2017-09-14 15:51   ` Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 25/59] hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 24/59] usb: make the MTK XHCI driver compile for older MIPS SoCs Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 27/59] iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 29/59] IB/rxe: Add a runtime check in alloc_index() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 28/59] iio: adc: hx711: Add DT binding for avia,hx711 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 26/59] iio: adc: imx25-gcq: Fix module autoload Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 32/59] drm/i915/psr: disable psr2 for resolution greater than 32X20 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 33/59] serial: 8250: moxa: Store num_ports in brd Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 31/59] ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 30/59] IB/rxe: Fix a MR reference leak in check_rkey() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 37/59] IB/ipoib: rtnl_unlock can not come after free_netdev Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 34/59] tty: goldfish: Fix a parameter of a call to free_irq Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 35/59] serial: 8250_port: Remove dangerous pr_debug() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 36/59] IB/ipoib: Fix deadlock over vlan_mutex Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 39/59] arm: dts: mt2701: Add subsystem clock controller device nodes Levin, Alexander (Sasha Levin)
2017-09-15 11:15   ` Matthias Brugger
2017-09-17 23:20     ` Levin, Alexander (Sasha Levin)
2017-09-18 10:28       ` Matthias Brugger
2017-09-14 15:51 ` [PATCH for 4.9 41/59] USB: serial: mos7720: fix control-message error handling Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 38/59] IB/ipoib: Replace list_del of the neigh->list with list_del_init Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 40/59] drm/amdkfd: fix improper return value on error Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 45/59] partitions/efi: Fix integer overflow in GPT size calculation Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 44/59] pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 42/59] USB: serial: mos7840: fix control-message error handling Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 43/59] sfc: get PIO buffer size from the NIC Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 48/59] ath10k: prevent sta pointer rcu violation Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 46/59] ASoC: dapm: handle probe deferrals Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 47/59] audit: log 32-bit socketcalls Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 49/59] spi: pxa2xx: Add support for Intel Gemini Lake Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 50/59] iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged' Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 52/59] rtl8xxxu: Add additional USB IDs for rtl8192eu devices Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 53/59] ASoC: dapm: fix some pointer error handling Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 51/59] usb: chipidea: vbus event may exist before starting gadget Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 57/59] MIPS: Lantiq: Fix another request_mem_region() return code check Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 55/59] drm: mali-dp: Fix transposed horizontal/vertical flip Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 56/59] HID: wacom: release the resources before leaving despite devm Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 54/59] drm: mali-dp: Fix destination size handling when rotating Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 59/59] lkdtm: Fix Oops when unloading the module Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 58/59] mips: ath79: clock:- Unmap region obtained by of_iomap Levin, Alexander (Sasha Levin)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.