All of lore.kernel.org
 help / color / mirror / Atom feed
* Follow-up patches for 3.16-stable
@ 2017-05-09 10:04 Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 01/14] staging: r8192ee: prorperly format warning message Arnd Bergmann
                   ` (13 more replies)
  0 siblings, 14 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable

Hi Ben,

I fixed a couple of problems with my previous (rather long) series
of 3.16 build fixes:

- My script to generate the changeset text was wrong, and they
  all ended up with an incorrect reference to the upstream commit
- One patch was backported incorrectly, now fixed
- kernelci.org found a few more issues, and I found some more
  locally
- Ard pointed to one missing patch to fix up another that was
  in my first series. The fixup is now also in 3.18 and 4.4 that
  were missing it too.

The additional 14 patches are in this series, and I've uploaded
the entire set of now 101 patches to

git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git stable-3.16.y

      Arnd

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

* [PATCH 3.16-stable 01/14] staging: r8192ee: prorperly format warning message
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
@ 2017-05-09 10:04 ` Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 02/14] mtd: cfi: reduce stack size Arnd Bergmann
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable, Arnd Bergmann

In stable/linux-3.16.y, we get a warning for 64-bit architectures:

drivers/staging/rtl8192ee/pci.c: In function '_rtl_pci_rx_interrupt':
include/linux/kern_levels.h:4:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'sk_buff_data_t {aka unsigned char *}' [-Wformat=]
include/linux/kern_levels.h:4:18: warning: format '%d' expects argument of type 'int', but argument 3 has type 'sk_buff_data_t {aka unsigned char *}' [-Wformat=]

The driver was removed in 3.18 before this was fixed, so there is no
workaround to backport, but it's easy enough to avoid the problem
by changing the printk message to something similar that uses
proper accessors for the skb fields.

Fixes: 78de2c063710 ("staging: r8192ee: Add source files for core driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/rtl8192ee/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192ee/pci.c b/drivers/staging/rtl8192ee/pci.c
index 3fe9b7ba01d6..1686b360e088 100644
--- a/drivers/staging/rtl8192ee/pci.c
+++ b/drivers/staging/rtl8192ee/pci.c
@@ -882,8 +882,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
 
 		} else {
 			if (err_count++ < 10) {
-				pr_info("skb->end (%d) - skb->tail (%d) > len (%d)\n",
-					skb->end, skb->tail, len);
+				pr_info("skb end: %d) - tailroom (%d) > len (%d)\n",
+					skb_end_offset(skb), skb_tailroom(skb), len);
 				RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_EMERG,
 					      "RX desc\n",
 					      (u8 *)pdesc, 32);
-- 
2.9.0

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

* [PATCH 3.16-stable 02/14] mtd: cfi: reduce stack size
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 01/14] staging: r8192ee: prorperly format warning message Arnd Bergmann
@ 2017-05-09 10:04 ` Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 03/14] drbd: avoid redefinition of BITS_PER_PAGE Arnd Bergmann
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable, Arnd Bergmann, Brian Norris

Commit d09957fbb4d0b059b3176b510540df69048ad170 upstream.

The cfi_staa_write_buffers function uses a large amount of kernel stack
whenever CONFIG_MTD_MAP_BANK_WIDTH_32 is set, and that results in a
warning on ARM allmodconfig builds:

drivers/mtd/chips/cfi_cmdset_0020.c: In function 'cfi_staa_write_buffers':
drivers/mtd/chips/cfi_cmdset_0020.c:651:1: warning: the frame size of 1208 bytes is larger than 1024 bytes [-Wframe-larger-than=]

It turns out that this is largely a result of a suboptimal implementation
of map_word_andequal(). Replacing this function with a straightforward
one reduces the stack size in this function by exactly 200 bytes,
shrinks the .text segment for this file from 27648 bytes to 26608 bytes,
and makes the warning go away.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/mtd/map.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index b501e9cd7d3e..db1dba23aed2 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -317,7 +317,17 @@ static inline map_word map_word_or(struct map_info *map, map_word val1, map_word
 	return r;
 }
 
-#define map_word_andequal(m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b))
+static inline int map_word_andequal(struct map_info *map, map_word val1, map_word val2, map_word val3)
+{
+	int i;
+
+	for (i = 0; i < map_words(map); i++) {
+		if ((val1.x[i] & val2.x[i]) != val3.x[i])
+			return 0;
+	}
+
+	return 1;
+}
 
 static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word val2)
 {
-- 
2.9.0

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

* [PATCH 3.16-stable 03/14] drbd: avoid redefinition of BITS_PER_PAGE
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 01/14] staging: r8192ee: prorperly format warning message Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 02/14] mtd: cfi: reduce stack size Arnd Bergmann
@ 2017-05-09 10:04 ` Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 04/14] MIPS: ip27: Disable mpt2sas driver in defconfig Arnd Bergmann
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: stable, Lars Ellenberg, Philipp Reisner, Jens Axboe, Arnd Bergmann

From: Lars Ellenberg <lars.ellenberg@linbit.com>

Commit 2630628b2dbc3fc320aafaf84836119e4e3d62f1 upstream.

Apparently we now implicitly get definitions for BITS_PER_PAGE and
BITS_PER_PAGE_MASK from the pid_namespace.h

Instead of renaming our defines, I chose to define only if not yet
defined, but to double check the value if already defined.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/block/drbd/drbd_bitmap.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c
index 1aa29f8fdfe1..7c76f7270bec 100644
--- a/drivers/block/drbd/drbd_bitmap.c
+++ b/drivers/block/drbd/drbd_bitmap.c
@@ -478,8 +478,14 @@ void drbd_bm_cleanup(struct drbd_device *device)
  * this masks out the remaining bits.
  * Returns the number of bits cleared.
  */
+#ifndef BITS_PER_PAGE
 #define BITS_PER_PAGE		(1UL << (PAGE_SHIFT + 3))
 #define BITS_PER_PAGE_MASK	(BITS_PER_PAGE - 1)
