From 30459ff41064318ab2931ffe24e7994884b46a6f Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Mon, 11 Jul 2016 17:03:04 +0200 Subject: linux-qoriq: Upgrade to v4.1 Drop patches that are already in mainline. Signed-off-by: Adrian Dudau --- ...x-oops-in-fsnotify_clear_marks_by_group_f.patch | 80 ---------------------- ...pc-fix-compat-msgrcv-with-negative-msgtyp.patch | 27 -------- ...erpc-Fix-64-bit-builds-with-binutils-2.24.patch | 80 ---------------------- ...werpc-fsl-booke64-Set-vmemmap_psize-to-4K.patch | 19 ----- recipes-kernel/linux/linux-qoriq-common.inc | 2 - recipes-kernel/linux/linux-qoriq_3.12.bbappend | 3 - recipes-kernel/linux/linux-qoriq_4.1.bbappend | 1 + 7 files changed, 1 insertion(+), 211 deletions(-) delete mode 100644 recipes-kernel/linux/files/0001-fsnotify-fix-oops-in-fsnotify_clear_marks_by_group_f.patch delete mode 100644 recipes-kernel/linux/files/Trusty-SRU-ipc-fix-compat-msgrcv-with-negative-msgtyp.patch delete mode 100644 recipes-kernel/linux/files/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch delete mode 100644 recipes-kernel/linux/files/powerpc-fsl-booke64-Set-vmemmap_psize-to-4K.patch delete mode 100644 recipes-kernel/linux/linux-qoriq_3.12.bbappend create mode 100644 recipes-kernel/linux/linux-qoriq_4.1.bbappend diff --git a/recipes-kernel/linux/files/0001-fsnotify-fix-oops-in-fsnotify_clear_marks_by_group_f.patch b/recipes-kernel/linux/files/0001-fsnotify-fix-oops-in-fsnotify_clear_marks_by_group_f.patch deleted file mode 100644 index 250c8db..0000000 --- a/recipes-kernel/linux/files/0001-fsnotify-fix-oops-in-fsnotify_clear_marks_by_group_f.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 8f2f3eb59dff4ec538de55f2e0592fec85966aab Mon Sep 17 00:00:00 2001 -From: Jan Kara -Date: Thu, 6 Aug 2015 15:46:42 -0700 -Subject: [PATCH] fsnotify: fix oops in fsnotify_clear_marks_by_group_flags() - -fsnotify_clear_marks_by_group_flags() can race with -fsnotify_destroy_marks() so that when fsnotify_destroy_mark_locked() -drops mark_mutex, a mark from the list iterated by -fsnotify_clear_marks_by_group_flags() can be freed and thus the next -entry pointer we have cached may become stale and we dereference free -memory. - -Fix the problem by first moving marks to free to a special private list -and then always free the first entry in the special list. This method -is safe even when entries from the list can disappear once we drop the -lock. - -Upstream-Status: Backported - -Signed-off-by: Jan Kara -Reported-by: Ashish Sangwan -Reviewed-by: Ashish Sangwan -Cc: Lino Sanfilippo -Cc: -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Adrian Dudau ---- - fs/notify/mark.c | 30 +++++++++++++++++++++++++----- - 1 file changed, 25 insertions(+), 5 deletions(-) - -diff --git a/fs/notify/mark.c b/fs/notify/mark.c -index 92e48c7..39ddcaf 100644 ---- a/fs/notify/mark.c -+++ b/fs/notify/mark.c -@@ -412,16 +412,36 @@ void fsnotify_clear_marks_by_group_flags(struct fsnotify_group *group, - unsigned int flags) - { - struct fsnotify_mark *lmark, *mark; -+ LIST_HEAD(to_free); - -+ /* -+ * We have to be really careful here. Anytime we drop mark_mutex, e.g. -+ * fsnotify_clear_marks_by_inode() can come and free marks. Even in our -+ * to_free list so we have to use mark_mutex even when accessing that -+ * list. And freeing mark requires us to drop mark_mutex. So we can -+ * reliably free only the first mark in the list. That's why we first -+ * move marks to free to to_free list in one go and then free marks in -+ * to_free list one by one. -+ */ - mutex_lock_nested(&group->mark_mutex, SINGLE_DEPTH_NESTING); - list_for_each_entry_safe(mark, lmark, &group->marks_list, g_list) { -- if (mark->flags & flags) { -- fsnotify_get_mark(mark); -- fsnotify_destroy_mark_locked(mark, group); -- fsnotify_put_mark(mark); -- } -+ if (mark->flags & flags) -+ list_move(&mark->g_list, &to_free); - } - mutex_unlock(&group->mark_mutex); -+ -+ while (1) { -+ mutex_lock_nested(&group->mark_mutex, SINGLE_DEPTH_NESTING); -+ if (list_empty(&to_free)) { -+ mutex_unlock(&group->mark_mutex); -+ break; -+ } -+ mark = list_first_entry(&to_free, struct fsnotify_mark, g_list); -+ fsnotify_get_mark(mark); -+ fsnotify_destroy_mark_locked(mark, group); -+ mutex_unlock(&group->mark_mutex); -+ fsnotify_put_mark(mark); -+ } - } - - /* --- -1.9.1 - diff --git a/recipes-kernel/linux/files/Trusty-SRU-ipc-fix-compat-msgrcv-with-negative-msgtyp.patch b/recipes-kernel/linux/files/Trusty-SRU-ipc-fix-compat-msgrcv-with-negative-msgtyp.patch deleted file mode 100644 index b90a114..0000000 --- a/recipes-kernel/linux/files/Trusty-SRU-ipc-fix-compat-msgrcv-with-negative-msgtyp.patch +++ /dev/null @@ -1,27 +0,0 @@ -BugLink: http://bugs.launchpad.net/bugs/1393355 - -Compat function takes msgtyp argument as u32 and passes it down to -do_msgrcv which results in casting to long, thus the sign is lost and we -get a big positive number instead. - -Cast the argument to signed type before passing it down. - -Signed-off-by: Mateusz Guzik -Reported-by: Gabriellla Schmidt - -Upstream-Status::Backport -Kernel 3.14 - -diff --git a/ipc/compat.c b/ipc/compat.c -index 892f658..d3b3760 100644 ---- a/ipc/compat.c -+++ b/ipc/compat.c -@@ -381,7 +381,7 @@ COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second, - uptr = compat_ptr(ipck.msgp); - fifth = ipck.msgtyp; - } -- return do_msgrcv(first, uptr, second, fifth, third, -+ return do_msgrcv(first, uptr, second, (s32)fifth, third, - compat_do_msg_fill); - } - case MSGGET: diff --git a/recipes-kernel/linux/files/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch b/recipes-kernel/linux/files/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch deleted file mode 100644 index 2fdcc9f..0000000 --- a/recipes-kernel/linux/files/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 7998eb3dc700aaf499f93f50b3d77da834ef9e1d Mon Sep 17 00:00:00 2001 -From: Guenter Roeck -Date: Thu, 15 May 2014 09:33:42 -0700 -Subject: powerpc: Fix 64 bit builds with binutils 2.24 - -Upstream-Status: Backport - -With binutils 2.24, various 64 bit builds fail with relocation errors -such as - -arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e': - (.text+0x165ee): relocation truncated to fit: R_PPC64_ADDR16_HI - against symbol `interrupt_base_book3e' defined in .text section - in arch/powerpc/kernel/built-in.o -arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e': - (.text+0x16602): relocation truncated to fit: R_PPC64_ADDR16_HI - against symbol `interrupt_end_book3e' defined in .text section - in arch/powerpc/kernel/built-in.o - -The assembler maintainer says: - - I changed the ABI, something that had to be done but unfortunately - happens to break the booke kernel code. When building up a 64-bit - value with lis, ori, shl, oris, ori or similar sequences, you now - should use @high and @higha in place of @h and @ha. @h and @ha - (and their associated relocs R_PPC64_ADDR16_HI and R_PPC64_ADDR16_HA) - now report overflow if the value is out of 32-bit signed range. - ie. @h and @ha assume you're building a 32-bit value. This is needed - to report out-of-range -mcmodel=medium toc pointer offsets in @toc@h - and @toc@ha expressions, and for consistency I did the same for all - other @h and @ha relocs. - -Replacing @h with @high in one strategic location fixes the relocation -errors. This has to be done conditionally since the assembler either -supports @h or @high but not both. - -Cc: -Signed-off-by: Guenter Roeck -Signed-off-by: Benjamin Herrenschmidt - -diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile -index 4c0cedf..ce4c68a 100644 ---- a/arch/powerpc/Makefile -+++ b/arch/powerpc/Makefile -@@ -150,7 +150,9 @@ endif - - CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell) - --KBUILD_CPPFLAGS += -Iarch/$(ARCH) -+asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1) -+ -+KBUILD_CPPFLAGS += -Iarch/$(ARCH) $(asinstr) - KBUILD_AFLAGS += -Iarch/$(ARCH) - KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) - CPP = $(CC) -E $(KBUILD_CFLAGS) -diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h -index 6586a40..cded7c1 100644 ---- a/arch/powerpc/include/asm/ppc_asm.h -+++ b/arch/powerpc/include/asm/ppc_asm.h -@@ -318,11 +318,16 @@ n: - addi reg,reg,(name - 0b)@l; - - #ifdef __powerpc64__ -+#ifdef HAVE_AS_ATHIGH -+#define __AS_ATHIGH high -+#else -+#define __AS_ATHIGH h -+#endif - #define LOAD_REG_IMMEDIATE(reg,expr) \ - lis reg,(expr)@highest; \ - ori reg,reg,(expr)@higher; \ - rldicr reg,reg,32,31; \ -- oris reg,reg,(expr)@h; \ -+ oris reg,reg,(expr)@__AS_ATHIGH; \ - ori reg,reg,(expr)@l; - - #define LOAD_REG_ADDR(reg,name) \ --- -cgit v0.10.1 - diff --git a/recipes-kernel/linux/files/powerpc-fsl-booke64-Set-vmemmap_psize-to-4K.patch b/recipes-kernel/linux/files/powerpc-fsl-booke64-Set-vmemmap_psize-to-4K.patch deleted file mode 100644 index 5acf97a..0000000 --- a/recipes-kernel/linux/files/powerpc-fsl-booke64-Set-vmemmap_psize-to-4K.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c -index ae3d5b7..92cb18d 100644 ---- a/arch/powerpc/mm/tlb_nohash.c -+++ b/arch/powerpc/mm/tlb_nohash.c -@@ -596,8 +596,13 @@ static void __early_init_mmu(int boot_cpu) - /* XXX This should be decided at runtime based on supported - * page sizes in the TLB, but for now let's assume 16M is - * always there and a good fit (which it probably is) -+ * -+ * Freescale booke only supports 4K pages in TLB0, so use that. - */ -- mmu_vmemmap_psize = MMU_PAGE_16M; -+ if (mmu_has_feature(MMU_FTR_TYPE_FSL_E)) -+ mmu_vmemmap_psize = MMU_PAGE_4K; -+ else -+ mmu_vmemmap_psize = MMU_PAGE_16M; - - /* XXX This code only checks for TLB 0 capabilities and doesn't - * check what page size combos are supported by the HW. It diff --git a/recipes-kernel/linux/linux-qoriq-common.inc b/recipes-kernel/linux/linux-qoriq-common.inc index d6f0565..d46272e 100644 --- a/recipes-kernel/linux/linux-qoriq-common.inc +++ b/recipes-kernel/linux/linux-qoriq-common.inc @@ -4,8 +4,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI += "file://b4860-hard_irq_disable-bug.patch \ file://0001-sdhci-fix-Timeout-error-messages.patch \ - file://powerpc-fsl-booke64-Set-vmemmap_psize-to-4K.patch \ - file://0001-fsnotify-fix-oops-in-fsnotify_clear_marks_by_group_f.patch \ " ENEA_KERNEL_FRAGMENTS += "\ diff --git a/recipes-kernel/linux/linux-qoriq_3.12.bbappend b/recipes-kernel/linux/linux-qoriq_3.12.bbappend deleted file mode 100644 index bd21278..0000000 --- a/recipes-kernel/linux/linux-qoriq_3.12.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -require recipes-kernel/linux/linux-qoriq-common.inc -SRC_URI += "file://Trusty-SRU-ipc-fix-compat-msgrcv-with-negative-msgtyp.patch \ - " diff --git a/recipes-kernel/linux/linux-qoriq_4.1.bbappend b/recipes-kernel/linux/linux-qoriq_4.1.bbappend new file mode 100644 index 0000000..f9311e9 --- /dev/null +++ b/recipes-kernel/linux/linux-qoriq_4.1.bbappend @@ -0,0 +1 @@ +require recipes-kernel/linux/linux-qoriq-common.inc -- cgit v1.2.3-54-g00ecf