+#else
+# if BITS_PER_PAGE != (1UL << (PAGE_SHIFT + 3))
+#  error "ambiguous BITS_PER_PAGE"
+# endif
+#endif
 #define BITS_PER_LONG_MASK	(BITS_PER_LONG - 1)
 static int bm_clear_surplus(struct drbd_bitmap *b)
 {
-- 
2.9.0

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

* [PATCH 3.16-stable 04/14] MIPS: ip27: Disable mpt2sas driver in defconfig
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
                   ` (2 preceding siblings ...)
  2017-05-09 10:04 ` [PATCH 3.16-stable 03/14] drbd: avoid redefinition of BITS_PER_PAGE Arnd Bergmann
@ 2017-05-09 10:04 ` Arnd Bergmann
  2017-11-06 19:26   ` Ben Hutchings
  2017-05-09 10:04 ` [PATCH 3.16-stable 05/14] perf: Avoid horrible stack usage Arnd Bergmann
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable, Arnd Bergmann

Similar to commit c64ebe32d3fc90c52277257d6c9fa7d589877cc2 upstream,
this fixes one more 3.16 build failure in kernelci.org that results
from a gcc bug:

drivers/scsi/mpt2sas/mpt2sas_base.c:3550:1: error: insn does not satisfy its constraints:
drivers/scsi/mpt2sas/mpt2sas_base.c:3550:1: internal compiler error: in extract_constrain_insn, at recog.c:2190

This is apparently broken in gcc-6 but fixed in gcc-7, and I cannot
reproduce the problem here. However, it is clear that ip27_defconfig
does not actually need this driver as the platform has only PCI-X but
not PCIe, and the qlge adapter in turn is PCIe-only.

The driver was originally enabled in 2010 along with lots of other
drivers.

Fixes: 59d302b342e5 ("MIPS: IP27: Make defconfig useful again.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/configs/ip27_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index 7446284dd7b3..cb56ff8d0cdd 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -129,7 +129,6 @@ CONFIG_SCSI_AIC94XX=m
 CONFIG_SCSI_MVSAS=m
 # CONFIG_SCSI_MVSAS_DEBUG is not set
 CONFIG_SCSI_DPT_I2O=m
-CONFIG_SCSI_MPT2SAS=m
 CONFIG_LIBFC=m
 CONFIG_SCSI_QLOGIC_1280=y
 CONFIG_SCSI_PMCRAID=m
-- 
2.9.0

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

* [PATCH 3.16-stable 05/14] perf: Avoid horrible stack usage
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
                   ` (3 preceding siblings ...)
  2017-05-09 10:04 ` [PATCH 3.16-stable 04/14] MIPS: ip27: Disable mpt2sas driver in defconfig Arnd Bergmann
@ 2017-05-09 10:04 ` Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 06/14] MIPS: jz4740: fix build error in irq.h Arnd Bergmann
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: stable, Peter Zijlstra (Intel),
	Arnaldo Carvalho de Melo, Javi Merino, Linus Torvalds,
	Mathieu Desnoyers, Oleg Nesterov, Paul Mackerras, Petr Mladek,
	Steven Rostedt, Tom Zanussi, Vaibhav Nagarnaik, Ingo Molnar,
	Arnd Bergmann

From: "Peter Zijlstra (Intel)" <peterz@infradead.org>

commit 86038c5ea81b519a8a1fcfcd5e4599aab0cdd119 upstream.

Both Linus (most recent) and Steve (a while ago) reported that perf
related callbacks have massive stack bloat.

The problem is that software events need a pt_regs in order to
properly report the event location and unwind stack. And because we
could not assume one was present we allocated one on stack and filled
it with minimal bits required for operation.

Now, pt_regs is quite large, so this is undesirable. Furthermore it
turns out that most sites actually have a pt_regs pointer available,
making this even more onerous, as the stack space is pointless waste.

This patch addresses the problem by observing that software events
have well defined nesting semantics, therefore we can use static
per-cpu storage instead of on-stack.

Linus made the further observation that all but the scheduler callers
of perf_sw_event() have a pt_regs available, so we change the regular
perf_sw_event() to require a valid pt_regs (where it used to be
optional) and add perf_sw_event_sched() for the scheduler.

We have a scheduler specific call instead of a more generic _noregs()
like construct because we can assume non-recursion from the scheduler
and thereby simplify the code further (_noregs would have to put the
recursion context call inline in order to assertain which __perf_regs
element to use).

One last note on the implementation of perf_trace_buf_prepare(); we
allow .regs = NULL for those cases where we already have a pt_regs
pointer available and do not need another.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Javi Merino <javi.merino@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Petr Mladek <pmladek@suse.cz>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
Cc: Vaibhav Nagarnaik <vnagarnaik@google.com>
Link: http://lkml.kernel.org/r/20141216115041.GW3337@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/ftrace_event.h    |  2 +-
 include/linux/perf_event.h      | 28 +++++++++++++++++++++-------
 include/trace/ftrace.h          |  7 ++++---
 kernel/events/core.c            | 23 +++++++++++++++++------
 kernel/sched/core.c             |  2 +-
 kernel/trace/trace_event_perf.c |  4 +++-
 kernel/trace/trace_kprobe.c     |  4 ++--
 kernel/trace/trace_syscalls.c   |  4 ++--
 kernel/trace/trace_uprobe.c     |  2 +-
 9 files changed, 52 insertions(+), 24 deletions(-)

diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index cff3106ffe2c..c817d7938b4b 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -621,7 +621,7 @@ extern int  ftrace_profile_set_filter(struct perf_event *event, int event_id,
 				     char *filter_str);
 extern void ftrace_profile_free_filter(struct perf_event *event);
 extern void *perf_trace_buf_prepare(int size, unsigned short type,
-				    struct pt_regs *regs, int *rctxp);
+				    struct pt_regs **regs, int *rctxp);
 
 static inline void
 perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 7e8445e9dcbf..d86153fef0e0 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -642,6 +642,7 @@ static inline int is_software_event(struct perf_event *event)
 
 extern struct static_key perf_swevent_enabled[PERF_COUNT_SW_MAX];
 
+extern void ___perf_sw_event(u32, u64, struct pt_regs *, u64);
 extern void __perf_sw_event(u32, u64, struct pt_regs *, u64);
 
 #ifndef perf_arch_fetch_caller_regs
@@ -666,14 +667,25 @@ static inline void perf_fetch_caller_regs(struct pt_regs *regs)
 static __always_inline void
 perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
 {
-	struct pt_regs hot_regs;
+	if (static_key_false(&perf_swevent_enabled[event_id]))
+		__perf_sw_event(event_id, nr, regs, addr);
+}
+
+DECLARE_PER_CPU(struct pt_regs, __perf_regs[4]);
 
+/*
+ * 'Special' version for the scheduler, it hard assumes no recursion,
+ * which is guaranteed by us not actually scheduling inside other swevents
+ * because those disable preemption.
+ */
+static __always_inline void
+perf_sw_event_sched(u32 event_id, u64 nr, u64 addr)
+{
 	if (static_key_false(&perf_swevent_enabled[event_id])) {
-		if (!regs) {
-			perf_fetch_caller_regs(&hot_regs);
-			regs = &hot_regs;
-		}
-		__perf_sw_event(event_id, nr, regs, addr);
+		struct pt_regs *regs = this_cpu_ptr(&__perf_regs[0]);
+
+		perf_fetch_caller_regs(regs);
+		___perf_sw_event(event_id, nr, regs, addr);
 	}
 }
 
@@ -689,7 +701,7 @@ static inline void perf_event_task_sched_in(struct task_struct *prev,
 static inline void perf_event_task_sched_out(struct task_struct *prev,
 					     struct task_struct *next)
 {
-	perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0);
+	perf_sw_event_sched(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 0);
 
 	if (static_key_false(&perf_sched_events.key))
 		__perf_event_task_sched_out(prev, next);
@@ -800,6 +812,8 @@ static inline int perf_event_refresh(struct perf_event *event, int refresh)
 static inline void
 perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)	{ }
 static inline void
+perf_sw_event_sched(u32 event_id, u64 nr, u64 addr)			{ }
+static inline void
 perf_bp_event(struct perf_event *event, void *data)			{ }
 
 static inline int perf_register_guest_info_callbacks
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 26b4f2e13275..bb1f5d82ad49 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -765,7 +765,7 @@ perf_trace_##call(void *__data, proto)					\
 	struct ftrace_event_call *event_call = __data;			\
 	struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
 	struct ftrace_raw_##call *entry;				\
-	struct pt_regs __regs;						\
+	struct pt_regs *__regs;						\
 	u64 __addr = 0, __count = 1;					\
 	struct task_struct *__task = NULL;				\
 	struct hlist_head *head;					\
@@ -784,18 +784,19 @@ perf_trace_##call(void *__data, proto)					\
 			     sizeof(u64));				\
 	__entry_size -= sizeof(u32);					\
 									\
-	perf_fetch_caller_regs(&__regs);				\
 	entry = perf_trace_buf_prepare(__entry_size,			\
 			event_call->event.type, &__regs, &rctx);	\
 	if (!entry)							\
 		return;							\
 									\
+	perf_fetch_caller_regs(__regs);					\
+									\
 	tstruct								\
 									\
 	{ assign; }							\
 									\
 	perf_trace_buf_submit(entry, __entry_size, rctx, __addr,	\
-		__count, &__regs, head, __task);			\
+		__count, __regs, head, __task);				\
 }
 
 /*
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 2faaed3ba61b..48988c7ac954 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5934,6 +5934,8 @@ end:
 	rcu_read_unlock();
 }
 
+DEFINE_PER_CPU(struct pt_regs, __perf_regs[4]);
+
 int perf_swevent_get_recursion_context(void)
 {
 	struct swevent_htable *swhash = &__get_cpu_var(swevent_htable);
@@ -5949,21 +5951,30 @@ inline void perf_swevent_put_recursion_context(int rctx)
 	put_recursion_context(swhash->recursion, rctx);
 }
 
-void __perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
+void ___perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
 {
 	struct perf_sample_data data;
-	int rctx;
 
-	preempt_disable_notrace();
-	rctx = perf_swevent_get_recursion_context();
-	if (rctx < 0)
+	if (WARN_ON_ONCE(!regs))
 		return;
 
 	perf_sample_data_init(&data, addr, 0);
-
 	do_perf_sw_event(PERF_TYPE_SOFTWARE, event_id, nr, &data, regs);
+}
+
+void __perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
+{
+	int rctx;
+
+	preempt_disable_notrace();
+	rctx = perf_swevent_get_recursion_context();
+	if (unlikely(rctx < 0))
+		goto fail;
+
+	___perf_sw_event(event_id, nr, regs, addr);
 
 	perf_swevent_put_recursion_context(rctx);
+fail:
 	preempt_enable_notrace();
 }
 
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f2c0bcc4ba6c..e5cd1088c1dc 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1085,7 +1085,7 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
 		if (p->sched_class->migrate_task_rq)
 			p->sched_class->migrate_task_rq(p, new_cpu);
 		p->se.nr_migrations++;
-		perf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, NULL, 0);
+		perf_sw_event_sched(PERF_COUNT_SW_CPU_MIGRATIONS, 1, 0);
 
 		tmn.task = p;
 		tmn.from_cpu = task_cpu(p);
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index 5d12bb407b44..a818e5601f89 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -249,7 +249,7 @@ void perf_trace_del(struct perf_event *p_event, int flags)
 }
 
 void *perf_trace_buf_prepare(int size, unsigned short type,
-			     struct pt_regs *regs, int *rctxp)
+			     struct pt_regs **regs, int *rctxp)
 {
 	struct trace_entry *entry;
 	unsigned long flags;
@@ -268,6 +268,8 @@ void *perf_trace_buf_prepare(int size, unsigned short type,
 	if (*rctxp < 0)
 		return NULL;
 
+	if (regs)
+		*regs = this_cpu_ptr(&__perf_regs[*rctxp]);
 	raw_data = this_cpu_ptr(perf_trace_buf[*rctxp]);
 
 	/* zero the dead bytes from align to not leak stack to user */
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 282f6e4e5539..22328503aa3e 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -1158,7 +1158,7 @@ kprobe_perf_func(struct trace_kprobe *tk, struct pt_regs *regs)
 	size = ALIGN(__size + sizeof(u32), sizeof(u64));
 	size -= sizeof(u32);
 
-	entry = perf_trace_buf_prepare(size, call->event.type, regs, &rctx);
+	entry = perf_trace_buf_prepare(size, call->event.type, NULL, &rctx);
 	if (!entry)
 		return;
 
@@ -1189,7 +1189,7 @@ kretprobe_perf_func(struct trace_kprobe *tk, struct kretprobe_instance *ri,
 	size = ALIGN(__size + sizeof(u32), sizeof(u64));
 	size -= sizeof(u32);
 
-	entry = perf_trace_buf_prepare(size, call->event.type, regs, &rctx);
+	entry = perf_trace_buf_prepare(size, call->event.type, NULL, &rctx);
 	if (!entry)
 		return;
 
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 7e3cd7aaec83..ba78f0e3477d 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -586,7 +586,7 @@ static void perf_syscall_enter(void *ignore, struct pt_regs *regs, long id)
 	size -= sizeof(u32);
 
 	rec = (struct syscall_trace_enter *)perf_trace_buf_prepare(size,
-				sys_data->enter_event->event.type, regs, &rctx);
+				sys_data->enter_event->event.type, NULL, &rctx);
 	if (!rec)
 		return;
 
@@ -659,7 +659,7 @@ static void perf_syscall_exit(void *ignore, struct pt_regs *regs, long ret)
 	size -= sizeof(u32);
 
 	rec = (struct syscall_trace_exit *)perf_trace_buf_prepare(size,
-				sys_data->exit_event->event.type, regs, &rctx);
+				sys_data->exit_event->event.type, NULL, &rctx);
 	if (!rec)
 		return;
 
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 3c9b97e6b1f4..5224e836acde 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -1116,7 +1116,7 @@ static void __uprobe_perf_func(struct trace_uprobe *tu,
 	if (hlist_empty(head))
 		goto out;
 
-	entry = perf_trace_buf_prepare(size, call->event.type, regs, &rctx);
+	entry = perf_trace_buf_prepare(size, call->event.type, NULL, &rctx);
 	if (!entry)
 		goto out;
 
-- 
2.9.0

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

* [PATCH 3.16-stable 06/14] MIPS: jz4740: fix build error in irq.h
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
                   ` (4 preceding siblings ...)
  2017-05-09 10:04 ` [PATCH 3.16-stable 05/14] perf: Avoid horrible stack usage Arnd Bergmann
@ 2017-05-09 10:04 ` Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 07/14] MIPS: elf2ecoff: Ignore PT_MIPS_ABIFLAGS program headers Arnd Bergmann
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable, Arnd Bergmann, Lars-Peter Clausen

kernelci found build error on the 3.16 and 3.18 stable trees that don't
show up in later versions:

arch/mips/jz4740/irq.h:21:38: error: 'struct irq_data' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
arch/mips/jz4740/irq.h:20:39: error: 'struct irq_data' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
include/linux/irqdesc.h:92:33: error: 'NR_IRQS' undeclared here (not in a function)
arch/mips/jz4740/irq.c:91:41: error: 'JZ4740_IRQ_BASE' undeclared (first use in this function)
arch/mips/jz4740/irq.c:68:6: error: conflicting types for 'jz4740_irq_resume'
arch/mips/jz4740/irq.c:62:6: error: conflicting types for 'jz4740_irq_suspend'
arch/mips/jz4740/irq.c:49:39: error: 'JZ4740_IRQ_BASE' undeclared (first use in this function)
arch/mips/jz4740/gpio.c:47:32: error: initializer element is not constant
arch/mips/jz4740/gpio.c:46:32: error: initializer element is not constant
arch/mips/jz4740/gpio.c:45:32: error: initializer element is not constant
arch/mips/jz4740/gpio.c:44:32: error: initializer element is not constant
arch/mips/jz4740/gpio.c:447:22: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
arch/mips/jz4740/gpio.c:446:23: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
arch/mips/jz4740/gpio.c:427:14: error: implicit declaration of function 'JZ4740_IRQ_INTC_GPIO' [-Werror=implicit-function-declaration]
arch/mips/jz4740/gpio.c:269:9: error: implicit declaration of function 'JZ4740_IRQ_GPIO' [-Werror=implicit-function-declaration]

The problem seems to be caused by commit 83bc76920080 ("MIPS: JZ4740: Use
generic irq chip") from linux-3.2, but only showed up in a defconfig
build when qi_lb60_defconfig was added in linux-3.13 and that configuration
never successfully built.

The code has changed in a number of ways before 4.4, which builds fine.
While I did not bisect the problem to a specific change, I found a simple
fix by including the obviously missing header.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/jz4740/irq.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/mips/jz4740/irq.h b/arch/mips/jz4740/irq.h
index 0f48720b5b63..486db78808cc 100644
--- a/arch/mips/jz4740/irq.h
+++ b/arch/mips/jz4740/irq.h
@@ -16,7 +16,9 @@
 #define __MIPS_JZ4740_IRQ_H__
 
 #include <linux/irq.h>
+#include <asm/mach-jz4740/irq.h>
 
+struct irq_data;
 extern void jz4740_irq_suspend(struct irq_data *data);
 extern void jz4740_irq_resume(struct irq_data *data);
 
-- 
2.9.0

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

* [PATCH 3.16-stable 07/14] MIPS: elf2ecoff: Ignore PT_MIPS_ABIFLAGS program headers.
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
                   ` (5 preceding siblings ...)
  2017-05-09 10:04 ` [PATCH 3.16-stable 06/14] MIPS: jz4740: fix build error in irq.h Arnd Bergmann
@ 2017-05-09 10:04 ` Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 08/14] gfs2: remove IS_ERR_VALUE abuse Arnd Bergmann
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable, Ralf Baechle, Arnd Bergmann

From: Ralf Baechle <ralf@linux-mips.org>

Commit 26f7c4bd05cf34e63a4a794150ab66a40a5a84a9 upstream.

These are generated by very recent toolchains and result in an error
message when attenpting to convert a kernel from ELF to ECOFF.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/boot/elf2ecoff.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/boot/elf2ecoff.c b/arch/mips/boot/elf2ecoff.c
index bef06453edc0..6950fee4576c 100644
--- a/arch/mips/boot/elf2ecoff.c
+++ b/arch/mips/boot/elf2ecoff.c
@@ -49,7 +49,8 @@
 /*
  * Some extra ELF definitions
  */
-#define PT_MIPS_REGINFO 0x70000000	/* Register usage information */
+#define PT_MIPS_REGINFO 	0x70000000	/* Register usage information */
+#define PT_MIPS_ABIFLAGS	0x70000003	/* Records ABI related flags  */
 
 /* -------------------------------------------------------------------- */
 
@@ -347,7 +348,8 @@ int main(int argc, char *argv[])
 		/* Section types we can ignore... */
 		if (ph[i].p_type == PT_NULL || ph[i].p_type == PT_NOTE ||
 		    ph[i].p_type == PT_PHDR
-		    || ph[i].p_type == PT_MIPS_REGINFO)
+		    || ph[i].p_type == PT_MIPS_REGINFO
+		    || ph[i].p_type == PT_MIPS_ABIFLAGS)
 			continue;
 		/* Section types we can't handle... */
 		else if (ph[i].p_type != PT_LOAD) {
-- 
2.9.0

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

* [PATCH 3.16-stable 08/14] gfs2: remove IS_ERR_VALUE abuse
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
                   ` (6 preceding siblings ...)
  2017-05-09 10:04 ` [PATCH 3.16-stable 07/14] MIPS: elf2ecoff: Ignore PT_MIPS_ABIFLAGS program headers Arnd Bergmann
@ 2017-05-09 10:04 ` Arnd Bergmann
  2017-11-06 19:46   ` Ben Hutchings
  2017-05-09 10:04 ` [PATCH 3.16-stable 09/14] net: ti: cpmac: Fix compiler warning due to type confusion Arnd Bergmann
                   ` (5 subsequent siblings)
  13 siblings, 1 reply; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable, Arnd Bergmann

Picked from commit 287980e49ffc0f6d911601e7e352a812ed27768e ("remove lots
of IS_ERR_VALUE abuses") upstream.

The original fix that was backported to 3.18 already addressed the warning
in some configurations, but not in others, leaving us with the same output:

../fs/gfs2/dir.c: In function 'get_first_leaf':
../fs/gfs2/dir.c:768:9: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]
   error = get_leaf(dip, leaf_no, bh_out);
         ^
../fs/gfs2/dir.c: In function 'dir_split_leaf.isra.20':
../fs/gfs2/dir.c:987:8: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]

This takes the approach that we took in later versions in mainline,
but does not backport the entire patch, as that would be too large
for stable and IIRC caused regressions in other drivers.

Fixes: 9d46d31e9aea ("gfs2: avoid uninitialized variable warning")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/gfs2/dir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index 6810c8772eb1..f3508f4583d5 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -767,7 +767,7 @@ static int get_first_leaf(struct gfs2_inode *dip, u32 index,
 	int error;
 
 	error = get_leaf_nr(dip, index, &leaf_no);
-	if (!IS_ERR_VALUE(error))
+	if (!error)
 		error = get_leaf(dip, leaf_no, bh_out);
 
 	return error;
@@ -983,7 +983,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name)
 
 	index = name->hash >> (32 - dip->i_depth);
 	error = get_leaf_nr(dip, index, &leaf_no);
-	if (IS_ERR_VALUE(error))
+	if (error)
 		return error;
 
 	/*  Get the old leaf block  */
-- 
2.9.0

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

* [PATCH 3.16-stable 09/14] net: ti: cpmac: Fix compiler warning due to type confusion
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
                   ` (7 preceding siblings ...)
  2017-05-09 10:04 ` [PATCH 3.16-stable 08/14] gfs2: remove IS_ERR_VALUE abuse Arnd Bergmann
@ 2017-05-09 10:04 ` Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 10/14] e1000e: fix call to do_div() to use u64 arg Arnd Bergmann
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: stable, Paul Burton, David S . Miller, Arnd Bergmann, Greg Kroah-Hartman

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

commit 2f5281ba2a8feaf6f0aee93356f350855bb530fc upstream.

cpmac_start_xmit() used the max() macro on skb->len (an unsigned int)
and ETH_ZLEN (a signed int literal). This led to the following compiler
warning:

  In file included from include/linux/list.h:8:0,
                   from include/linux/module.h:9,
                   from drivers/net/ethernet/ti/cpmac.c:19:
  drivers/net/ethernet/ti/cpmac.c: In function 'cpmac_start_xmit':
  include/linux/kernel.h:748:17: warning: comparison of distinct pointer
  types lacks a cast
    (void) (&_max1 == &_max2);  \
                   ^
  drivers/net/ethernet/ti/cpmac.c:560:8: note: in expansion of macro 'max'
    len = max(skb->len, ETH_ZLEN);
          ^

On top of this, it assigned the result of the max() macro to a signed
integer whilst all further uses of it result in it being cast to varying
widths of unsigned integer.

Fix this up by using max_t to ensure the comparison is performed as
unsigned integers, and for consistency change the type of the len
variable to unsigned int.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/ti/cpmac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index 44d5a7bee0d7..755ddd586189 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -543,7 +543,8 @@ fatal_error:
 
 static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	int queue, len;
+	int queue;
+	unsigned int len;
 	struct cpmac_desc *desc;
 	struct cpmac_priv *priv = netdev_priv(dev);
 
@@ -553,7 +554,7 @@ static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (unlikely(skb_padto(skb, ETH_ZLEN)))
 		return NETDEV_TX_OK;
 
-	len = max(skb->len, ETH_ZLEN);
+	len = max_t(unsigned int, skb->len, ETH_ZLEN);
 	queue = skb_get_queue_mapping(skb);
 	netif_stop_subqueue(dev, queue);
 
-- 
2.9.0

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

* [PATCH 3.16-stable 10/14] e1000e: fix call to do_div() to use u64 arg
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
                   ` (8 preceding siblings ...)
  2017-05-09 10:04 ` [PATCH 3.16-stable 09/14] net: ti: cpmac: Fix compiler warning due to type confusion Arnd Bergmann
@ 2017-05-09 10:04 ` Arnd Bergmann
  2017-05-09 10:04 ` [PATCH 3.16-stable 11/14] MIPS: Fix a warning for virt_to_page Arnd Bergmann
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: stable, Jeff Kirsher, Yanjiang Jin, Yanir Lubetkin, Arnd Bergmann

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Commit 30544af5483755b11bb5924736e9e0b45ef0644a upstream.

We were using s64 for lat_ns (latency nano-second value) since in
our calculations a negative value could be a resultant.  For negative
values, we then assign lat_ns to be zero, so the value passed to
do_div() was never negative, but do_div() expects the argument type
to be u64, so do a cast to resolve a compile warning seen on
PowerPC.

CC: Yanjiang Jin <yanjiang.jin@windriver.com>
CC: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Reported-by: Yanjiang Jin <yanjiang.jin@windriver.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/intel/e1000e/ich8lan.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 060c5510b0c4..05e42d3d8a63 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -984,7 +984,7 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
 		u16 max_snoop, max_nosnoop;
 		u16 max_ltr_enc;	/* max LTR latency encoded */
 		s64 lat_ns;	/* latency (ns) */
-		s64 value;
+		u64 value;
 		u32 rxa;
 
 		if (!hw->adapter->max_frame_size) {
@@ -1011,12 +1011,13 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
 		 */
 		lat_ns = ((s64)rxa * 1024 -
 			  (2 * (s64)hw->adapter->max_frame_size)) * 8 * 1000;
-		if (lat_ns < 0)
-			lat_ns = 0;
-		else
-			do_div(lat_ns, speed);
+		if (lat_ns < 0) {
+			value = 0;
+		} else {
+			value = lat_ns;
+			do_div(value, speed);
+		}
 
-		value = lat_ns;
 		while (value > PCI_LTR_VALUE_MASK) {
 			scale++;
 			value = DIV_ROUND_UP(value, (1 << 5));
-- 
2.9.0

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

* [PATCH 3.16-stable 11/14] MIPS: Fix a warning for virt_to_page
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
                   ` (9 preceding siblings ...)
  2017-05-09 10:04 ` [PATCH 3.16-stable 10/14] e1000e: fix call to do_div() to use u64 arg Arnd Bergmann
@ 2017-05-09 10:04 ` Arnd Bergmann
  2017-05-09 10:05 ` [PATCH 3.16-stable 12/14] wlcore: fix 64K page support Arnd Bergmann
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:04 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: stable, Zubair Lutfullah Kakakhel, linux-mips, Ralf Baechle,
	Arnd Bergmann

From: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>

commit 4d5b3bdc0ecb0cf5b1e1598eeaaac4b5cb33868d upstream.

Compiling mm/highmem.c gives a warning: passing argument 1 of
'virt_to_phys' makes pointer from integer without a cast

Fixed by casting to void*

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7337/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/include/asm/page.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 5699ec3a71af..fd0347da36df 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -223,7 +223,8 @@ static inline int pfn_valid(unsigned long pfn)
 
 #endif
 
-#define virt_to_page(kaddr)	pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
+#define virt_to_page(kaddr)	pfn_to_page(PFN_DOWN(virt_to_phys((void *)     \
+								  (kaddr))))
 
 extern int __virt_addr_valid(const volatile void *kaddr);
 #define virt_addr_valid(kaddr)						\
-- 
2.9.0

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

* [PATCH 3.16-stable 12/14] wlcore: fix 64K page support
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
                   ` (10 preceding siblings ...)
  2017-05-09 10:04 ` [PATCH 3.16-stable 11/14] MIPS: Fix a warning for virt_to_page Arnd Bergmann
@ 2017-05-09 10:05 ` Arnd Bergmann
  2017-11-06 19:52   ` Ben Hutchings
  2017-05-09 10:05 ` [PATCH 3.16-stable 13/14] net/xen-netback: disable on 64KB page granularity Arnd Bergmann
  2017-05-09 10:05 ` [PATCH 3.16-stable 14/14] ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode Arnd Bergmann
  13 siblings, 1 reply; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:05 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable, Arnd Bergmann

In the stable linux-3.16 branch, I ran into a warning in the
wlcore driver:

drivers/net/wireless/ti/wlcore/spi.c: In function 'wl12xx_spi_raw_write':
drivers/net/wireless/ti/wlcore/spi.c:315:1: error: the frame size of 12848 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

Newer kernels no longer show the warning, but the bug is still there,
as the allocation is based on the CPU page size rather than the
actual capabilities of the hardware.

This replaces the PAGE_SIZE macro with the SZ_4K macro, i.e. 4096 bytes
per buffer.

Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/wireless/ti/wlcore/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index a460fe669443..48559a5baffa 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -71,7 +71,7 @@
  * only support SPI for 12xx - this code should be reworked when 18xx
  * support is introduced
  */
-#define SPI_AGGR_BUFFER_SIZE (4 * PAGE_SIZE)
+#define SPI_AGGR_BUFFER_SIZE (4 * SZ_4K)
 
 /* Maximum number of SPI write chunks */
 #define WSPI_MAX_NUM_OF_CHUNKS \
-- 
2.9.0

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

* [PATCH 3.16-stable 13/14] net/xen-netback: disable on 64KB page granularity
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
                   ` (11 preceding siblings ...)
  2017-05-09 10:05 ` [PATCH 3.16-stable 12/14] wlcore: fix 64K page support Arnd Bergmann
@ 2017-05-09 10:05 ` Arnd Bergmann
  2017-05-09 10:05 ` [PATCH 3.16-stable 14/14] ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode Arnd Bergmann
  13 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:05 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable, Arnd Bergmann

Building the linux-3.16 stable branch, I ran into this warning that
shows a serious problem in the xen-netback driver:

drivers/net/xen-netback/netback.c: In function 'xenvif_dealloc_kthread':
drivers/net/xen-netback/netback.c:2002:1: error: the frame size of 16384 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

The bug was fixed in linux-4.4, but for any older stable kernel we
either need to backport that fix, or not use the driver when the page
size is set to 64KB. As the proper fix is way bigger than the usual limit
for stable backport patches, this adds a Kconfig dependency.

Fixes: d0089e8a0e4c ("net/xen-netback: Make it running on 64KB page granularity")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 3fdfe317a6c5..b7e2fb72578d 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -331,6 +331,9 @@ config XEN_NETDEV_FRONTEND
 config XEN_NETDEV_BACKEND
 	tristate "Xen backend network device"
 	depends on XEN_BACKEND
+	depends on !(PAGE_SIZE_64KB || ARM64_64K_PAGES || \
+		     IA64_PAGE_SIZE_64KB || MICROBLAZE_64K_PAGES || \
+		     PARISC_PAGE_SIZE_64KB || PPC_64K_PAGES)
 	help
 	  This driver allows the kernel to act as a Xen network driver
 	  domain which exports paravirtual network devices to other
-- 
2.9.0

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

* [PATCH 3.16-stable 14/14] ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode
  2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
                   ` (12 preceding siblings ...)
  2017-05-09 10:05 ` [PATCH 3.16-stable 13/14] net/xen-netback: disable on 64KB page granularity Arnd Bergmann
@ 2017-05-09 10:05 ` Arnd Bergmann
  13 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-05-09 10:05 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable, Ard Biesheuvel, Russell King, Arnd Bergmann

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Commit 5008efc83bf85b647aa1cbc44718b1675bbb7444 upstream.

The PJ4 inline asm sequence to write to cp15 cannot be built in Thumb-2
mode, due to the way it performs arithmetic on the program counter, so it
is built in ARM mode instead. However, building C files in ARM mode under
CONFIG_THUMB2_KERNEL is problematic, since the instrumentation performed
by subsystems like ftrace does not expect having to deal with interworking
branches.

Since the sequence in question is simply a poor man's ISB instruction,
let's use a straight 'isb' instead when building in Thumb2 mode. Thumb2
implies V7, so 'isb' should always be supported in that case.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/kernel/Makefile  | 1 -
 arch/arm/kernel/pj4-cp0.c | 4 ++++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 2ecc7d15bc09..03120e656aea 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -84,7 +84,6 @@ obj-$(CONFIG_CPU_PJ4B)		+= pj4-cp0.o
 obj-$(CONFIG_IWMMXT)		+= iwmmxt.o
 obj-$(CONFIG_PERF_EVENTS)	+= perf_regs.o
 obj-$(CONFIG_HW_PERF_EVENTS)	+= perf_event.o perf_event_cpu.o
-CFLAGS_pj4-cp0.o		:= -marm
 AFLAGS_iwmmxt.o			:= -Wa,-mcpu=iwmmxt
 obj-$(CONFIG_ARM_CPU_TOPOLOGY)  += topology.o
 
diff --git a/arch/arm/kernel/pj4-cp0.c b/arch/arm/kernel/pj4-cp0.c
index 8153e36b2491..7c9248b74d3f 100644
--- a/arch/arm/kernel/pj4-cp0.c
+++ b/arch/arm/kernel/pj4-cp0.c
@@ -66,9 +66,13 @@ static void __init pj4_cp_access_write(u32 value)
 
 	__asm__ __volatile__ (
 		"mcr	p15, 0, %1, c1, c0, 2\n\t"
+#ifdef CONFIG_THUMB2_KERNEL
+		"isb\n\t"
+#else
 		"mrc	p15, 0, %0, c1, c0, 2\n\t"
 		"mov	%0, %0\n\t"
 		"sub	pc, pc, #4\n\t"
+#endif
 		: "=r" (temp) : "r" (value));
 }
 
-- 
2.9.0

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

* Re: [PATCH 3.16-stable 04/14] MIPS: ip27: Disable mpt2sas driver in defconfig
  2017-05-09 10:04 ` [PATCH 3.16-stable 04/14] MIPS: ip27: Disable mpt2sas driver in defconfig Arnd Bergmann
@ 2017-11-06 19:26   ` Ben Hutchings
  2017-11-06 20:30     ` Arnd Bergmann
  0 siblings, 1 reply; 19+ messages in thread
From: Ben Hutchings @ 2017-11-06 19:26 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: stable

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

On Tue, 2017-05-09 at 12:04 +0200, Arnd Bergmann wrote:
> Similar to commit c64ebe32d3fc90c52277257d6c9fa7d589877cc2 upstream,
> this fixes one more 3.16 build failure in kernelci.org that results
> from a gcc bug:
> 
> drivers/scsi/mpt2sas/mpt2sas_base.c:3550:1: error: insn does not satisfy its constraints:
> drivers/scsi/mpt2sas/mpt2sas_base.c:3550:1: internal compiler error: in extract_constrain_insn, at recog.c:2190
> 
> This is apparently broken in gcc-6 but fixed in gcc-7, and I cannot
> reproduce the problem here. However, it is clear that ip27_defconfig
> does not actually need this driver as the platform has only PCI-X but
> not PCIe, and the qlge adapter in turn is PCIe-only.

Then wouldn't it make sense to apply this upstream too?

Ben.

> The driver was originally enabled in 2010 along with lots of other
> drivers.
> 
> Fixes: 59d302b342e5 ("MIPS: IP27: Make defconfig useful again.")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/mips/configs/ip27_defconfig | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
> index 7446284dd7b3..cb56ff8d0cdd 100644
> --- a/arch/mips/configs/ip27_defconfig
> +++ b/arch/mips/configs/ip27_defconfig
> @@ -129,7 +129,6 @@ CONFIG_SCSI_AIC94XX=m
>  CONFIG_SCSI_MVSAS=m
>  # CONFIG_SCSI_MVSAS_DEBUG is not set
>  CONFIG_SCSI_DPT_I2O=m
> -CONFIG_SCSI_MPT2SAS=m
>  CONFIG_LIBFC=m
>  CONFIG_SCSI_QLOGIC_1280=y
>  CONFIG_SCSI_PMCRAID=m
-- 
Ben Hutchings
It is a miracle that curiosity survives formal education. - Albert
Einstein


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

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

* Re: [PATCH 3.16-stable 08/14] gfs2: remove IS_ERR_VALUE abuse
  2017-05-09 10:04 ` [PATCH 3.16-stable 08/14] gfs2: remove IS_ERR_VALUE abuse Arnd Bergmann
@ 2017-11-06 19:46   ` Ben Hutchings
  0 siblings, 0 replies; 19+ messages in thread
From: Ben Hutchings @ 2017-11-06 19:46 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: stable

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

On Tue, 2017-05-09 at 12:04 +0200, Arnd Bergmann wrote:
> Picked from commit 287980e49ffc0f6d911601e7e352a812ed27768e ("remove lots
> of IS_ERR_VALUE abuses") upstream.
> 
> The original fix that was backported to 3.18 already addressed the warning
> in some configurations, but not in others, leaving us with the same output:
> 
> ../fs/gfs2/dir.c: In function 'get_first_leaf':
> ../fs/gfs2/dir.c:768:9: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]
>    error = get_leaf(dip, leaf_no, bh_out);
>          ^
> ../fs/gfs2/dir.c: In function 'dir_split_leaf.isra.20':
> ../fs/gfs2/dir.c:987:8: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]
> 
> This takes the approach that we took in later versions in mainline,
> but does not backport the entire patch, as that would be too large
> for stable and IIRC caused regressions in other drivers.
> 
> Fixes: 9d46d31e9aea ("gfs2: avoid uninitialized variable warning")

In fact, it reverts it completely.  So I've dropped both of these.

Ben.

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  fs/gfs2/dir.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
> index 6810c8772eb1..f3508f4583d5 100644
> --- a/fs/gfs2/dir.c
> +++ b/fs/gfs2/dir.c
> @@ -767,7 +767,7 @@ static int get_first_leaf(struct gfs2_inode *dip, u32 index,
>  	int error;
>  
>  	error = get_leaf_nr(dip, index, &leaf_no);
> -	if (!IS_ERR_VALUE(error))
> +	if (!error)
>  		error = get_leaf(dip, leaf_no, bh_out);
>  
>  	return error;
> @@ -983,7 +983,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name)
>  
>  	index = name->hash >> (32 - dip->i_depth);
>  	error = get_leaf_nr(dip, index, &leaf_no);
> -	if (IS_ERR_VALUE(error))
> +	if (error)
>  		return error;
>  
>  	/*  Get the old leaf block  */
-- 
Ben Hutchings
It is a miracle that curiosity survives formal education. - Albert
Einstein


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

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

* Re: [PATCH 3.16-stable 12/14] wlcore: fix 64K page support
  2017-05-09 10:05 ` [PATCH 3.16-stable 12/14] wlcore: fix 64K page support Arnd Bergmann
@ 2017-11-06 19:52   ` Ben Hutchings
  0 siblings, 0 replies; 19+ messages in thread
From: Ben Hutchings @ 2017-11-06 19:52 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: stable

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

On Tue, 2017-05-09 at 12:05 +0200, Arnd Bergmann wrote:
> In the stable linux-3.16 branch, I ran into a warning in the
> wlcore driver:
> 
> drivers/net/wireless/ti/wlcore/spi.c: In function 'wl12xx_spi_raw_write':
> drivers/net/wireless/ti/wlcore/spi.c:315:1: error: the frame size of 12848 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
> 
> Newer kernels no longer show the warning, but the bug is still there,
> as the allocation is based on the CPU page size rather than the
> actual capabilities of the hardware.
> 
> This replaces the PAGE_SIZE macro with the SZ_4K macro, i.e. 4096 bytes
> per buffer.

I replaced this with the upstream version (commit
4a4274bf2dbbd1c7a45be0c89a1687c9d2eef4a0).

Ben.

> Cc: stable@vger.kernel.org
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/net/wireless/ti/wlcore/spi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
> index a460fe669443..48559a5baffa 100644
> --- a/drivers/net/wireless/ti/wlcore/spi.c
> +++ b/drivers/net/wireless/ti/wlcore/spi.c
> @@ -71,7 +71,7 @@
>   * only support SPI for 12xx - this code should be reworked when 18xx
>   * support is introduced
>   */
> -#define SPI_AGGR_BUFFER_SIZE (4 * PAGE_SIZE)
> +#define SPI_AGGR_BUFFER_SIZE (4 * SZ_4K)
>  
>  /* Maximum number of SPI write chunks */
>  #define WSPI_MAX_NUM_OF_CHUNKS \
-- 
Ben Hutchings
It is a miracle that curiosity survives formal education. - Albert
Einstein

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

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

* Re: [PATCH 3.16-stable 04/14] MIPS: ip27: Disable mpt2sas driver in defconfig
  2017-11-06 19:26   ` Ben Hutchings
@ 2017-11-06 20:30     ` Arnd Bergmann
  0 siblings, 0 replies; 19+ messages in thread
From: Arnd Bergmann @ 2017-11-06 20:30 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: # 3.4.x

On Mon, Nov 6, 2017 at 8:26 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> On Tue, 2017-05-09 at 12:04 +0200, Arnd Bergmann wrote:
>> Similar to commit c64ebe32d3fc90c52277257d6c9fa7d589877cc2 upstream,
>> this fixes one more 3.16 build failure in kernelci.org that results
>> from a gcc bug:
>>
>> drivers/scsi/mpt2sas/mpt2sas_base.c:3550:1: error: insn does not satisfy its constraints:
>> drivers/scsi/mpt2sas/mpt2sas_base.c:3550:1: internal compiler error: in extract_constrain_insn, at recog.c:2190
>>
>> This is apparently broken in gcc-6 but fixed in gcc-7, and I cannot
>> reproduce the problem here. However, it is clear that ip27_defconfig
>> does not actually need this driver as the platform has only PCI-X but
>> not PCIe, and the qlge adapter in turn is PCIe-only.
>
> Then wouldn't it make sense to apply this upstream too?

I don't think it matters much either way, it's only about building an
unused module on
a platform that probably nobody cares about. If you prefer to create a patch and
send that upstream before backporting it, feel free to add my Reported-by and
Acked-by tags.

      Arnd

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

end of thread, other threads:[~2017-11-06 20:30 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 10:04 Follow-up patches for 3.16-stable Arnd Bergmann
2017-05-09 10:04 ` [PATCH 3.16-stable 01/14] staging: r8192ee: prorperly format warning message Arnd Bergmann
2017-05-09 10:04 ` [PATCH 3.16-stable 02/14] mtd: cfi: reduce stack size Arnd Bergmann
2017-05-09 10:04 ` [PATCH 3.16-stable 03/14] drbd: avoid redefinition of BITS_PER_PAGE Arnd Bergmann
2017-05-09 10:04 ` [PATCH 3.16-stable 04/14] MIPS: ip27: Disable mpt2sas driver in defconfig Arnd Bergmann
2017-11-06 19:26   ` Ben Hutchings
2017-11-06 20:30     ` Arnd Bergmann
2017-05-09 10:04 ` [PATCH 3.16-stable 05/14] perf: Avoid horrible stack usage Arnd Bergmann
2017-05-09 10:04 ` [PATCH 3.16-stable 06/14] MIPS: jz4740: fix build error in irq.h Arnd Bergmann
2017-05-09 10:04 ` [PATCH 3.16-stable 07/14] MIPS: elf2ecoff: Ignore PT_MIPS_ABIFLAGS program headers Arnd Bergmann
2017-05-09 10:04 ` [PATCH 3.16-stable 08/14] gfs2: remove IS_ERR_VALUE abuse Arnd Bergmann
2017-11-06 19:46   ` Ben Hutchings
2017-05-09 10:04 ` [PATCH 3.16-stable 09/14] net: ti: cpmac: Fix compiler warning due to type confusion Arnd Bergmann
2017-05-09 10:04 ` [PATCH 3.16-stable 10/14] e1000e: fix call to do_div() to use u64 arg Arnd Bergmann
2017-05-09 10:04 ` [PATCH 3.16-stable 11/14] MIPS: Fix a warning for virt_to_page Arnd Bergmann
2017-05-09 10:05 ` [PATCH 3.16-stable 12/14] wlcore: fix 64K page support Arnd Bergmann
2017-11-06 19:52   ` Ben Hutchings
2017-05-09 10:05 ` [PATCH 3.16-stable 13/14] net/xen-netback: disable on 64KB page granularity Arnd Bergmann
2017-05-09 10:05 ` [PATCH 3.16-stable 14/14] ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode Arnd Bergmann

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.