diff --git a/kernel/kernel/files/patches/linux/patch-4.3.2.xz b/kernel/kernel/files/patches/linux/patch-4.3.2.xz deleted file mode 100644 index 32f9f186..00000000 Binary files a/kernel/kernel/files/patches/linux/patch-4.3.2.xz and /dev/null differ diff --git a/kernel/kernel/files/patches/linux/patch-4.4.1.xz b/kernel/kernel/files/patches/linux/patch-4.4.1.xz deleted file mode 100644 index 7a414d5b..00000000 Binary files a/kernel/kernel/files/patches/linux/patch-4.4.1.xz and /dev/null differ diff --git a/kernel/kernel/files/patches/linux/patch-4.4.2.xz b/kernel/kernel/files/patches/linux/patch-4.4.2.xz deleted file mode 100644 index b2133065..00000000 Binary files a/kernel/kernel/files/patches/linux/patch-4.4.2.xz and /dev/null differ diff --git a/kernel/kernel/files/patches/linux/patch-4.4.4.xz b/kernel/kernel/files/patches/linux/patch-4.4.4.xz deleted file mode 100644 index f8dad414..00000000 Binary files a/kernel/kernel/files/patches/linux/patch-4.4.4.xz and /dev/null differ diff --git a/kernel/kernel/files/patches/linux/patch-4.4.8.xz b/kernel/kernel/files/patches/linux/patch-4.4.8.xz deleted file mode 100644 index 95b5d264..00000000 Binary files a/kernel/kernel/files/patches/linux/patch-4.4.8.xz and /dev/null differ diff --git a/kernel/kernel/files/patches/linux/patch-4.6.3.xz b/kernel/kernel/files/patches/linux/patch-4.6.3.xz deleted file mode 100644 index ea360870..00000000 Binary files a/kernel/kernel/files/patches/linux/patch-4.6.3.xz and /dev/null differ diff --git a/kernel/kernel/files/patches/linux/patch-4.8.6.xz b/kernel/kernel/files/patches/linux/patch-4.8.6.xz new file mode 100644 index 00000000..0438de2b Binary files /dev/null and b/kernel/kernel/files/patches/linux/patch-4.8.6.xz differ diff --git a/kernel/kernel/files/patches/mageia/dm-raid-fix-compat_features-validation.patch b/kernel/kernel/files/patches/mageia/dm-raid-fix-compat_features-validation.patch new file mode 100644 index 00000000..f2261039 --- /dev/null +++ b/kernel/kernel/files/patches/mageia/dm-raid-fix-compat_features-validation.patch @@ -0,0 +1,39 @@ +From 5c33677c87cbe44ae04df69c4a29c1750a9ec4e5 Mon Sep 17 00:00:00 2001 +From: Andy Whitcroft +Date: Tue, 11 Oct 2016 15:16:57 +0100 +Subject: [PATCH] dm raid: fix compat_features validation + +In ecbfb9f118bce4 ("dm raid: add raid level takeover support") a new +compatible feature flag was added. Validation for these compat_features +was added but this only passes for new raid mappings with this feature +flag. This causes previously created raid mappings to be failed at +import. + +Check compat_features for the only valid combination. + +Fixes: ecbfb9f118bce4 ("dm raid: add raid level takeover support") +Cc: stable@vger.kernel.org # v4.8 +Signed-off-by: Andy Whitcroft +Signed-off-by: Heinz Mauelshagen +Signed-off-by: Mike Snitzer +--- + drivers/md/dm-raid.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c +index 8abde6b..2a39700 100644 +--- a/drivers/md/dm-raid.c ++++ b/drivers/md/dm-raid.c +@@ -2258,7 +2258,8 @@ static int super_validate(struct raid_set *rs, struct md_rdev *rdev) + if (!mddev->events && super_init_validation(rs, rdev)) + return -EINVAL; + +- if (le32_to_cpu(sb->compat_features) != FEATURE_FLAG_SUPPORTS_V190) { ++ if (le32_to_cpu(sb->compat_features) && ++ le32_to_cpu(sb->compat_features) != FEATURE_FLAG_SUPPORTS_V190) { + rs->ti->error = "Unable to assemble array: Unknown flag(s) in compatible feature flags"; + return -EINVAL; + } +-- +2.10.1 + diff --git a/kernel/kernel/files/patches/mageia/drm-i915-gen9-fix-DDB-partitioning-for-multi-screen-cases.patch b/kernel/kernel/files/patches/mageia/drm-i915-gen9-fix-DDB-partitioning-for-multi-screen-cases.patch deleted file mode 100644 index d91513c1..00000000 --- a/kernel/kernel/files/patches/mageia/drm-i915-gen9-fix-DDB-partitioning-for-multi-screen-cases.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c -index 425544b..0c2e252 100644 ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -3362,13 +3362,15 @@ skl_allocate_pipe_ddb(struct intel_crtc_state *cstate, - int num_active; - int id, i; - -+ /* Clear the partitioning for disabled planes. */ -+ memset(ddb->plane[pipe], 0, sizeof(ddb->plane[pipe])); -+ memset(ddb->y_plane[pipe], 0, sizeof(ddb->y_plane[pipe])); -+ - if (WARN_ON(!state)) - return 0; - - if (!cstate->base.active) { - ddb->pipe[pipe].start = ddb->pipe[pipe].end = 0; -- memset(ddb->plane[pipe], 0, sizeof(ddb->plane[pipe])); -- memset(ddb->y_plane[pipe], 0, sizeof(ddb->y_plane[pipe])); - return 0; - } - -@@ -4054,6 +4056,12 @@ skl_compute_ddb(struct drm_atomic_state *state) - intel_state->wm_results.dirty_pipes = ~0; - } - -+ /* -+ * We're not recomputing for the pipes not included in the commit, so -+ * make sure we start with the current state. -+ */ -+ memcpy(ddb, &dev_priv->wm.skl_hw.ddb, sizeof(*ddb)); -+ - for_each_intel_crtc_mask(dev, intel_crtc, realloc_pipes) { - struct intel_crtc_state *cstate; - diff --git a/kernel/kernel/files/patches/mageia/fs-aufs-4.7-ver-fix.patch b/kernel/kernel/files/patches/mageia/fs-aufs-4.7-ver-fix.patch deleted file mode 100644 index 7ffd27e4..00000000 --- a/kernel/kernel/files/patches/mageia/fs-aufs-4.7-ver-fix.patch +++ /dev/null @@ -1,16 +0,0 @@ - -Mark as 4.7 so we can rebuild aufs tools with matching 4.7 check - -Signed-off-by: Thomas Backlund - ---- linux/include/uapi/linux/aufs_type.h.orig -+++ linux/include/uapi/linux/aufs_type.h -@@ -26,7 +26,7 @@ - - #include - --#define AUFS_VERSION "4.x-rcN" -+#define AUFS_VERSION "4.7" - - /* todo? move this to linux-2.6.19/include/magic.h */ - #define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') diff --git a/kernel/kernel/files/patches/mageia/fs-aufs-4.7-modular.patch b/kernel/kernel/files/patches/mageia/fs-aufs-4.8-modular.patch similarity index 71% rename from kernel/kernel/files/patches/mageia/fs-aufs-4.7-modular.patch rename to kernel/kernel/files/patches/mageia/fs-aufs-4.8-modular.patch index faedd6af..62a3b4f0 100644 --- a/kernel/kernel/files/patches/mageia/fs-aufs-4.7-modular.patch +++ b/kernel/kernel/files/patches/mageia/fs-aufs-4.8-modular.patch @@ -18,9 +18,9 @@ security/security.c | 10 ++++++++++ 17 files changed, 41 insertions(+), 1 deletion(-) -diff -Nurp linux-4.7-rc6-aufs/fs/aufs/Kconfig linux-4.7-rc6-aufs-mod/fs/aufs/Kconfig ---- linux-4.7-rc6-aufs/fs/aufs/Kconfig 2016-07-04 19:02:29.246286120 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/aufs/Kconfig 2016-07-04 19:03:53.653714965 +0300 +diff -Nurp linux-4.8-aufs/fs/aufs/Kconfig linux-4.8-aufs-mod/fs/aufs/Kconfig +--- linux-4.8-aufs/fs/aufs/Kconfig 2016-07-04 19:02:29.246286120 +0300 ++++ linux-4.8-aufs-mod/fs/aufs/Kconfig 2016-07-04 19:03:53.653714965 +0300 @@ -1,5 +1,5 @@ config AUFS_FS - bool "Aufs (Advanced multi layered unification filesystem) support" @@ -28,9 +28,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/aufs/Kconfig linux-4.7-rc6-aufs-mod/fs/aufs/Kco help Aufs is a stackable unification filesystem such as Unionfs, which unifies several directories and provides a merged single -diff -Nurp linux-4.7-rc6-aufs/fs/dcache.c linux-4.7-rc6-aufs-mod/fs/dcache.c ---- linux-4.7-rc6-aufs/fs/dcache.c 2016-07-04 19:02:29.260286196 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/dcache.c 2016-07-04 19:03:53.653714965 +0300 +diff -Nurp linux-4.8-aufs/fs/dcache.c linux-4.8-aufs-mod/fs/dcache.c +--- linux-4.8-aufs/fs/dcache.c 2016-07-04 19:02:29.260286196 +0300 ++++ linux-4.8-aufs-mod/fs/dcache.c 2016-07-04 19:03:53.653714965 +0300 @@ -1310,6 +1310,7 @@ rename_retry: seq = 1; goto again; @@ -39,9 +39,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/dcache.c linux-4.7-rc6-aufs-mod/fs/dcache.c /* * Search for at least 1 mount point in the dentry's subdirs. -diff -Nurp linux-4.7-rc6-aufs/fs/exec.c linux-4.7-rc6-aufs-mod/fs/exec.c ---- linux-4.7-rc6-aufs/fs/exec.c 2016-07-04 17:58:15.707773651 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/exec.c 2016-07-04 19:03:53.654714970 +0300 +diff -Nurp linux-4.8-aufs/fs/exec.c linux-4.8-aufs-mod/fs/exec.c +--- linux-4.8-aufs/fs/exec.c 2016-07-04 17:58:15.707773651 +0300 ++++ linux-4.8-aufs-mod/fs/exec.c 2016-07-04 19:03:53.654714970 +0300 @@ -104,6 +104,7 @@ bool path_noexec(const struct path *path return (path->mnt->mnt_flags & MNT_NOEXEC) || (path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC); @@ -50,9 +50,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/exec.c linux-4.7-rc6-aufs-mod/fs/exec.c #ifdef CONFIG_USELIB /* -diff -Nurp linux-4.7-rc6-aufs/fs/fcntl.c linux-4.7-rc6-aufs-mod/fs/fcntl.c ---- linux-4.7-rc6-aufs/fs/fcntl.c 2016-07-04 19:02:29.260286196 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/fcntl.c 2016-07-04 19:03:53.654714970 +0300 +diff -Nurp linux-4.8-aufs/fs/fcntl.c linux-4.8-aufs-mod/fs/fcntl.c +--- linux-4.8-aufs/fs/fcntl.c 2016-07-04 19:02:29.260286196 +0300 ++++ linux-4.8-aufs-mod/fs/fcntl.c 2016-07-04 19:03:53.654714970 +0300 @@ -82,6 +82,7 @@ int setfl(int fd, struct file * filp, un out: return error; @@ -61,9 +61,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/fcntl.c linux-4.7-rc6-aufs-mod/fs/fcntl.c static void f_modown(struct file *filp, struct pid *pid, enum pid_type type, int force) -diff -Nurp linux-4.7-rc6-aufs/fs/file_table.c linux-4.7-rc6-aufs-mod/fs/file_table.c ---- linux-4.7-rc6-aufs/fs/file_table.c 2016-05-16 01:43:13.000000000 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/file_table.c 2016-07-04 19:03:53.654714970 +0300 +diff -Nurp linux-4.8-aufs/fs/file_table.c linux-4.8-aufs-mod/fs/file_table.c +--- linux-4.8-aufs/fs/file_table.c 2016-05-16 01:43:13.000000000 +0300 ++++ linux-4.8-aufs-mod/fs/file_table.c 2016-07-04 19:03:53.654714970 +0300 @@ -147,6 +147,7 @@ over: } return ERR_PTR(-ENFILE); @@ -96,9 +96,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/file_table.c linux-4.7-rc6-aufs-mod/fs/file_tab void __init files_init(void) { -diff -Nurp linux-4.7-rc6-aufs/fs/inode.c linux-4.7-rc6-aufs-mod/fs/inode.c ---- linux-4.7-rc6-aufs/fs/inode.c 2016-07-04 19:02:29.261286202 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/inode.c 2016-07-04 20:51:39.805168596 +0300 +diff -Nurp linux-4.8-aufs/fs/inode.c linux-4.8-aufs-mod/fs/inode.c +--- linux-4.8-aufs/fs/inode.c 2016-07-04 19:02:29.261286202 +0300 ++++ linux-4.8-aufs-mod/fs/inode.c 2016-07-04 20:51:39.805168596 +0300 @@ -1600,6 +1600,7 @@ int update_time(struct inode *inode, str return update_time(inode, time, flags); @@ -107,9 +107,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/inode.c linux-4.7-rc6-aufs-mod/fs/inode.c /** * touch_atime - update the access time -diff -Nurp linux-4.7-rc6-aufs/fs/namespace.c linux-4.7-rc6-aufs-mod/fs/namespace.c ---- linux-4.7-rc6-aufs/fs/namespace.c 2016-07-04 17:58:15.729773645 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/namespace.c 2016-07-04 19:03:53.654714970 +0300 +diff -Nurp linux-4.8-aufs/fs/namespace.c linux-4.8-aufs-mod/fs/namespace.c +--- linux-4.8-aufs/fs/namespace.c 2016-07-04 17:58:15.729773645 +0300 ++++ linux-4.8-aufs-mod/fs/namespace.c 2016-07-04 19:03:53.654714970 +0300 @@ -463,6 +463,7 @@ void __mnt_drop_write(struct vfsmount *m mnt_dec_writers(real_mount(mnt)); preempt_enable(); @@ -126,9 +126,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/namespace.c linux-4.7-rc6-aufs-mod/fs/namespace static void cleanup_group_ids(struct mount *mnt, struct mount *end) { -diff -Nurp linux-4.7-rc6-aufs/fs/notify/group.c linux-4.7-rc6-aufs-mod/fs/notify/group.c ---- linux-4.7-rc6-aufs/fs/notify/group.c 2016-07-04 17:58:15.742773641 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/notify/group.c 2016-07-04 19:03:53.655714975 +0300 +diff -Nurp linux-4.8-aufs/fs/notify/group.c linux-4.8-aufs-mod/fs/notify/group.c +--- linux-4.8-aufs/fs/notify/group.c 2016-07-04 17:58:15.742773641 +0300 ++++ linux-4.8-aufs-mod/fs/notify/group.c 2016-07-04 19:03:53.655714975 +0300 @@ -22,6 +22,7 @@ #include #include @@ -161,9 +161,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/notify/group.c linux-4.7-rc6-aufs-mod/fs/notify int fsnotify_fasync(int fd, struct file *file, int on) { -diff -Nurp linux-4.7-rc6-aufs/fs/notify/mark.c linux-4.7-rc6-aufs-mod/fs/notify/mark.c ---- linux-4.7-rc6-aufs/fs/notify/mark.c 2016-07-04 17:58:15.742773641 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/notify/mark.c 2016-07-04 19:03:53.655714975 +0300 +diff -Nurp linux-4.8-aufs/fs/notify/mark.c linux-4.8-aufs-mod/fs/notify/mark.c +--- linux-4.8-aufs/fs/notify/mark.c 2016-07-04 17:58:15.742773641 +0300 ++++ linux-4.8-aufs-mod/fs/notify/mark.c 2016-07-04 19:03:53.655714975 +0300 @@ -113,6 +113,7 @@ void fsnotify_put_mark(struct fsnotify_m mark->free_mark(mark); } @@ -196,9 +196,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/notify/mark.c linux-4.7-rc6-aufs-mod/fs/notify/ /* * Nothing fancy, just initialize lists and locks and counters. -diff -Nurp linux-4.7-rc6-aufs/fs/open.c linux-4.7-rc6-aufs-mod/fs/open.c ---- linux-4.7-rc6-aufs/fs/open.c 2016-07-04 17:58:15.746773640 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/open.c 2016-07-04 19:03:53.655714975 +0300 +diff -Nurp linux-4.8-aufs/fs/open.c linux-4.8-aufs-mod/fs/open.c +--- linux-4.8-aufs/fs/open.c 2016-07-04 17:58:15.746773640 +0300 ++++ linux-4.8-aufs-mod/fs/open.c 2016-07-04 19:03:53.655714975 +0300 @@ -64,6 +64,7 @@ int do_truncate(struct dentry *dentry, l inode_unlock(dentry->d_inode); return ret; @@ -215,9 +215,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/open.c linux-4.7-rc6-aufs-mod/fs/open.c static int do_dentry_open(struct file *f, struct inode *inode, -diff -Nurp linux-4.7-rc6-aufs/fs/read_write.c linux-4.7-rc6-aufs-mod/fs/read_write.c ---- linux-4.7-rc6-aufs/fs/read_write.c 2016-07-04 19:02:29.262286207 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/read_write.c 2016-07-04 19:03:53.655714975 +0300 +diff -Nurp linux-4.8-aufs/fs/read_write.c linux-4.8-aufs-mod/fs/read_write.c +--- linux-4.8-aufs/fs/read_write.c 2016-07-04 19:02:29.262286207 +0300 ++++ linux-4.8-aufs-mod/fs/read_write.c 2016-07-04 19:03:53.655714975 +0300 @@ -525,6 +525,7 @@ vfs_readf_t vfs_readf(struct file *file) return new_sync_read; return ERR_PTR(-ENOSYS); @@ -234,9 +234,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/read_write.c linux-4.7-rc6-aufs-mod/fs/read_wri ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos) { -diff -Nurp linux-4.7-rc6-aufs/fs/splice.c linux-4.7-rc6-aufs-mod/fs/splice.c ---- linux-4.7-rc6-aufs/fs/splice.c 2016-07-04 19:02:29.262286207 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/splice.c 2016-07-04 19:03:53.656714979 +0300 +diff -Nurp linux-4.8-aufs/fs/splice.c linux-4.8-aufs-mod/fs/splice.c +--- linux-4.8-aufs/fs/splice.c 2016-07-04 19:02:29.262286207 +0300 ++++ linux-4.8-aufs-mod/fs/splice.c 2016-07-04 19:03:53.656714979 +0300 @@ -1124,6 +1124,7 @@ long do_splice_from(struct pipe_inode_in return splice_write(pipe, out, ppos, len, flags); @@ -253,9 +253,9 @@ diff -Nurp linux-4.7-rc6-aufs/fs/splice.c linux-4.7-rc6-aufs-mod/fs/splice.c /** * splice_direct_to_actor - splices data directly between two non-pipes -diff -Nurp linux-4.7-rc6-aufs/fs/xattr.c linux-4.7-rc6-aufs-mod/fs/xattr.c ---- linux-4.7-rc6-aufs/fs/xattr.c 2016-07-04 17:58:15.754773638 +0300 -+++ linux-4.7-rc6-aufs-mod/fs/xattr.c 2016-07-04 19:03:53.656714979 +0300 +diff -Nurp linux-4.8-aufs/fs/xattr.c linux-4.8-aufs-mod/fs/xattr.c +--- linux-4.8-aufs/fs/xattr.c 2016-07-04 17:58:15.754773638 +0300 ++++ linux-4.8-aufs-mod/fs/xattr.c 2016-07-04 19:03:53.656714979 +0300 @@ -207,6 +207,7 @@ vfs_getxattr_alloc(struct dentry *dentry *xattr_value = value; return error; @@ -264,17 +264,17 @@ diff -Nurp linux-4.7-rc6-aufs/fs/xattr.c linux-4.7-rc6-aufs-mod/fs/xattr.c ssize_t vfs_getxattr(struct dentry *dentry, const char *name, void *value, size_t size) -diff -Nurp linux-4.7-rc6-aufs/kernel/task_work.c linux-4.7-rc6-aufs-mod/kernel/task_work.c ---- linux-4.7-rc6-aufs/kernel/task_work.c 2016-05-16 01:43:13.000000000 +0300 -+++ linux-4.7-rc6-aufs-mod/kernel/task_work.c 2016-07-04 19:03:53.656714979 +0300 +diff -Nurp linux-4.8-aufs/kernel/task_work.c linux-4.8-aufs-mod/kernel/task_work.c +--- linux-4.8-aufs/kernel/task_work.c 2016-05-16 01:43:13.000000000 +0300 ++++ linux-4.8-aufs-mod/kernel/task_work.c 2016-07-04 19:03:53.656714979 +0300 @@ -118,3 +118,4 @@ void task_work_run(void) } while (work); } } +EXPORT_SYMBOL_GPL(task_work_run); -diff -Nurp linux-4.7-rc6-aufs/security/commoncap.c linux-4.7-rc6-aufs-mod/security/commoncap.c ---- linux-4.7-rc6-aufs/security/commoncap.c 2016-07-04 17:58:15.945773585 +0300 -+++ linux-4.7-rc6-aufs-mod/security/commoncap.c 2016-07-04 19:03:53.656714979 +0300 +diff -Nurp linux-4.8-aufs/security/commoncap.c linux-4.8-aufs-mod/security/commoncap.c +--- linux-4.8-aufs/security/commoncap.c 2016-07-04 17:58:15.945773585 +0300 ++++ linux-4.8-aufs-mod/security/commoncap.c 2016-07-04 19:03:53.656714979 +0300 @@ -1058,12 +1058,14 @@ int cap_mmap_addr(unsigned long addr) } return ret; @@ -290,9 +290,9 @@ diff -Nurp linux-4.7-rc6-aufs/security/commoncap.c linux-4.7-rc6-aufs-mod/securi #ifdef CONFIG_SECURITY -diff -Nurp linux-4.7-rc6-aufs/security/device_cgroup.c linux-4.7-rc6-aufs-mod/security/device_cgroup.c ---- linux-4.7-rc6-aufs/security/device_cgroup.c 2016-05-16 01:43:13.000000000 +0300 -+++ linux-4.7-rc6-aufs-mod/security/device_cgroup.c 2016-07-04 19:03:53.656714979 +0300 +diff -Nurp linux-4.8-aufs/security/device_cgroup.c linux-4.8-aufs-mod/security/device_cgroup.c +--- linux-4.8-aufs/security/device_cgroup.c 2016-05-16 01:43:13.000000000 +0300 ++++ linux-4.8-aufs-mod/security/device_cgroup.c 2016-07-04 19:03:53.656714979 +0300 @@ -7,6 +7,7 @@ #include #include @@ -309,9 +309,9 @@ diff -Nurp linux-4.7-rc6-aufs/security/device_cgroup.c linux-4.7-rc6-aufs-mod/se int devcgroup_inode_mknod(int mode, dev_t dev) { -diff -Nurp linux-4.7-rc6-aufs/security/security.c linux-4.7-rc6-aufs-mod/security/security.c ---- linux-4.7-rc6-aufs/security/security.c 2016-07-04 17:58:15.948773584 +0300 -+++ linux-4.7-rc6-aufs-mod/security/security.c 2016-07-04 19:03:53.657714984 +0300 +diff -Nurp linux-4.8-aufs/security/security.c linux-4.8-aufs-mod/security/security.c +--- linux-4.8-aufs/security/security.c 2016-07-04 17:58:15.948773584 +0300 ++++ linux-4.8-aufs-mod/security/security.c 2016-07-04 19:03:53.657714984 +0300 @@ -434,6 +434,7 @@ int security_path_rmdir(const struct pat return 0; return call_int_hook(path_rmdir, 0, dir, dentry); diff --git a/kernel/kernel/files/patches/mageia/fs-aufs-4.7.patch b/kernel/kernel/files/patches/mageia/fs-aufs-4.8.patch similarity index 96% rename from kernel/kernel/files/patches/mageia/fs-aufs-4.7.patch rename to kernel/kernel/files/patches/mageia/fs-aufs-4.8.patch index d2d09b83..1efb3528 100644 --- a/kernel/kernel/files/patches/mageia/fs-aufs-4.7.patch +++ b/kernel/kernel/files/patches/mageia/fs-aufs-4.8.patch @@ -1,4 +1,117 @@ + Documentation/ABI/testing/debugfs-aufs | 50 + Documentation/ABI/testing/sysfs-aufs | 31 + Documentation/filesystems/aufs/README | 392 +++ + Documentation/filesystems/aufs/design/01intro.txt | 157 + + Documentation/filesystems/aufs/design/02struct.txt | 245 ++ + Documentation/filesystems/aufs/design/03atomic_open.txt | 72 + Documentation/filesystems/aufs/design/03lookup.txt | 100 + Documentation/filesystems/aufs/design/04branch.txt | 61 + Documentation/filesystems/aufs/design/05wbr_policy.txt | 51 + Documentation/filesystems/aufs/design/06fhsm.txt | 105 + Documentation/filesystems/aufs/design/06mmap.txt | 59 + Documentation/filesystems/aufs/design/06xattr.txt | 81 + Documentation/filesystems/aufs/design/07export.txt | 45 + Documentation/filesystems/aufs/design/08shwh.txt | 39 + Documentation/filesystems/aufs/design/10dynop.txt | 34 + MAINTAINERS | 13 + drivers/block/loop.c | 18 + fs/Kconfig | 1 + fs/Makefile | 1 + fs/aufs/Kconfig | 185 + + fs/aufs/Makefile | 36 + fs/aufs/aufs.h | 46 + fs/aufs/branch.c | 1399 ++++++++++++ + fs/aufs/branch.h | 296 ++ + fs/aufs/cpup.c | 1378 +++++++++++ + fs/aufs/cpup.h | 81 + fs/aufs/dbgaufs.c | 425 +++ + fs/aufs/dbgaufs.h | 35 + fs/aufs/dcsub.c | 212 + + fs/aufs/dcsub.h | 123 + + fs/aufs/debug.c | 427 +++ + fs/aufs/debug.h | 212 + + fs/aufs/dentry.c | 1117 +++++++++ + fs/aufs/dentry.h | 242 ++ + fs/aufs/dinfo.c | 540 ++++ + fs/aufs/dir.c | 749 ++++++ + fs/aufs/dir.h | 124 + + fs/aufs/dynop.c | 358 +++ + fs/aufs/dynop.h | 61 + fs/aufs/export.c | 824 +++++++ + fs/aufs/f_op.c | 759 ++++++ + fs/aufs/fhsm.c | 412 +++ + fs/aufs/file.c | 844 +++++++ + fs/aufs/file.h | 281 ++ + fs/aufs/finfo.c | 138 + + fs/aufs/fstype.h | 387 +++ + fs/aufs/hfsnotify.c | 274 ++ + fs/aufs/hfsplus.c | 43 + fs/aufs/hnotify.c | 710 ++++++ + fs/aufs/i_op.c | 1438 ++++++++++++ + fs/aufs/i_op_add.c | 911 +++++++ + fs/aufs/i_op_del.c | 498 ++++ + fs/aufs/i_op_ren.c | 1002 ++++++++ + fs/aufs/iinfo.c | 272 ++ + fs/aufs/inode.c | 506 ++++ + fs/aufs/inode.h | 687 +++++ + fs/aufs/ioctl.c | 206 + + fs/aufs/loop.c | 134 + + fs/aufs/loop.h | 39 + fs/aufs/magic.mk | 30 + fs/aufs/module.c | 319 ++ + fs/aufs/module.h | 143 + + fs/aufs/mvdown.c | 691 +++++ + fs/aufs/opts.c | 1847 ++++++++++++++++ + fs/aufs/opts.h | 198 + + fs/aufs/plink.c | 501 ++++ + fs/aufs/poll.c | 39 + fs/aufs/posix_acl.c | 85 + fs/aufs/procfs.c | 156 + + fs/aufs/rdu.c | 368 +++ + fs/aufs/rwsem.h | 185 + + fs/aufs/sbinfo.c | 342 ++ + fs/aufs/spl.h | 100 + fs/aufs/super.c | 1025 ++++++++ + fs/aufs/super.h | 625 +++++ + fs/aufs/sysaufs.c | 91 + fs/aufs/sysaufs.h | 88 + fs/aufs/sysfs.c | 340 ++ + fs/aufs/sysrq.c | 144 + + fs/aufs/vdir.c | 887 +++++++ + fs/aufs/vfsub.c | 871 +++++++ + fs/aufs/vfsub.h | 303 ++ + fs/aufs/wbr_policy.c | 752 ++++++ + fs/aufs/whout.c | 1047 +++++++++ + fs/aufs/whout.h | 72 + fs/aufs/wkq.c | 200 + + fs/aufs/wkq.h | 80 + fs/aufs/xattr.c | 334 ++ + fs/aufs/xino.c | 1305 +++++++++++ + fs/dcache.c | 2 + fs/fcntl.c | 4 + fs/inode.c | 2 + fs/proc/base.c | 2 + fs/proc/nommu.c | 5 + fs/proc/task_mmu.c | 7 + fs/proc/task_nommu.c | 5 + fs/read_write.c | 22 + fs/splice.c | 10 + include/linux/file.h | 1 + include/linux/fs.h | 9 + include/linux/mm.h | 22 + include/linux/mm_types.h | 2 + include/linux/splice.h | 6 + include/uapi/linux/Kbuild | 1 + include/uapi/linux/aufs_type.h | 406 +++ + kernel/fork.c | 2 + mm/Makefile | 2 + mm/filemap.c | 2 + mm/memory.c | 2 + mm/mmap.c | 33 + mm/nommu.c | 10 + mm/prfile.c | 86 + 112 files changed, 33747 insertions(+), 30 deletions(-) Documentation/ABI/testing/debugfs-aufs | 50 + Documentation/ABI/testing/sysfs-aufs | 31 + Documentation/filesystems/aufs/README | 392 +++++ @@ -21,73 +134,73 @@ fs/aufs/Kconfig | 185 ++ fs/aufs/Makefile | 36 + fs/aufs/aufs.h | 46 + - fs/aufs/branch.c | 1393 +++++++++++++++ + fs/aufs/branch.c | 1399 +++++++++++++++ fs/aufs/branch.h | 296 ++++ - fs/aufs/cpup.c | 1370 +++++++++++++++ + fs/aufs/cpup.c | 1378 +++++++++++++++ fs/aufs/cpup.h | 81 + - fs/aufs/dbgaufs.c | 419 +++++ + fs/aufs/dbgaufs.c | 425 +++++ fs/aufs/dbgaufs.h | 35 + - fs/aufs/dcsub.c | 211 +++ + fs/aufs/dcsub.c | 212 +++ fs/aufs/dcsub.h | 123 ++ - fs/aufs/debug.c | 428 +++++ + fs/aufs/debug.c | 427 +++++ fs/aufs/debug.h | 212 +++ - fs/aufs/dentry.c | 1115 ++++++++++++ - fs/aufs/dentry.h | 239 +++ - fs/aufs/dinfo.c | 539 ++++++ - fs/aufs/dir.c | 743 ++++++++ - fs/aufs/dir.h | 118 ++ - fs/aufs/dynop.c | 356 ++++ + fs/aufs/dentry.c | 1117 ++++++++++++ + fs/aufs/dentry.h | 242 +++ + fs/aufs/dinfo.c | 540 ++++++ + fs/aufs/dir.c | 749 ++++++++ + fs/aufs/dir.h | 124 ++ + fs/aufs/dynop.c | 358 ++++ fs/aufs/dynop.h | 61 + fs/aufs/export.c | 824 +++++++++ - fs/aufs/f_op.c | 757 ++++++++ + fs/aufs/f_op.c | 759 ++++++++ fs/aufs/fhsm.c | 412 +++++ - fs/aufs/file.c | 830 +++++++++ - fs/aufs/file.h | 278 +++ - fs/aufs/finfo.c | 136 ++ + fs/aufs/file.c | 844 +++++++++ + fs/aufs/file.h | 281 +++ + fs/aufs/finfo.c | 138 ++ fs/aufs/fstype.h | 387 ++++ fs/aufs/hfsnotify.c | 274 +++ fs/aufs/hfsplus.c | 43 + - fs/aufs/hnotify.c | 697 ++++++++ - fs/aufs/i_op.c | 1401 +++++++++++++++ + fs/aufs/hnotify.c | 710 ++++++++ + fs/aufs/i_op.c | 1438 +++++++++++++++ fs/aufs/i_op_add.c | 911 ++++++++++ fs/aufs/i_op_del.c | 498 ++++++ fs/aufs/i_op_ren.c | 1002 +++++++++++ - fs/aufs/iinfo.c | 271 +++ - fs/aufs/inode.c | 504 ++++++ - fs/aufs/inode.h | 681 ++++++++ + fs/aufs/iinfo.c | 272 +++ + fs/aufs/inode.c | 506 ++++++ + fs/aufs/inode.h | 687 ++++++++ fs/aufs/ioctl.c | 206 +++ - fs/aufs/loop.c | 133 ++ + fs/aufs/loop.c | 134 ++ fs/aufs/loop.h | 39 + fs/aufs/magic.mk | 30 + - fs/aufs/module.c | 209 +++ - fs/aufs/module.h | 76 + + fs/aufs/module.c | 319 ++++ + fs/aufs/module.h | 143 ++ fs/aufs/mvdown.c | 691 ++++++++ - fs/aufs/opts.c | 1846 ++++++++++++++++++++ + fs/aufs/opts.c | 1847 ++++++++++++++++++++ fs/aufs/opts.h | 198 +++ - fs/aufs/plink.c | 489 ++++++ + fs/aufs/plink.c | 501 ++++++ fs/aufs/poll.c | 39 + fs/aufs/posix_acl.c | 85 + fs/aufs/procfs.c | 156 ++ fs/aufs/rdu.c | 368 ++++ fs/aufs/rwsem.h | 185 ++ - fs/aufs/sbinfo.c | 340 ++++ - fs/aufs/spl.h | 98 ++ - fs/aufs/super.c | 1026 +++++++++++ + fs/aufs/sbinfo.c | 342 ++++ + fs/aufs/spl.h | 100 ++ + fs/aufs/super.c | 1025 +++++++++++ fs/aufs/super.h | 625 +++++++ fs/aufs/sysaufs.c | 91 + fs/aufs/sysaufs.h | 88 + fs/aufs/sysfs.c | 340 ++++ fs/aufs/sysrq.c | 144 ++ - fs/aufs/vdir.c | 876 ++++++++++ + fs/aufs/vdir.c | 887 ++++++++++ fs/aufs/vfsub.c | 871 +++++++++ - fs/aufs/vfsub.h | 297 ++++ + fs/aufs/vfsub.h | 303 ++++ fs/aufs/wbr_policy.c | 752 ++++++++ fs/aufs/whout.c | 1047 +++++++++++ fs/aufs/whout.h | 72 + - fs/aufs/wkq.c | 205 +++ - fs/aufs/wkq.h | 82 + - fs/aufs/xattr.c | 332 ++++ - fs/aufs/xino.c | 1304 ++++++++++++++ + fs/aufs/wkq.c | 200 +++ + fs/aufs/wkq.h | 80 + + fs/aufs/xattr.c | 334 ++++ + fs/aufs/xino.c | 1305 ++++++++++++++ fs/dcache.c | 2 +- fs/fcntl.c | 4 +- fs/inode.c | 2 +- @@ -111,7 +224,7 @@ mm/mmap.c | 33 +- mm/nommu.c | 10 +- mm/prfile.c | 86 + - 112 files changed, 33420 insertions(+), 30 deletions(-) + 112 files changed, 33747 insertions(+), 30 deletions(-) diff --git a/Documentation/ABI/testing/debugfs-aufs b/Documentation/ABI/testing/debugfs-aufs new file mode 100644 @@ -1726,10 +1839,10 @@ index 0000000..49afc58 +Currently this approach is applied to address_space_operations for +regular files only. diff --git a/MAINTAINERS b/MAINTAINERS -index 952fd2a..6a8f0f8 100644 +index f593300..8a17054 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -2210,6 +2210,19 @@ F: include/linux/audit.h +@@ -2256,6 +2256,19 @@ F: include/linux/audit.h F: include/uapi/linux/audit.h F: kernel/audit* @@ -1750,10 +1863,10 @@ index 952fd2a..6a8f0f8 100644 M: Miguel Ojeda Sandonis W: http://miguelojeda.es/auxdisplay.htm diff --git a/drivers/block/loop.c b/drivers/block/loop.c -index 1fa8cc2..7339e65 100644 +index c9f2107..005e292 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c -@@ -712,6 +712,24 @@ static inline int is_loop_device(struct file *file) +@@ -701,6 +701,24 @@ static inline int is_loop_device(struct file *file) return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR; } @@ -1779,10 +1892,10 @@ index 1fa8cc2..7339e65 100644 static ssize_t loop_attr_show(struct device *dev, char *page, diff --git a/fs/Kconfig b/fs/Kconfig -index b8fcb41..78adefb 100644 +index 2bc7ad7..3049386 100644 --- a/fs/Kconfig +++ b/fs/Kconfig -@@ -236,6 +236,7 @@ source "fs/pstore/Kconfig" +@@ -245,6 +245,7 @@ source "fs/pstore/Kconfig" source "fs/sysv/Kconfig" source "fs/ufs/Kconfig" source "fs/exofs/Kconfig" @@ -1791,10 +1904,10 @@ index b8fcb41..78adefb 100644 endif # MISC_FILESYSTEMS diff --git a/fs/Makefile b/fs/Makefile -index 85b6e13..e7bb164 100644 +index ed2b632..aa6d14b 100644 --- a/fs/Makefile +++ b/fs/Makefile -@@ -128,3 +128,4 @@ obj-y += exofs/ # Multiple modules +@@ -129,3 +129,4 @@ obj-y += exofs/ # Multiple modules obj-$(CONFIG_CEPH_FS) += ceph/ obj-$(CONFIG_PSTORE) += pstore/ obj-$(CONFIG_EFIVAR_FS) += efivarfs/ @@ -2086,10 +2199,10 @@ index 0000000..49f43b4 +#endif /* __AUFS_H__ */ diff --git a/fs/aufs/branch.c b/fs/aufs/branch.c new file mode 100644 -index 0000000..baf786e +index 0000000..3bfbe5b --- /dev/null +++ b/fs/aufs/branch.c -@@ -0,0 +1,1393 @@ +@@ -0,0 +1,1399 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -2130,7 +2243,7 @@ index 0000000..baf786e + + if (br->br_fhsm) { + au_br_fhsm_fin(br->br_fhsm); -+ kfree(br->br_fhsm); ++ au_delayed_kfree(br->br_fhsm); + } + + key = br->br_dykey; @@ -2144,8 +2257,9 @@ index 0000000..baf786e + lockdep_off(); + path_put(&br->br_path); + lockdep_on(); -+ kfree(wbr); -+ kfree(br); ++ if (wbr) ++ au_delayed_kfree(wbr); ++ au_delayed_kfree(br); +} + +/* @@ -2232,22 +2346,23 @@ index 0000000..baf786e + goto out_wbr; + } + -+ err = au_sbr_realloc(au_sbi(sb), new_nbranch); ++ err = au_sbr_realloc(au_sbi(sb), new_nbranch, /*may_shrink*/0); + if (!err) -+ err = au_di_realloc(au_di(root), new_nbranch); ++ err = au_di_realloc(au_di(root), new_nbranch, /*may_shrink*/0); + if (!err) { + inode = d_inode(root); -+ err = au_hinode_realloc(au_ii(inode), new_nbranch); ++ err = au_hinode_realloc(au_ii(inode), new_nbranch, /*may_shrink*/0); + } + if (!err) + return add_branch; /* success */ + +out_wbr: -+ kfree(add_branch->br_wbr); ++ if (add_branch->br_wbr) ++ au_delayed_kfree(add_branch->br_wbr); +out_hnotify: + au_hnotify_fin_br(add_branch); +out_br: -+ kfree(add_branch); ++ au_delayed_kfree(add_branch); +out: + return ERR_PTR(err); +} @@ -2413,7 +2528,7 @@ index 0000000..baf786e + br->br_perm = old_perm; + + if (!err && wbr && !au_br_writable(new_perm)) { -+ kfree(wbr); ++ au_delayed_kfree(wbr); + br->br_wbr = NULL; + } + @@ -2980,7 +3095,8 @@ index 0000000..baf786e + sbinfo->si_branch[0 + bbot] = NULL; + sbinfo->si_bbot--; + -+ p = krealloc(sbinfo->si_branch, sizeof(*p) * bbot, AuGFP_SBILIST); ++ p = au_krealloc(sbinfo->si_branch, sizeof(*p) * bbot, AuGFP_SBILIST, ++ /*may_shrink*/1); + if (p) + sbinfo->si_branch = p; + /* harmless error */ @@ -2999,7 +3115,8 @@ index 0000000..baf786e + /* au_h_dentry_init(au_hdentry(dinfo, bbot); */ + dinfo->di_bbot--; + -+ p = krealloc(dinfo->di_hdentry, sizeof(*p) * bbot, AuGFP_SBILIST); ++ p = au_krealloc(dinfo->di_hdentry, sizeof(*p) * bbot, AuGFP_SBILIST, ++ /*may_shrink*/1); + if (p) + dinfo->di_hdentry = p; + /* harmless error */ @@ -3018,7 +3135,8 @@ index 0000000..baf786e + /* au_hinode_init(au_hinode(iinfo, bbot)); */ + iinfo->ii_bbot--; + -+ p = krealloc(iinfo->ii_hinode, sizeof(*p) * bbot, AuGFP_SBILIST); ++ p = au_krealloc(iinfo->ii_hinode, sizeof(*p) * bbot, AuGFP_SBILIST, ++ /*may_shrink*/1); + if (p) + iinfo->ii_hinode = p; + /* harmless error */ @@ -3436,7 +3554,7 @@ index 0000000..baf786e + if (br->br_wbr) { + err = au_wbr_init(br, sb, mod->perm); + if (unlikely(err)) { -+ kfree(br->br_wbr); ++ au_delayed_kfree(br->br_wbr); + br->br_wbr = NULL; + } + } @@ -3448,7 +3566,7 @@ index 0000000..baf786e + if (!au_br_fhsm(mod->perm)) { + /* fhsm --> non-fhsm */ + au_br_fhsm_fin(br->br_fhsm); -+ kfree(br->br_fhsm); ++ au_delayed_kfree(br->br_fhsm); + br->br_fhsm = NULL; + } + } else if (au_br_fhsm(mod->perm)) @@ -3460,7 +3578,8 @@ index 0000000..baf786e + goto out; /* success */ + +out_bf: -+ kfree(bf); ++ if (bf) ++ au_delayed_kfree(bf); +out: + AuTraceErr(err); + return err; @@ -3787,10 +3906,10 @@ index 0000000..32a4d8f +#endif /* __AUFS_BRANCH_H__ */ diff --git a/fs/aufs/cpup.c b/fs/aufs/cpup.c new file mode 100644 -index 0000000..52f87de +index 0000000..598a4d6 --- /dev/null +++ b/fs/aufs/cpup.c -@@ -0,0 +1,1370 @@ +@@ -0,0 +1,1378 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -4137,9 +4256,9 @@ index 0000000..52f87de + dst->f_pos = 0; + err = au_do_copy_file(dst, src, len, buf, blksize); + if (do_kfree) -+ kfree(buf); ++ au_delayed_kfree(buf); + else -+ free_page((unsigned long)buf); ++ au_delayed_free_page((unsigned long)buf); + +out: + return err; @@ -4174,6 +4293,7 @@ index 0000000..52f87de + } + }; + struct super_block *sb; ++ struct inode *h_src_inode; + struct task_struct *tsk = current; + + /* bsrc branch can be ro/rw. */ @@ -4189,7 +4309,9 @@ index 0000000..52f87de + } + + /* try stopping to update while we copyup */ -+ IMustLock(d_inode(file[SRC].dentry)); ++ h_src_inode = d_inode(file[SRC].dentry); ++ if (!au_test_nfs(h_src_inode->i_sb)) ++ IMustLock(h_src_inode); + err = au_copy_file(file[DST].file, file[SRC].file, cpg->len); + + /* i wonder if we had O_NO_DELAY_FPUT flag */ @@ -4249,8 +4371,13 @@ index 0000000..52f87de + goto out; + } + h_src_attr->valid = 1; -+ err = au_cp_regular(cpg); -+ inode_unlock(h_src_inode); ++ if (!au_test_nfs(h_src_inode->i_sb)) { ++ err = au_cp_regular(cpg); ++ inode_unlock(h_src_inode); ++ } else { ++ inode_unlock(h_src_inode); ++ err = au_cp_regular(cpg); ++ } + rerr = au_pin_hdir_relock(cpg->pin); + if (!err && rerr) + err = rerr; @@ -4299,7 +4426,7 @@ index 0000000..52f87de + sym.k[symlen] = 0; + err = vfsub_symlink(h_dir, h_path, sym.k); + } -+ free_page((unsigned long)sym.k); ++ au_delayed_free_page((unsigned long)sym.k); + +out: + return err; @@ -4670,7 +4797,7 @@ index 0000000..52f87de + } +out_parent: + dput(dst_parent); -+ kfree(a); ++ au_delayed_kfree(a); +out: + return err; +} @@ -5250,10 +5377,10 @@ index 0000000..ccba2c4 +#endif /* __AUFS_CPUP_H__ */ diff --git a/fs/aufs/dbgaufs.c b/fs/aufs/dbgaufs.c new file mode 100644 -index 0000000..21ac773 +index 0000000..4db01e8 --- /dev/null +++ b/fs/aufs/dbgaufs.c -@@ -0,0 +1,419 @@ +@@ -0,0 +1,425 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -5284,7 +5411,7 @@ index 0000000..21ac773 +static int dbgaufs_xi_release(struct inode *inode __maybe_unused, + struct file *file) +{ -+ kfree(file->private_data); ++ au_delayed_kfree(file->private_data); + return 0; +} + @@ -5346,7 +5473,7 @@ index 0000000..21ac773 +static int dbgaufs_plink_release(struct inode *inode __maybe_unused, + struct file *file) +{ -+ free_page((unsigned long)file->private_data); ++ au_delayed_free_page((unsigned long)file->private_data); + return 0; +} + @@ -5410,7 +5537,7 @@ index 0000000..21ac773 + goto out; /* success */ + +out_free: -+ free_page((unsigned long)p); ++ au_delayed_free_page((unsigned long)p); +out: + return err; +} @@ -5512,7 +5639,10 @@ index 0000000..21ac773 + for (; bindex <= bbot; bindex++) { + br = au_sbr(sb, bindex); + xi = &br->br_xino; ++ /* debugfs acquires the parent i_mutex */ ++ lockdep_off(); + debugfs_remove(xi->xi_dbgaufs); ++ lockdep_on(); + xi->xi_dbgaufs = NULL; + } +} @@ -5537,8 +5667,11 @@ index 0000000..21ac773 + br = au_sbr(sb, bindex); + xi = &br->br_xino; + AuDebugOn(xi->xi_dbgaufs); ++ /* debugfs acquires the parent i_mutex */ ++ lockdep_off(); + xi->xi_dbgaufs = debugfs_create_file(name, dbgaufs_mode, parent, + sbinfo, &dbgaufs_xino_fop); ++ lockdep_on(); + /* ignore an error */ + if (unlikely(!xi->xi_dbgaufs)) + AuWarn1("failed %s under debugfs\n", name); @@ -5716,10 +5849,10 @@ index 0000000..81f272e +#endif /* __DBGAUFS_H__ */ diff --git a/fs/aufs/dcsub.c b/fs/aufs/dcsub.c new file mode 100644 -index 0000000..e72acce +index 0000000..5d46398 --- /dev/null +++ b/fs/aufs/dcsub.c -@@ -0,0 +1,211 @@ +@@ -0,0 +1,212 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -5738,7 +5871,7 @@ index 0000000..e72acce + p = dpage->dentries; + for (i = 0; i < dpage->ndentry; i++) + dput(*p++); -+ free_page((unsigned long)dpage->dentries); ++ au_delayed_free_page((unsigned long)dpage->dentries); +} + +int au_dpages_init(struct au_dcsub_pages *dpages, gfp_t gfp) @@ -5761,7 +5894,7 @@ index 0000000..e72acce + return 0; /* success */ + +out_dpages: -+ kfree(dpages->dpages); ++ au_delayed_kfree(dpages->dpages); +out: + return err; +} @@ -5774,7 +5907,7 @@ index 0000000..e72acce + p = dpages->dpages; + for (i = 0; i < dpages->ndpage; i++) + au_dpage_free(p++); -+ kfree(dpages->dpages); ++ au_delayed_kfree(dpages->dpages); +} + +static int au_dpages_append(struct au_dcsub_pages *dpages, @@ -5791,7 +5924,8 @@ index 0000000..e72acce + err = -ENOMEM; + sz = dpages->ndpage * sizeof(*dpages->dpages); + p = au_kzrealloc(dpages->dpages, sz, -+ sz + sizeof(*dpages->dpages), gfp); ++ sz + sizeof(*dpages->dpages), gfp, ++ /*may_shrink*/0); + if (unlikely(!p)) + goto out; + @@ -6062,10 +6196,10 @@ index 0000000..5d2cf66 +#endif /* __AUFS_DCSUB_H__ */ diff --git a/fs/aufs/debug.c b/fs/aufs/debug.c new file mode 100644 -index 0000000..44bdb5f +index 0000000..443fee3 --- /dev/null +++ b/fs/aufs/debug.c -@@ -0,0 +1,428 @@ +@@ -0,0 +1,427 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -6391,7 +6525,7 @@ index 0000000..44bdb5f + au_br_count_init(&a->fake); + err = do_pri_br(-1, &a->fake); + au_br_count_fin(&a->fake); -+ kfree(a); ++ au_delayed_kfree(a); + dpri("dev 0x%x\n", sb->s_dev); + if (err || !au_test_aufs(sb)) + return; @@ -6399,9 +6533,8 @@ index 0000000..44bdb5f + sbinfo = au_sbi(sb); + if (!sbinfo) + return; -+ dpri("nw %lld, gen %u, kobj %d\n", -+ percpu_counter_sum(&sbinfo->si_nowait.nw_len), -+ sbinfo->si_generation, ++ dpri("nw %d, gen %u, kobj %d\n", ++ atomic_read(&sbinfo->si_nowait.nw_len), sbinfo->si_generation, + atomic_read(&sbinfo->si_kobj.kref.refcount)); + for (bindex = 0; bindex <= sbinfo->si_bbot; bindex++) + do_pri_br(bindex, sbinfo->si_branch[0 + bindex]); @@ -6714,10 +6847,10 @@ index 0000000..0567f31 +#endif /* __AUFS_DEBUG_H__ */ diff --git a/fs/aufs/dentry.c b/fs/aufs/dentry.c new file mode 100644 -index 0000000..4bb1530 +index 0000000..5eb4f36 --- /dev/null +++ b/fs/aufs/dentry.c -@@ -0,0 +1,1115 @@ +@@ -0,0 +1,1117 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -6756,7 +6889,7 @@ index 0000000..4bb1530 + br = au_sbr(dentry->d_sb, bindex); + wh_able = !!au_br_whable(br->br_perm); + if (wh_able) -+ wh_found = au_wh_test(h_parent, wh_name, /*try_sio*/0); ++ wh_found = au_wh_test(h_parent, wh_name, ignore_perm); + h_dentry = ERR_PTR(wh_found); + if (!wh_found) + goto real_lookup; @@ -6921,7 +7054,7 @@ index 0000000..4bb1530 + +out_parent: + dput(parent); -+ kfree(whname.name); ++ au_delayed_kfree(whname.name); +out: + return err; +} @@ -7421,7 +7554,7 @@ index 0000000..4bb1530 + +int au_refresh_dentry(struct dentry *dentry, struct dentry *parent) +{ -+ int err, ebrange; ++ int err, ebrange, nbr; + unsigned int sigen; + struct au_dinfo *dinfo, *tmp; + struct super_block *sb; @@ -7437,8 +7570,9 @@ index 0000000..4bb1530 + if (unlikely(err)) + goto out; + ++ nbr = au_sbbot(sb) + 1; + dinfo = au_di(dentry); -+ err = au_di_realloc(dinfo, au_sbbot(sb) + 1); ++ err = au_di_realloc(dinfo, nbr, /*may_shrink*/0); + if (unlikely(err)) + goto out; + ebrange = au_dbrange_test(dentry); @@ -7481,6 +7615,7 @@ index 0000000..4bb1530 + au_dbg_verify_dinode(dentry); + AuTraceErr(err); + } ++ au_di_realloc(dinfo, nbr, /*may_shrink*/1); /* harmless if err */ + au_rw_write_unlock(&tmp->di_rwsem); + au_di_free(tmp); + if (unlikely(err)) @@ -7835,10 +7970,10 @@ index 0000000..4bb1530 +}; diff --git a/fs/aufs/dentry.h b/fs/aufs/dentry.h new file mode 100644 -index 0000000..bdc1af6 +index 0000000..01211d2 --- /dev/null +++ b/fs/aufs/dentry.h -@@ -0,0 +1,239 @@ +@@ -0,0 +1,242 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -7866,7 +8001,10 @@ index 0000000..bdc1af6 + struct au_rwsem di_rwsem; + aufs_bindex_t di_btop, di_bbot, di_bwh, di_bdiropq; + unsigned char di_tmpfile; /* to allow the different name */ -+ struct au_hdentry *di_hdentry; ++ union { ++ struct au_hdentry *di_hdentry; ++ struct llist_node di_lnode; /* delayed free */ ++ }; +} ____cacheline_aligned_in_smp; + +/* ---------------------------------------------------------------------- */ @@ -7904,7 +8042,7 @@ index 0000000..bdc1af6 +void au_di_cp(struct au_dinfo *dst, struct au_dinfo *src); +int au_di_init(struct dentry *dentry); +void au_di_fin(struct dentry *dentry); -+int au_di_realloc(struct au_dinfo *dinfo, int nbr); ++int au_di_realloc(struct au_dinfo *dinfo, int nbr, int may_shrink); + +void di_read_lock(struct dentry *d, int flags, unsigned int lsc); +void di_read_unlock(struct dentry *d, int flags); @@ -8080,10 +8218,10 @@ index 0000000..bdc1af6 +#endif /* __AUFS_DENTRY_H__ */ diff --git a/fs/aufs/dinfo.c b/fs/aufs/dinfo.c new file mode 100644 -index 0000000..43b5509 +index 0000000..2626c0c --- /dev/null +++ b/fs/aufs/dinfo.c -@@ -0,0 +1,539 @@ +@@ -0,0 +1,540 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -8126,7 +8264,7 @@ index 0000000..43b5509 + goto out; + } + -+ au_cache_free_dinfo(dinfo); ++ au_cache_dfree_dinfo(dinfo); + dinfo = NULL; + +out: @@ -8146,8 +8284,8 @@ index 0000000..43b5509 + while (bindex++ <= bbot) + au_hdput(p++); + } -+ kfree(dinfo->di_hdentry); -+ au_cache_free_dinfo(dinfo); ++ au_delayed_kfree(dinfo->di_hdentry); ++ au_cache_dfree_dinfo(dinfo); +} + +void au_di_swap(struct au_dinfo *a, struct au_dinfo *b) @@ -8215,7 +8353,7 @@ index 0000000..43b5509 + au_di_free(dinfo); +} + -+int au_di_realloc(struct au_dinfo *dinfo, int nbr) ++int au_di_realloc(struct au_dinfo *dinfo, int nbr, int may_shrink) +{ + int err, sz; + struct au_hdentry *hdp; @@ -8226,7 +8364,8 @@ index 0000000..43b5509 + sz = sizeof(*hdp) * (dinfo->di_bbot + 1); + if (!sz) + sz = sizeof(*hdp); -+ hdp = au_kzrealloc(dinfo->di_hdentry, sz, sizeof(*hdp) * nbr, GFP_NOFS); ++ hdp = au_kzrealloc(dinfo->di_hdentry, sz, sizeof(*hdp) * nbr, GFP_NOFS, ++ may_shrink); + if (hdp) { + dinfo->di_hdentry = hdp; + err = 0; @@ -8625,10 +8764,10 @@ index 0000000..43b5509 +} diff --git a/fs/aufs/dir.c b/fs/aufs/dir.c new file mode 100644 -index 0000000..27bef0b +index 0000000..395563e --- /dev/null +++ b/fs/aufs/dir.c -@@ -0,0 +1,743 @@ +@@ -0,0 +1,749 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -8774,7 +8913,7 @@ index 0000000..27bef0b +out: + dput(a->dentry); + au_nwt_done(&au_sbi(sb)->si_nowait); -+ kfree(arg); ++ au_delayed_kfree(arg); +} + +void au_dir_ts(struct inode *dir, aufs_bindex_t bindex) @@ -8810,7 +8949,7 @@ index 0000000..27bef0b + if (unlikely(wkq_err)) { + pr_err("wkq %d\n", wkq_err); + dput(dentry); -+ kfree(arg); ++ au_delayed_kfree(arg); + } + +out: @@ -8929,7 +9068,7 @@ index 0000000..27bef0b + }; + err = au_do_open(file, &args); + if (unlikely(err)) -+ kfree(fidir); ++ au_delayed_kfree(fidir); + } + si_read_unlock(sb); + return err; @@ -8941,8 +9080,11 @@ index 0000000..27bef0b + struct au_vdir *vdir_cache; + struct au_finfo *finfo; + struct au_fidir *fidir; ++ struct au_hfile *hf; + aufs_bindex_t bindex, bbot; ++ int execed, delayed; + ++ delayed = (current->flags & PF_KTHREAD) || in_interrupt(); + finfo = au_fi(file); + fidir = finfo->fi_hdir; + if (fidir) { @@ -8950,22 +9092,25 @@ index 0000000..27bef0b + &au_sbi(file->f_path.dentry->d_sb)->si_files); + vdir_cache = fidir->fd_vdir_cache; /* lock-free */ + if (vdir_cache) -+ au_vdir_free(vdir_cache); ++ au_vdir_free(vdir_cache, delayed); + + bindex = finfo->fi_btop; + if (bindex >= 0) { ++ execed = vfsub_file_execed(file); ++ hf = fidir->fd_hfile + bindex; + /* + * calls fput() instead of filp_close(), + * since no dnotify or lock for the lower file. + */ + bbot = fidir->fd_bbot; -+ for (; bindex <= bbot; bindex++) -+ au_set_h_fptr(file, bindex, NULL); ++ for (; bindex <= bbot; bindex++, hf++) ++ if (hf->hf_file) ++ au_hfput(hf, execed); + } -+ kfree(fidir); ++ au_delayed_kfree(fidir); + finfo->fi_hdir = NULL; + } -+ au_finfo_fin(file); ++ au_finfo_fin(file, delayed); + return 0; +} + @@ -9374,10 +9519,10 @@ index 0000000..27bef0b +}; diff --git a/fs/aufs/dir.h b/fs/aufs/dir.h new file mode 100644 -index 0000000..b0a79d7 +index 0000000..4f3945a --- /dev/null +++ b/fs/aufs/dir.h -@@ -0,0 +1,118 @@ +@@ -0,0 +1,124 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -9409,7 +9554,10 @@ index 0000000..b0a79d7 + +struct au_vdir_dehstr { + struct hlist_node hash; -+ struct au_vdir_destr *str; ++ union { ++ struct au_vdir_destr *str; ++ struct llist_node lnode; /* delayed free */ ++ }; +} ____cacheline_aligned_in_smp; + +struct au_vdir_de { @@ -9447,7 +9595,10 @@ index 0000000..b0a79d7 + + unsigned long vd_version; + unsigned int vd_deblk_sz; -+ unsigned long vd_jiffy; ++ union { ++ unsigned long vd_jiffy; ++ struct llist_node vd_lnode; /* delayed free */ ++ }; +} ____cacheline_aligned_in_smp; + +/* ---------------------------------------------------------------------- */ @@ -9471,7 +9622,7 @@ index 0000000..b0a79d7 +int au_nhash_append_wh(struct au_nhash *whlist, char *name, int nlen, ino_t ino, + unsigned int d_type, aufs_bindex_t bindex, + unsigned char shwh); -+void au_vdir_free(struct au_vdir *vdir); ++void au_vdir_free(struct au_vdir *vdir, int atonce); +int au_vdir_init(struct file *file); +int au_vdir_fill_de(struct file *file, struct dir_context *ctx); + @@ -9498,10 +9649,10 @@ index 0000000..b0a79d7 +#endif /* __AUFS_DIR_H__ */ diff --git a/fs/aufs/dynop.c b/fs/aufs/dynop.c new file mode 100644 -index 0000000..dfb3a71 +index 0000000..eb0e1a7 --- /dev/null +++ b/fs/aufs/dynop.c -@@ -0,0 +1,356 @@ +@@ -0,0 +1,358 @@ +/* + * Copyright (C) 2010-2016 Junjiro R. Okajima + */ @@ -9518,17 +9669,17 @@ index 0000000..dfb3a71 + * How large will these lists be? + * Usually just a few elements, 20-30 at most for each, I guess. + */ -+static struct au_splhead dynop[AuDyLast]; ++static struct au_sphlhead dynop[AuDyLast]; + -+static struct au_dykey *dy_gfind_get(struct au_splhead *spl, const void *h_op) ++static struct au_dykey *dy_gfind_get(struct au_sphlhead *sphl, const void *h_op) +{ + struct au_dykey *key, *tmp; -+ struct list_head *head; ++ struct hlist_head *head; + + key = NULL; -+ head = &spl->head; ++ head = &sphl->head; + rcu_read_lock(); -+ list_for_each_entry_rcu(tmp, head, dk_list) ++ hlist_for_each_entry_rcu(tmp, head, dk_hnode) + if (tmp->dk_op.dy_hop == h_op) { + key = tmp; + kref_get(&key->dk_kref); @@ -9575,24 +9726,24 @@ index 0000000..dfb3a71 +} + +/* kref_get() if @key is already added */ -+static struct au_dykey *dy_gadd(struct au_splhead *spl, struct au_dykey *key) ++static struct au_dykey *dy_gadd(struct au_sphlhead *sphl, struct au_dykey *key) +{ + struct au_dykey *tmp, *found; -+ struct list_head *head; ++ struct hlist_head *head; + const void *h_op = key->dk_op.dy_hop; + + found = NULL; -+ head = &spl->head; -+ spin_lock(&spl->spin); -+ list_for_each_entry(tmp, head, dk_list) ++ head = &sphl->head; ++ spin_lock(&sphl->spin); ++ hlist_for_each_entry(tmp, head, dk_hnode) + if (tmp->dk_op.dy_hop == h_op) { + kref_get(&tmp->dk_kref); + found = tmp; + break; + } + if (!found) -+ list_add_rcu(&key->dk_list, head); -+ spin_unlock(&spl->spin); ++ hlist_add_head_rcu(&key->dk_hnode, head); ++ spin_unlock(&sphl->spin); + + if (!found) + DyPrSym(key); @@ -9605,17 +9756,17 @@ index 0000000..dfb3a71 + + key = container_of(rcu, struct au_dykey, dk_rcu); + DyPrSym(key); -+ kfree(key); ++ kfree(key); /* not delayed */ +} + +static void dy_free(struct kref *kref) +{ + struct au_dykey *key; -+ struct au_splhead *spl; ++ struct au_sphlhead *sphl; + + key = container_of(kref, struct au_dykey, dk_kref); -+ spl = dynop + key->dk_op.dy_type; -+ au_spl_del_rcu(&key->dk_list, spl); ++ sphl = dynop + key->dk_op.dy_type; ++ au_sphl_del_rcu(&key->dk_hnode, sphl); + call_rcu(&key->dk_rcu, dy_free_rcu); +} + @@ -9680,6 +9831,8 @@ index 0000000..dfb3a71 + /* this one will be changed according to an aufs mount option */ + DySetAop(direct_IO); + DySetAop(migratepage); ++ DySetAop(isolate_page); ++ DySetAop(putback_page); + DySetAop(launder_page); + DySetAop(is_partially_uptodate); + DySetAop(is_dirty_writeback); @@ -9700,7 +9853,7 @@ index 0000000..dfb3a71 +static struct au_dykey *dy_get(struct au_dynop *op, struct au_branch *br) +{ + struct au_dykey *key, *old; -+ struct au_splhead *spl; ++ struct au_sphlhead *sphl; + struct op { + unsigned int sz; + void (*set)(struct au_dykey *key, const void *h_op, @@ -9714,8 +9867,8 @@ index 0000000..dfb3a71 + }; + const struct op *p; + -+ spl = dynop + op->dy_type; -+ key = dy_gfind_get(spl, op->dy_hop); ++ sphl = dynop + op->dy_type; ++ key = dy_gfind_get(sphl, op->dy_hop); + if (key) + goto out_add; /* success */ + @@ -9729,9 +9882,9 @@ index 0000000..dfb3a71 + key->dk_op.dy_hop = op->dy_hop; + kref_init(&key->dk_kref); + p->set(key, op->dy_hop, au_br_sb(br)); -+ old = dy_gadd(spl, key); ++ old = dy_gadd(sphl, key); + if (old) { -+ kfree(key); ++ au_delayed_kfree(key); + key = old; + } + @@ -9826,16 +9979,16 @@ index 0000000..dfb3a71 + +void au_dy_arefresh(int do_dx) +{ -+ struct au_splhead *spl; -+ struct list_head *head; ++ struct au_sphlhead *sphl; ++ struct hlist_head *head; + struct au_dykey *key; + -+ spl = dynop + AuDy_AOP; -+ head = &spl->head; -+ spin_lock(&spl->spin); -+ list_for_each_entry(key, head, dk_list) ++ sphl = dynop + AuDy_AOP; ++ head = &sphl->head; ++ spin_lock(&sphl->spin); ++ hlist_for_each_entry(key, head, dk_hnode) + dy_adx((void *)key, do_dx); -+ spin_unlock(&spl->spin); ++ spin_unlock(&sphl->spin); +} + +/* ---------------------------------------------------------------------- */ @@ -9848,7 +10001,7 @@ index 0000000..dfb3a71 + BUILD_BUG_ON(offsetof(struct au_dyaop, da_key)); + + for (i = 0; i < AuDyLast; i++) -+ au_spl_init(dynop + i); ++ au_sphl_init(dynop + i); +} + +void au_dy_fin(void) @@ -9856,11 +10009,11 @@ index 0000000..dfb3a71 + int i; + + for (i = 0; i < AuDyLast; i++) -+ WARN_ON(!list_empty(&dynop[i].head)); ++ WARN_ON(!hlist_empty(&dynop[i].head)); +} diff --git a/fs/aufs/dynop.h b/fs/aufs/dynop.h new file mode 100644 -index 0000000..8680bfc +index 0000000..5db2da2 --- /dev/null +++ b/fs/aufs/dynop.h @@ -0,0 +1,61 @@ @@ -9892,7 +10045,7 @@ index 0000000..8680bfc + +struct au_dykey { + union { -+ struct list_head dk_list; ++ struct hlist_node dk_hnode; + struct rcu_head dk_rcu; + }; + struct au_dynop dk_op; @@ -9927,7 +10080,7 @@ index 0000000..8680bfc +#endif /* __AUFS_DYNOP_H__ */ diff --git a/fs/aufs/export.c b/fs/aufs/export.c new file mode 100644 -index 0000000..98a7036 +index 0000000..6b5a7be --- /dev/null +++ b/fs/aufs/export.c @@ -0,0 +1,824 @@ @@ -10337,7 +10490,7 @@ index 0000000..98a7036 + } + +out_name: -+ free_page((unsigned long)arg.name); ++ au_delayed_free_page((unsigned long)arg.name); +out_file: + fput(file); +out: @@ -10491,7 +10644,7 @@ index 0000000..98a7036 + dentry = ERR_PTR(-ESTALE); + } +out_pathname: -+ free_page((unsigned long)pathname); ++ au_delayed_free_page((unsigned long)pathname); +out_h_parent: + dput(h_parent); +out: @@ -10757,10 +10910,10 @@ index 0000000..98a7036 +} diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c new file mode 100644 -index 0000000..504b767 +index 0000000..00475fb --- /dev/null +++ b/fs/aufs/f_op.c -@@ -0,0 +1,757 @@ +@@ -0,0 +1,759 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -10849,6 +11002,7 @@ index 0000000..504b767 +{ + struct au_finfo *finfo; + aufs_bindex_t bindex; ++ int delayed; + + finfo = au_fi(file); + au_sphl_del(&finfo->fi_hlist, @@ -10857,7 +11011,8 @@ index 0000000..504b767 + if (bindex >= 0) + au_set_h_fptr(file, bindex, NULL); + -+ au_finfo_fin(file); ++ delayed = (current->flags & PF_KTHREAD) || in_interrupt(); ++ au_finfo_fin(file, delayed); + return 0; +} + @@ -11938,10 +12093,10 @@ index 0000000..e3cb6ed +} diff --git a/fs/aufs/file.c b/fs/aufs/file.c new file mode 100644 -index 0000000..4b68aef +index 0000000..bfc1d1b --- /dev/null +++ b/fs/aufs/file.c -@@ -0,0 +1,830 @@ +@@ -0,0 +1,844 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -12204,7 +12359,7 @@ index 0000000..4b68aef + } + if (unlikely(err)) { + finfo->fi_hdir = NULL; -+ au_finfo_fin(file); ++ au_finfo_fin(file, /*atonce*/0); + } + +out: @@ -12524,6 +12679,7 @@ index 0000000..4b68aef + +static void au_do_refresh_dir(struct file *file) +{ ++ int execed; + aufs_bindex_t bindex, bbot, new_bindex, brid; + struct au_hfile *p, tmp, *q; + struct au_finfo *finfo; @@ -12562,6 +12718,7 @@ index 0000000..4b68aef + } + } + ++ execed = vfsub_file_execed(file); + p = fidir->fd_hfile; + if (!au_test_mmapped(file) && !d_unlinked(file->f_path.dentry)) { + bbot = au_sbbot(sb); @@ -12570,14 +12727,14 @@ index 0000000..4b68aef + if (p->hf_file) { + if (file_inode(p->hf_file)) + break; -+ au_hfput(p, file); ++ au_hfput(p, execed); + } + } else { + bbot = au_br_index(sb, brid); + for (finfo->fi_btop = 0; finfo->fi_btop < bbot; + finfo->fi_btop++, p++) + if (p->hf_file) -+ au_hfput(p, file); ++ au_hfput(p, execed); + bbot = au_sbbot(sb); + } + @@ -12587,7 +12744,7 @@ index 0000000..4b68aef + if (p->hf_file) { + if (file_inode(p->hf_file)) + break; -+ au_hfput(p, file); ++ au_hfput(p, execed); + } + AuDebugOn(fidir->fd_bbot < finfo->fi_btop); +} @@ -12597,23 +12754,26 @@ index 0000000..4b68aef + */ +static int refresh_file(struct file *file, int (*reopen)(struct file *file)) +{ -+ int err, need_reopen; ++ int err, need_reopen, nbr; + aufs_bindex_t bbot, bindex; + struct dentry *dentry; ++ struct super_block *sb; + struct au_finfo *finfo; + struct au_hfile *hfile; + + dentry = file->f_path.dentry; ++ sb = dentry->d_sb; ++ nbr = au_sbbot(sb) + 1; + finfo = au_fi(file); + if (!finfo->fi_hdir) { + hfile = &finfo->fi_htop; + AuDebugOn(!hfile->hf_file); -+ bindex = au_br_index(dentry->d_sb, hfile->hf_br->br_id); ++ bindex = au_br_index(sb, hfile->hf_br->br_id); + AuDebugOn(bindex < 0); + if (bindex != finfo->fi_btop) + au_set_fbtop(file, bindex); + } else { -+ err = au_fidir_realloc(finfo, au_sbbot(dentry->d_sb) + 1); ++ err = au_fidir_realloc(finfo, nbr, /*may_shrink*/0); + if (unlikely(err)) + goto out; + au_do_refresh_dir(file); @@ -12623,6 +12783,9 @@ index 0000000..4b68aef + need_reopen = 1; + if (!au_test_mmapped(file)) + err = au_file_refresh_by_inode(file, &need_reopen); ++ if (finfo->fi_hdir) ++ /* harmless if err */ ++ au_fidir_realloc(finfo, nbr, /*may_shrink*/1); + if (!err && need_reopen && !d_unlinked(dentry)) + err = reopen(file); + if (!err) { @@ -12730,6 +12893,10 @@ index 0000000..4b68aef + struct page *page, enum migrate_mode mode) +{ AuUnsupport(); return 0; } +#endif ++static bool aufs_isolate_page(struct page *page, isolate_mode_t mode) ++{ AuUnsupport(); return true; } ++static void aufs_putback_page(struct page *page) ++{ AuUnsupport(); } +static int aufs_launder_page(struct page *page) +{ AuUnsupport(); return 0; } +static int aufs_is_partially_uptodate(struct page *page, @@ -12764,6 +12931,8 @@ index 0000000..4b68aef + .releasepage = aufs_releasepage, + /* is fallback_migrate_page ok? */ + /* .migratepage = aufs_migratepage, */ ++ .isolate_page = aufs_isolate_page, ++ .putback_page = aufs_putback_page, + .launder_page = aufs_launder_page, + .is_partially_uptodate = aufs_is_partially_uptodate, + .is_dirty_writeback = aufs_is_dirty_writeback, @@ -12774,10 +12943,10 @@ index 0000000..4b68aef +}; diff --git a/fs/aufs/file.h b/fs/aufs/file.h new file mode 100644 -index 0000000..96ab0a0 +index 0000000..f53b381 --- /dev/null +++ b/fs/aufs/file.h -@@ -0,0 +1,278 @@ +@@ -0,0 +1,281 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -12830,7 +12999,10 @@ index 0000000..96ab0a0 + struct au_fidir *fi_hdir; /* for dir only */ + + struct hlist_node fi_hlist; -+ struct file *fi_file; /* very ugly */ ++ union { ++ struct file *fi_file; /* very ugly */ ++ struct llist_node fi_lnode; /* delayed free */ ++ }; +} ____cacheline_aligned_in_smp; + +/* ---------------------------------------------------------------------- */ @@ -12881,16 +13053,16 @@ index 0000000..96ab0a0 +struct file *au_read_pre(struct file *file, int keep_fi); + +/* finfo.c */ -+void au_hfput(struct au_hfile *hf, struct file *file); ++void au_hfput(struct au_hfile *hf, int execed); +void au_set_h_fptr(struct file *file, aufs_bindex_t bindex, + struct file *h_file); + +void au_update_figen(struct file *file); +struct au_fidir *au_fidir_alloc(struct super_block *sb); -+int au_fidir_realloc(struct au_finfo *finfo, int nbr); ++int au_fidir_realloc(struct au_finfo *finfo, int nbr, int may_shrink); + +void au_fi_init_once(void *_fi); -+void au_finfo_fin(struct file *file); ++void au_finfo_fin(struct file *file, int atonce); +int au_finfo_init(struct file *file, struct au_fidir *fidir); + +/* ioctl.c */ @@ -13058,10 +13230,10 @@ index 0000000..96ab0a0 +#endif /* __AUFS_FILE_H__ */ diff --git a/fs/aufs/finfo.c b/fs/aufs/finfo.c new file mode 100644 -index 0000000..07f6eb3 +index 0000000..0f016ed --- /dev/null +++ b/fs/aufs/finfo.c -@@ -0,0 +1,136 @@ +@@ -0,0 +1,138 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -13072,10 +13244,9 @@ index 0000000..07f6eb3 + +#include "aufs.h" + -+void au_hfput(struct au_hfile *hf, struct file *file) ++void au_hfput(struct au_hfile *hf, int execed) +{ -+ /* todo: direct access f_flags */ -+ if (vfsub_file_flags(file) & __FMODE_EXEC) ++ if (execed) + allow_write_access(hf->hf_file); + fput(hf->hf_file); + hf->hf_file = NULL; @@ -13097,7 +13268,7 @@ index 0000000..07f6eb3 + hf = fidir->fd_hfile + bindex; + + if (hf && hf->hf_file) -+ au_hfput(hf, file); ++ au_hfput(hf, vfsub_file_execed(file)); + if (val) { + FiMustWriteLock(file); + AuDebugOn(IS_ERR_OR_NULL(file->f_path.dentry)); @@ -13131,7 +13302,7 @@ index 0000000..07f6eb3 + return fidir; +} + -+int au_fidir_realloc(struct au_finfo *finfo, int nbr) ++int au_fidir_realloc(struct au_finfo *finfo, int nbr, int may_shrink) +{ + int err; + struct au_fidir *fidir, *p; @@ -13142,7 +13313,7 @@ index 0000000..07f6eb3 + + err = -ENOMEM; + p = au_kzrealloc(fidir, au_fidir_sz(fidir->fd_nent), au_fidir_sz(nbr), -+ GFP_NOFS); ++ GFP_NOFS, may_shrink); + if (p) { + p->fd_nent = nbr; + finfo->fi_hdir = p; @@ -13154,7 +13325,7 @@ index 0000000..07f6eb3 + +/* ---------------------------------------------------------------------- */ + -+void au_finfo_fin(struct file *file) ++void au_finfo_fin(struct file *file, int atonce) +{ + struct au_finfo *finfo; + @@ -13163,7 +13334,10 @@ index 0000000..07f6eb3 + finfo = au_fi(file); + AuDebugOn(finfo->fi_hdir); + AuRwDestroy(&finfo->fi_rwsem); -+ au_cache_free_finfo(finfo); ++ if (!atonce) ++ au_cache_dfree_finfo(finfo); ++ else ++ au_cache_free_finfo(finfo); +} + +void au_fi_init_once(void *_finfo) @@ -13200,7 +13374,7 @@ index 0000000..07f6eb3 +} diff --git a/fs/aufs/fstype.h b/fs/aufs/fstype.h new file mode 100644 -index 0000000..725b2ff +index 0000000..95b78b9 --- /dev/null +++ b/fs/aufs/fstype.h @@ -0,0 +1,387 @@ @@ -13234,7 +13408,7 @@ index 0000000..725b2ff + +static inline int au_test_iso9660(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_ISO9660_FS) || defined(CONFIG_ISO9660_FS_MODULE) ++#if IS_ENABLED(CONFIG_ISO9660_FS) + return sb->s_magic == ISOFS_SUPER_MAGIC; +#else + return 0; @@ -13243,7 +13417,7 @@ index 0000000..725b2ff + +static inline int au_test_romfs(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_ROMFS_FS) || defined(CONFIG_ROMFS_FS_MODULE) ++#if IS_ENABLED(CONFIG_ROMFS_FS) + return sb->s_magic == ROMFS_MAGIC; +#else + return 0; @@ -13252,7 +13426,7 @@ index 0000000..725b2ff + +static inline int au_test_cramfs(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_CRAMFS) || defined(CONFIG_CRAMFS_MODULE) ++#if IS_ENABLED(CONFIG_CRAMFS) + return sb->s_magic == CRAMFS_MAGIC; +#endif + return 0; @@ -13260,7 +13434,7 @@ index 0000000..725b2ff + +static inline int au_test_nfs(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_NFS_FS) || defined(CONFIG_NFS_FS_MODULE) ++#if IS_ENABLED(CONFIG_NFS_FS) + return sb->s_magic == NFS_SUPER_MAGIC; +#else + return 0; @@ -13269,7 +13443,7 @@ index 0000000..725b2ff + +static inline int au_test_fuse(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_FUSE_FS) || defined(CONFIG_FUSE_FS_MODULE) ++#if IS_ENABLED(CONFIG_FUSE_FS) + return sb->s_magic == FUSE_SUPER_MAGIC; +#else + return 0; @@ -13278,7 +13452,7 @@ index 0000000..725b2ff + +static inline int au_test_xfs(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_XFS_FS) || defined(CONFIG_XFS_FS_MODULE) ++#if IS_ENABLED(CONFIG_XFS_FS) + return sb->s_magic == XFS_SB_MAGIC; +#else + return 0; @@ -13296,7 +13470,7 @@ index 0000000..725b2ff + +static inline int au_test_ecryptfs(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_ECRYPT_FS) || defined(CONFIG_ECRYPT_FS_MODULE) ++#if IS_ENABLED(CONFIG_ECRYPT_FS) + return !strcmp(au_sbtype(sb), "ecryptfs"); +#else + return 0; @@ -13310,7 +13484,7 @@ index 0000000..725b2ff + +static inline int au_test_ubifs(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_UBIFS_FS) || defined(CONFIG_UBIFS_FS_MODULE) ++#if IS_ENABLED(CONFIG_UBIFS_FS) + return sb->s_magic == UBIFS_SUPER_MAGIC; +#else + return 0; @@ -13337,7 +13511,7 @@ index 0000000..725b2ff + +static inline int au_test_configfs(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_CONFIGFS_FS) || defined(CONFIG_CONFIGFS_FS_MODULE) ++#if IS_ENABLED(CONFIG_CONFIGFS_FS) + return sb->s_magic == CONFIGFS_MAGIC; +#else + return 0; @@ -13346,7 +13520,7 @@ index 0000000..725b2ff + +static inline int au_test_minix(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_MINIX_FS) || defined(CONFIG_MINIX_FS_MODULE) ++#if IS_ENABLED(CONFIG_MINIX_FS) + return sb->s_magic == MINIX3_SUPER_MAGIC + || sb->s_magic == MINIX2_SUPER_MAGIC + || sb->s_magic == MINIX2_SUPER_MAGIC2 @@ -13359,7 +13533,7 @@ index 0000000..725b2ff + +static inline int au_test_fat(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_FAT_FS) || defined(CONFIG_FAT_FS_MODULE) ++#if IS_ENABLED(CONFIG_FAT_FS) + return sb->s_magic == MSDOS_SUPER_MAGIC; +#else + return 0; @@ -13387,7 +13561,7 @@ index 0000000..725b2ff + +static inline int au_test_squashfs(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_SQUASHFS) || defined(CONFIG_SQUASHFS_MODULE) ++#if IS_ENABLED(CONFIG_SQUASHFS) + return sb->s_magic == SQUASHFS_MAGIC; +#else + return 0; @@ -13396,7 +13570,7 @@ index 0000000..725b2ff + +static inline int au_test_btrfs(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_BTRFS_FS) || defined(CONFIG_BTRFS_FS_MODULE) ++#if IS_ENABLED(CONFIG_BTRFS_FS) + return sb->s_magic == BTRFS_SUPER_MAGIC; +#else + return 0; @@ -13405,7 +13579,7 @@ index 0000000..725b2ff + +static inline int au_test_xenfs(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_XENFS) || defined(CONFIG_XENFS_MODULE) ++#if IS_ENABLED(CONFIG_XENFS) + return sb->s_magic == XENFS_SUPER_MAGIC; +#else + return 0; @@ -13423,7 +13597,7 @@ index 0000000..725b2ff + +static inline int au_test_nilfs(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_NILFS) || defined(CONFIG_NILFS_MODULE) ++#if IS_ENABLED(CONFIG_NILFS) + return sb->s_magic == NILFS_SUPER_MAGIC; +#else + return 0; @@ -13432,7 +13606,7 @@ index 0000000..725b2ff + +static inline int au_test_hfsplus(struct super_block *sb __maybe_unused) +{ -+#if defined(CONFIG_HFSPLUS_FS) || defined(CONFIG_HFSPLUS_FS_MODULE) ++#if IS_ENABLED(CONFIG_HFSPLUS_FS) + return sb->s_magic == HFSPLUS_SUPER_MAGIC; +#else + return 0; @@ -13593,7 +13767,7 @@ index 0000000..725b2ff +#endif /* __AUFS_FSTYPE_H__ */ diff --git a/fs/aufs/hfsnotify.c b/fs/aufs/hfsnotify.c new file mode 100644 -index 0000000..6afef3f +index 0000000..110f8f5 --- /dev/null +++ b/fs/aufs/hfsnotify.c @@ -0,0 +1,274 @@ @@ -13618,7 +13792,7 @@ index 0000000..6afef3f + struct au_hnotify *hn = container_of(mark, struct au_hnotify, + hn_mark); + /* AuDbg("here\n"); */ -+ au_cache_free_hnotify(hn); ++ au_cache_dfree_hnotify(hn); + smp_mb__before_atomic(); + if (atomic64_dec_and_test(&au_hfsn_ifree)) + wake_up(&au_hfsn_wq); @@ -13742,7 +13916,7 @@ index 0000000..6afef3f + struct au_br_hfsnotify *hfsn = group->private; + + /* AuDbg("here\n"); */ -+ kfree(hfsn); ++ au_delayed_kfree(hfsn); +} + +static int au_hfsn_handle_event(struct fsnotify_group *group, @@ -13836,7 +14010,7 @@ index 0000000..6afef3f + goto out; /* success */ + +out_hfsn: -+ kfree(hfsn); ++ au_delayed_kfree(hfsn); +out: + return err; +} @@ -13922,10 +14096,10 @@ index 0000000..145c6ac +} diff --git a/fs/aufs/hnotify.c b/fs/aufs/hnotify.c new file mode 100644 -index 0000000..3016c5e +index 0000000..a05aed8 --- /dev/null +++ b/fs/aufs/hnotify.c -@@ -0,0 +1,697 @@ +@@ -0,0 +1,710 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -13950,7 +14124,7 @@ index 0000000..3016c5e + AuTraceErr(err); + if (unlikely(err)) { + hinode->hi_notify = NULL; -+ au_cache_free_hnotify(hn); ++ au_cache_dfree_hnotify(hn); + /* + * The upper dir was removed by udba, but the same named + * dir left. In this case, aufs assignes a new inode @@ -13974,7 +14148,7 @@ index 0000000..3016c5e + if (hn) { + hinode->hi_notify = NULL; + if (au_hnotify_op.free(hinode, hn)) -+ au_cache_free_hnotify(hn); ++ au_cache_dfree_hnotify(hn); + } +} + @@ -14408,7 +14582,7 @@ index 0000000..3016c5e + || au_ftest_hnjob(a->flags[AuHn_CHILD], GEN))) { + inode = lookup_wlock_by_ino(sb, bfound, h_ino); + try_iput = 1; -+ } ++ } + + args.flags = a->flags[AuHn_CHILD]; + args.dentry = dentry; @@ -14447,7 +14621,7 @@ index 0000000..3016c5e + iput(a->dir); + si_write_unlock(sb); + au_nwt_done(&sbinfo->si_nowait); -+ kfree(a); ++ au_delayed_kfree(a); +} + +/* ---------------------------------------------------------------------- */ @@ -14553,7 +14727,7 @@ index 0000000..3016c5e + iput(args->h_child_inode); + iput(args->h_dir); + iput(args->dir); -+ kfree(args); ++ au_delayed_kfree(args); + } + +out: @@ -14594,17 +14768,26 @@ index 0000000..3016c5e + +static void au_hn_destroy_cache(void) +{ -+ kmem_cache_destroy(au_cachep[AuCache_HNOTIFY]); -+ au_cachep[AuCache_HNOTIFY] = NULL; ++ struct au_cache *cp; ++ ++ flush_delayed_work(&au_dfree.dwork); ++ cp = au_dfree.cache + AuCache_HNOTIFY; ++ AuDebugOn(!llist_empty(&cp->llist)); ++ kmem_cache_destroy(cp->cache); ++ cp->cache = NULL; +} + ++AU_CACHE_DFREE_FUNC(hnotify, HNOTIFY, hn_lnode); ++ +int __init au_hnotify_init(void) +{ + int err; ++ struct au_cache *cp; + + err = -ENOMEM; -+ au_cachep[AuCache_HNOTIFY] = AuCache(au_hnotify); -+ if (au_cachep[AuCache_HNOTIFY]) { ++ cp = au_dfree.cache + AuCache_HNOTIFY; ++ cp->cache = AuCache(au_hnotify); ++ if (cp->cache) { + err = 0; + if (au_hnotify_op.init) + err = au_hnotify_op.init(); @@ -14617,18 +14800,22 @@ index 0000000..3016c5e + +void au_hnotify_fin(void) +{ ++ struct au_cache *cp; ++ + if (au_hnotify_op.fin) + au_hnotify_op.fin(); ++ + /* cf. au_cache_fin() */ -+ if (au_cachep[AuCache_HNOTIFY]) ++ cp = au_dfree.cache + AuCache_HNOTIFY; ++ if (cp->cache) + au_hn_destroy_cache(); +} diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c new file mode 100644 -index 0000000..cc1e312 +index 0000000..c730ec7 --- /dev/null +++ b/fs/aufs/i_op.c -@@ -0,0 +1,1401 @@ +@@ -0,0 +1,1438 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -14644,17 +14831,20 @@ index 0000000..cc1e312 +#include "aufs.h" + +static int h_permission(struct inode *h_inode, int mask, -+ struct vfsmount *h_mnt, int brperm) ++ struct path *h_path, int brperm) +{ + int err; + const unsigned char write_mask = !!(mask & (MAY_WRITE | MAY_APPEND)); + ++ err = -EPERM; ++ if (write_mask && IS_IMMUTABLE(h_inode)) ++ goto out; ++ + err = -EACCES; -+ if ((write_mask && IS_IMMUTABLE(h_inode)) -+ || ((mask & MAY_EXEC) -+ && S_ISREG(h_inode->i_mode) -+ && ((h_mnt->mnt_flags & MNT_NOEXEC) -+ || !(h_inode->i_mode & S_IXUGO)))) ++ if (((mask & MAY_EXEC) ++ && S_ISREG(h_inode->i_mode) ++ && (path_noexec(h_path) ++ || !(h_inode->i_mode & S_IXUGO)))) + goto out; + + /* @@ -14738,7 +14928,7 @@ index 0000000..cc1e312 + err = 0; + bindex = au_ibtop(inode); + br = au_sbr(sb, bindex); -+ err = h_permission(h_inode, mask, au_br_mnt(br), br->br_perm); ++ err = h_permission(h_inode, mask, &br->br_path, br->br_perm); + if (write_mask + && !err + && !special_file(h_inode->i_mode)) { @@ -14764,7 +14954,7 @@ index 0000000..cc1e312 + break; + + br = au_sbr(sb, bindex); -+ err = h_permission(h_inode, mask, au_br_mnt(br), ++ err = h_permission(h_inode, mask, &br->br_path, + br->br_perm); + } + } @@ -14899,8 +15089,7 @@ index 0000000..cc1e312 +{ + int err, h_opened = *opened; + unsigned int lkup_flags; -+ struct dentry *parent; -+ struct dentry *d; ++ struct dentry *parent, *d; + struct au_sphlhead *aopen; + struct vfsub_aopen_args args = { + .open_flag = open_flag, @@ -14995,10 +15184,10 @@ index 0000000..cc1e312 + di_write_unlock(parent); + aufs_read_unlock(dentry, AuLock_DW); + AuDbgDentry(dentry); -+ if (unlikely(err)) ++ if (unlikely(err < 0)) + goto out; +out_no_open: -+ if (!err && !(*opened & FILE_CREATED)) { ++ if (err >= 0 && !(*opened & FILE_CREATED)) { + AuLabel(out_no_open); + dget(dentry); + err = finish_no_open(file, dentry); @@ -15612,7 +15801,7 @@ index 0000000..cc1e312 +out_si: + si_read_unlock(sb); +out_kfree: -+ kfree(a); ++ au_delayed_kfree(a); +out: + AuTraceErr(err); + return err; @@ -15705,7 +15894,7 @@ index 0000000..cc1e312 + di_write_unlock(dentry); + si_read_unlock(sb); +out_kfree: -+ kfree(a); ++ au_delayed_kfree(a); +out: + AuTraceErr(err); + return err; @@ -15925,20 +16114,55 @@ index 0000000..cc1e312 + +/* ---------------------------------------------------------------------- */ + ++static int au_is_special(struct inode *inode) ++{ ++ return (inode->i_mode & (S_IFBLK | S_IFCHR | S_IFIFO | S_IFSOCK)); ++} ++ +static int aufs_update_time(struct inode *inode, struct timespec *ts, int flags) +{ + int err; ++ aufs_bindex_t bindex; + struct super_block *sb; + struct inode *h_inode; ++ struct vfsmount *h_mnt; + + sb = inode->i_sb; ++ WARN_ONCE((flags & S_ATIME) && !IS_NOATIME(inode), ++ "unexpected s_flags 0x%lx", sb->s_flags); ++ + /* mmap_sem might be acquired already, cf. aufs_mmap() */ + lockdep_off(); + si_read_lock(sb, AuLock_FLUSH); + ii_write_lock_child(inode); + lockdep_on(); -+ h_inode = au_h_iptr(inode, au_ibtop(inode)); -+ err = vfsub_update_time(h_inode, ts, flags); ++ ++ err = 0; ++ bindex = au_ibtop(inode); ++ h_inode = au_h_iptr(inode, bindex); ++ if (!au_test_ro(sb, bindex, inode)) { ++ h_mnt = au_sbr_mnt(sb, bindex); ++ err = vfsub_mnt_want_write(h_mnt); ++ if (!err) { ++ err = vfsub_update_time(h_inode, ts, flags); ++ vfsub_mnt_drop_write(h_mnt); ++ } ++ } else if (au_is_special(h_inode)) { ++ /* ++ * Never copy-up here. ++ * These special files may already be opened and used for ++ * communicating. If we copied it up, then the communication ++ * would be corrupted. ++ */ ++ AuWarn1("timestamps for i%lu are ignored " ++ "since it is on readonly branch (hi%lu).\n", ++ inode->i_ino, h_inode->i_ino); ++ } else if (flags & ~S_ATIME) { ++ err = -EIO; ++ AuIOErr1("unexpected flags 0x%x\n", flags); ++ AuDebugOn(1); ++ } ++ + lockdep_off(); + if (!err) + au_cpup_attr_timesizes(inode); @@ -16032,7 +16256,7 @@ index 0000000..cc1e312 +}; diff --git a/fs/aufs/i_op_add.c b/fs/aufs/i_op_add.c new file mode 100644 -index 0000000..8e3fb61 +index 0000000..2a9aa09 --- /dev/null +++ b/fs/aufs/i_op_add.c @@ -0,0 +1,911 @@ @@ -16370,7 +16594,7 @@ index 0000000..8e3fb61 + if (!try_aopen) + aufs_read_unlock(dentry, AuLock_DW); +out_free: -+ kfree(a); ++ au_delayed_kfree(a); +out: + return err; +} @@ -16834,7 +17058,7 @@ index 0000000..8e3fb61 + } + aufs_read_and_write_unlock2(dentry, src_dentry); +out_kfree: -+ kfree(a); ++ au_delayed_kfree(a); +out: + AuTraceErr(err); + return err; @@ -16943,13 +17167,13 @@ index 0000000..8e3fb61 + } + aufs_read_unlock(dentry, AuLock_DW); +out_free: -+ kfree(a); ++ au_delayed_kfree(a); +out: + return err; +} diff --git a/fs/aufs/i_op_del.c b/fs/aufs/i_op_del.c new file mode 100644 -index 0000000..35b923c +index 0000000..2fe8f07 --- /dev/null +++ b/fs/aufs/i_op_del.c @@ -0,0 +1,498 @@ @@ -17336,7 +17560,7 @@ index 0000000..35b923c +out_unlock: + aufs_read_unlock(dentry, AuLock_DW); +out_free: -+ kfree(a); ++ au_delayed_kfree(a); +out: + return err; +} @@ -17446,14 +17670,14 @@ index 0000000..35b923c +out_unlock: + aufs_read_unlock(dentry, AuLock_DW); +out_free: -+ kfree(a); ++ au_delayed_kfree(a); +out: + AuTraceErr(err); + return err; +} diff --git a/fs/aufs/i_op_ren.c b/fs/aufs/i_op_ren.c new file mode 100644 -index 0000000..df697de +index 0000000..43a0909 --- /dev/null +++ b/fs/aufs/i_op_ren.c @@ -0,0 +1,1002 @@ @@ -18454,17 +18678,17 @@ index 0000000..df697de + iput(a->dst_inode); + if (a->thargs) + au_whtmp_rmdir_free(a->thargs); -+ kfree(a); ++ au_delayed_kfree(a); +out: + AuTraceErr(err); + return err; +} diff --git a/fs/aufs/iinfo.c b/fs/aufs/iinfo.c new file mode 100644 -index 0000000..fae4c27 +index 0000000..975cff3 --- /dev/null +++ b/fs/aufs/iinfo.c -@@ -0,0 +1,271 @@ +@@ -0,0 +1,272 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -18672,7 +18896,7 @@ index 0000000..fae4c27 + return -ENOMEM; +} + -+int au_hinode_realloc(struct au_iinfo *iinfo, int nbr) ++int au_hinode_realloc(struct au_iinfo *iinfo, int nbr, int may_shrink) +{ + int err, i; + struct au_hinode *hip; @@ -18680,7 +18904,8 @@ index 0000000..fae4c27 + AuRwMustWriteLock(&iinfo->ii_rwsem); + + err = -ENOMEM; -+ hip = krealloc(iinfo->ii_hinode, sizeof(*hip) * nbr, GFP_NOFS); ++ hip = au_krealloc(iinfo->ii_hinode, sizeof(*hip) * nbr, GFP_NOFS, ++ may_shrink); + if (hip) { + iinfo->ii_hinode = hip; + i = iinfo->ii_bbot + 1; @@ -18721,7 +18946,7 @@ index 0000000..fae4c27 + + iinfo = au_ii(inode); + if (iinfo->ii_vdir) -+ au_vdir_free(iinfo->ii_vdir); ++ au_vdir_free(iinfo->ii_vdir, /*atonce*/0); + + bindex = iinfo->ii_btop; + if (bindex >= 0) { @@ -18733,15 +18958,15 @@ index 0000000..fae4c27 + hi++; + } + } -+ kfree(iinfo->ii_hinode); ++ au_delayed_kfree(iinfo->ii_hinode); + AuRwDestroy(&iinfo->ii_rwsem); +} diff --git a/fs/aufs/inode.c b/fs/aufs/inode.c new file mode 100644 -index 0000000..a4b994e +index 0000000..8f7446d --- /dev/null +++ b/fs/aufs/inode.c -@@ -0,0 +1,504 @@ +@@ -0,0 +1,506 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -18771,7 +18996,7 @@ index 0000000..a4b994e + +static int au_ii_refresh(struct inode *inode, int *update) +{ -+ int err, e; ++ int err, e, nbr; + umode_t type; + aufs_bindex_t bindex, new_bindex; + struct super_block *sb; @@ -18783,9 +19008,10 @@ index 0000000..a4b994e + + *update = 0; + sb = inode->i_sb; ++ nbr = au_sbbot(sb) + 1; + type = inode->i_mode & S_IFMT; + iinfo = au_ii(inode); -+ err = au_hinode_realloc(iinfo, au_sbbot(sb) + 1); ++ err = au_hinode_realloc(iinfo, nbr, /*may_shrink*/0); + if (unlikely(err)) + goto out; + @@ -18823,6 +19049,7 @@ index 0000000..a4b994e + } + } + au_update_ibrange(inode, /*do_put_zero*/0); ++ au_hinode_realloc(iinfo, nbr, /*may_shrink*/1); /* harmless if err */ + e = au_dy_irefresh(inode); + if (unlikely(e && !err)) + err = e; @@ -19248,10 +19475,10 @@ index 0000000..a4b994e +} diff --git a/fs/aufs/inode.h b/fs/aufs/inode.h new file mode 100644 -index 0000000..3fc5a58 +index 0000000..33d9f5e --- /dev/null +++ b/fs/aufs/inode.h -@@ -0,0 +1,681 @@ +@@ -0,0 +1,687 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -19276,7 +19503,10 @@ index 0000000..3fc5a58 + /* never use fsnotify_add_vfsmount_mark() */ + struct fsnotify_mark hn_mark; +#endif -+ struct inode *hn_aufs_inode; /* no get/put */ ++ union { ++ struct inode *hn_aufs_inode; /* no get/put */ ++ struct llist_node hn_lnode; /* delayed free */ ++ }; +#endif +} ____cacheline_aligned_in_smp; + @@ -19319,7 +19549,10 @@ index 0000000..3fc5a58 +struct au_icntnr { + struct au_iinfo iinfo; + struct inode vfs_inode; -+ struct hlist_node plink; ++ union { ++ struct hlist_node plink; ++ struct llist_node lnode; /* delayed free */ ++ }; +} ____cacheline_aligned_in_smp; + +/* au_pin flags */ @@ -19506,7 +19739,7 @@ index 0000000..3fc5a58 +void au_hinode_init(struct au_hinode *hinode); +int au_iinfo_init(struct inode *inode); +void au_iinfo_fin(struct inode *inode); -+int au_hinode_realloc(struct au_iinfo *iinfo, int nbr); ++int au_hinode_realloc(struct au_iinfo *iinfo, int nbr, int may_shrink); + +#ifdef CONFIG_PROC_FS +/* plink.c */ @@ -20147,10 +20380,10 @@ index 0000000..2ebfdc4 +#endif diff --git a/fs/aufs/loop.c b/fs/aufs/loop.c new file mode 100644 -index 0000000..5711e7a +index 0000000..c3ca50f --- /dev/null +++ b/fs/aufs/loop.c -@@ -0,0 +1,133 @@ +@@ -0,0 +1,134 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -20244,7 +20477,8 @@ index 0000000..5711e7a + new_nelem = au_warn_loopback_nelem + au_warn_loopback_step; + a = au_kzrealloc(au_warn_loopback_array, + au_warn_loopback_nelem * sizeof(unsigned long), -+ new_nelem * sizeof(unsigned long), GFP_ATOMIC); ++ new_nelem * sizeof(unsigned long), GFP_ATOMIC, ++ /*may_shrink*/0); + if (a) { + au_warn_loopback_nelem = new_nelem; + au_warn_loopback_array = a; @@ -20282,7 +20516,7 @@ index 0000000..5711e7a +{ + if (backing_file_func) + symbol_put(loop_backing_file); -+ kfree(au_warn_loopback_array); ++ au_delayed_kfree(au_warn_loopback_array); +} diff --git a/fs/aufs/loop.h b/fs/aufs/loop.h new file mode 100644 @@ -20367,10 +20601,10 @@ index 0000000..4f83bdf +endif diff --git a/fs/aufs/module.c b/fs/aufs/module.c new file mode 100644 -index 0000000..88f8f41 +index 0000000..5092b4b --- /dev/null +++ b/fs/aufs/module.c -@@ -0,0 +1,209 @@ +@@ -0,0 +1,319 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -20383,29 +20617,120 @@ index 0000000..88f8f41 +#include +#include "aufs.h" + -+void *au_kzrealloc(void *p, unsigned int nused, unsigned int new_sz, gfp_t gfp) ++/* shrinkable realloc */ ++void *au_krealloc(void *p, unsigned int new_sz, gfp_t gfp, int may_shrink) +{ -+ if (new_sz <= nused) -+ return p; ++ size_t sz; ++ int diff; + -+ p = krealloc(p, new_sz, gfp); -+ if (p) ++ sz = 0; ++ diff = -1; ++ if (p) { ++#if 0 /* unused */ ++ if (!new_sz) { ++ au_delayed_kfree(p); ++ p = NULL; ++ goto out; ++ } ++#else ++ AuDebugOn(!new_sz); ++#endif ++ sz = ksize(p); ++ diff = au_kmidx_sub(sz, new_sz); ++ } ++ if (sz && !diff) ++ goto out; ++ ++ if (sz < new_sz) ++ /* expand or SLOB */ ++ p = krealloc(p, new_sz, gfp); ++ else if (new_sz < sz && may_shrink) { ++ /* shrink */ ++ void *q; ++ ++ q = kmalloc(new_sz, gfp); ++ if (q) { ++ if (p) { ++ memcpy(q, p, new_sz); ++ au_delayed_kfree(p); ++ } ++ p = q; ++ } else ++ p = NULL; ++ } ++ ++out: ++ return p; ++} ++ ++void *au_kzrealloc(void *p, unsigned int nused, unsigned int new_sz, gfp_t gfp, ++ int may_shrink) ++{ ++ p = au_krealloc(p, new_sz, gfp, may_shrink); ++ if (p && new_sz > nused) + memset(p + nused, 0, new_sz - nused); + return p; +} + +/* ---------------------------------------------------------------------- */ -+ +/* + * aufs caches + */ -+struct kmem_cache *au_cachep[AuCache_Last] = { -+ [0] = NULL -+}; ++ ++struct au_dfree au_dfree; ++ ++/* delayed free */ ++static void au_do_dfree(struct work_struct *work __maybe_unused) ++{ ++ struct llist_head *head; ++ struct llist_node *node, *next; ++ ++#define AU_CACHE_DFREE_DO_BODY(name, idx, lnode) do { \ ++ head = &au_dfree.cache[AuCache_##idx].llist; \ ++ node = llist_del_all(head); \ ++ for (; node; node = next) { \ ++ struct au_##name *p \ ++ = llist_entry(node, struct au_##name, \ ++ lnode); \ ++ next = llist_next(node); \ ++ au_cache_free_##name(p); \ ++ } \ ++ } while (0) ++ ++ AU_CACHE_DFREE_DO_BODY(dinfo, DINFO, di_lnode); ++ AU_CACHE_DFREE_DO_BODY(icntnr, ICNTNR, lnode); ++ AU_CACHE_DFREE_DO_BODY(finfo, FINFO, fi_lnode); ++ AU_CACHE_DFREE_DO_BODY(vdir, VDIR, vd_lnode); ++ AU_CACHE_DFREE_DO_BODY(vdir_dehstr, DEHSTR, lnode); ++#ifdef CONFIG_AUFS_HNOTIFY ++ AU_CACHE_DFREE_DO_BODY(hnotify, HNOTIFY, hn_lnode); ++#endif ++ ++#define AU_DFREE_DO_BODY(llist, func) do { \ ++ node = llist_del_all(llist); \ ++ for (; node; node = next) { \ ++ next = llist_next(node); \ ++ func(node); \ ++ } \ ++ } while (0) ++ ++ AU_DFREE_DO_BODY(au_dfree.llist + AU_DFREE_KFREE, kfree); ++ AU_DFREE_DO_BODY(au_dfree.llist + AU_DFREE_FREE_PAGE, au_free_page); ++ ++#undef AU_CACHE_DFREE_DO_BODY ++#undef AU_DFREE_DO_BODY ++} ++ ++AU_CACHE_DFREE_FUNC(dinfo, DINFO, di_lnode); ++AU_CACHE_DFREE_FUNC(icntnr, ICNTNR, lnode); ++AU_CACHE_DFREE_FUNC(finfo, FINFO, fi_lnode); ++AU_CACHE_DFREE_FUNC(vdir, VDIR, vd_lnode); ++AU_CACHE_DFREE_FUNC(vdir_dehstr, DEHSTR, lnode); + +static void au_cache_fin(void) +{ + int i; ++ struct au_cache *cp; + + /* + * Make sure all delayed rcu free inodes are flushed before we @@ -20415,27 +20740,33 @@ index 0000000..88f8f41 + + /* excluding AuCache_HNOTIFY */ + BUILD_BUG_ON(AuCache_HNOTIFY + 1 != AuCache_Last); ++ flush_delayed_work(&au_dfree.dwork); + for (i = 0; i < AuCache_HNOTIFY; i++) { -+ kmem_cache_destroy(au_cachep[i]); -+ au_cachep[i] = NULL; ++ cp = au_dfree.cache + i; ++ AuDebugOn(!llist_empty(&cp->llist)); ++ kmem_cache_destroy(cp->cache); ++ cp->cache = NULL; + } +} + +static int __init au_cache_init(void) +{ -+ au_cachep[AuCache_DINFO] = AuCacheCtor(au_dinfo, au_di_init_once); -+ if (au_cachep[AuCache_DINFO]) ++ struct au_cache *cp; ++ ++ cp = au_dfree.cache; ++ cp[AuCache_DINFO].cache = AuCacheCtor(au_dinfo, au_di_init_once); ++ if (cp[AuCache_DINFO].cache) + /* SLAB_DESTROY_BY_RCU */ -+ au_cachep[AuCache_ICNTNR] = AuCacheCtor(au_icntnr, -+ au_icntnr_init_once); -+ if (au_cachep[AuCache_ICNTNR]) -+ au_cachep[AuCache_FINFO] = AuCacheCtor(au_finfo, -+ au_fi_init_once); -+ if (au_cachep[AuCache_FINFO]) -+ au_cachep[AuCache_VDIR] = AuCache(au_vdir); -+ if (au_cachep[AuCache_VDIR]) -+ au_cachep[AuCache_DEHSTR] = AuCache(au_vdir_dehstr); -+ if (au_cachep[AuCache_DEHSTR]) ++ cp[AuCache_ICNTNR].cache = AuCacheCtor(au_icntnr, ++ au_icntnr_init_once); ++ if (cp[AuCache_ICNTNR].cache) ++ cp[AuCache_FINFO].cache = AuCacheCtor(au_finfo, ++ au_fi_init_once); ++ if (cp[AuCache_FINFO].cache) ++ cp[AuCache_VDIR].cache = AuCache(au_vdir); ++ if (cp[AuCache_VDIR].cache) ++ cp[AuCache_DEHSTR].cache = AuCache(au_vdir_dehstr); ++ if (cp[AuCache_DEHSTR].cache) + return 0; + + au_cache_fin(); @@ -20497,6 +20828,7 @@ index 0000000..88f8f41 +{ + int err, i; + char *p; ++ struct au_cache *cp; + + p = au_esc_chars; + for (i = 1; i <= ' '; i++) @@ -20511,6 +20843,16 @@ index 0000000..88f8f41 + for (i = 0; i < AuIop_Last; i++) + aufs_iop_nogetattr[i].getattr = NULL; + ++ /* First, initialize au_dfree */ ++ for (i = 0; i < AuCache_Last; i++) { /* including hnotify */ ++ cp = au_dfree.cache + i; ++ cp->cache = NULL; ++ init_llist_head(&cp->llist); ++ } ++ for (i = 0; i < AU_DFREE_Last; i++) ++ init_llist_head(au_dfree.llist + i); ++ INIT_DELAYED_WORK(&au_dfree.dwork, au_do_dfree); ++ + au_sbilist_init(); + sysaufs_brs_init(); + au_debug_init(); @@ -20561,6 +20903,7 @@ index 0000000..88f8f41 +out_sysaufs: + sysaufs_fin(); + au_dy_fin(); ++ flush_delayed_work(&au_dfree.dwork); +out: + return err; +} @@ -20576,16 +20919,17 @@ index 0000000..88f8f41 + au_procfs_fin(); + sysaufs_fin(); + au_dy_fin(); ++ flush_delayed_work(&au_dfree.dwork); +} + +module_init(aufs_init); +module_exit(aufs_exit); diff --git a/fs/aufs/module.h b/fs/aufs/module.h new file mode 100644 -index 0000000..1383e3d +index 0000000..6f968ba --- /dev/null +++ b/fs/aufs/module.h -@@ -0,0 +1,76 @@ +@@ -0,0 +1,143 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -20600,6 +20944,7 @@ index 0000000..1383e3d +#ifdef __KERNEL__ + +#include ++#include "debug.h" + +struct path; +struct seq_file; @@ -20612,7 +20957,19 @@ index 0000000..1383e3d + +extern int au_dir_roflags; + -+void *au_kzrealloc(void *p, unsigned int nused, unsigned int new_sz, gfp_t gfp); ++void *au_krealloc(void *p, unsigned int new_sz, gfp_t gfp, int may_shrink); ++void *au_kzrealloc(void *p, unsigned int nused, unsigned int new_sz, gfp_t gfp, ++ int may_shrink); ++ ++static inline int au_kmidx_sub(size_t sz, size_t new_sz) ++{ ++#ifndef CONFIG_SLOB ++ return kmalloc_index(sz) - kmalloc_index(new_sz); ++#else ++ return -1; /* SLOB is untested */ ++#endif ++} ++ +int au_seq_path(struct seq_file *seq, struct path *path); + +#ifdef CONFIG_PROC_FS @@ -20626,7 +20983,7 @@ index 0000000..1383e3d + +/* ---------------------------------------------------------------------- */ + -+/* kmem cache */ ++/* kmem cache and delayed free */ +enum { + AuCache_DINFO, + AuCache_ICNTNR, @@ -20637,19 +20994,54 @@ index 0000000..1383e3d + AuCache_Last +}; + ++enum { ++ AU_DFREE_KFREE, ++ AU_DFREE_FREE_PAGE, ++ AU_DFREE_Last ++}; ++ ++struct au_cache { ++ struct kmem_cache *cache; ++ struct llist_head llist; /* delayed free */ ++}; ++ ++/* ++ * in order to reduce the cost of the internal timer, consolidate all the ++ * delayed free works into a single delayed_work. ++ */ ++struct au_dfree { ++ struct au_cache cache[AuCache_Last]; ++ struct llist_head llist[AU_DFREE_Last]; ++ struct delayed_work dwork; ++}; ++ ++extern struct au_dfree au_dfree; ++ +#define AuCacheFlags (SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD) +#define AuCache(type) KMEM_CACHE(type, AuCacheFlags) +#define AuCacheCtor(type, ctor) \ + kmem_cache_create(#type, sizeof(struct type), \ + __alignof__(struct type), AuCacheFlags, ctor) + -+extern struct kmem_cache *au_cachep[]; ++#define AU_DFREE_DELAY msecs_to_jiffies(10) ++#define AU_DFREE_BODY(lnode, llist) do { \ ++ if (llist_add(lnode, llist)) \ ++ schedule_delayed_work(&au_dfree.dwork, \ ++ AU_DFREE_DELAY); \ ++ } while (0) ++#define AU_CACHE_DFREE_FUNC(name, idx, lnode) \ ++ void au_cache_dfree_##name(struct au_##name *p) \ ++ { \ ++ struct au_cache *cp = au_dfree.cache + AuCache_##idx; \ ++ AU_DFREE_BODY(&p->lnode, &cp->llist); \ ++ } + +#define AuCacheFuncs(name, index) \ +static inline struct au_##name *au_cache_alloc_##name(void) \ -+{ return kmem_cache_alloc(au_cachep[AuCache_##index], GFP_NOFS); } \ ++{ return kmem_cache_alloc(au_dfree.cache[AuCache_##index].cache, GFP_NOFS); } \ +static inline void au_cache_free_##name(struct au_##name *p) \ -+{ kmem_cache_free(au_cachep[AuCache_##index], p); } ++{ kmem_cache_free(au_dfree.cache[AuCache_##index].cache, p); } \ ++void au_cache_dfree_##name(struct au_##name *p) + +AuCacheFuncs(dinfo, DINFO); +AuCacheFuncs(icntnr, ICNTNR); @@ -20660,11 +21052,30 @@ index 0000000..1383e3d +AuCacheFuncs(hnotify, HNOTIFY); +#endif + ++static inline void au_delayed_kfree(const void *p) ++{ ++ AuDebugOn(!p); ++ AuDebugOn(ksize(p) < sizeof(struct llist_node)); ++ ++ AU_DFREE_BODY((void *)p, au_dfree.llist + AU_DFREE_KFREE); ++} ++ ++/* cast only */ ++static inline void au_free_page(void *p) ++{ ++ free_page((unsigned long)p); ++} ++ ++static inline void au_delayed_free_page(unsigned long addr) ++{ ++ AU_DFREE_BODY((void *)addr, au_dfree.llist + AU_DFREE_FREE_PAGE); ++} ++ +#endif /* __KERNEL__ */ +#endif /* __AUFS_MODULE_H__ */ diff --git a/fs/aufs/mvdown.c b/fs/aufs/mvdown.c new file mode 100644 -index 0000000..a48aa1c +index 0000000..b0e5b84 --- /dev/null +++ b/fs/aufs/mvdown.c @@ -0,0 +1,691 @@ @@ -21354,17 +21765,17 @@ index 0000000..a48aa1c + e = copy_to_user(uarg, &args->mvdown, sizeof(args->mvdown)); + if (unlikely(e)) + err = -EFAULT; -+ kfree(args); ++ au_delayed_kfree(args); +out: + AuTraceErr(err); + return err; +} diff --git a/fs/aufs/opts.c b/fs/aufs/opts.c new file mode 100644 -index 0000000..79c7d71 +index 0000000..1d21f0d --- /dev/null +++ b/fs/aufs/opts.c -@@ -0,0 +1,1846 @@ +@@ -0,0 +1,1847 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -22610,7 +23021,7 @@ index 0000000..79c7d71 + } + } + -+ kfree(a); ++ au_delayed_kfree(a); + dump_opts(opts); + if (unlikely(err)) + au_opts_free(opts); @@ -23032,7 +23443,8 @@ index 0000000..79c7d71 + au_hn_inode_unlock(hdir); + + if (!err && do_free) { -+ kfree(wbr); ++ if (wbr) ++ au_delayed_kfree(wbr); + br->br_wbr = NULL; + } + } @@ -23417,10 +23829,10 @@ index 0000000..0d6c2e1 +#endif /* __AUFS_OPTS_H__ */ diff --git a/fs/aufs/plink.c b/fs/aufs/plink.c new file mode 100644 -index 0000000..c42734d +index 0000000..d8d75e8 --- /dev/null +++ b/fs/aufs/plink.c -@@ -0,0 +1,489 @@ +@@ -0,0 +1,501 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -23455,6 +23867,7 @@ index 0000000..c42734d +{ + int err; + pid_t pid, ppid; ++ struct task_struct *parent, *prev; + struct au_sbinfo *sbi; + + SiMustAnyLock(sb); @@ -23469,11 +23882,22 @@ index 0000000..c42734d + goto out; + + /* todo: it highly depends upon /sbin/mount.aufs */ ++ prev = NULL; ++ parent = current; ++ ppid = 0; + rcu_read_lock(); -+ ppid = task_pid_vnr(rcu_dereference(current->real_parent)); ++ while (1) { ++ parent = rcu_dereference(parent->real_parent); ++ if (parent == prev) ++ break; ++ ppid = task_pid_vnr(parent); ++ if (pid == ppid) { ++ rcu_read_unlock(); ++ goto out; ++ } ++ prev = parent; ++ } + rcu_read_unlock(); -+ if (pid == ppid) -+ goto out; + + if (au_ftest_lock(flags, NOPLMW)) { + /* if there is no i_mutex lock in VFS, we don't need to wait */ @@ -24775,10 +25199,10 @@ index 0000000..6c0d5a9 +#endif /* __AUFS_RWSEM_H__ */ diff --git a/fs/aufs/sbinfo.c b/fs/aufs/sbinfo.c new file mode 100644 -index 0000000..aa97059 +index 0000000..e113b51 --- /dev/null +++ b/fs/aufs/sbinfo.c -@@ -0,0 +1,340 @@ +@@ -0,0 +1,342 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -24801,7 +25225,7 @@ index 0000000..aa97059 + sbinfo = container_of(kobj, struct au_sbinfo, si_kobj); + for (i = 0; i < AuPlink_NHASH; i++) + AuDebugOn(!hlist_empty(&sbinfo->si_plink[i].head)); -+ au_nwt_fin(&sbinfo->si_nowait); ++ AuDebugOn(atomic_read(&sbinfo->si_nowait.nw_len)); + + AuDebugOn(percpu_counter_sum(&sbinfo->si_ninodes)); + percpu_counter_destroy(&sbinfo->si_ninodes); @@ -24812,14 +25236,15 @@ index 0000000..aa97059 + au_br_free(sbinfo); + au_rw_write_unlock(&sbinfo->si_rwsem); + -+ kfree(sbinfo->si_branch); ++ au_delayed_kfree(sbinfo->si_branch); + for (i = 0; i < AU_NPIDMAP; i++) -+ kfree(sbinfo->au_si_pid.pid_bitmap[i]); ++ if (sbinfo->au_si_pid.pid_bitmap[i]) ++ au_delayed_kfree(sbinfo->au_si_pid.pid_bitmap[i]); + mutex_destroy(&sbinfo->au_si_pid.pid_mtx); + mutex_destroy(&sbinfo->si_xib_mtx); + AuRwDestroy(&sbinfo->si_rwsem); + -+ kfree(sbinfo); ++ au_delayed_kfree(sbinfo); +} + +int au_si_alloc(struct super_block *sb) @@ -24891,14 +25316,14 @@ index 0000000..aa97059 + return 0; /* success */ + +out_br: -+ kfree(sbinfo->si_branch); ++ au_delayed_kfree(sbinfo->si_branch); +out_sbinfo: -+ kfree(sbinfo); ++ au_delayed_kfree(sbinfo); +out: + return err; +} + -+int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr) ++int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr, int may_shrink) +{ + int err, sz; + struct au_branch **brp; @@ -24909,7 +25334,8 @@ index 0000000..aa97059 + sz = sizeof(*brp) * (sbinfo->si_bbot + 1); + if (unlikely(!sz)) + sz = sizeof(*brp); -+ brp = au_kzrealloc(sbinfo->si_branch, sz, sizeof(*brp) * nbr, GFP_NOFS); ++ brp = au_kzrealloc(sbinfo->si_branch, sz, sizeof(*brp) * nbr, GFP_NOFS, ++ may_shrink); + if (brp) { + sbinfo->si_branch = brp; + err = 0; @@ -25121,10 +25547,10 @@ index 0000000..aa97059 +} diff --git a/fs/aufs/spl.h b/fs/aufs/spl.h new file mode 100644 -index 0000000..f9b5288 +index 0000000..8f519db3 --- /dev/null +++ b/fs/aufs/spl.h -@@ -0,0 +1,98 @@ +@@ -0,0 +1,100 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -25138,6 +25564,7 @@ index 0000000..f9b5288 + +#ifdef __KERNEL__ + ++#if 0 +struct au_splhead { + spinlock_t spin; + struct list_head head; @@ -25170,6 +25597,7 @@ index 0000000..f9b5288 + list_del_rcu(list); + spin_unlock(&spl->spin); +} ++#endif + +/* ---------------------------------------------------------------------- */ + @@ -25225,10 +25653,10 @@ index 0000000..f9b5288 +#endif /* __AUFS_SPL_H__ */ diff --git a/fs/aufs/super.c b/fs/aufs/super.c new file mode 100644 -index 0000000..8bd2d9c +index 0000000..58a773c --- /dev/null +++ b/fs/aufs/super.c -@@ -0,0 +1,1026 @@ +@@ -0,0 +1,1025 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -25264,8 +25692,7 @@ index 0000000..8bd2d9c +{ + struct inode *inode = container_of(head, struct inode, i_rcu); + -+ INIT_HLIST_HEAD(&inode->i_dentry); -+ au_cache_free_icntnr(container_of(inode, struct au_icntnr, vfs_inode)); ++ au_cache_dfree_icntnr(container_of(inode, struct au_icntnr, vfs_inode)); +} + +static void aufs_destroy_inode(struct inode *inode) @@ -26047,7 +26474,7 @@ index 0000000..8bd2d9c +out_mtx: + inode_unlock(inode); +out_opts: -+ free_page((unsigned long)opts.opt); ++ au_delayed_free_page((unsigned long)opts.opt); +out: + err = cvt_err(err); + AuTraceErr(err); @@ -26188,7 +26615,7 @@ index 0000000..8bd2d9c + kobject_put(&sbinfo->si_kobj); + sb->s_fs_info = NULL; +out_opts: -+ free_page((unsigned long)opts.opt); ++ au_delayed_free_page((unsigned long)opts.opt); +out: + AuTraceErr(err); + err = cvt_err(err); @@ -26257,7 +26684,7 @@ index 0000000..8bd2d9c +}; diff --git a/fs/aufs/super.h b/fs/aufs/super.h new file mode 100644 -index 0000000..b8ca149 +index 0000000..e4ac866 --- /dev/null +++ b/fs/aufs/super.h @@ -0,0 +1,625 @@ @@ -26529,7 +26956,7 @@ index 0000000..b8ca149 +/* sbinfo.c */ +void au_si_free(struct kobject *kobj); +int au_si_alloc(struct super_block *sb); -+int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr); ++int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr, int may_shrink); + +unsigned int au_sigen_inc(struct super_block *sb); +aufs_bindex_t au_new_br_id(struct super_block *sb); @@ -27079,7 +27506,7 @@ index 0000000..1f79983 +#endif /* __SYSAUFS_H__ */ diff --git a/fs/aufs/sysfs.c b/fs/aufs/sysfs.c new file mode 100644 -index 0000000..0efb77a +index 0000000..f4c3170 --- /dev/null +++ b/fs/aufs/sysfs.c @@ -0,0 +1,340 @@ @@ -27258,7 +27685,7 @@ index 0000000..0efb77a + if (unlikely(err == PAGE_SIZE)) + err = -EFBIG; + } -+ kfree(seq); ++ au_delayed_kfree(seq); +out_unlock: + si_read_unlock(sb); +out: @@ -27329,9 +27756,9 @@ index 0000000..0efb77a + err = -EFAULT; + +out_seq: -+ kfree(seq); ++ au_delayed_kfree(seq); +out_buf: -+ free_page((unsigned long)buf); ++ au_delayed_free_page((unsigned long)buf); +out: + si_read_unlock(sb); + return err; @@ -27575,10 +28002,10 @@ index 0000000..7d22979 +} diff --git a/fs/aufs/vdir.c b/fs/aufs/vdir.c new file mode 100644 -index 0000000..0a9ff00 +index 0000000..b2eb4c0 --- /dev/null +++ b/fs/aufs/vdir.c -@@ -0,0 +1,876 @@ +@@ -0,0 +1,887 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -27678,7 +28105,7 @@ index 0000000..0a9ff00 + struct hlist_node *node; + + hlist_for_each_entry_safe(pos, node, head, wh_hash) -+ kfree(pos); ++ au_delayed_kfree(pos); +} + +static void au_nhash_de_do_free(struct hlist_head *head) @@ -27687,7 +28114,7 @@ index 0000000..0a9ff00 + struct hlist_node *node; + + hlist_for_each_entry_safe(pos, node, head, hash) -+ au_cache_free_vdir_dehstr(pos); ++ au_cache_dfree_vdir_dehstr(pos); +} + +static void au_nhash_do_free(struct au_nhash *nhash, @@ -27705,7 +28132,7 @@ index 0000000..0a9ff00 + nhash_count(head); + free(head++); + } -+ kfree(nhash->nh_head); ++ au_delayed_kfree(nhash->nh_head); +} + +void au_nhash_wh_free(struct au_nhash *whlist) @@ -27748,6 +28175,8 @@ index 0000000..0a9ff00 + AuDebugOn(!nhash->nh_num || !nhash->nh_head); + + v = 0; ++ if (len > 8) ++ len = 8; + while (len--) + v += *name++; + /* v = hash_long(v, magic_bit); */ @@ -27845,8 +28274,8 @@ index 0000000..0a9ff00 + unsigned char **o; + + err = -ENOMEM; -+ o = krealloc(vdir->vd_deblk, sizeof(*o) * (vdir->vd_nblk + 1), -+ GFP_NOFS); ++ o = au_krealloc(vdir->vd_deblk, sizeof(*o) * (vdir->vd_nblk + 1), ++ GFP_NOFS, /*may_shrink*/0); + if (unlikely(!o)) + goto out; + @@ -27916,15 +28345,23 @@ index 0000000..0a9ff00 + +/* ---------------------------------------------------------------------- */ + -+void au_vdir_free(struct au_vdir *vdir) ++void au_vdir_free(struct au_vdir *vdir, int atonce) +{ + unsigned char **deblk; + + deblk = vdir->vd_deblk; -+ while (vdir->vd_nblk--) -+ kfree(*deblk++); -+ kfree(vdir->vd_deblk); -+ au_cache_free_vdir(vdir); ++ if (!atonce) { ++ while (vdir->vd_nblk--) ++ au_delayed_kfree(*deblk++); ++ au_delayed_kfree(vdir->vd_deblk); ++ au_cache_dfree_vdir(vdir); ++ } else { ++ /* not delayed */ ++ while (vdir->vd_nblk--) ++ kfree(*deblk++); ++ kfree(vdir->vd_deblk); ++ au_cache_free_vdir(vdir); ++ } +} + +static struct au_vdir *alloc_vdir(struct file *file) @@ -27958,10 +28395,10 @@ index 0000000..0a9ff00 + if (!err) + return vdir; /* success */ + -+ kfree(vdir->vd_deblk); ++ au_delayed_kfree(vdir->vd_deblk); + +out_free: -+ au_cache_free_vdir(vdir); ++ au_cache_dfree_vdir(vdir); +out: + vdir = ERR_PTR(err); + return vdir; @@ -27973,7 +28410,7 @@ index 0000000..0a9ff00 + union au_vdir_deblk_p p, deblk_end; + + while (vdir->vd_nblk > 1) { -+ kfree(vdir->vd_deblk[vdir->vd_nblk - 1]); ++ au_delayed_kfree(vdir->vd_deblk[vdir->vd_nblk - 1]); + /* vdir->vd_deblk[vdir->vd_nblk - 1] = NULL; */ + vdir->vd_nblk--; + } @@ -28104,7 +28541,7 @@ index 0000000..0a9ff00 + } + } + -+ free_page((unsigned long)o); ++ au_delayed_free_page((unsigned long)o); + +out: + AuTraceErr(err); @@ -28243,7 +28680,7 @@ index 0000000..0a9ff00 + if (allocated) + au_set_ivdir(inode, allocated); + } else if (allocated) -+ au_vdir_free(allocated); ++ au_vdir_free(allocated, /*atonce*/0); + +out: + return err; @@ -28261,8 +28698,8 @@ index 0000000..0a9ff00 + if (tgt->vd_nblk < src->vd_nblk) { + unsigned char **p; + -+ p = krealloc(tgt->vd_deblk, sizeof(*p) * src->vd_nblk, -+ GFP_NOFS); ++ p = au_krealloc(tgt->vd_deblk, sizeof(*p) * src->vd_nblk, ++ GFP_NOFS, /*may_shrink*/0); + if (unlikely(!p)) + goto out; + tgt->vd_deblk = p; @@ -28272,7 +28709,8 @@ index 0000000..0a9ff00 + unsigned char *p; + + tgt->vd_deblk_sz = deblk_sz; -+ p = krealloc(tgt->vd_deblk[0], deblk_sz, GFP_NOFS); ++ p = au_krealloc(tgt->vd_deblk[0], deblk_sz, GFP_NOFS, ++ /*may_shrink*/1); + if (unlikely(!p)) + goto out; + tgt->vd_deblk[0] = p; @@ -28337,7 +28775,7 @@ index 0000000..0a9ff00 + if (allocated) + au_set_fvdir_cache(file, allocated); + } else if (allocated) -+ au_vdir_free(allocated); ++ au_vdir_free(allocated, /*atonce*/0); + +out: + return err; @@ -29334,10 +29772,10 @@ index 0000000..2e54bad +} diff --git a/fs/aufs/vfsub.h b/fs/aufs/vfsub.h new file mode 100644 -index 0000000..291bfae +index 0000000..64fff0f --- /dev/null +++ b/fs/aufs/vfsub.h -@@ -0,0 +1,297 @@ +@@ -0,0 +1,303 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -29523,6 +29961,12 @@ index 0000000..291bfae + return flags; +} + ++static inline int vfsub_file_execed(struct file *file) ++{ ++ /* todo: direct access f_flags */ ++ return !!(vfsub_file_flags(file) & __FMODE_EXEC); ++} ++ +#if 0 /* reserved */ +static inline void vfsub_file_accessed(struct file *h_file) +{ @@ -29637,7 +30081,7 @@ index 0000000..291bfae +#endif /* __AUFS_VFSUB_H__ */ diff --git a/fs/aufs/wbr_policy.c b/fs/aufs/wbr_policy.c new file mode 100644 -index 0000000..91a010a +index 0000000..79eb9b4 --- /dev/null +++ b/fs/aufs/wbr_policy.c @@ -0,0 +1,752 @@ @@ -30091,7 +30535,7 @@ index 0000000..91a010a + + mfs->mfsrr_bytes = bavail; + AuDbg("b%d\n", mfs->mfs_bindex); -+ kfree(st); ++ au_delayed_kfree(st); +} + +static int au_wbr_create_mfs(struct dentry *dentry, unsigned int flags) @@ -30395,7 +30839,7 @@ index 0000000..91a010a +}; diff --git a/fs/aufs/whout.c b/fs/aufs/whout.c new file mode 100644 -index 0000000..16a96f88 +index 0000000..54feb08 --- /dev/null +++ b/fs/aufs/whout.c @@ -0,0 +1,1047 @@ @@ -30550,7 +30994,7 @@ index 0000000..16a96f88 + +out_name: + if (name != defname) -+ kfree(name); ++ au_delayed_kfree(name); +out: + AuTraceErrPtr(dentry); + return dentry; @@ -30989,7 +31433,7 @@ index 0000000..16a96f88 + au_br_put(a->br); + si_write_unlock(a->sb); + au_nwt_done(&au_sbi(a->sb)->si_nowait); -+ kfree(arg); ++ au_delayed_kfree(arg); + if (unlikely(err)) + AuIOErr("err %d\n", err); +} @@ -31017,7 +31461,7 @@ index 0000000..16a96f88 + if (unlikely(wkq_err)) { + atomic_dec(&br->br_wbr->wbr_wh_running); + au_br_put(br); -+ kfree(arg); ++ au_delayed_kfree(arg); + } + do_dec = 0; + } @@ -31176,7 +31620,7 @@ index 0000000..16a96f88 + wh_dentry = ERR_PTR(err); + if (!err) { + wh_dentry = vfsub_lkup_one(&wh_name, h_parent); -+ kfree(wh_name.name); ++ au_delayed_kfree(wh_name.name); + } + return wh_dentry; +} @@ -31252,7 +31696,7 @@ index 0000000..16a96f88 + break; + } + } -+ free_page((unsigned long)wh_name.name); ++ au_delayed_free_page((unsigned long)wh_name.name); + +out: + return err; @@ -31294,7 +31738,7 @@ index 0000000..16a96f88 + rdhash = AUFS_RDHASH_DEF; + err = au_nhash_alloc(&whtmp->whlist, rdhash, gfp); + if (unlikely(err)) { -+ kfree(whtmp); ++ au_delayed_kfree(whtmp); + whtmp = ERR_PTR(err); + } + @@ -31309,7 +31753,7 @@ index 0000000..16a96f88 + dput(whtmp->wh_dentry); + iput(whtmp->dir); + au_nhash_wh_free(&whtmp->whlist); -+ kfree(whtmp); ++ au_delayed_kfree(whtmp); +} + +/* @@ -31526,10 +31970,10 @@ index 0000000..4077dd1 +#endif /* __AUFS_WHOUT_H__ */ diff --git a/fs/aufs/wkq.c b/fs/aufs/wkq.c new file mode 100644 -index 0000000..65c0137 +index 0000000..216d08f --- /dev/null +++ b/fs/aufs/wkq.c -@@ -0,0 +1,205 @@ +@@ -0,0 +1,200 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -31573,7 +32017,7 @@ index 0000000..65c0137 + else { + kobject_put(wkinfo->kobj); + module_put(THIS_MODULE); /* todo: ?? */ -+ kfree(wkinfo); ++ au_delayed_kfree(wkinfo); + } +} + @@ -31596,7 +32040,7 @@ index 0000000..65c0137 + +static void au_wkq_comp_free(struct completion *comp) +{ -+ kfree(comp); ++ au_delayed_kfree(comp); +} + +#else @@ -31677,7 +32121,7 @@ index 0000000..65c0137 + int err; + struct au_wkinfo *wkinfo; + -+ percpu_counter_inc(&au_sbi(sb)->si_nowait.nw_len); ++ atomic_inc(&au_sbi(sb)->si_nowait.nw_len); + + /* + * wkq_func() must free this wkinfo. @@ -31707,16 +32151,11 @@ index 0000000..65c0137 + +void au_nwt_init(struct au_nowait_tasks *nwt) +{ -+ percpu_counter_init(&nwt->nw_len, 0, GFP_NOFS); ++ atomic_set(&nwt->nw_len, 0); ++ /* smp_mb(); */ /* atomic_set */ + init_waitqueue_head(&nwt->nw_wq); +} + -+void au_nwt_fin(struct au_nowait_tasks *nwt) -+{ -+ AuDebugOn(percpu_counter_sum(&nwt->nw_len)); -+ percpu_counter_destroy(&nwt->nw_len); -+} -+ +void au_wkq_fin(void) +{ + destroy_workqueue(au_wkq); @@ -31737,10 +32176,10 @@ index 0000000..65c0137 +} diff --git a/fs/aufs/wkq.h b/fs/aufs/wkq.h new file mode 100644 -index 0000000..0b870cc +index 0000000..6d63f74 --- /dev/null +++ b/fs/aufs/wkq.h -@@ -0,0 +1,82 @@ +@@ -0,0 +1,80 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -31765,7 +32204,7 @@ index 0000000..0b870cc + * in the next operation, wait for the 'nowait' tasks in system-wide workqueue + */ +struct au_nowait_tasks { -+ struct percpu_counter nw_len; ++ atomic_t nw_len; + wait_queue_head_t nw_wq; +}; + @@ -31792,7 +32231,6 @@ index 0000000..0b870cc +int au_wkq_nowait(au_wkq_func_t func, void *args, struct super_block *sb, + unsigned int flags); +void au_nwt_init(struct au_nowait_tasks *nwt); -+void au_nwt_fin(struct au_nowait_tasks *nwt); +int __init au_wkq_init(void); +void au_wkq_fin(void); + @@ -31810,14 +32248,13 @@ index 0000000..0b870cc + +static inline void au_nwt_done(struct au_nowait_tasks *nwt) +{ -+ percpu_counter_dec(&nwt->nw_len); -+ if (!percpu_counter_sum(&nwt->nw_len)) ++ if (atomic_dec_and_test(&nwt->nw_len)) + wake_up_all(&nwt->nw_wq); +} + +static inline int au_nwt_flush(struct au_nowait_tasks *nwt) +{ -+ wait_event(nwt->nw_wq, !percpu_counter_sum(&nwt->nw_len)); ++ wait_event(nwt->nw_wq, !atomic_read(&nwt->nw_len)); + return 0; +} + @@ -31825,10 +32262,10 @@ index 0000000..0b870cc +#endif /* __AUFS_WKQ_H__ */ diff --git a/fs/aufs/xattr.c b/fs/aufs/xattr.c new file mode 100644 -index 0000000..c12518f +index 0000000..2a148c9 --- /dev/null +++ b/fs/aufs/xattr.c -@@ -0,0 +1,332 @@ +@@ -0,0 +1,334 @@ +/* + * Copyright (C) 2014-2016 Junjiro R. Okajima + */ @@ -31994,10 +32431,12 @@ index 0000000..c12518f + AuTraceErr(err); + } + -+ kfree(value); ++ if (value) ++ au_delayed_kfree(value); + +out_free: -+ kfree(o); ++ if (o) ++ au_delayed_kfree(o); +out: + if (!unlocked) + inode_unlock(h_isrc); @@ -32163,10 +32602,10 @@ index 0000000..c12518f +#endif diff --git a/fs/aufs/xino.c b/fs/aufs/xino.c new file mode 100644 -index 0000000..4d1d5d4 +index 0000000..2a411f9 --- /dev/null +++ b/fs/aufs/xino.c -@@ -0,0 +1,1304 @@ +@@ -0,0 +1,1305 @@ +/* + * Copyright (C) 2005-2016 Junjiro R. Okajima + */ @@ -32494,7 +32933,7 @@ index 0000000..4d1d5d4 + AuErr1("statfs err %d, ignored\n", err); + +out_st: -+ kfree(st); ++ au_delayed_kfree(st); +out: + return err; +} @@ -32529,7 +32968,7 @@ index 0000000..4d1d5d4 + au_br_put(br); + si_write_unlock(sb); + au_nwt_done(&au_sbi(sb)->si_nowait); -+ kfree(args); ++ au_delayed_kfree(args); +} + +static int xino_trunc_test(struct super_block *sb, struct au_branch *br) @@ -32571,7 +33010,7 @@ index 0000000..4d1d5d4 + args = kmalloc(sizeof(*args), GFP_NOFS); + if (unlikely(!args)) { + AuErr1("no memory\n"); -+ goto out_args; ++ goto out; + } + + au_br_get(br); @@ -32583,9 +33022,8 @@ index 0000000..4d1d5d4 + + pr_err("wkq %d\n", wkq_err); + au_br_put(br); ++ au_delayed_kfree(args); + -+out_args: -+ kfree(args); +out: + atomic_dec(&br->br_xino_running); +} @@ -33108,7 +33546,7 @@ index 0000000..4d1d5d4 + (sb, au_sbr(sb, bindex)->br_xino.xi_file, page); + else + AuDbg("b%d\n", bindex); -+ free_page((unsigned long)page); ++ au_delayed_free_page((unsigned long)page); + +out: + return err; @@ -33185,7 +33623,8 @@ index 0000000..4d1d5d4 + if (sbinfo->si_xib) + fput(sbinfo->si_xib); + sbinfo->si_xib = NULL; -+ free_page((unsigned long)sbinfo->si_xib_buf); ++ if (sbinfo->si_xib_buf) ++ au_delayed_free_page((unsigned long)sbinfo->si_xib_buf); + sbinfo->si_xib_buf = NULL; +} + @@ -33228,7 +33667,8 @@ index 0000000..4d1d5d4 + goto out; /* success */ + +out_free: -+ free_page((unsigned long)sbinfo->si_xib_buf); ++ if (sbinfo->si_xib_buf) ++ au_delayed_free_page((unsigned long)sbinfo->si_xib_buf); + sbinfo->si_xib_buf = NULL; + if (err >= 0) + err = -EIO; @@ -33321,7 +33761,7 @@ index 0000000..4d1d5d4 + fput(p->new); + else + break; -+ kfree(fpair); ++ au_delayed_kfree(fpair); +out: + return err; +} @@ -33432,7 +33872,7 @@ index 0000000..4d1d5d4 + if (!IS_ERR(file)) + au_xino_brid_set(sb, br->br_id); + } -+ free_page((unsigned long)page); ++ au_delayed_free_page((unsigned long)page); + } else { + file = au_xino_create(sb, AUFS_XINO_DEFPATH, /*silent*/0); + if (IS_ERR(file)) @@ -33472,10 +33912,10 @@ index 0000000..4d1d5d4 + return err; +} diff --git a/fs/dcache.c b/fs/dcache.c -index d6847d7..c3c0b6d 100644 +index 5c7cc95..df0268c 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -1202,7 +1202,7 @@ enum d_walk_ret { +@@ -1164,7 +1164,7 @@ enum d_walk_ret { * * The @enter() and @finish() callbacks are called with d_lock held. */ @@ -33507,10 +33947,10 @@ index 350a2c8..6f42279 100644 return error; diff --git a/fs/inode.c b/fs/inode.c -index 4ccbc21..aa6d071 100644 +index 7e3ef3a..675fe84 100644 --- a/fs/inode.c +++ b/fs/inode.c -@@ -1591,7 +1591,7 @@ EXPORT_SYMBOL(generic_update_time); +@@ -1593,7 +1593,7 @@ EXPORT_SYMBOL(generic_update_time); * This does the actual work of updating an inodes time or version. Must have * had called mnt_want_write() before calling this. */ @@ -33520,10 +33960,10 @@ index 4ccbc21..aa6d071 100644 int (*update_time)(struct inode *, struct timespec *, int); diff --git a/fs/proc/base.c b/fs/proc/base.c -index a11eb71..8f10865 100644 +index ac0df4d..42255e5 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c -@@ -1939,7 +1939,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path) +@@ -1938,7 +1938,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path) down_read(&mm->mmap_sem); vma = find_exact_vma(mm, vm_start, vm_end); if (vma && vma->vm_file) { @@ -33549,7 +33989,7 @@ index f8595e8..cb8eda0 100644 ino = inode->i_ino; } diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index 4648c7f..061cb85 100644 +index f6fa99e..2750949 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -298,7 +298,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) @@ -33564,7 +34004,7 @@ index 4648c7f..061cb85 100644 dev = inode->i_sb->s_dev; ino = inode->i_ino; pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; -@@ -1624,7 +1627,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid) +@@ -1634,7 +1637,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid) struct proc_maps_private *proc_priv = &numa_priv->proc_maps; struct vm_area_struct *vma = v; struct numa_maps *md = &numa_priv->md; @@ -33590,7 +34030,7 @@ index faacb0c..17b43be 100644 ino = inode->i_ino; pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; diff --git a/fs/read_write.c b/fs/read_write.c -index 933b53a..2d13282 100644 +index 66215a7..a1da117 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -515,6 +515,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count, @@ -33663,10 +34103,10 @@ index 7444f5f..bdac0be 100644 static inline void fput_light(struct file *file, int fput_needed) { diff --git a/include/linux/fs.h b/include/linux/fs.h -index dd28814..b689a48 100644 +index 901e25d..a71aa9e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h -@@ -1306,6 +1306,7 @@ extern void fasync_free(struct fasync_struct *); +@@ -1275,6 +1275,7 @@ extern void fasync_free(struct fasync_struct *); /* can be called from interrupts */ extern void kill_fasync(struct fasync_struct **, int, int); @@ -33674,7 +34114,7 @@ index dd28814..b689a48 100644 extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force); extern void f_setown(struct file *filp, unsigned long arg, int force); extern void f_delown(struct file *filp); -@@ -1690,6 +1691,7 @@ struct file_operations { +@@ -1699,6 +1700,7 @@ struct file_operations { ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); int (*check_flags)(int); @@ -33682,7 +34122,7 @@ index dd28814..b689a48 100644 int (*flock) (struct file *, int, struct file_lock *); ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); -@@ -1750,6 +1752,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, +@@ -1759,6 +1761,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, struct iovec *fast_pointer, struct iovec **ret_pointer); @@ -33695,7 +34135,7 @@ index dd28814..b689a48 100644 extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *); extern ssize_t __vfs_write(struct file *, const char __user *, size_t, loff_t *); extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); -@@ -2105,6 +2113,7 @@ extern int current_umask(void); +@@ -2123,6 +2131,7 @@ extern int current_umask(void); extern void ihold(struct inode * inode); extern void iput(struct inode *); extern int generic_update_time(struct inode *, struct timespec *, int); @@ -33704,10 +34144,10 @@ index dd28814..b689a48 100644 /* /sys/fs */ extern struct kobject *fs_kobj; diff --git a/include/linux/mm.h b/include/linux/mm.h -index ece042d..1e24513 100644 +index ef815b9..a772481 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h -@@ -1239,6 +1239,28 @@ static inline int fixup_user_fault(struct task_struct *tsk, +@@ -1278,6 +1278,28 @@ static inline int fixup_user_fault(struct task_struct *tsk, } #endif @@ -33737,10 +34177,10 @@ index ece042d..1e24513 100644 extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, int len, int write); diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h -index ca3e517..10bc491 100644 +index 903200f..55fc528 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h -@@ -274,6 +274,7 @@ struct vm_region { +@@ -275,6 +275,7 @@ struct vm_region { unsigned long vm_top; /* region allocated to here */ unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ struct file *vm_file; /* the backing file or NULL */ @@ -33748,7 +34188,7 @@ index ca3e517..10bc491 100644 int vm_usage; /* region usage count (access under nommu_region_sem) */ bool vm_icache_flushed : 1; /* true if the icache has been flushed for -@@ -348,6 +349,7 @@ struct vm_area_struct { +@@ -349,6 +350,7 @@ struct vm_area_struct { unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE units */ struct file * vm_file; /* File we map to (can be NULL). */ @@ -33772,7 +34212,7 @@ index da2751d..2e0fca6 100644 + unsigned int flags); #endif diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild -index 8bdae34..65dbd5f 100644 +index 185f8ea..5deb0d1 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild @@ -59,6 +59,7 @@ header-y += atmsvc.h @@ -33785,7 +34225,7 @@ index 8bdae34..65dbd5f 100644 header-y += auxvec.h diff --git a/include/uapi/linux/aufs_type.h b/include/uapi/linux/aufs_type.h new file mode 100644 -index 0000000..4e08bdf +index 0000000..e220283 --- /dev/null +++ b/include/uapi/linux/aufs_type.h @@ -0,0 +1,406 @@ @@ -33817,7 +34257,7 @@ index 0000000..4e08bdf + +#include + -+#define AUFS_VERSION "4.x-rcN" ++#define AUFS_VERSION "4.8" + +/* todo? move this to linux-2.6.19/include/magic.h */ +#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') @@ -34196,10 +34636,10 @@ index 0000000..4e08bdf + +#endif /* __AUFS_TYPE_H__ */ diff --git a/kernel/fork.c b/kernel/fork.c -index 4a7ec0c..8c8f7ac 100644 +index beb3172..ad4cfa8 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -479,7 +479,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) +@@ -477,7 +477,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) struct inode *inode = file_inode(file); struct address_space *mapping = file->f_mapping; @@ -34209,10 +34649,10 @@ index 4a7ec0c..8c8f7ac 100644 atomic_dec(&inode->i_writecount); i_mmap_lock_write(mapping); diff --git a/mm/Makefile b/mm/Makefile -index 78c6f7d..aea4230 100644 +index 2ca1faf..6b9da3f 100644 --- a/mm/Makefile +++ b/mm/Makefile -@@ -37,7 +37,7 @@ obj-y := filemap.o mempool.o oom_kill.o \ +@@ -40,7 +40,7 @@ obj-y := filemap.o mempool.o oom_kill.o \ mm_init.o mmu_context.o percpu.o slab_common.o \ compaction.o vmacache.o \ interval_tree.o list_lru.o workingset.o \ @@ -34222,10 +34662,10 @@ index 78c6f7d..aea4230 100644 obj-y += init-mm.o diff --git a/mm/filemap.c b/mm/filemap.c -index 20f3b1f..ee827ce 100644 +index 2d0986a..4a31bad 100644 --- a/mm/filemap.c +++ b/mm/filemap.c -@@ -2208,7 +2208,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) +@@ -2284,7 +2284,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) int ret = VM_FAULT_LOCKED; sb_start_pagefault(inode->i_sb); @@ -34235,10 +34675,10 @@ index 20f3b1f..ee827ce 100644 if (page->mapping != inode->i_mapping) { unlock_page(page); diff --git a/mm/memory.c b/mm/memory.c -index cd1f29e..f0c204c 100644 +index 793fe0f..45f39f3 100644 --- a/mm/memory.c +++ b/mm/memory.c -@@ -2100,7 +2100,7 @@ static inline int wp_page_reuse(struct mm_struct *mm, +@@ -2113,7 +2113,7 @@ static inline int wp_page_reuse(struct fault_env *fe, pte_t orig_pte, } if (!page_mkwrite) @@ -34248,10 +34688,10 @@ index cd1f29e..f0c204c 100644 return VM_FAULT_WRITE; diff --git a/mm/mmap.c b/mm/mmap.c -index de2c176..b7f391c 100644 +index ca9d91b..f3ebc5a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c -@@ -162,7 +162,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) +@@ -163,7 +163,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) @@ -34260,7 +34700,7 @@ index de2c176..b7f391c 100644 mpol_put(vma_policy(vma)); kmem_cache_free(vm_area_cachep, vma); return next; -@@ -782,7 +782,7 @@ again: remove_next = 1 + (end > next->vm_end); +@@ -790,7 +790,7 @@ again: if (remove_next) { if (file) { uprobe_munmap(next, next->vm_start, next->vm_end); @@ -34269,7 +34709,7 @@ index de2c176..b7f391c 100644 } if (next->anon_vma) anon_vma_merge(vma, next); -@@ -1563,8 +1563,8 @@ out: +@@ -1574,8 +1574,8 @@ out: return addr; unmap_and_free_vma: @@ -34279,7 +34719,7 @@ index de2c176..b7f391c 100644 /* Undo any partial mapping done by a device driver. */ unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end); -@@ -2358,7 +2358,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -2380,7 +2380,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, goto out_free_mpol; if (new->vm_file) @@ -34288,7 +34728,7 @@ index de2c176..b7f391c 100644 if (new->vm_ops && new->vm_ops->open) new->vm_ops->open(new); -@@ -2377,7 +2377,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -2399,7 +2399,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, if (new->vm_ops && new->vm_ops->close) new->vm_ops->close(new); if (new->vm_file) @@ -34297,7 +34737,7 @@ index de2c176..b7f391c 100644 unlink_anon_vmas(new); out_free_mpol: mpol_put(vma_policy(new)); -@@ -2528,7 +2528,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, +@@ -2550,7 +2550,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, struct vm_area_struct *vma; unsigned long populate = 0; unsigned long ret = -EINVAL; @@ -34306,7 +34746,7 @@ index de2c176..b7f391c 100644 pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt.\n", current->comm, current->pid); -@@ -2597,10 +2597,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, +@@ -2625,10 +2625,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, } } @@ -34335,7 +34775,7 @@ index de2c176..b7f391c 100644 out: up_write(&mm->mmap_sem); if (populate) -@@ -2873,7 +2890,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, +@@ -2903,7 +2920,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, if (anon_vma_clone(new_vma, vma)) goto out_free_mempol; if (new_vma->vm_file) @@ -34345,7 +34785,7 @@ index de2c176..b7f391c 100644 new_vma->vm_ops->open(new_vma); vma_link(mm, new_vma, prev, rb_link, rb_parent); diff --git a/mm/nommu.c b/mm/nommu.c -index c2e588802..c39edc4 100644 +index 95daf81..5086a29 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -644,7 +644,7 @@ static void __put_nommu_region(struct vm_region *region) diff --git a/kernel/kernel/files/patches/mageia/gpu-drm-i915-gen9-fix-DDB-partitioning-for-multi-screen-cases.patch b/kernel/kernel/files/patches/mageia/gpu-drm-i915-gen9-fix-DDB-partitioning-for-multi-screen-cases.patch new file mode 100644 index 00000000..f7d2ac73 --- /dev/null +++ b/kernel/kernel/files/patches/mageia/gpu-drm-i915-gen9-fix-DDB-partitioning-for-multi-screen-cases.patch @@ -0,0 +1,75 @@ +From 5a920b85f2c6e3fd7d9dd9bb3f3345e9085e2360 Mon Sep 17 00:00:00 2001 +From: Paulo Zanoni +Date: Tue, 4 Oct 2016 14:37:32 -0300 +Subject: drm/i915/gen9: fix DDB partitioning for multi-screen cases + +With the previous code we were only recomputing the DDB partitioning +for the CRTCs included in the atomic commit, so any other active CRTCs +would end up having their DDB registers zeroed. In this patch we make +sure that the computed state starts as a copy of the current +partitioning, and then we only zero the DDBs that we're actually +going to recompute. + +How to reproduce the bug: + 1 - Enable the primary plane on pipe A + 2 - Enable the primary plane on pipe B + 3 - Enable the cursor or sprite plane on pipe A + +Step 3 will zero the DDB partitioning for pipe B since it's not +included in the commit that enabled the cursor or sprite for pipe A. + +I expect this to fix many FIFO underrun problems on gen9+. + +v2: + - Mention the cursor on the steps to reproduce the problem (Paulo). + - Add Testcase tag provided by Maarten (Maarten). + +Testcase: kms_cursor_legacy.cursorA-vs-flipB-atomic-transitions +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96226 +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96828 +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97450 +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97596 +Bugzilla: https://www.phoronix.com/scan.php?page=news_item&px=Intel-Skylake-Multi-Screen-Woes +Cc: stable@vger.kernel.org +Signed-off-by: Paulo Zanoni +Reviewed-by: Lyude +Link: http://patchwork.freedesktop.org/patch/msgid/1475602652-17326-1-git-send-email-paulo.r.zanoni@intel.com + +diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c +index 7f1748a..fe6c1c6 100644 +--- a/drivers/gpu/drm/i915/intel_pm.c ++++ b/drivers/gpu/drm/i915/intel_pm.c +@@ -3362,13 +3362,15 @@ skl_allocate_pipe_ddb(struct intel_crtc_state *cstate, + int num_active; + int id, i; + ++ /* Clear the partitioning for disabled planes. */ ++ memset(ddb->plane[pipe], 0, sizeof(ddb->plane[pipe])); ++ memset(ddb->y_plane[pipe], 0, sizeof(ddb->y_plane[pipe])); ++ + if (WARN_ON(!state)) + return 0; + + if (!cstate->base.active) { + ddb->pipe[pipe].start = ddb->pipe[pipe].end = 0; +- memset(ddb->plane[pipe], 0, sizeof(ddb->plane[pipe])); +- memset(ddb->y_plane[pipe], 0, sizeof(ddb->y_plane[pipe])); + return 0; + } + +@@ -4054,6 +4056,12 @@ skl_compute_ddb(struct drm_atomic_state *state) + intel_state->wm_results.dirty_pipes = ~0; + } + ++ /* ++ * We're not recomputing for the pipes not included in the commit, so ++ * make sure we start with the current state. ++ */ ++ memcpy(ddb, &dev_priv->wm.skl_hw.ddb, sizeof(*ddb)); ++ + for_each_intel_crtc_mask(dev, intel_crtc, realloc_pipes) { + struct intel_crtc_state *cstate; + +-- +cgit v0.10.2 + diff --git a/kernel/kernel/files/patches/mageia/net-add-recursion-limit-to-GRO.patch b/kernel/kernel/files/patches/mageia/net-add-recursion-limit-to-GRO.patch index cece1d9f..a3e3aa52 100644 --- a/kernel/kernel/files/patches/mageia/net-add-recursion-limit-to-GRO.patch +++ b/kernel/kernel/files/patches/mageia/net-add-recursion-limit-to-GRO.patch @@ -1,9 +1,10 @@ - +From fcd91dd449867c6bfe56a81cabba76b829fd05cd Mon Sep 17 00:00:00 2001 From: Sabrina Dubroca - -https://bugzilla.redhat.com/show_bug.cgi?id=1375944 -https://patchwork.ozlabs.org/patch/680412/ - +Date: Thu, 20 Oct 2016 15:58:02 +0200 +Subject: [PATCH] net: add recursion limit to GRO +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Currently, GRO can do unlimited recursion through the gro_receive handlers. This was fixed for tunneling protocols by limiting tunnel GRO @@ -13,7 +14,9 @@ receive a packet composed entirely of VLAN headers. This patch adds a recursion counter to the GRO layer to prevent stack overflow. When a gro_receive function hits the recursion limit, GRO is -aborted for this skb and it is processed normally. +aborted for this skb and it is processed normally. This recursion +counter is put in the GRO CB, but could be turned into a percpu counter +if we run out of space in the CB. Thanks to Vladimír Beneš for the initial bug report. @@ -23,10 +26,24 @@ Fixes: 66e5133f19e9 ("vlan: Add GRO support for non hardware accelerated vlan") Signed-off-by: Sabrina Dubroca Reviewed-by: Jiri Benc Acked-by: Hannes Frederic Sowa - +Acked-by: Tom Herbert +Signed-off-by: David S. Miller +--- + drivers/net/geneve.c | 2 +- + drivers/net/vxlan.c | 2 +- + include/linux/netdevice.h | 39 ++++++++++++++++++++++++++++++++++++++- + net/8021q/vlan.c | 2 +- + net/core/dev.c | 1 + + net/ethernet/eth.c | 2 +- + net/ipv4/af_inet.c | 2 +- + net/ipv4/fou.c | 4 ++-- + net/ipv4/gre_offload.c | 2 +- + net/ipv4/udp_offload.c | 2 +- + net/ipv6/ip6_offload.c | 2 +- + 11 files changed, 49 insertions(+), 11 deletions(-) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c -index 3c20e87bb761..16af1ce99233 100644 +index 3c20e87..16af1ce 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -453,7 +453,7 @@ static struct sk_buff **geneve_gro_receive(struct sock *sk, @@ -39,7 +56,7 @@ index 3c20e87bb761..16af1ce99233 100644 out_unlock: diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c -index e7d16687538b..c1639a3e95a4 100644 +index e7d1668..c1639a3 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -583,7 +583,7 @@ static struct sk_buff **vxlan_gro_receive(struct sock *sk, @@ -52,7 +69,7 @@ index e7d16687538b..c1639a3e95a4 100644 out: diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index 136ae6bbe81e..11a7218c3661 100644 +index 465e128..91ee364 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -2169,7 +2169,10 @@ struct napi_gro_cb { @@ -67,7 +84,7 @@ index 136ae6bbe81e..11a7218c3661 100644 /* used to support CHECKSUM_COMPLETE for tunneling protocols */ __wsum csum; -@@ -2180,6 +2183,25 @@ struct napi_gro_cb { +@@ -2180,6 +2183,40 @@ struct napi_gro_cb { #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) @@ -82,19 +99,34 @@ index 136ae6bbe81e..11a7218c3661 100644 + struct sk_buff **head, + struct sk_buff *skb) +{ -+ if (gro_recursion_inc_test(skb)) { ++ if (unlikely(gro_recursion_inc_test(skb))) { + NAPI_GRO_CB(skb)->flush |= 1; + return NULL; + } + + return cb(head, skb); +} ++ ++typedef struct sk_buff **(*gro_receive_sk_t)(struct sock *, struct sk_buff **, ++ struct sk_buff *); ++static inline struct sk_buff **call_gro_receive_sk(gro_receive_sk_t cb, ++ struct sock *sk, ++ struct sk_buff **head, ++ struct sk_buff *skb) ++{ ++ if (unlikely(gro_recursion_inc_test(skb))) { ++ NAPI_GRO_CB(skb)->flush |= 1; ++ return NULL; ++ } ++ ++ return cb(sk, head, skb); ++} + struct packet_type { __be16 type; /* This is really htons(ether_type). */ struct net_device *dev; /* NULL is wildcarded here */ diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c -index 8de138d3306b..f2531ad66b68 100644 +index 8de138d..f2531ad 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -664,7 +664,7 @@ static struct sk_buff **vlan_gro_receive(struct sk_buff **head, @@ -107,7 +139,7 @@ index 8de138d3306b..f2531ad66b68 100644 out_unlock: rcu_read_unlock(); diff --git a/net/core/dev.c b/net/core/dev.c -index f1fe26f66458..f7cd4b8b035d 100644 +index b09ac57..dbc8713 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4511,6 +4511,7 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff @@ -119,7 +151,7 @@ index f1fe26f66458..f7cd4b8b035d 100644 NAPI_GRO_CB(skb)->is_atomic = 1; NAPI_GRO_CB(skb)->gro_remcsum_start = 0; diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c -index 66dff5e3d772..02acfff36028 100644 +index 66dff5e..02acfff 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -439,7 +439,7 @@ struct sk_buff **eth_gro_receive(struct sk_buff **head, @@ -132,7 +164,7 @@ index 66dff5e3d772..02acfff36028 100644 out_unlock: rcu_read_unlock(); diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c -index 1effc986739e..9648c97e541f 100644 +index 1effc98..9648c97 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -1391,7 +1391,7 @@ struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb) @@ -145,7 +177,7 @@ index 1effc986739e..9648c97e541f 100644 out_unlock: rcu_read_unlock(); diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c -index cf50f7e2b012..030d1531e897 100644 +index cf50f7e..030d153 100644 --- a/net/ipv4/fou.c +++ b/net/ipv4/fou.c @@ -249,7 +249,7 @@ static struct sk_buff **fou_gro_receive(struct sock *sk, @@ -167,7 +199,7 @@ index cf50f7e2b012..030d1531e897 100644 out_unlock: diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c -index 96e0efecefa6..d5cac99170b1 100644 +index 96e0efe..d5cac99 100644 --- a/net/ipv4/gre_offload.c +++ b/net/ipv4/gre_offload.c @@ -229,7 +229,7 @@ static struct sk_buff **gre_gro_receive(struct sk_buff **head, @@ -180,26 +212,20 @@ index 96e0efecefa6..d5cac99170b1 100644 out_unlock: diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c -index f9333c963607..7b5879bcd08b 100644 +index f9333c9..b2be1d9 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c -@@ -295,7 +295,13 @@ struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff *skb, +@@ -295,7 +295,7 @@ struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff *skb, skb_gro_pull(skb, sizeof(struct udphdr)); /* pull encapsulating udp header */ skb_gro_postpull_rcsum(skb, uh, sizeof(struct udphdr)); - pp = udp_sk(sk)->gro_receive(sk, head, skb); -+ -+ if (gro_recursion_inc_test(skb)) { -+ flush = 1; -+ pp = NULL; -+ } else { -+ pp = udp_sk(sk)->gro_receive(sk, head, skb); -+ } ++ pp = call_gro_receive_sk(udp_sk(sk)->gro_receive, sk, head, skb); out_unlock: rcu_read_unlock(); diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c -index e7bfd55899a3..1fcf61f1cbc3 100644 +index e7bfd55..1fcf61f 100644 --- a/net/ipv6/ip6_offload.c +++ b/net/ipv6/ip6_offload.c @@ -246,7 +246,7 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, @@ -211,3 +237,6 @@ index e7bfd55899a3..1fcf61f1cbc3 100644 out_unlock: rcu_read_unlock(); +-- +2.10.1 + diff --git a/kernel/kernel/files/patches/mageia/net-wireless-rtlwifi-Fix-regression-caused-by-commit-d86e64768859.patch b/kernel/kernel/files/patches/mageia/net-wireless-rtlwifi-Fix-regression-caused-by-commit-d86e64768859.patch index 536fce2e..c251e081 100644 --- a/kernel/kernel/files/patches/mageia/net-wireless-rtlwifi-Fix-regression-caused-by-commit-d86e64768859.patch +++ b/kernel/kernel/files/patches/mageia/net-wireless-rtlwifi-Fix-regression-caused-by-commit-d86e64768859.patch @@ -1,5 +1,7 @@ - +From cf4747d7535a936105f0abe8d8109d3fe339162b Mon Sep 17 00:00:00 2001 From: Larry Finger +Date: Wed, 12 Oct 2016 13:54:04 -0500 +Subject: [PATCH] rtlwifi: Fix regression caused by commit d86e64768859 In commit d86e64768859 ("rtlwifi: rtl818x: constify local structures"), the configuration struct for most of the drivers was changed to be @@ -19,11 +21,9 @@ previous patch, is now constantfied. Fixes: d86e64768859 ("rtlwifi: rtl818x: constify local structures") Suggested-by: Johannes Berg Signed-off-by: Larry Finger -Cc: Stable +Cc: Stable # 4.8 Cc: Julia Lawall ---- - -V2 - Fix warnings that were generated for some compiler versions. +Signed-off-by: Kalle Valo --- drivers/net/wireless/realtek/rtlwifi/core.c | 2 +- drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c | 8 ++++---- @@ -86,10 +86,10 @@ index e7b11b4..f361808 100644 .mod_params = &rtl88ee_mod_params, diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c -index 5c46a98..691ddef 100644 +index 87aa209..8b6e37c 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c -@@ -92,6 +92,7 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw) +@@ -96,6 +96,7 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw) struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); @@ -97,7 +97,7 @@ index 5c46a98..691ddef 100644 rtl8192ce_bt_reg_init(hw); -@@ -163,15 +164,12 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw) +@@ -167,15 +168,12 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw) } /* request fw */ @@ -117,7 +117,7 @@ index 5c46a98..691ddef 100644 rtlpriv->io.dev, GFP_KERNEL, hw, rtl_fw_cb); if (err) { -@@ -258,7 +256,6 @@ static const struct rtl_hal_cfg rtl92ce_hal_cfg = { +@@ -262,7 +260,6 @@ static const struct rtl_hal_cfg rtl92ce_hal_cfg = { .bar_id = 2, .write_readback = true, .name = "rtl92c_pci", @@ -126,10 +126,10 @@ index 5c46a98..691ddef 100644 .mod_params = &rtl92ce_mod_params, diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c -index 92588e0..b84e13a 100644 +index 7c6f7f0..f953320 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c -@@ -55,6 +55,7 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) +@@ -59,6 +59,7 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); int err; @@ -137,7 +137,7 @@ index 92588e0..b84e13a 100644 rtlpriv->dm.dm_initialgain_enable = true; rtlpriv->dm.dm_flag = 0; -@@ -73,18 +74,18 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) +@@ -77,18 +78,18 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) } if (IS_VENDOR_UMC_A_CUT(rtlpriv->rtlhal.version) && !IS_92C_SERIAL(rtlpriv->rtlhal.version)) { @@ -161,7 +161,7 @@ index 92588e0..b84e13a 100644 GFP_KERNEL, hw, rtl_fw_cb); return err; } -@@ -183,7 +184,6 @@ static struct rtl_hal_usbint_cfg rtl92cu_interface_cfg = { +@@ -187,7 +188,6 @@ static struct rtl_hal_usbint_cfg rtl92cu_interface_cfg = { static struct rtl_hal_cfg rtl92cu_hal_cfg = { .name = "rtl92c_usb", @@ -170,10 +170,10 @@ index 92588e0..b84e13a 100644 .mod_params = &rtl92cu_mod_params, .usb_interface_cfg = &rtl92cu_interface_cfg, diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c -index a9c39eb..2d65e40 100644 +index 0538a4d..1ebfee1 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c -@@ -88,6 +88,7 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) +@@ -92,6 +92,7 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) u8 tid; struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); @@ -181,7 +181,7 @@ index a9c39eb..2d65e40 100644 rtlpriv->dm.dm_initialgain_enable = true; rtlpriv->dm.dm_flag = 0; -@@ -177,10 +178,10 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) +@@ -181,10 +182,10 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) rtlpriv->max_fw_size = 0x8000; pr_info("Driver for Realtek RTL8192DE WLAN interface\n"); @@ -194,7 +194,7 @@ index a9c39eb..2d65e40 100644 rtlpriv->io.dev, GFP_KERNEL, hw, rtl_fw_cb); if (err) { -@@ -262,7 +263,6 @@ static const struct rtl_hal_cfg rtl92de_hal_cfg = { +@@ -266,7 +267,6 @@ static const struct rtl_hal_cfg rtl92de_hal_cfg = { .bar_id = 2, .write_readback = true, .name = "rtl8192de", @@ -238,10 +238,10 @@ index ac299cb..46b605de3 100644 .mod_params = &rtl92ee_mod_params, diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c -index a652d45..998cefb 100644 +index 5e8e02d..3e1eaea 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c -@@ -85,12 +85,13 @@ static void rtl92se_fw_cb(const struct firmware *firmware, void *context) +@@ -89,12 +89,13 @@ static void rtl92se_fw_cb(const struct firmware *firmware, void *context) struct ieee80211_hw *hw = context; struct rtl_priv *rtlpriv = rtl_priv(hw); struct rt_firmware *pfirmware = NULL; @@ -256,7 +256,7 @@ index a652d45..998cefb 100644 rtlpriv->max_fw_size = 0; return; } -@@ -113,6 +114,7 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw) +@@ -117,6 +118,7 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw) struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); int err = 0; u16 earlyrxthreshold = 7; @@ -264,7 +264,7 @@ index a652d45..998cefb 100644 rtlpriv->dm.dm_initialgain_enable = true; rtlpriv->dm.dm_flag = 0; -@@ -210,9 +212,9 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw) +@@ -214,9 +216,9 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw) rtlpriv->max_fw_size = RTL8190_MAX_FIRMWARE_CODE_SIZE*2 + sizeof(struct fw_hdr); pr_info("Driver for Realtek RTL8192SE/RTL8191SE\n" @@ -276,7 +276,7 @@ index a652d45..998cefb 100644 rtlpriv->io.dev, GFP_KERNEL, hw, rtl92se_fw_cb); if (err) { -@@ -306,7 +308,6 @@ static const struct rtl_hal_cfg rtl92se_hal_cfg = { +@@ -310,7 +312,6 @@ static const struct rtl_hal_cfg rtl92se_hal_cfg = { .bar_id = 1, .write_readback = false, .name = "rtl92s_pci", @@ -424,3 +424,6 @@ index 595f7d5..dafe486 100644 struct rtl_hal_ops *ops; struct rtl_mod_params *mod_params; struct rtl_hal_usbint_cfg *usb_interface_cfg; +-- +2.10.1 + diff --git a/kernel/kernel/files/patches/mageia/series b/kernel/kernel/files/patches/mageia/series index 5f3d0487..e7a005b7 100644 --- a/kernel/kernel/files/patches/mageia/series +++ b/kernel/kernel/files/patches/mageia/series @@ -14,86 +14,6 @@ ### ### Stable Queue ### -stable-drm-vc4-fix-races-when-the-cs-reads-from-render-targets.patch -stable-drm-prime-pass-the-right-module-owner-through-to-dma_buf_export.patch -stable-drm-i915-backlight-setup-and-cache-pwm-alternate-increment-value.patch -stable-drm-i915-backlight-setup-backlight-pwm-alternate-increment-on-backlight-enable.patch -stable-drm-amdgpu-fix-ib-alignment-for-uvd.patch -stable-drm-amdgpu-dce10-disable-hpd-on-local-panels.patch -stable-drm-amdgpu-dce8-disable-hpd-on-local-panels.patch -stable-drm-amdgpu-dce11-disable-hpd-on-local-panels.patch -stable-drm-amdgpu-dce11-add-missing-drm_mode_config_cleanup-call.patch -stable-drm-amdgpu-initialize-the-context-reset_counter-in-amdgpu_ctx_init.patch -stable-drm-amdgpu-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch -stable-drm-radeon-narrow-asic_init-for-virtualization.patch -stable-drm-radeon-si-dpm-fix-phase-shedding-setup.patch -stable-drm-radeon-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch -stable-drm-vmwgfx-limit-the-user-space-command-buffer-size.patch -stable-drm-fsl-dcu-fix-endian-issue-when-using-clk_register_divider.patch -stable-drm-amd-powerplay-fix-mclk-not-switching-back-after-multi-head-was-disabled.patch -stable-hid-add-quirk-for-akai-midimix.patch -stable-drm-i915-skl-update-plane-watermarks-atomically-during-plane-updates.patch -stable-drm-i915-move-crtc-updating-in-atomic_commit-into-it-s-own-hook.patch -stable-drm-i915-skl-update-ddb-values-atomically-with-wms-plane-attrs.patch -stable-drm-i915-skl-don-t-try-to-update-plane-watermarks-if-they-haven-t-changed.patch -stable-drm-i915-gen9-only-add-the-planes-actually-affected-by-ddb-changes.patch -stable-drm-i915-gen9-fix-the-wawmmemoryreadlatency-implementation.patch -stable-drm-i915-gen9-minimum-scanlines-for-y-tile-is-not-always-4.patch -stable-drm-i915-gen9-fix-plane_blocks_per_line-on-watermarks-calculations.patch -stable-drm-i915-gen9-fix-the-watermark-res_blocks-value.patch -stable-drm-i915-sagv-is-not-skl-only-so-rename-a-few-things.patch -stable-drm-i915-introduce-intel_has_sagv.patch -stable-drm-i915-kbl-kbl-also-needs-to-run-the-sagv-code.patch -stable-revert-drm-i915-check-live-status-before-reading-edid.patch -stable-drm-i915-account-for-tseg-size-when-determining-865g-stolen-base.patch -stable-drm-i915-skl-ensure-pipes-with-changed-wms-get-added-to-the-state.patch -stable-drm-i915-allow-pch-dpll-sharing-regardless-of-dpll_sdvo_high_speed.patch -stable-drm-i915-move-long-hpd-handling-into-the-hotplug-work.patch -stable-drm-i915-allow-dp-to-work-w-o-edid.patch -stable-drm-i915-just-clear-the-mmiodebug-before-a-register-access.patch -stable-drm-i915-unalias-obj-phys_handle-and-obj-userptr.patch -stable-posix_acl-clear-sgid-bit-when-setting-file-permissions.patch -stable-rt2x00usb-fix-error-return-code.patch -stable-scsi-cxlflash-remove-the-device-cleanly-in-the-system-shutdown-path.patch -stable-genirq-generic_chip-add-irq_unmap-callback.patch -stable-coresight-remove-erroneous-dma_free_coherent-in-tmc_probe.patch -stable-uio-fix-dmem_region_start-computation.patch -stable-arm-clk-imx35-fix-name-for-ckil-clk.patch -stable-spi-spi-fsl-dspi-drop-extra-spi_master_put-in-device-remove-function.patch -stable-i40e-remove-a-stray-unlock.patch -stable-i40e-fix-broken-i40e_config_rss_aq-function.patch -stable-mwifiex-correct-aid-value-during-tdls-setup.patch -stable-mwifiex-fix-failed-to-reconnect-after-interface-disabled-enabled.patch -stable-ath10k-add-wmi_service_periodic_chan_stat_support-wmi-service.patch -stable-ath10k-fix-sending-frame-in-management-path-in-push-txq-logic.patch -stable-ath10k-fix-reporting-channel-survey-data.patch -stable-ath10k-fix-throughput-regression-in-multi-client-mode.patch -stable-crypto-marvell-don-t-overwrite-default-creq-state-during-initialization.patch -stable-crypto-gcm-fix-iv-buffer-size-in-crypto_gcm_setkey.patch -stable-crypto-marvell-update-transformation-context-for-each-dequeued-req.patch -stable-crypto-arm-ghash-ce-add-missing-async-import-export.patch -stable-crypto-ccp-fix-return-value-check-in-ccp_dmaengine_register.patch -stable-hwrng-omap-only-fail-if-pm_runtime_get_sync-returns-0.patch -stable-asoc-topology-fix-error-return-code-in-soc_tplg_dapm_widget_create.patch -stable-asoc-dapm-fix-possible-uninitialized-variable-in-snd_soc_dapm_get_volsw.patch -stable-asoc-dapm-fix-value-setting-for-_enum_double-mux-s-second-channel.patch -stable-asoc-dapm-fix-kcontrol-creation-for-output-driver-widget.patch -stable-asoc-sst-bxt-rt298-fix-obsoleted-initializers-for-array.patch -stable-asoc-sst-bxt-da7219_max98357a-fix-obsoleted-initializers-for-array.patch -stable-iio-ad5755-fix-off-by-one-on-devnr-limit-check.patch -stable-iio-light-us5182d-add-missing-error-code-assignment-before-test.patch -stable-staging-android-ion-hisi-fix-dependencies.patch -stable-staging-sm750fb-correctly-set-clock_phase-bit-of-display-controller.patch -stable-staging-r8188eu-fix-scheduling-while-atomic-splat.patch -stable-staging-ks7010-fix-wait_for_completion_interruptible_timeout-return-handling.patch -stable-staging-ks7010-declare-private-functions-static.patch -stable-ib-hfi1-move-iowait_init-to-priv-allocate.patch -stable-ib-rdmavt-correct-sparse-annotation.patch -stable-ib-qib-remove-qpt_mask-global.patch -stable-ib-mlx5-fix-steering-resource-leak.patch -stable-power-bq24257-fix-use-of-uninitialized-pointer-bq-charger.patch -stable-dmaengine-ipu-remove-bogus-no_irq-reference.patch -stable-mm-hugetlb-check-for-reserved-hugepages-during-memory-offline.patch ### ### Arch x86 @@ -121,6 +41,9 @@ Revert-cpufreq-pcc-Enable-autoload-of-pcc-cpufreq-fo.patch # breaks nvidia304 Revert-x86-mm-mtrr-Remove-kernel-internal-MTRR-inter.patch +# fix non-booting systems +x86-smpboot-Init-apic-mapping-before-usage.patch + ### ### Core ### @@ -216,6 +139,9 @@ nvmepatch1-V4.patch nvmepatch2-V4.patch nvmepatch3-V4.patch +# fix feature check, reported on dev@ ml +dm-raid-fix-compat_features-validation.patch + ### ### Char ### @@ -228,9 +154,8 @@ Revert-ipmi-Start-the-timer-and-thread-on-internal-m.patch ### # aufs from: http://aufs.sourceforge.net/ (mga#8314) -fs-aufs-4.7.patch -fs-aufs-4.7-modular.patch -fs-aufs-4.7-ver-fix.patch +fs-aufs-4.8.patch +fs-aufs-4.8-modular.patch ### ### FireWire @@ -270,7 +195,8 @@ gpu-drm-mach64-3.18-buildfix.patch # also from https://bugs.freedesktop.org/attachment.cgi?id=127264, first reference from # https://bugs.freedesktop.org/show_bug.cgi?id=97450). Does not completely resolve the # issues but reduce. -drm-i915-gen9-fix-DDB-partitioning-for-multi-screen-cases.patch +# now in drm-next: https://cgit.freedesktop.org/~airlied/linux/commit?h=drm-next&id=5a920b85f2c6e3fd7d9dd9bb3f3345e9085e2360 +gpu-drm-i915-gen9-fix-DDB-partitioning-for-multi-screen-cases.patch ### ### Hardware Monitoring diff --git a/kernel/kernel/files/patches/mageia/stable-arm-clk-imx35-fix-name-for-ckil-clk.patch b/kernel/kernel/files/patches/mageia/stable-arm-clk-imx35-fix-name-for-ckil-clk.patch deleted file mode 100644 index 04c91a98..00000000 --- a/kernel/kernel/files/patches/mageia/stable-arm-clk-imx35-fix-name-for-ckil-clk.patch +++ /dev/null @@ -1,37 +0,0 @@ -From fcff03813a7c612873303037cef5ba0329850c35 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= -Date: Thu, 8 Sep 2016 11:30:21 +0200 -Subject: ARM: clk-imx35: fix name for ckil clk -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Uwe Kleine-König - -commit fcff03813a7c612873303037cef5ba0329850c35 upstream. - -This fixes - [ 0.000000] i.MX clk 82: register failed with -17 -because the name is duplicated. - -Signed-off-by: Uwe Kleine-König -Fixes: 3713e3f5e927 ("clk: imx35: define two clocks for rtc") -Acked-by: Shawn Guo -Signed-off-by: Stephen Boyd -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/clk/imx/clk-imx35.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/clk/imx/clk-imx35.c -+++ b/drivers/clk/imx/clk-imx35.c -@@ -115,7 +115,7 @@ static void __init _mx35_clocks_init(voi - } - - clk[ckih] = imx_clk_fixed("ckih", 24000000); -- clk[ckil] = imx_clk_fixed("ckih", 32768); -+ clk[ckil] = imx_clk_fixed("ckil", 32768); - clk[mpll] = imx_clk_pllv1(IMX_PLLV1_IMX35, "mpll", "ckih", base + MX35_CCM_MPCTL); - clk[ppll] = imx_clk_pllv1(IMX_PLLV1_IMX35, "ppll", "ckih", base + MX35_CCM_PPCTL); - diff --git a/kernel/kernel/files/patches/mageia/stable-asoc-dapm-fix-kcontrol-creation-for-output-driver-widget.patch b/kernel/kernel/files/patches/mageia/stable-asoc-dapm-fix-kcontrol-creation-for-output-driver-widget.patch deleted file mode 100644 index d7cd051d..00000000 --- a/kernel/kernel/files/patches/mageia/stable-asoc-dapm-fix-kcontrol-creation-for-output-driver-widget.patch +++ /dev/null @@ -1,41 +0,0 @@ -From a3930ed060df4ccf2a06cf0b68738dec3e6ff89a Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 27 Aug 2016 19:28:00 +0800 -Subject: ASoC: dapm: Fix kcontrol creation for output driver widget - -From: Chen-Yu Tsai - -commit a3930ed060df4ccf2a06cf0b68738dec3e6ff89a upstream. - -Commit d88429a695a4 ("ASoC: dapm: Add output driver widget") added -the snd_soc_dapm_out_drv ID for the output driver widget, which is -the same as the PGA widget, with a later power sequence number. - -Commit 19a2557b76d6 ("ASoC: dapm: Add kcontrol support for PGAs") -then added kcontrol support for PGA widgets, but failed to account -for output driver widgets. Attempts to use kcontrols with output -driver widgets result in silent failures, with the developer having -little idea about what went on. - -Add snd_soc_dapm_out_drv to the switch/case block under snd_soc_dapm_pga -in dapm_create_or_share_kcontrol, since they are essentially the same. - -Fixes: 19a2557b76d6 (ASoC: dapm: Add kcontrol support for PGAs) -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Mark Brown -Signed-off-by: Greg Kroah-Hartman - ---- - sound/soc/soc-dapm.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/sound/soc/soc-dapm.c -+++ b/sound/soc/soc-dapm.c -@@ -823,6 +823,7 @@ static int dapm_create_or_share_kcontrol - case snd_soc_dapm_switch: - case snd_soc_dapm_mixer: - case snd_soc_dapm_pga: -+ case snd_soc_dapm_out_drv: - wname_in_long_name = true; - kcname_in_long_name = true; - break; diff --git a/kernel/kernel/files/patches/mageia/stable-asoc-dapm-fix-possible-uninitialized-variable-in-snd_soc_dapm_get_volsw.patch b/kernel/kernel/files/patches/mageia/stable-asoc-dapm-fix-possible-uninitialized-variable-in-snd_soc_dapm_get_volsw.patch deleted file mode 100644 index 014bcdc0..00000000 --- a/kernel/kernel/files/patches/mageia/stable-asoc-dapm-fix-possible-uninitialized-variable-in-snd_soc_dapm_get_volsw.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 01ad5e7de67b408d9b48b437b06a9938ddf460b5 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 27 Aug 2016 19:27:58 +0800 -Subject: ASoC: dapm: Fix possible uninitialized variable in snd_soc_dapm_get_volsw() - -From: Chen-Yu Tsai - -commit 01ad5e7de67b408d9b48b437b06a9938ddf460b5 upstream. - -If soc_dapm_read() fails, val will be uninitialized, and bogus values -will be written later: - - ret = soc_dapm_read(dapm, reg, &val); - val = (val >> shift) & mask; - -However, the compiler does not give a warning. Return on error before -val is really used to avoid this. - -This is similar to the commit 6912831623c5 ("ASoC: dapm: Fix -uninitialized variable in snd_soc_dapm_get_enum_double()") - -Fixes: ce0fc93ae56e (ASoC: Add DAPM support at the component level) -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Mark Brown -Signed-off-by: Greg Kroah-Hartman - ---- - sound/soc/soc-dapm.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/sound/soc/soc-dapm.c -+++ b/sound/soc/soc-dapm.c -@@ -3049,6 +3049,9 @@ int snd_soc_dapm_get_volsw(struct snd_kc - } - mutex_unlock(&card->dapm_mutex); - -+ if (ret) -+ return ret; -+ - if (invert) - ucontrol->value.integer.value[0] = max - val; - else diff --git a/kernel/kernel/files/patches/mageia/stable-asoc-dapm-fix-value-setting-for-_enum_double-mux-s-second-channel.patch b/kernel/kernel/files/patches/mageia/stable-asoc-dapm-fix-value-setting-for-_enum_double-mux-s-second-channel.patch deleted file mode 100644 index 737cd33e..00000000 --- a/kernel/kernel/files/patches/mageia/stable-asoc-dapm-fix-value-setting-for-_enum_double-mux-s-second-channel.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 071133a209354f39d4e5785d5a6a390e03241841 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 27 Aug 2016 19:27:59 +0800 -Subject: ASoC: dapm: Fix value setting for _ENUM_DOUBLE MUX's second channel - -From: Chen-Yu Tsai - -commit 071133a209354f39d4e5785d5a6a390e03241841 upstream. - -The value for the second channel in _ENUM_DOUBLE (double channel) MUXs -is not correctly updated, due to using the wrong bit shift. - -Use the correct bit shift, so both channels toggle together. - -Fixes: 3727b4968453 (ASoC: dapm: Consolidate MUXs and value MUXs) -Signed-off-by: Chen-Yu Tsai -Reviewed-by: Charles Keepax -Signed-off-by: Mark Brown -Signed-off-by: Greg Kroah-Hartman - ---- - sound/soc/soc-dapm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/sound/soc/soc-dapm.c -+++ b/sound/soc/soc-dapm.c -@@ -3203,7 +3203,7 @@ int snd_soc_dapm_put_enum_double(struct - if (e->shift_l != e->shift_r) { - if (item[1] > e->items) - return -EINVAL; -- val |= snd_soc_enum_item_to_val(e, item[1]) << e->shift_l; -+ val |= snd_soc_enum_item_to_val(e, item[1]) << e->shift_r; - mask |= e->mask << e->shift_r; - } - diff --git a/kernel/kernel/files/patches/mageia/stable-asoc-sst-bxt-da7219_max98357a-fix-obsoleted-initializers-for-array.patch b/kernel/kernel/files/patches/mageia/stable-asoc-sst-bxt-da7219_max98357a-fix-obsoleted-initializers-for-array.patch deleted file mode 100644 index 610d3216..00000000 --- a/kernel/kernel/files/patches/mageia/stable-asoc-sst-bxt-da7219_max98357a-fix-obsoleted-initializers-for-array.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 43d443dc257c00ef3a3f940b6abfb7537c4fcbe8 Mon Sep 17 00:00:00 2001 -From: Takashi Sakamoto -Date: Tue, 27 Sep 2016 07:45:09 +0900 -Subject: ASoC: sst-bxt-da7219_max98357a: fix obsoleted initializers for array - -From: Takashi Sakamoto - -commit 43d443dc257c00ef3a3f940b6abfb7537c4fcbe8 upstream. - -Sparse reports below warnings. - -bxt_da7219_max98357a.c:250:9: warning: obsolete array initializer, use C99 syntax -bxt_da7219_max98357a.c:275:9: warning: obsolete array initializer, use C99 syntax -bxt_da7219_max98357a.c:290:9: warning: obsolete array initializer, use C99 syntax -bxt_da7219_max98357a.c:304:9: warning: obsolete array initializer, use C99 syntax -bxt_da7219_max98357a.c:317:9: warning: obsolete array initializer, use C99 syntax - -There's no need to use obsoleted way. This commit fixes it. - -Fixes: 723bad3fef8b (ASoC: Intel: Add Broxton-P Dialog Maxim machine driver) -Signed-off-by: Takashi Sakamoto -Acked-by: Vinod Koul -Signed-off-by: Mark Brown -Signed-off-by: Greg Kroah-Hartman - ---- - sound/soc/intel/boards/bxt_da7219_max98357a.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - ---- a/sound/soc/intel/boards/bxt_da7219_max98357a.c -+++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c -@@ -255,7 +255,7 @@ static struct snd_soc_ops broxton_da7219 - /* broxton digital audio interface glue - connects codec <--> CPU */ - static struct snd_soc_dai_link broxton_dais[] = { - /* Front End DAI links */ -- [BXT_DPCM_AUDIO_PB] -+ [BXT_DPCM_AUDIO_PB] = - { - .name = "Bxt Audio Port", - .stream_name = "Audio", -@@ -271,7 +271,7 @@ static struct snd_soc_dai_link broxton_d - .dpcm_playback = 1, - .ops = &broxton_da7219_fe_ops, - }, -- [BXT_DPCM_AUDIO_CP] -+ [BXT_DPCM_AUDIO_CP] = - { - .name = "Bxt Audio Capture Port", - .stream_name = "Audio Record", -@@ -286,7 +286,7 @@ static struct snd_soc_dai_link broxton_d - .dpcm_capture = 1, - .ops = &broxton_da7219_fe_ops, - }, -- [BXT_DPCM_AUDIO_REF_CP] -+ [BXT_DPCM_AUDIO_REF_CP] = - { - .name = "Bxt Audio Reference cap", - .stream_name = "Refcap", -@@ -300,7 +300,7 @@ static struct snd_soc_dai_link broxton_d - .nonatomic = 1, - .dynamic = 1, - }, -- [BXT_DPCM_AUDIO_HDMI1_PB] -+ [BXT_DPCM_AUDIO_HDMI1_PB] = - { - .name = "Bxt HDMI Port1", - .stream_name = "Hdmi1", -@@ -313,7 +313,7 @@ static struct snd_soc_dai_link broxton_d - .nonatomic = 1, - .dynamic = 1, - }, -- [BXT_DPCM_AUDIO_HDMI2_PB] -+ [BXT_DPCM_AUDIO_HDMI2_PB] = - { - .name = "Bxt HDMI Port2", - .stream_name = "Hdmi2", -@@ -326,7 +326,7 @@ static struct snd_soc_dai_link broxton_d - .nonatomic = 1, - .dynamic = 1, - }, -- [BXT_DPCM_AUDIO_HDMI3_PB] -+ [BXT_DPCM_AUDIO_HDMI3_PB] = - { - .name = "Bxt HDMI Port3", - .stream_name = "Hdmi3", diff --git a/kernel/kernel/files/patches/mageia/stable-asoc-sst-bxt-rt298-fix-obsoleted-initializers-for-array.patch b/kernel/kernel/files/patches/mageia/stable-asoc-sst-bxt-rt298-fix-obsoleted-initializers-for-array.patch deleted file mode 100644 index 9d9c7243..00000000 --- a/kernel/kernel/files/patches/mageia/stable-asoc-sst-bxt-rt298-fix-obsoleted-initializers-for-array.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 5919a3898136aae4d2cb4b18b44f70f7b185aa47 Mon Sep 17 00:00:00 2001 -From: Takashi Sakamoto -Date: Tue, 27 Sep 2016 07:45:08 +0900 -Subject: ASoC: sst-bxt-rt298: fix obsoleted initializers for array - -From: Takashi Sakamoto - -commit 5919a3898136aae4d2cb4b18b44f70f7b185aa47 upstream. - -Sparse reports below warnings. - -bxt_rt298.c:275:9: warning: obsolete array initializer, use C99 syntax -bxt_rt298.c:290:9: warning: obsolete array initializer, use C99 syntax -bxt_rt298.c:304:9: warning: obsolete array initializer, use C99 syntax -bxt_rt298.c:317:9: warning: obsolete array initializer, use C99 syntax -bxt_rt298.c:331:9: warning: obsolete array initializer, use C99 syntax -bxt_rt298.c:344:9: warning: obsolete array initializer, use C99 syntax -bxt_rt298.c:357:9: warning: obsolete array initializer, use C99 syntax - -There's no need to use obsoleted way. This commit fixes it. - -Fixes: 76016322ec56 (ASoC: Intel: Add Broxton-P machine driver) -Signed-off-by: Takashi Sakamoto -Acked-by: Vinod Koul -Signed-off-by: Mark Brown -Signed-off-by: Greg Kroah-Hartman - ---- - sound/soc/intel/boards/bxt_rt298.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - ---- a/sound/soc/intel/boards/bxt_rt298.c -+++ b/sound/soc/intel/boards/bxt_rt298.c -@@ -271,7 +271,7 @@ static const struct snd_soc_ops broxton_ - /* broxton digital audio interface glue - connects codec <--> CPU */ - static struct snd_soc_dai_link broxton_rt298_dais[] = { - /* Front End DAI links */ -- [BXT_DPCM_AUDIO_PB] -+ [BXT_DPCM_AUDIO_PB] = - { - .name = "Bxt Audio Port", - .stream_name = "Audio", -@@ -286,7 +286,7 @@ static struct snd_soc_dai_link broxton_r - .dpcm_playback = 1, - .ops = &broxton_rt286_fe_ops, - }, -- [BXT_DPCM_AUDIO_CP] -+ [BXT_DPCM_AUDIO_CP] = - { - .name = "Bxt Audio Capture Port", - .stream_name = "Audio Record", -@@ -300,7 +300,7 @@ static struct snd_soc_dai_link broxton_r - .dpcm_capture = 1, - .ops = &broxton_rt286_fe_ops, - }, -- [BXT_DPCM_AUDIO_REF_CP] -+ [BXT_DPCM_AUDIO_REF_CP] = - { - .name = "Bxt Audio Reference cap", - .stream_name = "refcap", -@@ -313,7 +313,7 @@ static struct snd_soc_dai_link broxton_r - .nonatomic = 1, - .dynamic = 1, - }, -- [BXT_DPCM_AUDIO_DMIC_CP] -+ [BXT_DPCM_AUDIO_DMIC_CP] = - { - .name = "Bxt Audio DMIC cap", - .stream_name = "dmiccap", -@@ -327,7 +327,7 @@ static struct snd_soc_dai_link broxton_r - .dynamic = 1, - .ops = &broxton_dmic_ops, - }, -- [BXT_DPCM_AUDIO_HDMI1_PB] -+ [BXT_DPCM_AUDIO_HDMI1_PB] = - { - .name = "Bxt HDMI Port1", - .stream_name = "Hdmi1", -@@ -340,7 +340,7 @@ static struct snd_soc_dai_link broxton_r - .nonatomic = 1, - .dynamic = 1, - }, -- [BXT_DPCM_AUDIO_HDMI2_PB] -+ [BXT_DPCM_AUDIO_HDMI2_PB] = - { - .name = "Bxt HDMI Port2", - .stream_name = "Hdmi2", -@@ -353,7 +353,7 @@ static struct snd_soc_dai_link broxton_r - .nonatomic = 1, - .dynamic = 1, - }, -- [BXT_DPCM_AUDIO_HDMI3_PB] -+ [BXT_DPCM_AUDIO_HDMI3_PB] = - { - .name = "Bxt HDMI Port3", - .stream_name = "Hdmi3", diff --git a/kernel/kernel/files/patches/mageia/stable-asoc-topology-fix-error-return-code-in-soc_tplg_dapm_widget_create.patch b/kernel/kernel/files/patches/mageia/stable-asoc-topology-fix-error-return-code-in-soc_tplg_dapm_widget_create.patch deleted file mode 100644 index f029224c..00000000 --- a/kernel/kernel/files/patches/mageia/stable-asoc-topology-fix-error-return-code-in-soc_tplg_dapm_widget_create.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8ae3ea48df0d746b663057cf0b972a18d0777b7b Mon Sep 17 00:00:00 2001 -From: Wei Yongjun -Date: Wed, 10 Aug 2016 13:43:12 +0000 -Subject: ASoC: topology: Fix error return code in soc_tplg_dapm_widget_create() - -From: Wei Yongjun - -commit 8ae3ea48df0d746b663057cf0b972a18d0777b7b upstream. - -Fix to return error code -ENOMEM instead of 0 when failed to create -widget, as done elsewhere in this function. - -Fixes: 8a9782346dcc ("ASoC: topology: Add topology core") -Signed-off-by: Wei Yongjun -Signed-off-by: Mark Brown -Signed-off-by: Greg Kroah-Hartman - ---- - sound/soc/soc-topology.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/sound/soc/soc-topology.c -+++ b/sound/soc/soc-topology.c -@@ -1475,6 +1475,7 @@ widget: - if (widget == NULL) { - dev_err(tplg->dev, "ASoC: failed to create widget %s controls\n", - w->name); -+ ret = -ENOMEM; - goto hdr_err; - } - diff --git a/kernel/kernel/files/patches/mageia/stable-ath10k-add-wmi_service_periodic_chan_stat_support-wmi-service.patch b/kernel/kernel/files/patches/mageia/stable-ath10k-add-wmi_service_periodic_chan_stat_support-wmi-service.patch deleted file mode 100644 index d29be132..00000000 --- a/kernel/kernel/files/patches/mageia/stable-ath10k-add-wmi_service_periodic_chan_stat_support-wmi-service.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 64ed5771aca2fcfb8ea440fc679741054011fd7e Mon Sep 17 00:00:00 2001 -From: Tamizh chelvam -Date: Tue, 2 Aug 2016 16:13:14 +0530 -Subject: ath10k: Add WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT wmi service - -From: Tamizh chelvam - -commit 64ed5771aca2fcfb8ea440fc679741054011fd7e upstream. - -WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT service has missed in -the commit 7e247a9e88dc ("ath10k: add dynamic tx mode switch -config support for qca4019"). This patch adds the service to -avoid mismatch between host and target. - -Fixes: 7e247a9e88dc ("ath10k: add dynamic tx mode switch config support for qca4019") -Signed-off-by: Tamizh chelvam -Signed-off-by: Kalle Valo -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/net/wireless/ath/ath10k/wmi.h | 5 +++++ - 1 file changed, 5 insertions(+) - ---- a/drivers/net/wireless/ath/ath10k/wmi.h -+++ b/drivers/net/wireless/ath/ath10k/wmi.h -@@ -180,6 +180,7 @@ enum wmi_service { - WMI_SERVICE_MESH_NON_11S, - WMI_SERVICE_PEER_STATS, - WMI_SERVICE_RESTRT_CHNL_SUPPORT, -+ WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT, - WMI_SERVICE_TX_MODE_PUSH_ONLY, - WMI_SERVICE_TX_MODE_PUSH_PULL, - WMI_SERVICE_TX_MODE_DYNAMIC, -@@ -305,6 +306,7 @@ enum wmi_10_4_service { - WMI_10_4_SERVICE_RESTRT_CHNL_SUPPORT, - WMI_10_4_SERVICE_PEER_STATS, - WMI_10_4_SERVICE_MESH_11S, -+ WMI_10_4_SERVICE_PERIODIC_CHAN_STAT_SUPPORT, - WMI_10_4_SERVICE_TX_MODE_PUSH_ONLY, - WMI_10_4_SERVICE_TX_MODE_PUSH_PULL, - WMI_10_4_SERVICE_TX_MODE_DYNAMIC, -@@ -402,6 +404,7 @@ static inline char *wmi_service_name(int - SVCSTR(WMI_SERVICE_MESH_NON_11S); - SVCSTR(WMI_SERVICE_PEER_STATS); - SVCSTR(WMI_SERVICE_RESTRT_CHNL_SUPPORT); -+ SVCSTR(WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT); - SVCSTR(WMI_SERVICE_TX_MODE_PUSH_ONLY); - SVCSTR(WMI_SERVICE_TX_MODE_PUSH_PULL); - SVCSTR(WMI_SERVICE_TX_MODE_DYNAMIC); -@@ -652,6 +655,8 @@ static inline void wmi_10_4_svc_map(cons - WMI_SERVICE_PEER_STATS, len); - SVCMAP(WMI_10_4_SERVICE_MESH_11S, - WMI_SERVICE_MESH_11S, len); -+ SVCMAP(WMI_10_4_SERVICE_PERIODIC_CHAN_STAT_SUPPORT, -+ WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT, len); - SVCMAP(WMI_10_4_SERVICE_TX_MODE_PUSH_ONLY, - WMI_SERVICE_TX_MODE_PUSH_ONLY, len); - SVCMAP(WMI_10_4_SERVICE_TX_MODE_PUSH_PULL, diff --git a/kernel/kernel/files/patches/mageia/stable-ath10k-fix-reporting-channel-survey-data.patch b/kernel/kernel/files/patches/mageia/stable-ath10k-fix-reporting-channel-survey-data.patch deleted file mode 100644 index 463c00aa..00000000 --- a/kernel/kernel/files/patches/mageia/stable-ath10k-fix-reporting-channel-survey-data.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 77eb3d693182b4eaa88c6ba406fbb92b1f1bd636 Mon Sep 17 00:00:00 2001 -From: Ashok Raj Nagarajan -Date: Fri, 2 Sep 2016 10:59:53 +0530 -Subject: ath10k: fix reporting channel survey data - -From: Ashok Raj Nagarajan - -commit 77eb3d693182b4eaa88c6ba406fbb92b1f1bd636 upstream. - -When user requests for survey dump data, driver is providing wrong survey -information. This information we sent is the survey data that we have -collected during previous user request. - -This issue occurs because we request survey dump for wrong channel. With -this change, we correctly display the correct and current survey -information to userspace. - -Fixes: fa7937e3d5c2 ("ath10k: update bss channel survey information") -Signed-off-by: Ashok Raj Nagarajan -Signed-off-by: Kalle Valo -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/net/wireless/ath/ath10k/mac.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/wireless/ath/ath10k/mac.c -+++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -6558,7 +6558,7 @@ static int ath10k_get_survey(struct ieee - goto exit; - } - -- ath10k_mac_update_bss_chan_survey(ar, survey->channel); -+ ath10k_mac_update_bss_chan_survey(ar, &sband->channels[idx]); - - spin_lock_bh(&ar->data_lock); - memcpy(survey, ar_survey, sizeof(*survey)); diff --git a/kernel/kernel/files/patches/mageia/stable-ath10k-fix-sending-frame-in-management-path-in-push-txq-logic.patch b/kernel/kernel/files/patches/mageia/stable-ath10k-fix-sending-frame-in-management-path-in-push-txq-logic.patch deleted file mode 100644 index 4e94923d..00000000 --- a/kernel/kernel/files/patches/mageia/stable-ath10k-fix-sending-frame-in-management-path-in-push-txq-logic.patch +++ /dev/null @@ -1,81 +0,0 @@ -From e4fd726f21cdae0dc9cea6cbfcb7e27f21393f88 Mon Sep 17 00:00:00 2001 -From: Ashok Raj Nagarajan -Date: Thu, 18 Aug 2016 15:30:04 +0530 -Subject: ath10k: fix sending frame in management path in push txq logic - -From: Ashok Raj Nagarajan - -commit e4fd726f21cdae0dc9cea6cbfcb7e27f21393f88 upstream. - -In the wake tx queue path, we are not checking if the frame to be sent -takes management path or not. For eg. QOS null func frame coming here will -take the management path. Since we are not incrementing the descriptor -counter (num_pending_mgmt_tx) w.r.t tx management, on tx completion it is -possible to see negative values. - -When the above counter reaches a negative value, we will not be sending a -probe response out. - - if (is_presp && - ar->hw_params.max_probe_resp_desc_thres < htt->num_pending_mgmt_tx) - -For IPQ4019, max_probe_resp_desc_thres (u32) is 24 is compared against -num_pending_mgmt_tx (int) and the above condtions comes true if the counter -is negative and we drop the probe response. - -To avoid this, check on the wake tx queue path as well for the tx path of -the frame and increment the appropriate counters - -Fixes: cac085524cf1 "ath10k: move mgmt descriptor limit handle under mgmt_tx" -Signed-off-by: Ashok Raj Nagarajan -Signed-off-by: Kalle Valo -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/net/wireless/ath/ath10k/mac.c | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - ---- a/drivers/net/wireless/ath/ath10k/mac.c -+++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -3777,7 +3777,9 @@ int ath10k_mac_tx_push_txq(struct ieee80 - enum ath10k_hw_txrx_mode txmode; - enum ath10k_mac_tx_path txpath; - struct sk_buff *skb; -+ struct ieee80211_hdr *hdr; - size_t skb_len; -+ bool is_mgmt, is_presp; - int ret; - - spin_lock_bh(&ar->htt.tx_lock); -@@ -3801,6 +3803,22 @@ int ath10k_mac_tx_push_txq(struct ieee80 - skb_len = skb->len; - txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta, skb); - txpath = ath10k_mac_tx_h_get_txpath(ar, skb, txmode); -+ is_mgmt = (txpath == ATH10K_MAC_TX_HTT_MGMT); -+ -+ if (is_mgmt) { -+ hdr = (struct ieee80211_hdr *)skb->data; -+ is_presp = ieee80211_is_probe_resp(hdr->frame_control); -+ -+ spin_lock_bh(&ar->htt.tx_lock); -+ ret = ath10k_htt_tx_mgmt_inc_pending(htt, is_mgmt, is_presp); -+ -+ if (ret) { -+ ath10k_htt_tx_dec_pending(htt); -+ spin_unlock_bh(&ar->htt.tx_lock); -+ return ret; -+ } -+ spin_unlock_bh(&ar->htt.tx_lock); -+ } - - ret = ath10k_mac_tx(ar, vif, sta, txmode, txpath, skb); - if (unlikely(ret)) { -@@ -3808,6 +3826,8 @@ int ath10k_mac_tx_push_txq(struct ieee80 - - spin_lock_bh(&ar->htt.tx_lock); - ath10k_htt_tx_dec_pending(htt); -+ if (is_mgmt) -+ ath10k_htt_tx_mgmt_dec_pending(htt); - spin_unlock_bh(&ar->htt.tx_lock); - - return ret; diff --git a/kernel/kernel/files/patches/mageia/stable-ath10k-fix-throughput-regression-in-multi-client-mode.patch b/kernel/kernel/files/patches/mageia/stable-ath10k-fix-throughput-regression-in-multi-client-mode.patch deleted file mode 100644 index 965cd1a1..00000000 --- a/kernel/kernel/files/patches/mageia/stable-ath10k-fix-throughput-regression-in-multi-client-mode.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 18f53fe0f30331e826b075709ed7b26b9283235e Mon Sep 17 00:00:00 2001 -From: Rajkumar Manoharan -Date: Fri, 2 Sep 2016 19:46:10 +0300 -Subject: ath10k: fix throughput regression in multi client mode - -From: Rajkumar Manoharan - -commit 18f53fe0f30331e826b075709ed7b26b9283235e upstream. - -commit 7a0adc83f34d ("ath10k: improve tx scheduling") is causing -severe throughput drop in multi client mode. This issue is originally -reported in veriwave setup with 50 clients with TCP downlink traffic. -While increasing number of clients, the average throughput drops -gradually. With 50 clients, the combined peak throughput is decreased -to 98 Mbps whereas reverting given commit restored it to 550 Mbps. - -Processing txqs for every tx completion is causing overhead. Ideally for -management frame tx completion, pending txqs processing can be avoided. -The change partly reverts the commit "ath10k: improve tx scheduling". -Processing pending txqs after all skbs tx completion will yeild enough -room to burst tx frames. - -Fixes: 7a0adc83f34d ("ath10k: improve tx scheduling") -Signed-off-by: Rajkumar Manoharan -Signed-off-by: Kalle Valo -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/net/wireless/ath/ath10k/htt_rx.c | 2 ++ - drivers/net/wireless/ath/ath10k/txrx.c | 2 -- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/net/wireless/ath/ath10k/htt_rx.c -+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c -@@ -2394,6 +2394,8 @@ static void ath10k_htt_txrx_compl_task(u - skb_queue_splice_init(&htt->rx_in_ord_compl_q, &rx_ind_q); - spin_unlock_irqrestore(&htt->rx_in_ord_compl_q.lock, flags); - -+ ath10k_mac_tx_push_pending(ar); -+ - spin_lock_irqsave(&htt->tx_fetch_ind_q.lock, flags); - skb_queue_splice_init(&htt->tx_fetch_ind_q, &tx_ind_q); - spin_unlock_irqrestore(&htt->tx_fetch_ind_q.lock, flags); ---- a/drivers/net/wireless/ath/ath10k/txrx.c -+++ b/drivers/net/wireless/ath/ath10k/txrx.c -@@ -119,8 +119,6 @@ int ath10k_txrx_tx_unref(struct ath10k_h - ieee80211_tx_status(htt->ar->hw, msdu); - /* we do not own the msdu anymore */ - -- ath10k_mac_tx_push_pending(ar); -- - return 0; - } - diff --git a/kernel/kernel/files/patches/mageia/stable-coresight-remove-erroneous-dma_free_coherent-in-tmc_probe.patch b/kernel/kernel/files/patches/mageia/stable-coresight-remove-erroneous-dma_free_coherent-in-tmc_probe.patch deleted file mode 100644 index b3e6eb41..00000000 --- a/kernel/kernel/files/patches/mageia/stable-coresight-remove-erroneous-dma_free_coherent-in-tmc_probe.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 481e46fe7a88557b66330cbb047b25cc13eff4b9 Mon Sep 17 00:00:00 2001 -From: Suzuki K Poulose -Date: Thu, 25 Aug 2016 15:18:54 -0600 -Subject: coresight: Remove erroneous dma_free_coherent in tmc_probe - -From: Suzuki K Poulose - -commit 481e46fe7a88557b66330cbb047b25cc13eff4b9 upstream. - -commit de5461970b3e9e194 ("coresight: tmc: allocating memory when needed") -removed the static allocation of buffer for the trace data in ETR mode in -tmc_probe. However it failed to remove the "devm_free_coherent" in -tmc_probe when the probe fails due to other reasons. This patch gets -rid of the incorrect dma_free_coherent() call. - -Fixes: commit de5461970b3e9e194 ("coresight: tmc: allocating memory when needed") -Cc: Mathieu Poirier -Signed-off-by: Suzuki K Poulose -Signed-off-by: Mathieu Poirier -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/hwtracing/coresight/coresight-tmc.c | 3 --- - 1 file changed, 3 deletions(-) - ---- a/drivers/hwtracing/coresight/coresight-tmc.c -+++ b/drivers/hwtracing/coresight/coresight-tmc.c -@@ -388,9 +388,6 @@ static int tmc_probe(struct amba_device - err_misc_register: - coresight_unregister(drvdata->csdev); - err_devm_kzalloc: -- if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) -- dma_free_coherent(dev, drvdata->size, -- drvdata->vaddr, drvdata->paddr); - return ret; - } - diff --git a/kernel/kernel/files/patches/mageia/stable-crypto-arm-ghash-ce-add-missing-async-import-export.patch b/kernel/kernel/files/patches/mageia/stable-crypto-arm-ghash-ce-add-missing-async-import-export.patch deleted file mode 100644 index 5253ef79..00000000 --- a/kernel/kernel/files/patches/mageia/stable-crypto-arm-ghash-ce-add-missing-async-import-export.patch +++ /dev/null @@ -1,64 +0,0 @@ -From ed4767d612fd2c39e2c4c69eba484c1219dcddb6 Mon Sep 17 00:00:00 2001 -From: Ard Biesheuvel -Date: Thu, 1 Sep 2016 14:25:42 +0100 -Subject: crypto: arm/ghash-ce - add missing async import/export - -From: Ard Biesheuvel - -commit ed4767d612fd2c39e2c4c69eba484c1219dcddb6 upstream. - -Since commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero"), -all ahash drivers are required to implement import()/export(), and must have -a non-zero statesize. Fix this for the ARM Crypto Extensions GHASH -implementation. - -Fixes: 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero") -Signed-off-by: Ard Biesheuvel -Signed-off-by: Herbert Xu -Signed-off-by: Greg Kroah-Hartman - ---- - arch/arm/crypto/ghash-ce-glue.c | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - ---- a/arch/arm/crypto/ghash-ce-glue.c -+++ b/arch/arm/crypto/ghash-ce-glue.c -@@ -220,6 +220,27 @@ static int ghash_async_digest(struct aha - } - } - -+static int ghash_async_import(struct ahash_request *req, const void *in) -+{ -+ struct ahash_request *cryptd_req = ahash_request_ctx(req); -+ struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); -+ struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); -+ struct shash_desc *desc = cryptd_shash_desc(cryptd_req); -+ -+ desc->tfm = cryptd_ahash_child(ctx->cryptd_tfm); -+ desc->flags = req->base.flags; -+ -+ return crypto_shash_import(desc, in); -+} -+ -+static int ghash_async_export(struct ahash_request *req, void *out) -+{ -+ struct ahash_request *cryptd_req = ahash_request_ctx(req); -+ struct shash_desc *desc = cryptd_shash_desc(cryptd_req); -+ -+ return crypto_shash_export(desc, out); -+} -+ - static int ghash_async_setkey(struct crypto_ahash *tfm, const u8 *key, - unsigned int keylen) - { -@@ -268,7 +289,10 @@ static struct ahash_alg ghash_async_alg - .final = ghash_async_final, - .setkey = ghash_async_setkey, - .digest = ghash_async_digest, -+ .import = ghash_async_import, -+ .export = ghash_async_export, - .halg.digestsize = GHASH_DIGEST_SIZE, -+ .halg.statesize = sizeof(struct ghash_desc_ctx), - .halg.base = { - .cra_name = "ghash", - .cra_driver_name = "ghash-ce", diff --git a/kernel/kernel/files/patches/mageia/stable-crypto-ccp-fix-return-value-check-in-ccp_dmaengine_register.patch b/kernel/kernel/files/patches/mageia/stable-crypto-ccp-fix-return-value-check-in-ccp_dmaengine_register.patch deleted file mode 100644 index 2685ecb5..00000000 --- a/kernel/kernel/files/patches/mageia/stable-crypto-ccp-fix-return-value-check-in-ccp_dmaengine_register.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 7514e3688811e610640ec2201ca14dfebfe13442 Mon Sep 17 00:00:00 2001 -From: Wei Yongjun -Date: Sat, 17 Sep 2016 16:01:22 +0000 -Subject: crypto: ccp - Fix return value check in ccp_dmaengine_register() - -From: Wei Yongjun - -commit 7514e3688811e610640ec2201ca14dfebfe13442 upstream. - -Fix the retrn value check which testing the wrong variable -in ccp_dmaengine_register(). - -Fixes: 58ea8abf4904 ("crypto: ccp - Register the CCP as a DMA resource") -Signed-off-by: Wei Yongjun -Acked-by: Gary R Hook -Signed-off-by: Herbert Xu -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/crypto/ccp/ccp-dmaengine.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/crypto/ccp/ccp-dmaengine.c -+++ b/drivers/crypto/ccp/ccp-dmaengine.c -@@ -650,7 +650,7 @@ int ccp_dmaengine_register(struct ccp_de - dma_desc_cache_name = devm_kasprintf(ccp->dev, GFP_KERNEL, - "%s-dmaengine-desc-cache", - ccp->name); -- if (!dma_cmd_cache_name) -+ if (!dma_desc_cache_name) - return -ENOMEM; - ccp->dma_desc_cache = kmem_cache_create(dma_desc_cache_name, - sizeof(struct ccp_dma_desc), diff --git a/kernel/kernel/files/patches/mageia/stable-crypto-gcm-fix-iv-buffer-size-in-crypto_gcm_setkey.patch b/kernel/kernel/files/patches/mageia/stable-crypto-gcm-fix-iv-buffer-size-in-crypto_gcm_setkey.patch deleted file mode 100644 index 7a66373f..00000000 --- a/kernel/kernel/files/patches/mageia/stable-crypto-gcm-fix-iv-buffer-size-in-crypto_gcm_setkey.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 50d2e6dc1f83db0563c7d6603967bf9585ce934b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ondrej=20Mosn=C3=A1=C4=8Dek?= -Date: Fri, 23 Sep 2016 10:47:32 +0200 -Subject: crypto: gcm - Fix IV buffer size in crypto_gcm_setkey - -From: Ondrej Mosnáček - -commit 50d2e6dc1f83db0563c7d6603967bf9585ce934b upstream. - -The cipher block size for GCM is 16 bytes, and thus the CTR transform -used in crypto_gcm_setkey() will also expect a 16-byte IV. However, -the code currently reserves only 8 bytes for the IV, causing -an out-of-bounds access in the CTR transform. This patch fixes -the issue by setting the size of the IV buffer to 16 bytes. - -Fixes: 84c911523020 ("[CRYPTO] gcm: Add support for async ciphers") -Signed-off-by: Ondrej Mosnacek -Signed-off-by: Herbert Xu -Signed-off-by: Greg Kroah-Hartman - ---- - crypto/gcm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/crypto/gcm.c -+++ b/crypto/gcm.c -@@ -117,7 +117,7 @@ static int crypto_gcm_setkey(struct cryp - struct crypto_skcipher *ctr = ctx->ctr; - struct { - be128 hash; -- u8 iv[8]; -+ u8 iv[16]; - - struct crypto_gcm_setkey_result result; - diff --git a/kernel/kernel/files/patches/mageia/stable-crypto-marvell-don-t-overwrite-default-creq-state-during-initialization.patch b/kernel/kernel/files/patches/mageia/stable-crypto-marvell-don-t-overwrite-default-creq-state-during-initialization.patch deleted file mode 100644 index 6d98c6f5..00000000 --- a/kernel/kernel/files/patches/mageia/stable-crypto-marvell-don-t-overwrite-default-creq-state-during-initialization.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 57cfda1ac74e58767f6305bd1ea3449177425460 Mon Sep 17 00:00:00 2001 -From: Romain Perier -Date: Tue, 9 Aug 2016 11:03:19 +0200 -Subject: crypto: marvell - Don't overwrite default creq->state during initialization - -From: Romain Perier - -commit 57cfda1ac74e58767f6305bd1ea3449177425460 upstream. - -Currently, in mv_cesa_{md5,sha1,sha256}_init creq->state is initialized -before the call to mv_cesa_ahash_init. This is wrong because this -function fills creq with zero by using memset, so its 'state' that -contains the default DIGEST is overwritten. This commit fixes the issue -by initializing creq->state just after the call to mv_cesa_ahash_init. - -Fixes: commit b0ef51067cb4 ("crypto: marvell/cesa - initialize hash...") -Signed-off-by: Romain Perier -Signed-off-by: Herbert Xu -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/crypto/marvell/hash.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - ---- a/drivers/crypto/marvell/hash.c -+++ b/drivers/crypto/marvell/hash.c -@@ -805,13 +805,14 @@ static int mv_cesa_md5_init(struct ahash - struct mv_cesa_op_ctx tmpl = { }; - - mv_cesa_set_op_cfg(&tmpl, CESA_SA_DESC_CFG_MACM_MD5); -+ -+ mv_cesa_ahash_init(req, &tmpl, true); -+ - creq->state[0] = MD5_H0; - creq->state[1] = MD5_H1; - creq->state[2] = MD5_H2; - creq->state[3] = MD5_H3; - -- mv_cesa_ahash_init(req, &tmpl, true); -- - return 0; - } - -@@ -873,14 +874,15 @@ static int mv_cesa_sha1_init(struct ahas - struct mv_cesa_op_ctx tmpl = { }; - - mv_cesa_set_op_cfg(&tmpl, CESA_SA_DESC_CFG_MACM_SHA1); -+ -+ mv_cesa_ahash_init(req, &tmpl, false); -+ - creq->state[0] = SHA1_H0; - creq->state[1] = SHA1_H1; - creq->state[2] = SHA1_H2; - creq->state[3] = SHA1_H3; - creq->state[4] = SHA1_H4; - -- mv_cesa_ahash_init(req, &tmpl, false); -- - return 0; - } - -@@ -942,6 +944,9 @@ static int mv_cesa_sha256_init(struct ah - struct mv_cesa_op_ctx tmpl = { }; - - mv_cesa_set_op_cfg(&tmpl, CESA_SA_DESC_CFG_MACM_SHA256); -+ -+ mv_cesa_ahash_init(req, &tmpl, false); -+ - creq->state[0] = SHA256_H0; - creq->state[1] = SHA256_H1; - creq->state[2] = SHA256_H2; -@@ -951,8 +956,6 @@ static int mv_cesa_sha256_init(struct ah - creq->state[6] = SHA256_H6; - creq->state[7] = SHA256_H7; - -- mv_cesa_ahash_init(req, &tmpl, false); -- - return 0; - } - diff --git a/kernel/kernel/files/patches/mageia/stable-crypto-marvell-update-transformation-context-for-each-dequeued-req.patch b/kernel/kernel/files/patches/mageia/stable-crypto-marvell-update-transformation-context-for-each-dequeued-req.patch deleted file mode 100644 index 18fb155e..00000000 --- a/kernel/kernel/files/patches/mageia/stable-crypto-marvell-update-transformation-context-for-each-dequeued-req.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 09951d83fc58a6f772de09c08e370f6d9970dbb6 Mon Sep 17 00:00:00 2001 -From: Romain Perier -Date: Tue, 9 Aug 2016 11:03:18 +0200 -Subject: crypto: marvell - Update transformation context for each dequeued req - -From: Romain Perier - -commit 09951d83fc58a6f772de09c08e370f6d9970dbb6 upstream. - -So far, sub part of mv_cesa_int was responsible of dequeuing complete -requests, then call the 'cleanup' operation on these reqs and call the -crypto api callback 'complete'. The problem is that the transformation -context 'ctx' is retrieved only once before the while loop. Which means -that the wrong 'cleanup' operation might be called on the wrong type of -cesa requests, it can lead to memory corruptions with this message: - -marvell-cesa f1090000.crypto: dma_pool_free cesa_padding, 5a5a5a5a/5a5a5a5a (bad dma) - -This commit fixes the issue, by updating the transformation context for -each dequeued cesa request. - -Fixes: commit 85030c5168f1 ("crypto: marvell - Add support for chai...") -Signed-off-by: Romain Perier -Signed-off-by: Herbert Xu -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/crypto/marvell/cesa.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/crypto/marvell/cesa.c -+++ b/drivers/crypto/marvell/cesa.c -@@ -166,6 +166,7 @@ static irqreturn_t mv_cesa_int(int irq, - if (!req) - break; - -+ ctx = crypto_tfm_ctx(req->tfm); - mv_cesa_complete_req(ctx, req, 0); - } - } diff --git a/kernel/kernel/files/patches/mageia/stable-dmaengine-ipu-remove-bogus-no_irq-reference.patch b/kernel/kernel/files/patches/mageia/stable-dmaengine-ipu-remove-bogus-no_irq-reference.patch deleted file mode 100644 index dda0b6d5..00000000 --- a/kernel/kernel/files/patches/mageia/stable-dmaengine-ipu-remove-bogus-no_irq-reference.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 86c7e6836479c4045a9a81ed5ea76c51d719f9c1 Mon Sep 17 00:00:00 2001 -From: Arnd Bergmann -Date: Sat, 3 Sep 2016 01:22:02 +0200 -Subject: dmaengine: ipu: remove bogus NO_IRQ reference - -From: Arnd Bergmann - -commit 86c7e6836479c4045a9a81ed5ea76c51d719f9c1 upstream. - -A workaround for a warning introduced a use of the NO_IRQ -macro that should have been gone for a long time. - -It is clear from the code that the value cannot actually -be used, but apparently there was a configuration at -some point that caused a warning, so instead of just -reverting that patch, this rearranges the code in a way that -the warning cannot reappear. - -Signed-off-by: Arnd Bergmann -Fixes: 6ef41cf6f721 ("dmaengine :ipu: change ipu_irq_handler() to remove compile warning") -Signed-off-by: Vinod Koul -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/dma/ipu/ipu_irq.c | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - ---- a/drivers/dma/ipu/ipu_irq.c -+++ b/drivers/dma/ipu/ipu_irq.c -@@ -286,22 +286,21 @@ static void ipu_irq_handler(struct irq_d - raw_spin_unlock(&bank_lock); - while ((line = ffs(status))) { - struct ipu_irq_map *map; -- unsigned int irq = NO_IRQ; -+ unsigned int irq; - - line--; - status &= ~(1UL << line); - - raw_spin_lock(&bank_lock); - map = src2map(32 * i + line); -- if (map) -- irq = map->irq; -- raw_spin_unlock(&bank_lock); -- - if (!map) { -+ raw_spin_unlock(&bank_lock); - pr_err("IPU: Interrupt on unmapped source %u bank %d\n", - line, i); - continue; - } -+ irq = map->irq; -+ raw_spin_unlock(&bank_lock); - generic_handle_irq(irq); - } - } diff --git a/kernel/kernel/files/patches/mageia/stable-drm-amd-powerplay-fix-mclk-not-switching-back-after-multi-head-was-disabled.patch b/kernel/kernel/files/patches/mageia/stable-drm-amd-powerplay-fix-mclk-not-switching-back-after-multi-head-was-disabled.patch deleted file mode 100644 index 849b1ee5..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-amd-powerplay-fix-mclk-not-switching-back-after-multi-head-was-disabled.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 9716ebc38dfabe6c8e5e3c809e9f3c61dd3740f9 Mon Sep 17 00:00:00 2001 -From: Rex Zhu -Date: Wed, 14 Sep 2016 13:20:34 +0800 -Subject: drm/amd/powerplay: fix mclk not switching back after multi-head was disabled - -From: Rex Zhu - -commit 9716ebc38dfabe6c8e5e3c809e9f3c61dd3740f9 upstream. - -Signed-off-by: Rex Zhu -Reviewed-by: Alex Deucher -Signed-off-by: Alex Deucher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.c | 2 ++ - drivers/gpu/drm/amd/powerplay/eventmgr/psm.c | 3 ++- - 2 files changed, 4 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.c -+++ b/drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.c -@@ -262,6 +262,8 @@ static const pem_event_action * const di - unblock_adjust_power_state_tasks, - set_cpu_power_state, - notify_hw_power_source_tasks, -+ get_2d_performance_state_tasks, -+ set_performance_state_tasks, - /* updateDALConfigurationTasks, - variBrightDisplayConfigurationChangeTasks, */ - adjust_power_state_tasks, ---- a/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c -+++ b/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c -@@ -100,11 +100,12 @@ int psm_adjust_power_state_dynamic(struc - if (requested == NULL) - return 0; - -+ phm_apply_state_adjust_rules(hwmgr, requested, pcurrent); -+ - if (pcurrent == NULL || (0 != phm_check_states_equal(hwmgr, &pcurrent->hardware, &requested->hardware, &equal))) - equal = false; - - if (!equal || phm_check_smc_update_required_for_display_configuration(hwmgr)) { -- phm_apply_state_adjust_rules(hwmgr, requested, pcurrent); - phm_set_power_state(hwmgr, &pcurrent->hardware, &requested->hardware); - hwmgr->current_ps = requested; - } diff --git a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch b/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch deleted file mode 100644 index a99ae3e7..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch +++ /dev/null @@ -1,53 +0,0 @@ -From dc8184aa8621ee8048652496884d9f40d4bb407f Mon Sep 17 00:00:00 2001 -From: Rex Zhu -Date: Mon, 10 Oct 2016 15:57:21 +0800 -Subject: drm/amdgpu: change vblank_time's calculation method to reduce computational error. - -From: Rex Zhu - -commit dc8184aa8621ee8048652496884d9f40d4bb407f upstream. - -Signed-off-by: Rex Zhu -Reviewed-by: Alex Deucher -Signed-off-by: Alex Deucher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 14 ++++++++------ - 1 file changed, 8 insertions(+), 6 deletions(-) - ---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c -+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c -@@ -113,24 +113,26 @@ void amdgpu_dpm_print_ps_status(struct a - printk("\n"); - } - -+ - u32 amdgpu_dpm_get_vblank_time(struct amdgpu_device *adev) - { - struct drm_device *dev = adev->ddev; - struct drm_crtc *crtc; - struct amdgpu_crtc *amdgpu_crtc; -- u32 line_time_us, vblank_lines; -+ u32 vblank_in_pixels; - u32 vblank_time_us = 0xffffffff; /* if the displays are off, vblank time is max */ - - if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) { - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { - amdgpu_crtc = to_amdgpu_crtc(crtc); - if (crtc->enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) { -- line_time_us = (amdgpu_crtc->hw_mode.crtc_htotal * 1000) / -- amdgpu_crtc->hw_mode.clock; -- vblank_lines = amdgpu_crtc->hw_mode.crtc_vblank_end - -+ vblank_in_pixels = -+ amdgpu_crtc->hw_mode.crtc_htotal * -+ (amdgpu_crtc->hw_mode.crtc_vblank_end - - amdgpu_crtc->hw_mode.crtc_vdisplay + -- (amdgpu_crtc->v_border * 2); -- vblank_time_us = vblank_lines * line_time_us; -+ (amdgpu_crtc->v_border * 2)); -+ -+ vblank_time_us = vblank_in_pixels * 1000 / amdgpu_crtc->hw_mode.clock; - break; - } - } diff --git a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce10-disable-hpd-on-local-panels.patch b/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce10-disable-hpd-on-local-panels.patch deleted file mode 100644 index 7a7aa723..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce10-disable-hpd-on-local-panels.patch +++ /dev/null @@ -1,62 +0,0 @@ -From e96ec90f496603c48e0945f8bdeb4cdf3088cbba Mon Sep 17 00:00:00 2001 -From: Alex Deucher -Date: Wed, 28 Sep 2016 12:41:50 -0400 -Subject: drm/amdgpu/dce10: disable hpd on local panels - -From: Alex Deucher - -commit e96ec90f496603c48e0945f8bdeb4cdf3088cbba upstream. - -Otherwise we can get a hotplug interrupt storm when -we turn the panel off if hpd interrupts were enabled -by the bios. - -bug: -https://bugs.freedesktop.org/show_bug.cgi?id=97471 - -Signed-off-by: Alex Deucher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 23 +++++++++++++---------- - 1 file changed, 13 insertions(+), 10 deletions(-) - ---- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c -+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c -@@ -425,16 +425,6 @@ static void dce_v10_0_hpd_init(struct am - list_for_each_entry(connector, &dev->mode_config.connector_list, head) { - struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); - -- if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || -- connector->connector_type == DRM_MODE_CONNECTOR_LVDS) { -- /* don't try to enable hpd on eDP or LVDS avoid breaking the -- * aux dp channel on imac and help (but not completely fix) -- * https://bugzilla.redhat.com/show_bug.cgi?id=726143 -- * also avoid interrupt storms during dpms. -- */ -- continue; -- } -- - switch (amdgpu_connector->hpd.hpd) { - case AMDGPU_HPD_1: - idx = 0; -@@ -458,6 +448,19 @@ static void dce_v10_0_hpd_init(struct am - continue; - } - -+ if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || -+ connector->connector_type == DRM_MODE_CONNECTOR_LVDS) { -+ /* don't try to enable hpd on eDP or LVDS avoid breaking the -+ * aux dp channel on imac and help (but not completely fix) -+ * https://bugzilla.redhat.com/show_bug.cgi?id=726143 -+ * also avoid interrupt storms during dpms. -+ */ -+ tmp = RREG32(mmDC_HPD_INT_CONTROL + hpd_offsets[idx]); -+ tmp = REG_SET_FIELD(tmp, DC_HPD_INT_CONTROL, DC_HPD_INT_EN, 0); -+ WREG32(mmDC_HPD_INT_CONTROL + hpd_offsets[idx], tmp); -+ continue; -+ } -+ - tmp = RREG32(mmDC_HPD_CONTROL + hpd_offsets[idx]); - tmp = REG_SET_FIELD(tmp, DC_HPD_CONTROL, DC_HPD_EN, 1); - WREG32(mmDC_HPD_CONTROL + hpd_offsets[idx], tmp); diff --git a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce11-add-missing-drm_mode_config_cleanup-call.patch b/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce11-add-missing-drm_mode_config_cleanup-call.patch deleted file mode 100644 index de149bf4..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce11-add-missing-drm_mode_config_cleanup-call.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 140c94da3c3338c0ff4cc127cf9bec87905ca83c Mon Sep 17 00:00:00 2001 -From: Grazvydas Ignotas -Date: Mon, 3 Oct 2016 00:06:45 +0300 -Subject: drm/amdgpu/dce11: add missing drm_mode_config_cleanup call - -From: Grazvydas Ignotas - -commit 140c94da3c3338c0ff4cc127cf9bec87905ca83c upstream. - -All other amdgpu/dce_v* files have this call, it's only mysteriously -missing from dce_v11_0.c since the file was added and causes leaks. - -Fixes: aaa36a976bbb ("drm/amdgpu: Add initial VI support") -Signed-off-by: Grazvydas Ignotas -Signed-off-by: Alex Deucher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c -+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c -@@ -3112,6 +3112,7 @@ static int dce_v11_0_sw_fini(void *handl - - dce_v11_0_afmt_fini(adev); - -+ drm_mode_config_cleanup(adev->ddev); - adev->mode_info.mode_config_initialized = false; - - return 0; diff --git a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce11-disable-hpd-on-local-panels.patch b/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce11-disable-hpd-on-local-panels.patch deleted file mode 100644 index a6a83cd3..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce11-disable-hpd-on-local-panels.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 3a9d993ee9809c217f4322623a9b78c8d17fdd1f Mon Sep 17 00:00:00 2001 -From: Alex Deucher -Date: Wed, 28 Sep 2016 12:43:33 -0400 -Subject: drm/amdgpu/dce11: disable hpd on local panels - -From: Alex Deucher - -commit 3a9d993ee9809c217f4322623a9b78c8d17fdd1f upstream. - -Otherwise we can get a hotplug interrupt storm when -we turn the panel off if hpd interrupts were enabled -by the bios. - -bug: -https://bugs.freedesktop.org/show_bug.cgi?id=97471 - -Signed-off-by: Alex Deucher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 23 +++++++++++++---------- - 1 file changed, 13 insertions(+), 10 deletions(-) - ---- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c -+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c -@@ -443,16 +443,6 @@ static void dce_v11_0_hpd_init(struct am - list_for_each_entry(connector, &dev->mode_config.connector_list, head) { - struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); - -- if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || -- connector->connector_type == DRM_MODE_CONNECTOR_LVDS) { -- /* don't try to enable hpd on eDP or LVDS avoid breaking the -- * aux dp channel on imac and help (but not completely fix) -- * https://bugzilla.redhat.com/show_bug.cgi?id=726143 -- * also avoid interrupt storms during dpms. -- */ -- continue; -- } -- - switch (amdgpu_connector->hpd.hpd) { - case AMDGPU_HPD_1: - idx = 0; -@@ -476,6 +466,19 @@ static void dce_v11_0_hpd_init(struct am - continue; - } - -+ if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || -+ connector->connector_type == DRM_MODE_CONNECTOR_LVDS) { -+ /* don't try to enable hpd on eDP or LVDS avoid breaking the -+ * aux dp channel on imac and help (but not completely fix) -+ * https://bugzilla.redhat.com/show_bug.cgi?id=726143 -+ * also avoid interrupt storms during dpms. -+ */ -+ tmp = RREG32(mmDC_HPD_INT_CONTROL + hpd_offsets[idx]); -+ tmp = REG_SET_FIELD(tmp, DC_HPD_INT_CONTROL, DC_HPD_INT_EN, 0); -+ WREG32(mmDC_HPD_INT_CONTROL + hpd_offsets[idx], tmp); -+ continue; -+ } -+ - tmp = RREG32(mmDC_HPD_CONTROL + hpd_offsets[idx]); - tmp = REG_SET_FIELD(tmp, DC_HPD_CONTROL, DC_HPD_EN, 1); - WREG32(mmDC_HPD_CONTROL + hpd_offsets[idx], tmp); diff --git a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce8-disable-hpd-on-local-panels.patch b/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce8-disable-hpd-on-local-panels.patch deleted file mode 100644 index 63cda139..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-dce8-disable-hpd-on-local-panels.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 324082586cc5918e3230f0b2f326656c653201eb Mon Sep 17 00:00:00 2001 -From: Alex Deucher -Date: Wed, 28 Sep 2016 12:44:20 -0400 -Subject: drm/amdgpu/dce8: disable hpd on local panels - -From: Alex Deucher - -commit 324082586cc5918e3230f0b2f326656c653201eb upstream. - -Otherwise we can get a hotplug interrupt storm when -we turn the panel off if hpd interrupts were enabled -by the bios. - -bug: -https://bugs.freedesktop.org/show_bug.cgi?id=97471 - -Signed-off-by: Alex Deucher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 48 +++++++++++++++++++++++++++------- - 1 file changed, 39 insertions(+), 9 deletions(-) - ---- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c -+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c -@@ -395,15 +395,6 @@ static void dce_v8_0_hpd_init(struct amd - list_for_each_entry(connector, &dev->mode_config.connector_list, head) { - struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); - -- if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || -- connector->connector_type == DRM_MODE_CONNECTOR_LVDS) { -- /* don't try to enable hpd on eDP or LVDS avoid breaking the -- * aux dp channel on imac and help (but not completely fix) -- * https://bugzilla.redhat.com/show_bug.cgi?id=726143 -- * also avoid interrupt storms during dpms. -- */ -- continue; -- } - switch (amdgpu_connector->hpd.hpd) { - case AMDGPU_HPD_1: - WREG32(mmDC_HPD1_CONTROL, tmp); -@@ -426,6 +417,45 @@ static void dce_v8_0_hpd_init(struct amd - default: - break; - } -+ -+ if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || -+ connector->connector_type == DRM_MODE_CONNECTOR_LVDS) { -+ /* don't try to enable hpd on eDP or LVDS avoid breaking the -+ * aux dp channel on imac and help (but not completely fix) -+ * https://bugzilla.redhat.com/show_bug.cgi?id=726143 -+ * also avoid interrupt storms during dpms. -+ */ -+ u32 dc_hpd_int_cntl_reg, dc_hpd_int_cntl; -+ -+ switch (amdgpu_connector->hpd.hpd) { -+ case AMDGPU_HPD_1: -+ dc_hpd_int_cntl_reg = mmDC_HPD1_INT_CONTROL; -+ break; -+ case AMDGPU_HPD_2: -+ dc_hpd_int_cntl_reg = mmDC_HPD2_INT_CONTROL; -+ break; -+ case AMDGPU_HPD_3: -+ dc_hpd_int_cntl_reg = mmDC_HPD3_INT_CONTROL; -+ break; -+ case AMDGPU_HPD_4: -+ dc_hpd_int_cntl_reg = mmDC_HPD4_INT_CONTROL; -+ break; -+ case AMDGPU_HPD_5: -+ dc_hpd_int_cntl_reg = mmDC_HPD5_INT_CONTROL; -+ break; -+ case AMDGPU_HPD_6: -+ dc_hpd_int_cntl_reg = mmDC_HPD6_INT_CONTROL; -+ break; -+ default: -+ continue; -+ } -+ -+ dc_hpd_int_cntl = RREG32(dc_hpd_int_cntl_reg); -+ dc_hpd_int_cntl &= ~DC_HPD1_INT_CONTROL__DC_HPD1_INT_EN_MASK; -+ WREG32(dc_hpd_int_cntl_reg, dc_hpd_int_cntl); -+ continue; -+ } -+ - dce_v8_0_hpd_set_polarity(adev, amdgpu_connector->hpd.hpd); - amdgpu_irq_get(adev, &adev->hpd_irq, amdgpu_connector->hpd.hpd); - } diff --git a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-fix-ib-alignment-for-uvd.patch b/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-fix-ib-alignment-for-uvd.patch deleted file mode 100644 index 6e9010ec..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-fix-ib-alignment-for-uvd.patch +++ /dev/null @@ -1,30 +0,0 @@ -From c4795ca642b8bd76b5b6ffba41ba909543273d43 Mon Sep 17 00:00:00 2001 -From: Alex Deucher -Date: Mon, 22 Aug 2016 16:31:36 -0400 -Subject: drm/amdgpu: fix IB alignment for UVD - -From: Alex Deucher - -commit c4795ca642b8bd76b5b6ffba41ba909543273d43 upstream. - -According to the hw team, it should be 16, not 8. - -Cc: Peter Fang -Signed-off-by: Alex Deucher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c -+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c -@@ -292,7 +292,7 @@ static int amdgpu_info_ioctl(struct drm_ - type = AMD_IP_BLOCK_TYPE_UVD; - ring_mask = adev->uvd.ring.ready ? 1 : 0; - ib_start_alignment = AMDGPU_GPU_PAGE_SIZE; -- ib_size_alignment = 8; -+ ib_size_alignment = 16; - break; - case AMDGPU_HW_IP_VCE: - type = AMD_IP_BLOCK_TYPE_VCE; diff --git a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-initialize-the-context-reset_counter-in-amdgpu_ctx_init.patch b/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-initialize-the-context-reset_counter-in-amdgpu_ctx_init.patch deleted file mode 100644 index 4343c2f3..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-amdgpu-initialize-the-context-reset_counter-in-amdgpu_ctx_init.patch +++ /dev/null @@ -1,37 +0,0 @@ -From ce199ad690bd0a6ac6bf9e4df2c87b59d76f84da Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= -Date: Tue, 4 Oct 2016 09:43:30 +0200 -Subject: drm/amdgpu: initialize the context reset_counter in amdgpu_ctx_init -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Nicolai Hähnle - -commit ce199ad690bd0a6ac6bf9e4df2c87b59d76f84da upstream. - -Ensure that we really only report a GPU reset if one has happened since the -creation of the context. - -Signed-off-by: Nicolai Hähnle -Reviewed-by: Christian König -Signed-off-by: Alex Deucher -Signed-off-by: Alex Deucher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c -+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c -@@ -43,6 +43,9 @@ static int amdgpu_ctx_init(struct amdgpu - ctx->rings[i].sequence = 1; - ctx->rings[i].fences = &ctx->fences[amdgpu_sched_jobs * i]; - } -+ -+ ctx->reset_counter = atomic_read(&adev->gpu_reset_counter); -+ - /* create context entity for each ring */ - for (i = 0; i < adev->num_rings; i++) { - struct amdgpu_ring *ring = adev->rings[i]; diff --git a/kernel/kernel/files/patches/mageia/stable-drm-fsl-dcu-fix-endian-issue-when-using-clk_register_divider.patch b/kernel/kernel/files/patches/mageia/stable-drm-fsl-dcu-fix-endian-issue-when-using-clk_register_divider.patch deleted file mode 100644 index 92192a36..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-fsl-dcu-fix-endian-issue-when-using-clk_register_divider.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 6cc4758ae91c0582f07e3c94c7de1ad0975feff5 Mon Sep 17 00:00:00 2001 -From: Stefan Agner -Date: Fri, 2 Sep 2016 11:23:37 -0700 -Subject: drm/fsl-dcu: fix endian issue when using clk_register_divider - -From: Stefan Agner - -commit 6cc4758ae91c0582f07e3c94c7de1ad0975feff5 upstream. - -Since using clk_register_divider to setup the pixel clock, regmap -is no longer used. Regmap did take care of DCU using different -endianness. Check endianness using the device-tree property -"big-endian" to determine the location of DIV_RATIO. - -Fixes: 2d701449bce1 ("drm/fsl-dcu: use common clock framework for pixel clock divider") -Reported-by: Meng Yi -Signed-off-by: Stefan Agner -Tested-by: Meng Yi -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c -+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c -@@ -330,6 +330,7 @@ static int fsl_dcu_drm_probe(struct plat - const char *pix_clk_in_name; - const struct of_device_id *id; - int ret; -+ u8 div_ratio_shift = 0; - - fsl_dev = devm_kzalloc(dev, sizeof(*fsl_dev), GFP_KERNEL); - if (!fsl_dev) -@@ -382,11 +383,14 @@ static int fsl_dcu_drm_probe(struct plat - pix_clk_in = fsl_dev->clk; - } - -+ if (of_property_read_bool(dev->of_node, "big-endian")) -+ div_ratio_shift = 24; -+ - pix_clk_in_name = __clk_get_name(pix_clk_in); - snprintf(pix_clk_name, sizeof(pix_clk_name), "%s_pix", pix_clk_in_name); - fsl_dev->pix_clk = clk_register_divider(dev, pix_clk_name, - pix_clk_in_name, 0, base + DCU_DIV_RATIO, -- 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL); -+ div_ratio_shift, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL); - if (IS_ERR(fsl_dev->pix_clk)) { - dev_err(dev, "failed to register pix clk\n"); - ret = PTR_ERR(fsl_dev->pix_clk); diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-account-for-tseg-size-when-determining-865g-stolen-base.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-account-for-tseg-size-when-determining-865g-stolen-base.patch deleted file mode 100644 index 70ad7ba4..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-account-for-tseg-size-when-determining-865g-stolen-base.patch +++ /dev/null @@ -1,118 +0,0 @@ -From d721b02fd00bf133580f431b82ef37f3b746dfb2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= -Date: Mon, 8 Aug 2016 13:58:39 +0300 -Subject: drm/i915: Account for TSEG size when determining 865G stolen base -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Ville Syrjälä - -commit d721b02fd00bf133580f431b82ef37f3b746dfb2 upstream. - -Looks like the TSEG lives just above TOUD, stolen comes after TSEG. - -The spec seems somewhat self-contradictory in places, in the ESMRAMC -register desctription it says: - TSEG Size: - 10=(TOUD + 512 KB) to TOUD - 11 =(TOUD + 1 MB) to TOUD - -so that agrees with TSEG being at TOUD. But the example given -elsehwere in the spec says: - - TOUD equals 62.5 MB = 03E7FFFFh - TSEG selected as 512 KB in size, - Graphics local memory selected as 1 MB in size - General System RAM available in system = 62.5 MB - General system RAM range00000000h to 03E7FFFFh - TSEG address range03F80000h to 03FFFFFFh - TSEG pre-allocated from03F80000h to 03FFFFFFh - Graphics local memory pre-allocated from03E80000h to 03F7FFFFh - -so here we have TSEG above stolen. - -Real world evidence agrees with the TOUD->TSEG->stolen order however, so -let's fix up the code to account for the TSEG size. - -Cc: Taketo Kabe -Cc: Chris Wilson -Cc: Daniel Vetter -Cc: Thomas Gleixner -Cc: Ingo Molnar -Cc: "H. Peter Anvin" -Cc: x86@kernel.org -Fixes: 0ad98c74e093 ("drm/i915: Determine the stolen memory base address on gen2") -Fixes: a4dff76924fe ("x86/gpu: Add Intel graphics stolen memory quirk for gen2 platforms") -Reported-by: Taketo Kabe -Tested-by: Taketo Kabe -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96473 -Signed-off-by: Ville Syrjälä -Link: http://patchwork.freedesktop.org/patch/msgid/1470653919-27251-1-git-send-email-ville.syrjala@linux.intel.com -Link: http://download.intel.com/design/chipsets/datashts/25251405.pdf -Reviewed-by: Chris Wilson -Signed-off-by: Greg Kroah-Hartman - ---- - arch/x86/kernel/early-quirks.c | 9 ++------- - drivers/gpu/drm/i915/i915_gem_stolen.c | 23 +++++++++++++++++------ - 2 files changed, 19 insertions(+), 13 deletions(-) - ---- a/arch/x86/kernel/early-quirks.c -+++ b/arch/x86/kernel/early-quirks.c -@@ -317,16 +317,11 @@ static phys_addr_t __init i85x_stolen_ba - static phys_addr_t __init i865_stolen_base(int num, int slot, int func, - size_t stolen_size) - { -- u16 toud; -+ u16 toud = 0; - -- /* -- * FIXME is the graphics stolen memory region -- * always at TOUD? Ie. is it always the last -- * one to be allocated by the BIOS? -- */ - toud = read_pci_config_16(0, 0, 0, I865_TOUD); - -- return (phys_addr_t)toud << 16; -+ return (phys_addr_t)(toud << 16) + i845_tseg_size(); - } - - static phys_addr_t __init gen3_stolen_base(int num, int slot, int func, ---- a/drivers/gpu/drm/i915/i915_gem_stolen.c -+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c -@@ -115,17 +115,28 @@ static unsigned long i915_stolen_to_phys - - base = bsm & INTEL_BSM_MASK; - } else if (IS_I865G(dev)) { -+ u32 tseg_size = 0; - u16 toud = 0; -+ u8 tmp; -+ -+ pci_bus_read_config_byte(dev->pdev->bus, PCI_DEVFN(0, 0), -+ I845_ESMRAMC, &tmp); -+ -+ if (tmp & TSEG_ENABLE) { -+ switch (tmp & I845_TSEG_SIZE_MASK) { -+ case I845_TSEG_SIZE_512K: -+ tseg_size = KB(512); -+ break; -+ case I845_TSEG_SIZE_1M: -+ tseg_size = MB(1); -+ break; -+ } -+ } - -- /* -- * FIXME is the graphics stolen memory region -- * always at TOUD? Ie. is it always the last -- * one to be allocated by the BIOS? -- */ - pci_bus_read_config_word(dev->pdev->bus, PCI_DEVFN(0, 0), - I865_TOUD, &toud); - -- base = toud << 16; -+ base = (toud << 16) + tseg_size; - } else if (IS_I85X(dev)) { - u32 tseg_size = 0; - u32 tom; diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-allow-dp-to-work-w-o-edid.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-allow-dp-to-work-w-o-edid.patch deleted file mode 100644 index 418c1e77..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-allow-dp-to-work-w-o-edid.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 16c83fad79ca912b8b5bbdcb5272794a2be41262 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= -Date: Mon, 3 Oct 2016 10:55:16 +0300 -Subject: drm/i915: Allow DP to work w/o EDID -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Ville Syrjälä - -commit 16c83fad79ca912b8b5bbdcb5272794a2be41262 upstream. - -Allow returning "connected" or "unknown" connector status for DP branch -devices that don't have an EDID. Currently we'd claim the thing as -"disconnected" if there is no EDID. - -This stuff used to broken already, I think, but it got more broken by -commit f21a21983ef1 ("drm/i915: Splitting intel_dp_detect") - -Cc: Damien Cassou -Cc: freedesktop.org@gp.mailgun.org -Cc: Arno -Cc: Shubhangi Shrivastava -Cc: Sivakumar Thulasimani -Cc: Ander Conselvan de Oliveira -Tested-by: Arno -Fixes: f21a21983ef1 ("drm/i915: Splitting intel_dp_detect") -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83348 -Signed-off-by: Ville Syrjälä -Link: http://patchwork.freedesktop.org/patch/msgid/1475481316-8194-2-git-send-email-ville.syrjala@linux.intel.com -Reviewed-by: Ander Conselvan de Oliveira -(cherry picked from commit 5cb651a7959310ef4dbb0b93f005b10286789656) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_dp.c | 22 +++++++++------------- - 1 file changed, 9 insertions(+), 13 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_dp.c -+++ b/drivers/gpu/drm/i915/intel_dp.c -@@ -4207,7 +4207,7 @@ intel_dp_unset_edid(struct intel_dp *int - intel_dp->has_audio = false; - } - --static void -+static enum drm_connector_status - intel_dp_long_pulse(struct intel_connector *intel_connector) - { - struct drm_connector *connector = &intel_connector->base; -@@ -4232,7 +4232,7 @@ intel_dp_long_pulse(struct intel_connect - else - status = connector_status_disconnected; - -- if (status != connector_status_connected) { -+ if (status == connector_status_disconnected) { - intel_dp->compliance_test_active = 0; - intel_dp->compliance_test_type = 0; - intel_dp->compliance_test_data = 0; -@@ -4284,8 +4284,8 @@ intel_dp_long_pulse(struct intel_connect - intel_dp->aux.i2c_defer_count = 0; - - intel_dp_set_edid(intel_dp); -- -- status = connector_status_connected; -+ if (is_edp(intel_dp) || intel_connector->detect_edid) -+ status = connector_status_connected; - intel_dp->detect_done = true; - - /* Try to read the source of the interrupt */ -@@ -4303,12 +4303,11 @@ intel_dp_long_pulse(struct intel_connect - } - - out: -- if ((status != connector_status_connected) && -- (intel_dp->is_mst == false)) -+ if (status != connector_status_connected && !intel_dp->is_mst) - intel_dp_unset_edid(intel_dp); - - intel_display_power_put(to_i915(dev), power_domain); -- return; -+ return status; - } - - static enum drm_connector_status -@@ -4317,7 +4316,7 @@ intel_dp_detect(struct drm_connector *co - struct intel_dp *intel_dp = intel_attached_dp(connector); - struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); - struct intel_encoder *intel_encoder = &intel_dig_port->base; -- struct intel_connector *intel_connector = to_intel_connector(connector); -+ enum drm_connector_status status = connector->status; - - DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", - connector->base.id, connector->name); -@@ -4332,14 +4331,11 @@ intel_dp_detect(struct drm_connector *co - - /* If full detect is not performed yet, do a full detect */ - if (!intel_dp->detect_done) -- intel_dp_long_pulse(intel_dp->attached_connector); -+ status = intel_dp_long_pulse(intel_dp->attached_connector); - - intel_dp->detect_done = false; - -- if (is_edp(intel_dp) || intel_connector->detect_edid) -- return connector_status_connected; -- else -- return connector_status_disconnected; -+ return status; - } - - static void diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-allow-pch-dpll-sharing-regardless-of-dpll_sdvo_high_speed.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-allow-pch-dpll-sharing-regardless-of-dpll_sdvo_high_speed.patch deleted file mode 100644 index 4cf6873a..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-allow-pch-dpll-sharing-regardless-of-dpll_sdvo_high_speed.patch +++ /dev/null @@ -1,76 +0,0 @@ -From a3fd4c67af3d8a81d241b3d51b3525f36f1d68bb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= -Date: Mon, 26 Sep 2016 11:30:46 +0300 -Subject: drm/i915: Allow PCH DPLL sharing regardless of DPLL_SDVO_HIGH_SPEED -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Ville Syrjälä - -commit a3fd4c67af3d8a81d241b3d51b3525f36f1d68bb upstream. - -DPLL_SDVO_HIGH_SPEED must be set for SDVO/HDMI/DP, but nowhere is it -forbidden to set it for LVDS/CRT as well. So let's also set it on -CRT to make it possible to share the DPLL between HDMI and CRT. - -What that bit apparently does is enable the x5 clock to the port, -which then pumps out the bits on both edges of the clock. The DAC -doesn't need that clock since it's not pumping out bits, but I don't -think it hurts to have the DPLL output that clock anyway. - -This is fairly important on IVB since it has only two DPLLs with three -pipes. So trying to drive three or more PCH ports with three pipes -is only possible when at least one of the DPLLs gets shared between -two of the pipes. - -SNB doesn't really need to do this since it has only two pipes. It could -be done to avoid enabling the second DPLL at all in certain cases, but -I'm not sure that's such a huge win. So let's not do it for SNB, at -least for now. On ILK it never makes sense as the DPLLs can't be shared. - -v2: Just always enable the high speed clock to keep things simple (Daniel) - Beef up the commit message a bit (Daniel) - -Cc: Nick Yamane -Cc: Daniel Vetter -Tested-by: Nick Yamane -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97204 -Signed-off-by: Ville Syrjälä -Link: http://patchwork.freedesktop.org/patch/msgid/1474878646-17711-1-git-send-email-ville.syrjala@linux.intel.com -Reviewed-by: Ander Conselvan de Oliveira -(cherry picked from commit 7d7f8633a82763577727762ff3ac1df3017cb8fe) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_display.c | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - ---- a/drivers/gpu/drm/i915/intel_display.c -+++ b/drivers/gpu/drm/i915/intel_display.c -@@ -9007,6 +9007,24 @@ static void ironlake_compute_dpll(struct - if (intel_crtc_has_dp_encoder(crtc_state)) - dpll |= DPLL_SDVO_HIGH_SPEED; - -+ /* -+ * The high speed IO clock is only really required for -+ * SDVO/HDMI/DP, but we also enable it for CRT to make it -+ * possible to share the DPLL between CRT and HDMI. Enabling -+ * the clock needlessly does no real harm, except use up a -+ * bit of power potentially. -+ * -+ * We'll limit this to IVB with 3 pipes, since it has only two -+ * DPLLs and so DPLL sharing is the only way to get three pipes -+ * driving PCH ports at the same time. On SNB we could do this, -+ * and potentially avoid enabling the second DPLL, but it's not -+ * clear if it''s a win or loss power wise. No point in doing -+ * this on ILK at all since it has a fixed DPLL<->pipe mapping. -+ */ -+ if (INTEL_INFO(dev_priv)->num_pipes == 3 && -+ intel_crtc_has_type(crtc_state, INTEL_OUTPUT_ANALOG)) -+ dpll |= DPLL_SDVO_HIGH_SPEED; -+ - /* compute bitmask from p1 value */ - dpll |= (1 << (crtc_state->dpll.p1 - 1)) << DPLL_FPA01_P1_POST_DIV_SHIFT; - /* also FPA1 */ diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-backlight-setup-and-cache-pwm-alternate-increment-value.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-backlight-setup-and-cache-pwm-alternate-increment-value.patch deleted file mode 100644 index 800bedae..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-backlight-setup-and-cache-pwm-alternate-increment-value.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 16e1203db8ab740c912ea62761fdf27d7811b886 Mon Sep 17 00:00:00 2001 -From: Jani Nikula -Date: Mon, 19 Sep 2016 13:35:25 +0300 -Subject: drm/i915/backlight: setup and cache pwm alternate increment value -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Jani Nikula - -commit 16e1203db8ab740c912ea62761fdf27d7811b886 upstream. - -This will also be needed later on when setting up the alternate -increment in backlight enable. - -Cc: Shawn Lee -Reviewed-by: Ville Syrjälä -Signed-off-by: Jani Nikula -Link: http://patchwork.freedesktop.org/patch/msgid/9984b20bc59aee90b83caf59ce91f3fb122c9627.1474281249.git.jani.nikula@intel.com -(cherry picked from commit 32b421e79e6b546da1d469f1229403ac9142d695) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_drv.h | 1 + - drivers/gpu/drm/i915/intel_panel.c | 14 +++++++++++--- - 2 files changed, 12 insertions(+), 3 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_drv.h -+++ b/drivers/gpu/drm/i915/intel_drv.h -@@ -236,6 +236,7 @@ struct intel_panel { - bool enabled; - bool combination_mode; /* gen 2/4 only */ - bool active_low_pwm; -+ bool alternate_pwm_increment; /* lpt+ */ - - /* PWM chip */ - bool util_pin_active_low; /* bxt+ */ ---- a/drivers/gpu/drm/i915/intel_panel.c -+++ b/drivers/gpu/drm/i915/intel_panel.c -@@ -1242,10 +1242,10 @@ static u32 bxt_hz_to_pwm(struct intel_co - */ - static u32 spt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) - { -- struct drm_i915_private *dev_priv = to_i915(connector->base.dev); -+ struct intel_panel *panel = &connector->panel; - u32 mul; - -- if (I915_READ(SOUTH_CHICKEN1) & SPT_PWM_GRANULARITY) -+ if (panel->backlight.alternate_pwm_increment) - mul = 128; - else - mul = 16; -@@ -1261,9 +1261,10 @@ static u32 spt_hz_to_pwm(struct intel_co - static u32 lpt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) - { - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); -+ struct intel_panel *panel = &connector->panel; - u32 mul, clock; - -- if (I915_READ(SOUTH_CHICKEN2) & LPT_PWM_GRANULARITY) -+ if (panel->backlight.alternate_pwm_increment) - mul = 16; - else - mul = 128; -@@ -1414,6 +1415,13 @@ static int lpt_setup_backlight(struct in - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; - u32 pch_ctl1, pch_ctl2, val; -+ bool alt; -+ -+ if (HAS_PCH_LPT(dev_priv)) -+ alt = I915_READ(SOUTH_CHICKEN2) & LPT_PWM_GRANULARITY; -+ else -+ alt = I915_READ(SOUTH_CHICKEN1) & SPT_PWM_GRANULARITY; -+ panel->backlight.alternate_pwm_increment = alt; - - pch_ctl1 = I915_READ(BLC_PWM_PCH_CTL1); - panel->backlight.active_low_pwm = pch_ctl1 & BLM_PCH_POLARITY; diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-backlight-setup-backlight-pwm-alternate-increment-on-backlight-enable.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-backlight-setup-backlight-pwm-alternate-increment-on-backlight-enable.patch deleted file mode 100644 index 97d4e08a..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-backlight-setup-backlight-pwm-alternate-increment-on-backlight-enable.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 915b417946030e1f365c63728875cffd8db8e880 Mon Sep 17 00:00:00 2001 -From: Shawn Lee -Date: Mon, 19 Sep 2016 13:35:26 +0300 -Subject: drm/i915/backlight: setup backlight pwm alternate increment on backlight enable -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Shawn Lee - -commit 915b417946030e1f365c63728875cffd8db8e880 upstream. - -Backlight enable is supposed to do a full setup of the backlight. We -were missing the PWM alternate increment bit in the south chicken -registers on lpt+ pch. This potentially caused a PWM frequency change -when the chicken register value was lost e.g. on suspend. - -v2 by Jani, rebase on the patch caching alt increment - -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97486 -References: https://bugs.freedesktop.org/show_bug.cgi?id=67454 -Cc: Cooper Chiou -Cc: Wei Shun Chen -Cc: Gary C Wang -Reviewed-by: Ville Syrjälä -Signed-off-by: Shawn Lee -Signed-off-by: Jani Nikula -Link: http://patchwork.freedesktop.org/patch/msgid/8265f5935bd31c039ddfc82819d26c2ca1ae9cba.1474281249.git.jani.nikula@intel.com -(cherry picked from commit e29aff05f239f8dd24e9ee7816fd96726e20105a) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_panel.c | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/i915/intel_panel.c -+++ b/drivers/gpu/drm/i915/intel_panel.c -@@ -841,7 +841,7 @@ static void lpt_enable_backlight(struct - { - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; -- u32 pch_ctl1, pch_ctl2; -+ u32 pch_ctl1, pch_ctl2, schicken; - - pch_ctl1 = I915_READ(BLC_PWM_PCH_CTL1); - if (pch_ctl1 & BLM_PCH_PWM_ENABLE) { -@@ -850,6 +850,22 @@ static void lpt_enable_backlight(struct - I915_WRITE(BLC_PWM_PCH_CTL1, pch_ctl1); - } - -+ if (HAS_PCH_LPT(dev_priv)) { -+ schicken = I915_READ(SOUTH_CHICKEN2); -+ if (panel->backlight.alternate_pwm_increment) -+ schicken |= LPT_PWM_GRANULARITY; -+ else -+ schicken &= ~LPT_PWM_GRANULARITY; -+ I915_WRITE(SOUTH_CHICKEN2, schicken); -+ } else { -+ schicken = I915_READ(SOUTH_CHICKEN1); -+ if (panel->backlight.alternate_pwm_increment) -+ schicken |= SPT_PWM_GRANULARITY; -+ else -+ schicken &= ~SPT_PWM_GRANULARITY; -+ I915_WRITE(SOUTH_CHICKEN1, schicken); -+ } -+ - pch_ctl2 = panel->backlight.max << 16; - I915_WRITE(BLC_PWM_PCH_CTL2, pch_ctl2); - diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-fix-plane_blocks_per_line-on-watermarks-calculations.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-fix-plane_blocks_per_line-on-watermarks-calculations.patch deleted file mode 100644 index 0b3edb20..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-fix-plane_blocks_per_line-on-watermarks-calculations.patch +++ /dev/null @@ -1,111 +0,0 @@ -From cf6c525a31fac11b0775b8c06c00a508c6356d9b Mon Sep 17 00:00:00 2001 -From: Paulo Zanoni -Date: Thu, 22 Sep 2016 18:00:32 -0300 -Subject: drm/i915/gen9: fix plane_blocks_per_line on watermarks calculations - -From: Paulo Zanoni - -commit cf6c525a31fac11b0775b8c06c00a508c6356d9b upstream. - -The confusing thing is that plane_blocks_per_line is listed as part of -the method 2 calculation but is also used for other things. We -calculated it in two different places and different ways: one inside -skl_wm_method2() and the other inside skl_compute_plane_wm(). The -skl_wm_method2() implementation is the one that matches the -specification. - -With this patch we fix the skl_compute_plane_wm() calculation and just -pass it as a parameter to skl_wm_method2(). We also take care to not -modify the value of plane_bytes_per_line since we're going to rely on -it having a correct value in later patches. - -This should affect the watermarks for Linear and Y-tiled. - -From my analysis, it looks like the two plane_blocks_per_line -variables got out of sync on 0fda65680e92, but we can't really say -that commit was a regression, it looks like just an incomplete fix. -There's always the possibility that 0fda65680e92 matched our -specification at that time, and then later the specification changed. - -v2: Try to add a "Fixes" tag (Maarten). - -Fixes: 0fda65680e92 ("drm/i915/skl: Update watermarks for Y tiling") -Cc: Tvrtko Ursulin -Reviewed-by: Lyude -Reviewed-by: Maarten Lankhorst -Signed-off-by: Paulo Zanoni -Link: http://patchwork.freedesktop.org/patch/msgid/1474578035-424-7-git-send-email-paulo.r.zanoni@intel.com -(cherry picked from commit 7a1a8aed67e0a60772defe3f6499eb340da48634) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_pm.c | 39 +++++++++++++++------------------------ - 1 file changed, 15 insertions(+), 24 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -3475,30 +3475,14 @@ static uint32_t skl_wm_method1(uint32_t - } - - static uint32_t skl_wm_method2(uint32_t pixel_rate, uint32_t pipe_htotal, -- uint32_t horiz_pixels, uint8_t cpp, -- uint64_t tiling, uint32_t latency, -- uint32_t y_min_scanlines) -+ uint32_t latency, uint32_t plane_blocks_per_line) - { - uint32_t ret; -- uint32_t plane_bytes_per_line, plane_blocks_per_line; - uint32_t wm_intermediate_val; - - if (latency == 0) - return UINT_MAX; - -- plane_bytes_per_line = horiz_pixels * cpp; -- -- if (tiling == I915_FORMAT_MOD_Y_TILED || -- tiling == I915_FORMAT_MOD_Yf_TILED) { -- plane_bytes_per_line *= y_min_scanlines; -- plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512); -- plane_blocks_per_line /= y_min_scanlines; -- } else if (tiling == DRM_FORMAT_MOD_NONE) { -- plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512) + 1; -- } else { -- plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512); -- } -- - wm_intermediate_val = latency * pixel_rate; - ret = DIV_ROUND_UP(wm_intermediate_val, pipe_htotal * 1000) * - plane_blocks_per_line; -@@ -3587,17 +3571,24 @@ static int skl_compute_plane_wm(const st - y_min_scanlines = 4; - } - -+ plane_bytes_per_line = width * cpp; -+ if (fb->modifier[0] == I915_FORMAT_MOD_Y_TILED || -+ fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED) { -+ plane_blocks_per_line = -+ DIV_ROUND_UP(plane_bytes_per_line * y_min_scanlines, 512); -+ plane_blocks_per_line /= y_min_scanlines; -+ } else if (fb->modifier[0] == DRM_FORMAT_MOD_NONE) { -+ plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512) -+ + 1; -+ } else { -+ plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512); -+ } -+ - method1 = skl_wm_method1(plane_pixel_rate, cpp, latency); - method2 = skl_wm_method2(plane_pixel_rate, - cstate->base.adjusted_mode.crtc_htotal, -- width, -- cpp, -- fb->modifier[0], - latency, -- y_min_scanlines); -- -- plane_bytes_per_line = width * cpp; -- plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512); -+ plane_blocks_per_line); - - if (fb->modifier[0] == I915_FORMAT_MOD_Y_TILED || - fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED) { diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-fix-the-watermark-res_blocks-value.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-fix-the-watermark-res_blocks-value.patch deleted file mode 100644 index 9cd60dd2..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-fix-the-watermark-res_blocks-value.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 73fed0ef8567f1e1cba079994353e60208ded964 Mon Sep 17 00:00:00 2001 -From: Paulo Zanoni -Date: Thu, 22 Sep 2016 18:00:33 -0300 -Subject: drm/i915/gen9: fix the watermark res_blocks value - -From: Paulo Zanoni - -commit 73fed0ef8567f1e1cba079994353e60208ded964 upstream. - -We forgot the "res_blocks += y_tile_minimum" that's described on step -V of our documentation. - -Again, this should only affect the Y tiling cases. - -It looks like the relevant code was introduced in 0fda65680e92, but -there's always the possibility that it matched our specification when -it was introduced, and then the specification changed while the code -stayed the same. So we can't really say this was a regression, but -let's try to add a "Fixes" tag anyway to help backporting. - -v2: Try to add a "Fixes" tag (Maarten). - -Fixes: 0fda65680e92 ("drm/i915/skl: Update watermarks for Y tiling") -Cc: Tvrtko Ursulin -Reviewed-by: Lyude -Reviewed-by: Maarten Lankhorst -Signed-off-by: Paulo Zanoni -Link: http://patchwork.freedesktop.org/patch/msgid/1474578035-424-8-git-send-email-paulo.r.zanoni@intel.com -(cherry picked from commit 75676ed423a6acf9e2b1df52fbc036a51e11fb7a) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_pm.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -3533,7 +3533,7 @@ static int skl_compute_plane_wm(const st - uint8_t cpp; - uint32_t width = 0, height = 0; - uint32_t plane_pixel_rate; -- uint32_t y_min_scanlines; -+ uint32_t y_tile_minimum, y_min_scanlines; - - if (latency == 0 || !cstate->base.active || !intel_pstate->visible) { - *enabled = false; -@@ -3590,10 +3590,10 @@ static int skl_compute_plane_wm(const st - latency, - plane_blocks_per_line); - -+ y_tile_minimum = plane_blocks_per_line * y_min_scanlines; -+ - if (fb->modifier[0] == I915_FORMAT_MOD_Y_TILED || - fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED) { -- uint32_t y_tile_minimum = plane_blocks_per_line * -- y_min_scanlines; - selected_result = max(method2, y_tile_minimum); - } else { - if ((ddb_allocation / plane_blocks_per_line) >= 1) -@@ -3607,10 +3607,12 @@ static int skl_compute_plane_wm(const st - - if (level >= 1 && level <= 7) { - if (fb->modifier[0] == I915_FORMAT_MOD_Y_TILED || -- fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED) -+ fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED) { -+ res_blocks += y_tile_minimum; - res_lines += y_min_scanlines; -- else -+ } else { - res_blocks++; -+ } - } - - if (res_blocks >= ddb_allocation || res_lines > 31) { diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-fix-the-wawmmemoryreadlatency-implementation.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-fix-the-wawmmemoryreadlatency-implementation.patch deleted file mode 100644 index 54ffa0ea..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-fix-the-wawmmemoryreadlatency-implementation.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 4e4d3814a9bb4d71cd3ff0701d8d7041edefd8f0 Mon Sep 17 00:00:00 2001 -From: Paulo Zanoni -Date: Thu, 22 Sep 2016 18:00:30 -0300 -Subject: drm/i915/gen9: fix the WaWmMemoryReadLatency implementation - -From: Paulo Zanoni - -commit 4e4d3814a9bb4d71cd3ff0701d8d7041edefd8f0 upstream. - -Bspec says: - "The mailbox response data may not account for memory read latency. - If the mailbox response data for level 0 is 0us, add 2 microseconds - to the result for each valid level." - -This means we should only do the +2 in case wm[0] == 0, not always. - -So split the sanitizing implementation from the WA implementation and -fix the WA implementation. - -v2: Add Fixes tag (Maarten). - -Fixes: 367294be7c25 ("drm/i915/gen9: Add 2us read latency to WM level") -Cc: Vandana Kannan -Reviewed-by: Maarten Lankhorst -Signed-off-by: Paulo Zanoni -Link: http://patchwork.freedesktop.org/patch/msgid/1474578035-424-5-git-send-email-paulo.r.zanoni@intel.com -(cherry picked from commit 0727e40a48a1d08cf54ce2c01e120864b92e59bf) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_pm.c | 42 ++++++++++++++++++++-------------------- - 1 file changed, 22 insertions(+), 20 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -2119,32 +2119,34 @@ static void intel_read_wm_latency(struct - GEN9_MEM_LATENCY_LEVEL_MASK; - - /* -+ * If a level n (n > 1) has a 0us latency, all levels m (m >= n) -+ * need to be disabled. We make sure to sanitize the values out -+ * of the punit to satisfy this requirement. -+ */ -+ for (level = 1; level <= max_level; level++) { -+ if (wm[level] == 0) { -+ for (i = level + 1; i <= max_level; i++) -+ wm[i] = 0; -+ break; -+ } -+ } -+ -+ /* - * WaWmMemoryReadLatency:skl - * - * punit doesn't take into account the read latency so we need -- * to add 2us to the various latency levels we retrieve from -- * the punit. -- * - W0 is a bit special in that it's the only level that -- * can't be disabled if we want to have display working, so -- * we always add 2us there. -- * - For levels >=1, punit returns 0us latency when they are -- * disabled, so we respect that and don't add 2us then -- * -- * Additionally, if a level n (n > 1) has a 0us latency, all -- * levels m (m >= n) need to be disabled. We make sure to -- * sanitize the values out of the punit to satisfy this -- * requirement. -+ * to add 2us to the various latency levels we retrieve from the -+ * punit when level 0 response data us 0us. - */ -- wm[0] += 2; -- for (level = 1; level <= max_level; level++) -- if (wm[level] != 0) -+ if (wm[0] == 0) { -+ wm[0] += 2; -+ for (level = 1; level <= max_level; level++) { -+ if (wm[level] == 0) -+ break; - wm[level] += 2; -- else { -- for (i = level + 1; i <= max_level; i++) -- wm[i] = 0; -- -- break; - } -+ } -+ - } else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) { - uint64_t sskpd = I915_READ64(MCH_SSKPD); - diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-minimum-scanlines-for-y-tile-is-not-always-4.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-minimum-scanlines-for-y-tile-is-not-always-4.patch deleted file mode 100644 index 43111119..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-minimum-scanlines-for-y-tile-is-not-always-4.patch +++ /dev/null @@ -1,133 +0,0 @@ -From ccc1057477bc99678896b51adce6b6ee4019dc37 Mon Sep 17 00:00:00 2001 -From: Paulo Zanoni -Date: Thu, 22 Sep 2016 18:00:31 -0300 -Subject: drm/i915/gen9: minimum scanlines for Y tile is not always 4 - -From: Paulo Zanoni - -commit ccc1057477bc99678896b51adce6b6ee4019dc37 upstream. - -During watermarks calculations, this value is used in 3 different -places. Only one of them was not using a hardcoded 4. Move the code up -so everybody can benefit from the actual value. - -This should only help on situations with Y tiling + 90/270 rotation + -1 or 2 bpp or NV12. - -Reviewed-by: Maarten Lankhorst -Signed-off-by: Paulo Zanoni -Link: http://patchwork.freedesktop.org/patch/msgid/1474578035-424-6-git-send-email-paulo.r.zanoni@intel.com -(cherry picked from commit 1186fa85eb9b3cc0589990fbc39617e50e38759a) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_pm.c | 56 ++++++++++++++++++++++------------------ - 1 file changed, 32 insertions(+), 24 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -3476,7 +3476,8 @@ static uint32_t skl_wm_method1(uint32_t - - static uint32_t skl_wm_method2(uint32_t pixel_rate, uint32_t pipe_htotal, - uint32_t horiz_pixels, uint8_t cpp, -- uint64_t tiling, uint32_t latency) -+ uint64_t tiling, uint32_t latency, -+ uint32_t y_min_scanlines) - { - uint32_t ret; - uint32_t plane_bytes_per_line, plane_blocks_per_line; -@@ -3489,9 +3490,9 @@ static uint32_t skl_wm_method2(uint32_t - - if (tiling == I915_FORMAT_MOD_Y_TILED || - tiling == I915_FORMAT_MOD_Yf_TILED) { -- plane_bytes_per_line *= 4; -+ plane_bytes_per_line *= y_min_scanlines; - plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512); -- plane_blocks_per_line /= 4; -+ plane_blocks_per_line /= y_min_scanlines; - } else if (tiling == DRM_FORMAT_MOD_NONE) { - plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512) + 1; - } else { -@@ -3548,6 +3549,7 @@ static int skl_compute_plane_wm(const st - uint8_t cpp; - uint32_t width = 0, height = 0; - uint32_t plane_pixel_rate; -+ uint32_t y_min_scanlines; - - if (latency == 0 || !cstate->base.active || !intel_pstate->visible) { - *enabled = false; -@@ -3563,38 +3565,44 @@ static int skl_compute_plane_wm(const st - cpp = drm_format_plane_cpp(fb->pixel_format, 0); - plane_pixel_rate = skl_adjusted_plane_pixel_rate(cstate, intel_pstate); - -+ if (intel_rotation_90_or_270(pstate->rotation)) { -+ int cpp = (fb->pixel_format == DRM_FORMAT_NV12) ? -+ drm_format_plane_cpp(fb->pixel_format, 1) : -+ drm_format_plane_cpp(fb->pixel_format, 0); -+ -+ switch (cpp) { -+ case 1: -+ y_min_scanlines = 16; -+ break; -+ case 2: -+ y_min_scanlines = 8; -+ break; -+ default: -+ WARN(1, "Unsupported pixel depth for rotation"); -+ case 4: -+ y_min_scanlines = 4; -+ break; -+ } -+ } else { -+ y_min_scanlines = 4; -+ } -+ - method1 = skl_wm_method1(plane_pixel_rate, cpp, latency); - method2 = skl_wm_method2(plane_pixel_rate, - cstate->base.adjusted_mode.crtc_htotal, - width, - cpp, - fb->modifier[0], -- latency); -+ latency, -+ y_min_scanlines); - - plane_bytes_per_line = width * cpp; - plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512); - - if (fb->modifier[0] == I915_FORMAT_MOD_Y_TILED || - fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED) { -- uint32_t min_scanlines = 4; -- uint32_t y_tile_minimum; -- if (intel_rotation_90_or_270(pstate->rotation)) { -- int cpp = (fb->pixel_format == DRM_FORMAT_NV12) ? -- drm_format_plane_cpp(fb->pixel_format, 1) : -- drm_format_plane_cpp(fb->pixel_format, 0); -- -- switch (cpp) { -- case 1: -- min_scanlines = 16; -- break; -- case 2: -- min_scanlines = 8; -- break; -- case 8: -- WARN(1, "Unsupported pixel depth for rotation"); -- } -- } -- y_tile_minimum = plane_blocks_per_line * min_scanlines; -+ uint32_t y_tile_minimum = plane_blocks_per_line * -+ y_min_scanlines; - selected_result = max(method2, y_tile_minimum); - } else { - if ((ddb_allocation / plane_blocks_per_line) >= 1) -@@ -3609,7 +3617,7 @@ static int skl_compute_plane_wm(const st - if (level >= 1 && level <= 7) { - if (fb->modifier[0] == I915_FORMAT_MOD_Y_TILED || - fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED) -- res_lines += 4; -+ res_lines += y_min_scanlines; - else - res_blocks++; - } diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-only-add-the-planes-actually-affected-by-ddb-changes.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-only-add-the-planes-actually-affected-by-ddb-changes.patch deleted file mode 100644 index 8fec07d2..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-gen9-only-add-the-planes-actually-affected-by-ddb-changes.patch +++ /dev/null @@ -1,92 +0,0 @@ -From be5c571b2ff3a164d2e14ccc100cb5b2b3d3fb7c Mon Sep 17 00:00:00 2001 -From: Paulo Zanoni -Date: Thu, 29 Sep 2016 16:36:48 -0300 -Subject: drm/i915/gen9: only add the planes actually affected by ddb changes - -From: Paulo Zanoni - -commit be5c571b2ff3a164d2e14ccc100cb5b2b3d3fb7c upstream. - -We were previously adding all the planes owned by the CRTC even when -the ddb partitioning didn't change for them. As a consequence, a lot -of functions were being called when we were just moving the cursor -around the screen, such as skylake_update_primary_plane(). - -This was causing flickering on the primary plane when moving the -cursor. I'm not 100% sure which operation caused the flickering, but -we were writing to a lot of registers, so it could be any of these -writes. With this patch, just moving the mouse won't add the primary -plane to the commit since it won't trigger a change in DDB -partitioning. - -v2: Use skl_ddb_entry_equal() (Lyude). -v3: Change Reported-and-bisected-by: to Reported-by: for checkpatch - -Fixes: 05a76d3d6ad1 ("drm/i915/skl: Ensure pipes with changed wms get added to the state") -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97888 -Cc: Mike Lothian -Reported-by: Mike Lothian -Signed-off-by: Paulo Zanoni -Signed-off-by: Lyude -Link: http://patchwork.freedesktop.org/patch/msgid/1475177808-29955-1-git-send-email-paulo.r.zanoni@intel.com -(cherry picked from commit 7f60e200e254cd53ad1bd74a56bdd23e813ac4b7) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_pm.c | 37 ++++++++++++++++++++++++++++++++++++- - 1 file changed, 36 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -3940,6 +3940,41 @@ pipes_modified(struct drm_atomic_state * - return ret; - } - -+int -+skl_ddb_add_affected_planes(struct intel_crtc_state *cstate) -+{ -+ struct drm_atomic_state *state = cstate->base.state; -+ struct drm_device *dev = state->dev; -+ struct drm_crtc *crtc = cstate->base.crtc; -+ struct intel_crtc *intel_crtc = to_intel_crtc(crtc); -+ struct drm_i915_private *dev_priv = to_i915(dev); -+ struct intel_atomic_state *intel_state = to_intel_atomic_state(state); -+ struct skl_ddb_allocation *new_ddb = &intel_state->wm_results.ddb; -+ struct skl_ddb_allocation *cur_ddb = &dev_priv->wm.skl_hw.ddb; -+ struct drm_plane_state *plane_state; -+ struct drm_plane *plane; -+ enum pipe pipe = intel_crtc->pipe; -+ int id; -+ -+ WARN_ON(!drm_atomic_get_existing_crtc_state(state, crtc)); -+ -+ drm_for_each_plane_mask(plane, dev, crtc->state->plane_mask) { -+ id = skl_wm_plane_id(to_intel_plane(plane)); -+ -+ if (skl_ddb_entry_equal(&cur_ddb->plane[pipe][id], -+ &new_ddb->plane[pipe][id]) && -+ skl_ddb_entry_equal(&cur_ddb->y_plane[pipe][id], -+ &new_ddb->y_plane[pipe][id])) -+ continue; -+ -+ plane_state = drm_atomic_get_plane_state(state, plane); -+ if (IS_ERR(plane_state)) -+ return PTR_ERR(plane_state); -+ } -+ -+ return 0; -+} -+ - static int - skl_compute_ddb(struct drm_atomic_state *state) - { -@@ -4004,7 +4039,7 @@ skl_compute_ddb(struct drm_atomic_state - if (ret) - return ret; - -- ret = drm_atomic_add_affected_planes(state, &intel_crtc->base); -+ ret = skl_ddb_add_affected_planes(cstate); - if (ret) - return ret; - } diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-introduce-intel_has_sagv.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-introduce-intel_has_sagv.patch deleted file mode 100644 index c25ade40..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-introduce-intel_has_sagv.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 6e7fdb873d6255ca3c999dd5c6c18962a769ed3e Mon Sep 17 00:00:00 2001 -From: Paulo Zanoni -Date: Thu, 22 Sep 2016 18:00:28 -0300 -Subject: drm/i915: introduce intel_has_sagv() - -From: Paulo Zanoni - -commit 6e7fdb873d6255ca3c999dd5c6c18962a769ed3e upstream. - -And use it to move knowledge about the SAGV-supporting platforms from -the callers to the SAGV code. - -We'll add more platforms to intel_has_sagv(), so IMHO it makes more -sense to move all this to a single function instead of patching all -the callers every time we add SAGV support to a new platform. - -v2: Move I915_SAGV_NOT_CONTROLLED to the new function (Lyude). - -Reviewed-by: Maarten Lankhorst -Signed-off-by: Paulo Zanoni -Link: http://patchwork.freedesktop.org/patch/msgid/1474578035-424-3-git-send-email-paulo.r.zanoni@intel.com -(cherry picked from commit 56feca91973459d0b62cbb2610b62d341025ed89) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_display.c | 5 ++--- - drivers/gpu/drm/i915/intel_pm.c | 22 ++++++++++++++++++---- - 2 files changed, 20 insertions(+), 7 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_display.c -+++ b/drivers/gpu/drm/i915/intel_display.c -@@ -13891,7 +13891,7 @@ static void intel_atomic_commit_tail(str - * SKL workaround: bspec recommends we disable the SAGV when we - * have more then one pipe enabled - */ -- if (IS_SKYLAKE(dev_priv) && !intel_can_enable_sagv(state)) -+ if (!intel_can_enable_sagv(state)) - intel_disable_sagv(dev_priv); - - intel_modeset_verify_disabled(dev); -@@ -13949,8 +13949,7 @@ static void intel_atomic_commit_tail(str - intel_modeset_verify_crtc(crtc, old_crtc_state, crtc->state); - } - -- if (IS_SKYLAKE(dev_priv) && intel_state->modeset && -- intel_can_enable_sagv(state)) -+ if (intel_state->modeset && intel_can_enable_sagv(state)) - intel_enable_sagv(dev_priv); - - drm_atomic_helper_commit_hw_done(state); ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -2878,6 +2878,13 @@ skl_wm_plane_id(const struct intel_plane - } - } - -+static bool -+intel_has_sagv(struct drm_i915_private *dev_priv) -+{ -+ return IS_SKYLAKE(dev_priv) && -+ dev_priv->sagv_status != I915_SAGV_NOT_CONTROLLED; -+} -+ - /* - * SAGV dynamically adjusts the system agent voltage and clock frequencies - * depending on power and performance requirements. The display engine access -@@ -2894,8 +2901,10 @@ intel_enable_sagv(struct drm_i915_privat - { - int ret; - -- if (dev_priv->sagv_status == I915_SAGV_NOT_CONTROLLED || -- dev_priv->sagv_status == I915_SAGV_ENABLED) -+ if (!intel_has_sagv(dev_priv)) -+ return 0; -+ -+ if (dev_priv->sagv_status == I915_SAGV_ENABLED) - return 0; - - DRM_DEBUG_KMS("Enabling the SAGV\n"); -@@ -2943,8 +2952,10 @@ intel_disable_sagv(struct drm_i915_priva - { - int ret, result; - -- if (dev_priv->sagv_status == I915_SAGV_NOT_CONTROLLED || -- dev_priv->sagv_status == I915_SAGV_DISABLED) -+ if (!intel_has_sagv(dev_priv)) -+ return 0; -+ -+ if (dev_priv->sagv_status == I915_SAGV_DISABLED) - return 0; - - DRM_DEBUG_KMS("Disabling the SAGV\n"); -@@ -2985,6 +2996,9 @@ bool intel_can_enable_sagv(struct drm_at - enum pipe pipe; - int level, plane; - -+ if (!intel_has_sagv(dev_priv)) -+ return false; -+ - /* - * SKL workaround: bspec recommends we disable the SAGV when we have - * more then one pipe enabled diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-just-clear-the-mmiodebug-before-a-register-access.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-just-clear-the-mmiodebug-before-a-register-access.patch deleted file mode 100644 index 85b64a22..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-just-clear-the-mmiodebug-before-a-register-access.patch +++ /dev/null @@ -1,43 +0,0 @@ -From f856f847b22c52be82f712ea6ada946c6db884d7 Mon Sep 17 00:00:00 2001 -From: Chris Wilson -Date: Mon, 3 Oct 2016 13:45:14 +0100 -Subject: drm/i915: Just clear the mmiodebug before a register access - -From: Chris Wilson - -commit f856f847b22c52be82f712ea6ada946c6db884d7 upstream. - -When we enable the per-register access mmiodebug, it is to detect which -access is illegal. Reporting on earlier untraced access outside of the -mmiodebug does not help debugging (as the suspicion is immediately put -upon the current register which is not at fault)! - -References: https://bugs.freedesktop.org/show_bug.cgi?id=97985 -Signed-off-by: Chris Wilson -Cc: Mika Kuoppala -Reviewed-by: Mika Kuoppala -Link: http://patchwork.freedesktop.org/patch/msgid/20161003124516.12388-1-chris@chris-wilson.co.uk -(cherry picked from commit dda960335e020835f7f1c12760e7f0b525b451e2) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_uncore.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_uncore.c -+++ b/drivers/gpu/drm/i915/intel_uncore.c -@@ -796,10 +796,9 @@ __unclaimed_reg_debug(struct drm_i915_pr - const bool read, - const bool before) - { -- if (WARN(check_for_unclaimed_mmio(dev_priv), -- "Unclaimed register detected %s %s register 0x%x\n", -- before ? "before" : "after", -- read ? "reading" : "writing to", -+ if (WARN(check_for_unclaimed_mmio(dev_priv) && !before, -+ "Unclaimed %s register 0x%x\n", -+ read ? "read from" : "write to", - i915_mmio_reg_offset(reg))) - i915.mmio_debug--; /* Only report the first N failures */ - } diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-kbl-kbl-also-needs-to-run-the-sagv-code.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-kbl-kbl-also-needs-to-run-the-sagv-code.patch deleted file mode 100644 index ef3c31b9..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-kbl-kbl-also-needs-to-run-the-sagv-code.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 17777d61f4a87d7b6d5585e8fdffa83773c594e7 Mon Sep 17 00:00:00 2001 -From: Paulo Zanoni -Date: Thu, 22 Sep 2016 18:00:29 -0300 -Subject: drm/i915/kbl: KBL also needs to run the SAGV code - -From: Paulo Zanoni - -commit 17777d61f4a87d7b6d5585e8fdffa83773c594e7 upstream. - -According to BSpec, it's the "core CPUs" that need the code, which -means SKL and KBL, but not BXT. - -I don't have a KBL to test this patch on it. - -v2: Only SKL should have I915_SAGV_NOT_CONTROLLED. - -Reviewed-by: Maarten Lankhorst -Signed-off-by: Paulo Zanoni -Link: http://patchwork.freedesktop.org/patch/msgid/1474578035-424-4-git-send-email-paulo.r.zanoni@intel.com -(cherry picked from commit 6e3100ec21e7c774a0fc01e36a1e0739530c2f71) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_pm.c | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -2881,8 +2881,14 @@ skl_wm_plane_id(const struct intel_plane - static bool - intel_has_sagv(struct drm_i915_private *dev_priv) - { -- return IS_SKYLAKE(dev_priv) && -- dev_priv->sagv_status != I915_SAGV_NOT_CONTROLLED; -+ if (IS_KABYLAKE(dev_priv)) -+ return true; -+ -+ if (IS_SKYLAKE(dev_priv) && -+ dev_priv->sagv_status != I915_SAGV_NOT_CONTROLLED) -+ return true; -+ -+ return false; - } - - /* -@@ -2920,7 +2926,7 @@ intel_enable_sagv(struct drm_i915_privat - * Some skl systems, pre-release machines in particular, - * don't actually have an SAGV. - */ -- if (ret == -ENXIO) { -+ if (IS_SKYLAKE(dev_priv) && ret == -ENXIO) { - DRM_DEBUG_DRIVER("No SAGV found on system, ignoring\n"); - dev_priv->sagv_status = I915_SAGV_NOT_CONTROLLED; - return 0; -@@ -2974,7 +2980,7 @@ intel_disable_sagv(struct drm_i915_priva - * Some skl systems, pre-release machines in particular, - * don't actually have an SAGV. - */ -- if (result == -ENXIO) { -+ if (IS_SKYLAKE(dev_priv) && result == -ENXIO) { - DRM_DEBUG_DRIVER("No SAGV found on system, ignoring\n"); - dev_priv->sagv_status = I915_SAGV_NOT_CONTROLLED; - return 0; diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-move-crtc-updating-in-atomic_commit-into-it-s-own-hook.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-move-crtc-updating-in-atomic_commit-into-it-s-own-hook.patch deleted file mode 100644 index e4402b0b..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-move-crtc-updating-in-atomic_commit-into-it-s-own-hook.patch +++ /dev/null @@ -1,162 +0,0 @@ -From 896e5bb022bce64e29ce2e1b2fc2a7476d311a15 Mon Sep 17 00:00:00 2001 -From: Lyude -Date: Wed, 24 Aug 2016 07:48:09 +0200 -Subject: drm/i915: Move CRTC updating in atomic_commit into it's own hook -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Lyude - -commit 896e5bb022bce64e29ce2e1b2fc2a7476d311a15 upstream. - -Since we have to write ddb allocations at the same time as we do other -plane updates, we're going to need to be able to control the order in -which we execute modesets on each pipe. The easiest way to do this is to -just factor this section of intel_atomic_commit_tail() -(intel_atomic_commit() for stable branches) into it's own function, and -add an appropriate display function hook for it. - -Based off of Matt Rope's suggestions - -Changes since v1: - - Drop pipe_config->base.active check in intel_update_crtcs() since we - check that before calling the function - -Signed-off-by: Lyude -Reviewed-by: Matt Roper -[omitting CC for stable, since this patch will need to be changed for -such backports first] -Cc: Ville Syrjälä -Cc: Daniel Vetter -Cc: Radhakrishna Sripada -Cc: Hans de Goede -Signed-off-by: Lyude -Signed-off-by: Maarten Lankhorst -Link: http://patchwork.freedesktop.org/patch/msgid/1471961565-28540-1-git-send-email-cpaul@redhat.com -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/i915_drv.h | 2 - drivers/gpu/drm/i915/intel_display.c | 74 ++++++++++++++++++++++++----------- - 2 files changed, 54 insertions(+), 22 deletions(-) - ---- a/drivers/gpu/drm/i915/i915_drv.h -+++ b/drivers/gpu/drm/i915/i915_drv.h -@@ -631,6 +631,8 @@ struct drm_i915_display_funcs { - struct intel_crtc_state *crtc_state); - void (*crtc_enable)(struct drm_crtc *crtc); - void (*crtc_disable)(struct drm_crtc *crtc); -+ void (*update_crtcs)(struct drm_atomic_state *state, -+ unsigned int *crtc_vblank_mask); - void (*audio_codec_enable)(struct drm_connector *connector, - struct intel_encoder *encoder, - const struct drm_display_mode *adjusted_mode); ---- a/drivers/gpu/drm/i915/intel_display.c -+++ b/drivers/gpu/drm/i915/intel_display.c -@@ -13682,6 +13682,52 @@ static bool needs_vblank_wait(struct int - return false; - } - -+static void intel_update_crtc(struct drm_crtc *crtc, -+ struct drm_atomic_state *state, -+ struct drm_crtc_state *old_crtc_state, -+ unsigned int *crtc_vblank_mask) -+{ -+ struct drm_device *dev = crtc->dev; -+ struct drm_i915_private *dev_priv = to_i915(dev); -+ struct intel_crtc *intel_crtc = to_intel_crtc(crtc); -+ struct intel_crtc_state *pipe_config = to_intel_crtc_state(crtc->state); -+ bool modeset = needs_modeset(crtc->state); -+ -+ if (modeset) { -+ update_scanline_offset(intel_crtc); -+ dev_priv->display.crtc_enable(crtc); -+ } else { -+ intel_pre_plane_update(to_intel_crtc_state(old_crtc_state)); -+ } -+ -+ if (drm_atomic_get_existing_plane_state(state, crtc->primary)) { -+ intel_fbc_enable( -+ intel_crtc, pipe_config, -+ to_intel_plane_state(crtc->primary->state)); -+ } -+ -+ drm_atomic_helper_commit_planes_on_crtc(old_crtc_state); -+ -+ if (needs_vblank_wait(pipe_config)) -+ *crtc_vblank_mask |= drm_crtc_mask(crtc); -+} -+ -+static void intel_update_crtcs(struct drm_atomic_state *state, -+ unsigned int *crtc_vblank_mask) -+{ -+ struct drm_crtc *crtc; -+ struct drm_crtc_state *old_crtc_state; -+ int i; -+ -+ for_each_crtc_in_state(state, crtc, old_crtc_state, i) { -+ if (!crtc->state->active) -+ continue; -+ -+ intel_update_crtc(crtc, state, old_crtc_state, -+ crtc_vblank_mask); -+ } -+} -+ - static void intel_atomic_commit_tail(struct drm_atomic_state *state) - { - struct drm_device *dev = state->dev; -@@ -13780,17 +13826,9 @@ static void intel_atomic_commit_tail(str - intel_modeset_verify_disabled(dev); - } - -- /* Now enable the clocks, plane, pipe, and connectors that we set up. */ -+ /* Complete the events for pipes that have now been disabled */ - for_each_crtc_in_state(state, crtc, old_crtc_state, i) { -- struct intel_crtc *intel_crtc = to_intel_crtc(crtc); - bool modeset = needs_modeset(crtc->state); -- struct intel_crtc_state *pipe_config = -- to_intel_crtc_state(crtc->state); -- -- if (modeset && crtc->state->active) { -- update_scanline_offset(to_intel_crtc(crtc)); -- dev_priv->display.crtc_enable(crtc); -- } - - /* Complete events for now disable pipes here. */ - if (modeset && !crtc->state->active && crtc->state->event) { -@@ -13800,21 +13838,11 @@ static void intel_atomic_commit_tail(str - - crtc->state->event = NULL; - } -- -- if (!modeset) -- intel_pre_plane_update(to_intel_crtc_state(old_crtc_state)); -- -- if (crtc->state->active && -- drm_atomic_get_existing_plane_state(state, crtc->primary)) -- intel_fbc_enable(intel_crtc, pipe_config, to_intel_plane_state(crtc->primary->state)); -- -- if (crtc->state->active) -- drm_atomic_helper_commit_planes_on_crtc(old_crtc_state); -- -- if (pipe_config->base.active && needs_vblank_wait(pipe_config)) -- crtc_vblank_mask |= 1 << i; - } - -+ /* Now enable the clocks, plane, pipe, and connectors that we set up. */ -+ dev_priv->display.update_crtcs(state, &crtc_vblank_mask); -+ - /* FIXME: We should call drm_atomic_helper_commit_hw_done() here - * already, but still need the state for the delayed optimization. To - * fix this: -@@ -15275,6 +15303,8 @@ void intel_init_display_hooks(struct drm - dev_priv->display.crtc_disable = i9xx_crtc_disable; - } - -+ dev_priv->display.update_crtcs = intel_update_crtcs; -+ - /* Returns the core display clock speed */ - if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) - dev_priv->display.get_display_clock_speed = diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-move-long-hpd-handling-into-the-hotplug-work.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-move-long-hpd-handling-into-the-hotplug-work.patch deleted file mode 100644 index 5cb94eba..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-move-long-hpd-handling-into-the-hotplug-work.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 1015811609c0328b5ed670d07748591b837e74eb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= -Date: Mon, 3 Oct 2016 10:55:15 +0300 -Subject: drm/i915: Move long hpd handling into the hotplug work -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Ville Syrjälä - -commit 1015811609c0328b5ed670d07748591b837e74eb upstream. - -We can't rely on connector->status in the detect() hook if the long hpd -was already handled by the dig_port_work as that won't update -connector->status. Thus we have to defer the long hpd handling entirely -until the hotplug work runs to avoid the double long hpd handling -the "detect_done" flag is trying to prevent. - -We'll start to depend on connector->status being up to date in a -following patch. - -Cc: Damien Cassou -Cc: freedesktop.org@gp.mailgun.org -Cc: Arno -Cc: Shubhangi Shrivastava -Cc: Sivakumar Thulasimani -Cc: Ander Conselvan de Oliveira -Tested-by: Arno -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83348 -Signed-off-by: Ville Syrjälä -Link: http://patchwork.freedesktop.org/patch/msgid/1475481316-8194-1-git-send-email-ville.syrjala@linux.intel.com -Reviewed-by: Ander Conselvan de Oliveira -(cherry picked from commit 27d4efc5591a5853de54713bc717de73c8951e17) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_dp.c | 48 +++++++++++++++++++--------------------- - 1 file changed, 23 insertions(+), 25 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_dp.c -+++ b/drivers/gpu/drm/i915/intel_dp.c -@@ -4696,36 +4696,34 @@ intel_dp_hpd_pulse(struct intel_digital_ - port_name(intel_dig_port->port), - long_hpd ? "long" : "short"); - -+ if (long_hpd) { -+ intel_dp->detect_done = false; -+ return IRQ_NONE; -+ } -+ - power_domain = intel_display_port_aux_power_domain(intel_encoder); - intel_display_power_get(dev_priv, power_domain); - -- if (long_hpd) { -- intel_dp_long_pulse(intel_dp->attached_connector); -- if (intel_dp->is_mst) -- ret = IRQ_HANDLED; -- goto put_power; -- -- } else { -- if (intel_dp->is_mst) { -- if (intel_dp_check_mst_status(intel_dp) == -EINVAL) { -- /* -- * If we were in MST mode, and device is not -- * there, get out of MST mode -- */ -- DRM_DEBUG_KMS("MST device may have disappeared %d vs %d\n", -- intel_dp->is_mst, intel_dp->mst_mgr.mst_state); -- intel_dp->is_mst = false; -- drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, -- intel_dp->is_mst); -- goto put_power; -- } -+ if (intel_dp->is_mst) { -+ if (intel_dp_check_mst_status(intel_dp) == -EINVAL) { -+ /* -+ * If we were in MST mode, and device is not -+ * there, get out of MST mode -+ */ -+ DRM_DEBUG_KMS("MST device may have disappeared %d vs %d\n", -+ intel_dp->is_mst, intel_dp->mst_mgr.mst_state); -+ intel_dp->is_mst = false; -+ drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, -+ intel_dp->is_mst); -+ intel_dp->detect_done = false; -+ goto put_power; - } -+ } - -- if (!intel_dp->is_mst) { -- if (!intel_dp_short_pulse(intel_dp)) { -- intel_dp_long_pulse(intel_dp->attached_connector); -- goto put_power; -- } -+ if (!intel_dp->is_mst) { -+ if (!intel_dp_short_pulse(intel_dp)) { -+ intel_dp->detect_done = false; -+ goto put_power; - } - } - diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-sagv-is-not-skl-only-so-rename-a-few-things.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-sagv-is-not-skl-only-so-rename-a-few-things.patch deleted file mode 100644 index 0397a5f6..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-sagv-is-not-skl-only-so-rename-a-few-things.patch +++ /dev/null @@ -1,179 +0,0 @@ -From 674f823b455cdb94d5773406c1caac170f87e1c4 Mon Sep 17 00:00:00 2001 -From: Paulo Zanoni -Date: Thu, 22 Sep 2016 18:00:27 -0300 -Subject: drm/i915: SAGV is not SKL-only, so rename a few things - -From: Paulo Zanoni - -commit 674f823b455cdb94d5773406c1caac170f87e1c4 upstream. - -The plan is to introduce intel_has_sagv() and then use it to discover -which platforms actually support it. - -I thought about keeping the functions with their current skl names, -but found two problems: (i) skl_has_sagv() would become a very -confusing name, and (ii) intel_atomic_commit_tail() doesn't seem to be -calling any functions whose name start with a platform name, so the -"intel_" naming scheme seems make more sense than the "firstplatorm_" -naming scheme here. - -Reviewed-by: Lyude -Reviewed-by: Maarten Lankhorst -Signed-off-by: Paulo Zanoni -Link: http://patchwork.freedesktop.org/patch/msgid/1474578035-424-2-git-send-email-paulo.r.zanoni@intel.com -(cherry picked from commit 16dcdc4edbcf5cb130004737f2548401776170f1) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/i915_drv.h | 10 +++++----- - drivers/gpu/drm/i915/intel_display.c | 8 ++++---- - drivers/gpu/drm/i915/intel_drv.h | 6 +++--- - drivers/gpu/drm/i915/intel_pm.c | 26 +++++++++++++------------- - 4 files changed, 25 insertions(+), 25 deletions(-) - ---- a/drivers/gpu/drm/i915/i915_drv.h -+++ b/drivers/gpu/drm/i915/i915_drv.h -@@ -1967,11 +1967,11 @@ struct drm_i915_private { - struct vlv_s0ix_state vlv_s0ix_state; - - enum { -- I915_SKL_SAGV_UNKNOWN = 0, -- I915_SKL_SAGV_DISABLED, -- I915_SKL_SAGV_ENABLED, -- I915_SKL_SAGV_NOT_CONTROLLED -- } skl_sagv_status; -+ I915_SAGV_UNKNOWN = 0, -+ I915_SAGV_DISABLED, -+ I915_SAGV_ENABLED, -+ I915_SAGV_NOT_CONTROLLED -+ } sagv_status; - - struct { - /* ---- a/drivers/gpu/drm/i915/intel_display.c -+++ b/drivers/gpu/drm/i915/intel_display.c -@@ -13891,8 +13891,8 @@ static void intel_atomic_commit_tail(str - * SKL workaround: bspec recommends we disable the SAGV when we - * have more then one pipe enabled - */ -- if (IS_SKYLAKE(dev_priv) && !skl_can_enable_sagv(state)) -- skl_disable_sagv(dev_priv); -+ if (IS_SKYLAKE(dev_priv) && !intel_can_enable_sagv(state)) -+ intel_disable_sagv(dev_priv); - - intel_modeset_verify_disabled(dev); - } -@@ -13950,8 +13950,8 @@ static void intel_atomic_commit_tail(str - } - - if (IS_SKYLAKE(dev_priv) && intel_state->modeset && -- skl_can_enable_sagv(state)) -- skl_enable_sagv(dev_priv); -+ intel_can_enable_sagv(state)) -+ intel_enable_sagv(dev_priv); - - drm_atomic_helper_commit_hw_done(state); - ---- a/drivers/gpu/drm/i915/intel_drv.h -+++ b/drivers/gpu/drm/i915/intel_drv.h -@@ -1717,9 +1717,9 @@ void ilk_wm_get_hw_state(struct drm_devi - void skl_wm_get_hw_state(struct drm_device *dev); - void skl_ddb_get_hw_state(struct drm_i915_private *dev_priv, - struct skl_ddb_allocation *ddb /* out */); --bool skl_can_enable_sagv(struct drm_atomic_state *state); --int skl_enable_sagv(struct drm_i915_private *dev_priv); --int skl_disable_sagv(struct drm_i915_private *dev_priv); -+bool intel_can_enable_sagv(struct drm_atomic_state *state); -+int intel_enable_sagv(struct drm_i915_private *dev_priv); -+int intel_disable_sagv(struct drm_i915_private *dev_priv); - bool skl_ddb_allocation_equals(const struct skl_ddb_allocation *old, - const struct skl_ddb_allocation *new, - enum pipe pipe); ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -2890,12 +2890,12 @@ skl_wm_plane_id(const struct intel_plane - * - We're not using an interlaced display configuration - */ - int --skl_enable_sagv(struct drm_i915_private *dev_priv) -+intel_enable_sagv(struct drm_i915_private *dev_priv) - { - int ret; - -- if (dev_priv->skl_sagv_status == I915_SKL_SAGV_NOT_CONTROLLED || -- dev_priv->skl_sagv_status == I915_SKL_SAGV_ENABLED) -+ if (dev_priv->sagv_status == I915_SAGV_NOT_CONTROLLED || -+ dev_priv->sagv_status == I915_SAGV_ENABLED) - return 0; - - DRM_DEBUG_KMS("Enabling the SAGV\n"); -@@ -2913,19 +2913,19 @@ skl_enable_sagv(struct drm_i915_private - */ - if (ret == -ENXIO) { - DRM_DEBUG_DRIVER("No SAGV found on system, ignoring\n"); -- dev_priv->skl_sagv_status = I915_SKL_SAGV_NOT_CONTROLLED; -+ dev_priv->sagv_status = I915_SAGV_NOT_CONTROLLED; - return 0; - } else if (ret < 0) { - DRM_ERROR("Failed to enable the SAGV\n"); - return ret; - } - -- dev_priv->skl_sagv_status = I915_SKL_SAGV_ENABLED; -+ dev_priv->sagv_status = I915_SAGV_ENABLED; - return 0; - } - - static int --skl_do_sagv_disable(struct drm_i915_private *dev_priv) -+intel_do_sagv_disable(struct drm_i915_private *dev_priv) - { - int ret; - uint32_t temp = GEN9_SAGV_DISABLE; -@@ -2939,19 +2939,19 @@ skl_do_sagv_disable(struct drm_i915_priv - } - - int --skl_disable_sagv(struct drm_i915_private *dev_priv) -+intel_disable_sagv(struct drm_i915_private *dev_priv) - { - int ret, result; - -- if (dev_priv->skl_sagv_status == I915_SKL_SAGV_NOT_CONTROLLED || -- dev_priv->skl_sagv_status == I915_SKL_SAGV_DISABLED) -+ if (dev_priv->sagv_status == I915_SAGV_NOT_CONTROLLED || -+ dev_priv->sagv_status == I915_SAGV_DISABLED) - return 0; - - DRM_DEBUG_KMS("Disabling the SAGV\n"); - mutex_lock(&dev_priv->rps.hw_lock); - - /* bspec says to keep retrying for at least 1 ms */ -- ret = wait_for(result = skl_do_sagv_disable(dev_priv), 1); -+ ret = wait_for(result = intel_do_sagv_disable(dev_priv), 1); - mutex_unlock(&dev_priv->rps.hw_lock); - - if (ret == -ETIMEDOUT) { -@@ -2965,18 +2965,18 @@ skl_disable_sagv(struct drm_i915_private - */ - if (result == -ENXIO) { - DRM_DEBUG_DRIVER("No SAGV found on system, ignoring\n"); -- dev_priv->skl_sagv_status = I915_SKL_SAGV_NOT_CONTROLLED; -+ dev_priv->sagv_status = I915_SAGV_NOT_CONTROLLED; - return 0; - } else if (result < 0) { - DRM_ERROR("Failed to disable the SAGV\n"); - return result; - } - -- dev_priv->skl_sagv_status = I915_SKL_SAGV_DISABLED; -+ dev_priv->sagv_status = I915_SAGV_DISABLED; - return 0; - } - --bool skl_can_enable_sagv(struct drm_atomic_state *state) -+bool intel_can_enable_sagv(struct drm_atomic_state *state) - { - struct drm_device *dev = state->dev; - struct drm_i915_private *dev_priv = to_i915(dev); diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-don-t-try-to-update-plane-watermarks-if-they-haven-t-changed.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-don-t-try-to-update-plane-watermarks-if-they-haven-t-changed.patch deleted file mode 100644 index 4f468af0..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-don-t-try-to-update-plane-watermarks-if-they-haven-t-changed.patch +++ /dev/null @@ -1,79 +0,0 @@ -From ccebc23b57c313229526dc76383ce82f5e0b9001 Mon Sep 17 00:00:00 2001 -From: Lyude -Date: Mon, 29 Aug 2016 12:31:27 -0400 -Subject: drm/i915/skl: Don't try to update plane watermarks if they haven't changed - -From: Lyude - -commit ccebc23b57c313229526dc76383ce82f5e0b9001 upstream. - -i915 sometimes needs to disable planes in the middle of an atomic -commit, and then reenable them later in the same commit. Because of -this, we can't make the assumption that the state of the plane actually -changed. Since the state of the plane hasn't actually changed, neither -have it's watermarks. And if the watermarks hasn't changed then we -haven't populated skl_results with anything, which means we'll end up -zeroing out a plane's watermarks in the middle of the atomic commit -without restoring them later. - -Simple reproduction recipe: - - Get a SKL laptop, launch any kind of X session - - Get two extra monitors - - Keep hotplugging both displays (so that the display configuration - jumps from 1 active pipe to 3 active pipes and back) - - Eventually underrun - -Changes since v1: - - Fix incorrect use of "it's" -Changes since v2: - - Add reproduction recipe - -Signed-off-by: Lyude -Cc: Maarten Lankhorst -Fixes: 62e0fb880123 ("drm/i915/skl: Update plane watermarks atomically during plane updates") -Signed-off-by: Lyude -Testcase: kms_plane -Signed-off-by: Maarten Lankhorst -Link: http://patchwork.freedesktop.org/patch/msgid/1472488288-27280-1-git-send-email-cpaul@redhat.com -Cc: drm-intel-fixes@lists.freedesktop.org -Signed-off-by: Greg Kroah-Hartman - - ---- - drivers/gpu/drm/i915/intel_display.c | 7 ++++++- - drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++++ - 2 files changed, 14 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/i915/intel_display.c -+++ b/drivers/gpu/drm/i915/intel_display.c -@@ -3068,7 +3068,12 @@ static void skylake_disable_primary_plan - struct intel_crtc *intel_crtc = to_intel_crtc(crtc); - int pipe = intel_crtc->pipe; - -- skl_write_plane_wm(intel_crtc, &dev_priv->wm.skl_results, 0); -+ /* -+ * We only populate skl_results on watermark updates, and if the -+ * plane's visiblity isn't actually changing neither is its watermarks. -+ */ -+ if (!to_intel_plane_state(crtc->primary->state)->visible) -+ skl_write_plane_wm(intel_crtc, &dev_priv->wm.skl_results, 0); - - I915_WRITE(PLANE_CTL(pipe, 0), 0); - I915_WRITE(PLANE_SURF(pipe, 0), 0); ---- a/drivers/gpu/drm/i915/intel_sprite.c -+++ b/drivers/gpu/drm/i915/intel_sprite.c -@@ -314,6 +314,14 @@ skl_disable_plane(struct drm_plane *dpla - const int pipe = intel_plane->pipe; - const int plane = intel_plane->plane + 1; - -+ /* -+ * We only populate skl_results on watermark updates, and if the -+ * plane's visiblity isn't actually changing neither is its watermarks. -+ */ -+ if (!to_intel_plane_state(dplane->state)->visible) -+ skl_write_plane_wm(to_intel_crtc(crtc), -+ &dev_priv->wm.skl_results, plane); -+ - I915_WRITE(PLANE_CTL(pipe, plane), 0); - - I915_WRITE(PLANE_SURF(pipe, plane), 0); diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-ensure-pipes-with-changed-wms-get-added-to-the-state.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-ensure-pipes-with-changed-wms-get-added-to-the-state.patch deleted file mode 100644 index 58ac3c6a..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-ensure-pipes-with-changed-wms-get-added-to-the-state.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 05a76d3d6ad1ee9f9814f88949cc9305fc165460 Mon Sep 17 00:00:00 2001 -From: Lyude -Date: Wed, 17 Aug 2016 15:55:57 -0400 -Subject: drm/i915/skl: Ensure pipes with changed wms get added to the state -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Lyude - -commit 05a76d3d6ad1ee9f9814f88949cc9305fc165460 upstream. - -If we're enabling a pipe, we'll need to modify the watermarks on all -active planes. Since those planes won't be added to the state on -their own, we need to add them ourselves. - -Signed-off-by: Lyude -Reviewed-by: Matt Roper -Cc: Ville Syrjälä -Cc: Daniel Vetter -Cc: Radhakrishna Sripada -Cc: Hans de Goede -Signed-off-by: Maarten Lankhorst -Link: http://patchwork.freedesktop.org/patch/msgid/1471463761-26796-6-git-send-email-cpaul@redhat.com -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_pm.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -4065,6 +4065,10 @@ skl_compute_ddb(struct drm_atomic_state - ret = skl_ddb_add_affected_planes(cstate); - if (ret) - return ret; -+ -+ ret = drm_atomic_add_affected_planes(state, &intel_crtc->base); -+ if (ret) -+ return ret; - } - - return 0; diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-update-ddb-values-atomically-with-wms-plane-attrs.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-update-ddb-values-atomically-with-wms-plane-attrs.patch deleted file mode 100644 index 492d656f..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-update-ddb-values-atomically-with-wms-plane-attrs.patch +++ /dev/null @@ -1,479 +0,0 @@ -From 27082493e9c6371b05370a619ab9d2877c5f4726 Mon Sep 17 00:00:00 2001 -From: Lyude -Date: Wed, 24 Aug 2016 07:48:10 +0200 -Subject: drm/i915/skl: Update DDB values atomically with wms/plane attrs -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Lyude - -commit 27082493e9c6371b05370a619ab9d2877c5f4726 upstream. - -Now that we can hook into update_crtcs and control the order in which we -update CRTCs at each modeset, we can finish the final step of fixing -Skylake's watermark handling by performing DDB updates at the same time -as plane updates and watermark updates. - -The first major change in this patch is skl_update_crtcs(), which -handles ensuring that we order each CRTC update in our atomic commits -properly so that they honor the DDB flush order. - -The second major change in this patch is the order in which we flush the -pipes. While the previous order may have worked, it can't be used in -this approach since it no longer will do the right thing. For example, -using the old ddb flush order: - -We have pipes A, B, and C enabled, and we're disabling C. Initial ddb -allocation looks like this: - -| A | B |xxxxxxx| - -Since we're performing the ddb updates after performing any CRTC -disablements in intel_atomic_commit_tail(), the space to the right of -pipe B is unallocated. - -1. Flush pipes with new allocation contained into old space. None - apply, so we skip this -2. Flush pipes having their allocation reduced, but overlapping with a - previous allocation. None apply, so we also skip this -3. Flush pipes that got more space allocated. This applies to A and B, - giving us the following update order: A, B - -This is wrong, since updating pipe A first will cause it to overlap with -B and potentially burst into flames. Our new order (see the code -comments for details) would update the pipes in the proper order: B, A. - -As well, we calculate the order for each DDB update during the check -phase, and reference it later in the commit phase when we hit -skl_update_crtcs(). - -This long overdue patch fixes the rest of the underruns on Skylake. - -Changes since v1: - - Add skl_ddb_entry_write() for cursor into skl_write_cursor_wm() -Changes since v2: - - Use the method for updating CRTCs that Ville suggested - - In skl_update_wm(), only copy the watermarks for the crtc that was - passed to us -Changes since v3: - - Small comment fix in skl_ddb_allocation_overlaps() -Changes since v4: - - Remove the second loop in intel_update_crtcs() and use Ville's - suggestion for updating the ddb allocations in the right order - - Get rid of the second loop and just use the ddb state as it updates - to determine what order to update everything in (thanks for the - suggestion Ville) - - Simplify skl_ddb_allocation_overlaps() - - Split actual overlap checking into it's own helper - -Fixes: 0e8fb7ba7ca5 ("drm/i915/skl: Flush the WM configuration") -Fixes: 8211bd5bdf5e ("drm/i915/skl: Program the DDB allocation") -[omitting CC for stable, since this patch will need to be changed for -such backports first] - -Testcase: kms_cursor_legacy -Testcase: plane-all-modeset-transition -Signed-off-by: Lyude -Cc: Ville Syrjälä -Cc: Daniel Vetter -Cc: Radhakrishna Sripada -Cc: Hans de Goede -Cc: Matt Roper -Signed-off-by: Maarten Lankhorst -Link: http://patchwork.freedesktop.org/patch/msgid/1471961565-28540-2-git-send-email-cpaul@redhat.com -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_display.c | 93 ++++++++++++++-- - drivers/gpu/drm/i915/intel_drv.h | 7 + - drivers/gpu/drm/i915/intel_pm.c | 200 +++++++---------------------------- - 3 files changed, 132 insertions(+), 168 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_display.c -+++ b/drivers/gpu/drm/i915/intel_display.c -@@ -12967,16 +12967,23 @@ static void verify_wm_state(struct drm_c - hw_entry->start, hw_entry->end); - } - -- /* cursor */ -- hw_entry = &hw_ddb.plane[pipe][PLANE_CURSOR]; -- sw_entry = &sw_ddb->plane[pipe][PLANE_CURSOR]; -- -- if (!skl_ddb_entry_equal(hw_entry, sw_entry)) { -- DRM_ERROR("mismatch in DDB state pipe %c cursor " -- "(expected (%u,%u), found (%u,%u))\n", -- pipe_name(pipe), -- sw_entry->start, sw_entry->end, -- hw_entry->start, hw_entry->end); -+ /* -+ * cursor -+ * If the cursor plane isn't active, we may not have updated it's ddb -+ * allocation. In that case since the ddb allocation will be updated -+ * once the plane becomes visible, we can skip this check -+ */ -+ if (intel_crtc->cursor_addr) { -+ hw_entry = &hw_ddb.plane[pipe][PLANE_CURSOR]; -+ sw_entry = &sw_ddb->plane[pipe][PLANE_CURSOR]; -+ -+ if (!skl_ddb_entry_equal(hw_entry, sw_entry)) { -+ DRM_ERROR("mismatch in DDB state pipe %c cursor " -+ "(expected (%u,%u), found (%u,%u))\n", -+ pipe_name(pipe), -+ sw_entry->start, sw_entry->end, -+ hw_entry->start, hw_entry->end); -+ } - } - } - -@@ -13728,6 +13735,65 @@ static void intel_update_crtcs(struct dr - } - } - -+static void skl_update_crtcs(struct drm_atomic_state *state, -+ unsigned int *crtc_vblank_mask) -+{ -+ struct drm_device *dev = state->dev; -+ struct drm_i915_private *dev_priv = to_i915(dev); -+ struct intel_atomic_state *intel_state = to_intel_atomic_state(state); -+ struct drm_crtc *crtc; -+ struct drm_crtc_state *old_crtc_state; -+ struct skl_ddb_allocation *new_ddb = &intel_state->wm_results.ddb; -+ struct skl_ddb_allocation *cur_ddb = &dev_priv->wm.skl_hw.ddb; -+ unsigned int updated = 0; -+ bool progress; -+ enum pipe pipe; -+ -+ /* -+ * Whenever the number of active pipes changes, we need to make sure we -+ * update the pipes in the right order so that their ddb allocations -+ * never overlap with eachother inbetween CRTC updates. Otherwise we'll -+ * cause pipe underruns and other bad stuff. -+ */ -+ do { -+ int i; -+ progress = false; -+ -+ for_each_crtc_in_state(state, crtc, old_crtc_state, i) { -+ bool vbl_wait = false; -+ unsigned int cmask = drm_crtc_mask(crtc); -+ pipe = to_intel_crtc(crtc)->pipe; -+ -+ if (updated & cmask || !crtc->state->active) -+ continue; -+ if (skl_ddb_allocation_overlaps(state, cur_ddb, new_ddb, -+ pipe)) -+ continue; -+ -+ updated |= cmask; -+ -+ /* -+ * If this is an already active pipe, it's DDB changed, -+ * and this isn't the last pipe that needs updating -+ * then we need to wait for a vblank to pass for the -+ * new ddb allocation to take effect. -+ */ -+ if (!skl_ddb_allocation_equals(cur_ddb, new_ddb, pipe) && -+ !crtc->state->active_changed && -+ intel_state->wm_results.dirty_pipes != updated) -+ vbl_wait = true; -+ -+ intel_update_crtc(crtc, state, old_crtc_state, -+ crtc_vblank_mask); -+ -+ if (vbl_wait) -+ intel_wait_for_vblank(dev, pipe); -+ -+ progress = true; -+ } -+ } while (progress); -+} -+ - static void intel_atomic_commit_tail(struct drm_atomic_state *state) - { - struct drm_device *dev = state->dev; -@@ -15303,8 +15369,6 @@ void intel_init_display_hooks(struct drm - dev_priv->display.crtc_disable = i9xx_crtc_disable; - } - -- dev_priv->display.update_crtcs = intel_update_crtcs; -- - /* Returns the core display clock speed */ - if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) - dev_priv->display.get_display_clock_speed = -@@ -15394,6 +15458,11 @@ void intel_init_display_hooks(struct drm - skl_modeset_calc_cdclk; - } - -+ if (dev_priv->info.gen >= 9) -+ dev_priv->display.update_crtcs = skl_update_crtcs; -+ else -+ dev_priv->display.update_crtcs = intel_update_crtcs; -+ - switch (INTEL_INFO(dev_priv)->gen) { - case 2: - dev_priv->display.queue_flip = intel_gen2_queue_flip; ---- a/drivers/gpu/drm/i915/intel_drv.h -+++ b/drivers/gpu/drm/i915/intel_drv.h -@@ -1720,6 +1720,13 @@ void skl_ddb_get_hw_state(struct drm_i91 - bool skl_can_enable_sagv(struct drm_atomic_state *state); - int skl_enable_sagv(struct drm_i915_private *dev_priv); - int skl_disable_sagv(struct drm_i915_private *dev_priv); -+bool skl_ddb_allocation_equals(const struct skl_ddb_allocation *old, -+ const struct skl_ddb_allocation *new, -+ enum pipe pipe); -+bool skl_ddb_allocation_overlaps(struct drm_atomic_state *state, -+ const struct skl_ddb_allocation *old, -+ const struct skl_ddb_allocation *new, -+ enum pipe pipe); - void skl_write_cursor_wm(struct intel_crtc *intel_crtc, - const struct skl_wm_values *wm); - void skl_write_plane_wm(struct intel_crtc *intel_crtc, ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -3843,6 +3843,11 @@ void skl_write_plane_wm(struct intel_crt - wm->plane[pipe][plane][level]); - } - I915_WRITE(PLANE_WM_TRANS(pipe, plane), wm->plane_trans[pipe][plane]); -+ -+ skl_ddb_entry_write(dev_priv, PLANE_BUF_CFG(pipe, plane), -+ &wm->ddb.plane[pipe][plane]); -+ skl_ddb_entry_write(dev_priv, PLANE_NV12_BUF_CFG(pipe, plane), -+ &wm->ddb.y_plane[pipe][plane]); - } - - void skl_write_cursor_wm(struct intel_crtc *intel_crtc, -@@ -3859,170 +3864,46 @@ void skl_write_cursor_wm(struct intel_cr - wm->plane[pipe][PLANE_CURSOR][level]); - } - I915_WRITE(CUR_WM_TRANS(pipe), wm->plane_trans[pipe][PLANE_CURSOR]); --} -- --static void skl_write_wm_values(struct drm_i915_private *dev_priv, -- const struct skl_wm_values *new) --{ -- struct drm_device *dev = &dev_priv->drm; -- struct intel_crtc *crtc; -- -- for_each_intel_crtc(dev, crtc) { -- int i; -- enum pipe pipe = crtc->pipe; -- -- if ((new->dirty_pipes & drm_crtc_mask(&crtc->base)) == 0) -- continue; -- if (!crtc->active) -- continue; -- -- for (i = 0; i < intel_num_planes(crtc); i++) { -- skl_ddb_entry_write(dev_priv, -- PLANE_BUF_CFG(pipe, i), -- &new->ddb.plane[pipe][i]); -- skl_ddb_entry_write(dev_priv, -- PLANE_NV12_BUF_CFG(pipe, i), -- &new->ddb.y_plane[pipe][i]); -- } - -- skl_ddb_entry_write(dev_priv, CUR_BUF_CFG(pipe), -- &new->ddb.plane[pipe][PLANE_CURSOR]); -- } -+ skl_ddb_entry_write(dev_priv, CUR_BUF_CFG(pipe), -+ &wm->ddb.plane[pipe][PLANE_CURSOR]); - } - --/* -- * When setting up a new DDB allocation arrangement, we need to correctly -- * sequence the times at which the new allocations for the pipes are taken into -- * account or we'll have pipes fetching from space previously allocated to -- * another pipe. -- * -- * Roughly the sequence looks like: -- * 1. re-allocate the pipe(s) with the allocation being reduced and not -- * overlapping with a previous light-up pipe (another way to put it is: -- * pipes with their new allocation strickly included into their old ones). -- * 2. re-allocate the other pipes that get their allocation reduced -- * 3. allocate the pipes having their allocation increased -- * -- * Steps 1. and 2. are here to take care of the following case: -- * - Initially DDB looks like this: -- * | B | C | -- * - enable pipe A. -- * - pipe B has a reduced DDB allocation that overlaps with the old pipe C -- * allocation -- * | A | B | C | -- * -- * We need to sequence the re-allocation: C, B, A (and not B, C, A). -- */ -- --static void --skl_wm_flush_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, int pass) -+bool skl_ddb_allocation_equals(const struct skl_ddb_allocation *old, -+ const struct skl_ddb_allocation *new, -+ enum pipe pipe) - { -- int plane; -- -- DRM_DEBUG_KMS("flush pipe %c (pass %d)\n", pipe_name(pipe), pass); -- -- for_each_plane(dev_priv, pipe, plane) { -- I915_WRITE(PLANE_SURF(pipe, plane), -- I915_READ(PLANE_SURF(pipe, plane))); -- } -- I915_WRITE(CURBASE(pipe), I915_READ(CURBASE(pipe))); -+ return new->pipe[pipe].start == old->pipe[pipe].start && -+ new->pipe[pipe].end == old->pipe[pipe].end; - } - --static bool --skl_ddb_allocation_included(const struct skl_ddb_allocation *old, -- const struct skl_ddb_allocation *new, -- enum pipe pipe) -+static inline bool skl_ddb_entries_overlap(const struct skl_ddb_entry *a, -+ const struct skl_ddb_entry *b) - { -- uint16_t old_size, new_size; -- -- old_size = skl_ddb_entry_size(&old->pipe[pipe]); -- new_size = skl_ddb_entry_size(&new->pipe[pipe]); -- -- return old_size != new_size && -- new->pipe[pipe].start >= old->pipe[pipe].start && -- new->pipe[pipe].end <= old->pipe[pipe].end; -+ return a->start < b->end && b->start < a->end; - } - --static void skl_flush_wm_values(struct drm_i915_private *dev_priv, -- struct skl_wm_values *new_values) -+bool skl_ddb_allocation_overlaps(struct drm_atomic_state *state, -+ const struct skl_ddb_allocation *old, -+ const struct skl_ddb_allocation *new, -+ enum pipe pipe) - { -- struct drm_device *dev = &dev_priv->drm; -- struct skl_ddb_allocation *cur_ddb, *new_ddb; -- bool reallocated[I915_MAX_PIPES] = {}; -- struct intel_crtc *crtc; -- enum pipe pipe; -- -- new_ddb = &new_values->ddb; -- cur_ddb = &dev_priv->wm.skl_hw.ddb; -- -- /* -- * First pass: flush the pipes with the new allocation contained into -- * the old space. -- * -- * We'll wait for the vblank on those pipes to ensure we can safely -- * re-allocate the freed space without this pipe fetching from it. -- */ -- for_each_intel_crtc(dev, crtc) { -- if (!crtc->active) -- continue; -- -- pipe = crtc->pipe; -- -- if (!skl_ddb_allocation_included(cur_ddb, new_ddb, pipe)) -- continue; -- -- skl_wm_flush_pipe(dev_priv, pipe, 1); -- intel_wait_for_vblank(dev, pipe); -- -- reallocated[pipe] = true; -- } -- -- -- /* -- * Second pass: flush the pipes that are having their allocation -- * reduced, but overlapping with a previous allocation. -- * -- * Here as well we need to wait for the vblank to make sure the freed -- * space is not used anymore. -- */ -- for_each_intel_crtc(dev, crtc) { -- if (!crtc->active) -- continue; -+ struct drm_device *dev = state->dev; -+ struct intel_crtc *intel_crtc; -+ enum pipe otherp; - -- pipe = crtc->pipe; -+ for_each_intel_crtc(dev, intel_crtc) { -+ otherp = intel_crtc->pipe; - -- if (reallocated[pipe]) -+ if (otherp == pipe) - continue; - -- if (skl_ddb_entry_size(&new_ddb->pipe[pipe]) < -- skl_ddb_entry_size(&cur_ddb->pipe[pipe])) { -- skl_wm_flush_pipe(dev_priv, pipe, 2); -- intel_wait_for_vblank(dev, pipe); -- reallocated[pipe] = true; -- } -+ if (skl_ddb_entries_overlap(&new->pipe[pipe], -+ &old->pipe[otherp])) -+ return true; - } - -- /* -- * Third pass: flush the pipes that got more space allocated. -- * -- * We don't need to actively wait for the update here, next vblank -- * will just get more DDB space with the correct WM values. -- */ -- for_each_intel_crtc(dev, crtc) { -- if (!crtc->active) -- continue; -- -- pipe = crtc->pipe; -- -- /* -- * At this point, only the pipes more space than before are -- * left to re-allocate. -- */ -- if (reallocated[pipe]) -- continue; -- -- skl_wm_flush_pipe(dev_priv, pipe, 3); -- } -+ return false; - } - - static int skl_update_pipe_wm(struct drm_crtc_state *cstate, -@@ -4224,7 +4105,7 @@ static void skl_update_wm(struct drm_crt - struct skl_wm_values *hw_vals = &dev_priv->wm.skl_hw; - struct intel_crtc_state *cstate = to_intel_crtc_state(crtc->state); - struct skl_pipe_wm *pipe_wm = &cstate->wm.skl.optimal; -- int pipe; -+ enum pipe pipe = intel_crtc->pipe; - - if ((results->dirty_pipes & drm_crtc_mask(crtc)) == 0) - return; -@@ -4233,15 +4114,22 @@ static void skl_update_wm(struct drm_crt - - mutex_lock(&dev_priv->wm.wm_mutex); - -- skl_write_wm_values(dev_priv, results); -- skl_flush_wm_values(dev_priv, results); -- - /* -- * Store the new configuration (but only for the pipes that have -- * changed; the other values weren't recomputed). -+ * If this pipe isn't active already, we're going to be enabling it -+ * very soon. Since it's safe to update a pipe's ddb allocation while -+ * the pipe's shut off, just do so here. Already active pipes will have -+ * their watermarks updated once we update their planes. - */ -- for_each_pipe_masked(dev_priv, pipe, results->dirty_pipes) -- skl_copy_wm_for_pipe(hw_vals, results, pipe); -+ if (crtc->state->active_changed) { -+ int plane; -+ -+ for (plane = 0; plane < intel_num_planes(intel_crtc); plane++) -+ skl_write_plane_wm(intel_crtc, results, plane); -+ -+ skl_write_cursor_wm(intel_crtc, results); -+ } -+ -+ skl_copy_wm_for_pipe(hw_vals, results, pipe); - - mutex_unlock(&dev_priv->wm.wm_mutex); - } diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-update-plane-watermarks-atomically-during-plane-updates.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-update-plane-watermarks-atomically-during-plane-updates.patch deleted file mode 100644 index d9798c44..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-skl-update-plane-watermarks-atomically-during-plane-updates.patch +++ /dev/null @@ -1,335 +0,0 @@ -From 62e0fb880123c98793e5c3ba8355501b0305e92e Mon Sep 17 00:00:00 2001 -From: Lyude -Date: Mon, 22 Aug 2016 12:50:08 -0400 -Subject: drm/i915/skl: Update plane watermarks atomically during plane updates -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Lyude - -commit 62e0fb880123c98793e5c3ba8355501b0305e92e upstream. - -Thanks to Ville for suggesting this as a potential solution to pipe -underruns on Skylake. - -On Skylake all of the registers for configuring planes, including the -registers for configuring their watermarks, are double buffered. New -values written to them won't take effect until said registers are -"armed", which is done by writing to the PLANE_SURF (or in the case of -cursor planes, the CURBASE register) register. - -With this in mind, up until now we've been updating watermarks on skl -like this: - - non-modeset { - - calculate (during atomic check phase) - - finish_atomic_commit: - - intel_pre_plane_update: - - intel_update_watermarks() - - {vblank happens; new watermarks + old plane values => underrun } - - drm_atomic_helper_commit_planes_on_crtc: - - start vblank evasion - - write new plane registers - - end vblank evasion - } - - or - - modeset { - - calculate (during atomic check phase) - - finish_atomic_commit: - - crtc_enable: - - intel_update_watermarks() - - {vblank happens; new watermarks + old plane values => underrun } - - drm_atomic_helper_commit_planes_on_crtc: - - start vblank evasion - - write new plane registers - - end vblank evasion - } - -Now we update watermarks atomically like this: - - non-modeset { - - calculate (during atomic check phase) - - finish_atomic_commit: - - intel_pre_plane_update: - - intel_update_watermarks() (wm values aren't written yet) - - drm_atomic_helper_commit_planes_on_crtc: - - start vblank evasion - - write new plane registers - - write new wm values - - end vblank evasion - } - - modeset { - - calculate (during atomic check phase) - - finish_atomic_commit: - - crtc_enable: - - intel_update_watermarks() (actual wm values aren't written - yet) - - drm_atomic_helper_commit_planes_on_crtc: - - start vblank evasion - - write new plane registers - - write new wm values - - end vblank evasion - } - -So this patch moves all of the watermark writes into the right place; -inside of the vblank evasion where we update all of the registers for -each plane. While this patch doesn't fix everything, it does allow us to -update the watermark values in the way the hardware expects us to. - -Changes since original patch series: - - Remove mutex_lock/mutex_unlock since they don't do anything and we're - not touching global state - - Move skl_write_cursor_wm/skl_write_plane_wm functions into - intel_pm.c, make externally visible - - Add skl_write_plane_wm calls to skl_update_plane - - Fix conditional for for loop in skl_write_plane_wm (level < max_level - should be level <= max_level) - - Make diagram in commit more accurate to what's actually happening - - Add Fixes: - -Changes since v1: - - Use IS_GEN9() instead of IS_SKYLAKE() since these fixes apply to more - then just Skylake - - Update description to make it clear this patch doesn't fix everything - - Check if pipes were actually changed before writing watermarks - -Changes since v2: - - Write PIPE_WM_LINETIME during vblank evasion - -Changes since v3: - - Rebase against new SAGV patch changes - -Changes since v4: - - Add a parameter to choose what skl_wm_values struct to use when - writing new plane watermarks - -Changes since v5: - - Remove cursor ddb entry write in skl_write_cursor_wm(), defer until - patch 6 - - Write WM_LINETIME in intel_begin_crtc_commit() - -Changes since v6: - - Remove redundant dirty_pipes check in skl_write_plane_wm (we check - this in all places where we call this function, and it was supposed - to have been removed earlier anyway) - - In i9xx_update_cursor(), use dev_priv->info.gen >= 9 instead of - IS_GEN9(dev_priv). We do this everywhere else and I'd imagine this - needs to be done for gen10 as well - -Changes since v7: - - Fix rebase fail (unused variable obj) - - Make struct skl_wm_values *wm const - - Fix indenting - - Use INTEL_GEN() instead of dev_priv->info.gen - -Changes since v8: - - Don't forget calls to skl_write_plane_wm() when disabling planes - - Use INTEL_GEN(), not INTEL_INFO()->gen in intel_begin_crtc_commit() - -Fixes: 2d41c0b59afc ("drm/i915/skl: SKL Watermark Computation") -Signed-off-by: Lyude -Reviewed-by: Matt Roper -Cc: stable@vger.kernel.org -Cc: Ville Syrjälä -Cc: Daniel Vetter -Cc: Radhakrishna Sripada -Cc: Hans de Goede -Signed-off-by: Maarten Lankhorst -Link: http://patchwork.freedesktop.org/patch/msgid/1471884608-10671-1-git-send-email-cpaul@redhat.com -Link: http://patchwork.freedesktop.org/patch/msgid/1471884608-10671-1-git-send-email-cpaul@redhat.com -Signed-off-by: Greg Kroah-Hartman - - ---- - drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++++- - drivers/gpu/drm/i915/intel_drv.h | 5 +++ - drivers/gpu/drm/i915/intel_pm.c | 50 +++++++++++++++++++++++------------ - drivers/gpu/drm/i915/intel_sprite.c | 6 ++++ - 4 files changed, 64 insertions(+), 18 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_display.c -+++ b/drivers/gpu/drm/i915/intel_display.c -@@ -2980,6 +2980,7 @@ static void skylake_update_primary_plane - struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->base.crtc); - struct drm_framebuffer *fb = plane_state->base.fb; - struct drm_i915_gem_object *obj = intel_fb_obj(fb); -+ const struct skl_wm_values *wm = &dev_priv->wm.skl_results; - int pipe = intel_crtc->pipe; - u32 plane_ctl, stride_div, stride; - u32 tile_height, plane_offset, plane_size; -@@ -3031,6 +3032,9 @@ static void skylake_update_primary_plane - intel_crtc->adjusted_x = x_offset; - intel_crtc->adjusted_y = y_offset; - -+ if (wm->dirty_pipes & drm_crtc_mask(&intel_crtc->base)) -+ skl_write_plane_wm(intel_crtc, wm, 0); -+ - I915_WRITE(PLANE_CTL(pipe, 0), plane_ctl); - I915_WRITE(PLANE_OFFSET(pipe, 0), plane_offset); - I915_WRITE(PLANE_SIZE(pipe, 0), plane_size); -@@ -3061,7 +3065,10 @@ static void skylake_disable_primary_plan - { - struct drm_device *dev = crtc->dev; - struct drm_i915_private *dev_priv = to_i915(dev); -- int pipe = to_intel_crtc(crtc)->pipe; -+ struct intel_crtc *intel_crtc = to_intel_crtc(crtc); -+ int pipe = intel_crtc->pipe; -+ -+ skl_write_plane_wm(intel_crtc, &dev_priv->wm.skl_results, 0); - - I915_WRITE(PLANE_CTL(pipe, 0), 0); - I915_WRITE(PLANE_SURF(pipe, 0), 0); -@@ -10306,9 +10313,13 @@ static void i9xx_update_cursor(struct dr - struct drm_device *dev = crtc->dev; - struct drm_i915_private *dev_priv = to_i915(dev); - struct intel_crtc *intel_crtc = to_intel_crtc(crtc); -+ const struct skl_wm_values *wm = &dev_priv->wm.skl_results; - int pipe = intel_crtc->pipe; - uint32_t cntl = 0; - -+ if (INTEL_GEN(dev_priv) >= 9 && wm->dirty_pipes & drm_crtc_mask(crtc)) -+ skl_write_cursor_wm(intel_crtc, wm); -+ - if (plane_state && plane_state->visible) { - cntl = MCURSOR_GAMMA_ENABLE; - switch (plane_state->base.crtc_w) { -@@ -14221,10 +14232,12 @@ static void intel_begin_crtc_commit(stru - struct drm_crtc_state *old_crtc_state) - { - struct drm_device *dev = crtc->dev; -+ struct drm_i915_private *dev_priv = to_i915(dev); - struct intel_crtc *intel_crtc = to_intel_crtc(crtc); - struct intel_crtc_state *old_intel_state = - to_intel_crtc_state(old_crtc_state); - bool modeset = needs_modeset(crtc->state); -+ enum pipe pipe = intel_crtc->pipe; - - /* Perform vblank evasion around commit operation */ - intel_pipe_update_start(intel_crtc); -@@ -14239,8 +14252,12 @@ static void intel_begin_crtc_commit(stru - - if (to_intel_crtc_state(crtc->state)->update_pipe) - intel_update_pipe_config(intel_crtc, old_intel_state); -- else if (INTEL_INFO(dev)->gen >= 9) -+ else if (INTEL_GEN(dev_priv) >= 9) { - skl_detach_scalers(intel_crtc); -+ -+ I915_WRITE(PIPE_WM_LINETIME(pipe), -+ dev_priv->wm.skl_hw.wm_linetime[pipe]); -+ } - } - - static void intel_finish_crtc_commit(struct drm_crtc *crtc, ---- a/drivers/gpu/drm/i915/intel_drv.h -+++ b/drivers/gpu/drm/i915/intel_drv.h -@@ -1720,6 +1720,11 @@ void skl_ddb_get_hw_state(struct drm_i91 - bool skl_can_enable_sagv(struct drm_atomic_state *state); - int skl_enable_sagv(struct drm_i915_private *dev_priv); - int skl_disable_sagv(struct drm_i915_private *dev_priv); -+void skl_write_cursor_wm(struct intel_crtc *intel_crtc, -+ const struct skl_wm_values *wm); -+void skl_write_plane_wm(struct intel_crtc *intel_crtc, -+ const struct skl_wm_values *wm, -+ int plane); - uint32_t ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config); - bool ilk_disable_lp_wm(struct drm_device *dev); - int sanitize_rc6_option(struct drm_i915_private *dev_priv, int enable_rc6); ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -3828,6 +3828,39 @@ static void skl_ddb_entry_write(struct d - I915_WRITE(reg, 0); - } - -+void skl_write_plane_wm(struct intel_crtc *intel_crtc, -+ const struct skl_wm_values *wm, -+ int plane) -+{ -+ struct drm_crtc *crtc = &intel_crtc->base; -+ struct drm_device *dev = crtc->dev; -+ struct drm_i915_private *dev_priv = to_i915(dev); -+ int level, max_level = ilk_wm_max_level(dev); -+ enum pipe pipe = intel_crtc->pipe; -+ -+ for (level = 0; level <= max_level; level++) { -+ I915_WRITE(PLANE_WM(pipe, plane, level), -+ wm->plane[pipe][plane][level]); -+ } -+ I915_WRITE(PLANE_WM_TRANS(pipe, plane), wm->plane_trans[pipe][plane]); -+} -+ -+void skl_write_cursor_wm(struct intel_crtc *intel_crtc, -+ const struct skl_wm_values *wm) -+{ -+ struct drm_crtc *crtc = &intel_crtc->base; -+ struct drm_device *dev = crtc->dev; -+ struct drm_i915_private *dev_priv = to_i915(dev); -+ int level, max_level = ilk_wm_max_level(dev); -+ enum pipe pipe = intel_crtc->pipe; -+ -+ for (level = 0; level <= max_level; level++) { -+ I915_WRITE(CUR_WM(pipe, level), -+ wm->plane[pipe][PLANE_CURSOR][level]); -+ } -+ I915_WRITE(CUR_WM_TRANS(pipe), wm->plane_trans[pipe][PLANE_CURSOR]); -+} -+ - static void skl_write_wm_values(struct drm_i915_private *dev_priv, - const struct skl_wm_values *new) - { -@@ -3835,7 +3868,7 @@ static void skl_write_wm_values(struct d - struct intel_crtc *crtc; - - for_each_intel_crtc(dev, crtc) { -- int i, level, max_level = ilk_wm_max_level(dev); -+ int i; - enum pipe pipe = crtc->pipe; - - if ((new->dirty_pipes & drm_crtc_mask(&crtc->base)) == 0) -@@ -3843,21 +3876,6 @@ static void skl_write_wm_values(struct d - if (!crtc->active) - continue; - -- I915_WRITE(PIPE_WM_LINETIME(pipe), new->wm_linetime[pipe]); -- -- for (level = 0; level <= max_level; level++) { -- for (i = 0; i < intel_num_planes(crtc); i++) -- I915_WRITE(PLANE_WM(pipe, i, level), -- new->plane[pipe][i][level]); -- I915_WRITE(CUR_WM(pipe, level), -- new->plane[pipe][PLANE_CURSOR][level]); -- } -- for (i = 0; i < intel_num_planes(crtc); i++) -- I915_WRITE(PLANE_WM_TRANS(pipe, i), -- new->plane_trans[pipe][i]); -- I915_WRITE(CUR_WM_TRANS(pipe), -- new->plane_trans[pipe][PLANE_CURSOR]); -- - for (i = 0; i < intel_num_planes(crtc); i++) { - skl_ddb_entry_write(dev_priv, - PLANE_BUF_CFG(pipe, i), ---- a/drivers/gpu/drm/i915/intel_sprite.c -+++ b/drivers/gpu/drm/i915/intel_sprite.c -@@ -203,6 +203,9 @@ skl_update_plane(struct drm_plane *drm_p - struct intel_plane *intel_plane = to_intel_plane(drm_plane); - struct drm_framebuffer *fb = plane_state->base.fb; - struct drm_i915_gem_object *obj = intel_fb_obj(fb); -+ const struct skl_wm_values *wm = &dev_priv->wm.skl_results; -+ struct drm_crtc *crtc = crtc_state->base.crtc; -+ struct intel_crtc *intel_crtc = to_intel_crtc(crtc); - const int pipe = intel_plane->pipe; - const int plane = intel_plane->plane + 1; - u32 plane_ctl, stride_div, stride; -@@ -238,6 +241,9 @@ skl_update_plane(struct drm_plane *drm_p - crtc_w--; - crtc_h--; - -+ if (wm->dirty_pipes & drm_crtc_mask(crtc)) -+ skl_write_plane_wm(intel_crtc, wm, plane); -+ - if (key->flags) { - I915_WRITE(PLANE_KEYVAL(pipe, plane), key->min_value); - I915_WRITE(PLANE_KEYMAX(pipe, plane), key->max_value); diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-unalias-obj-phys_handle-and-obj-userptr.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-unalias-obj-phys_handle-and-obj-userptr.patch deleted file mode 100644 index 53219119..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-i915-unalias-obj-phys_handle-and-obj-userptr.patch +++ /dev/null @@ -1,61 +0,0 @@ -From ca5732c53bf66ad755284786897e0dd10330de87 Mon Sep 17 00:00:00 2001 -From: Chris Wilson -Date: Mon, 3 Oct 2016 13:45:15 +0100 -Subject: drm/i915: Unalias obj->phys_handle and obj->userptr - -From: Chris Wilson - -commit ca5732c53bf66ad755284786897e0dd10330de87 upstream. - -We use obj->phys_handle to choose the pread/pwrite path, but as -obj->phys_handle is a union with obj->userptr, we then mistakenly use -the phys_handle path for userptr objects within pread/pwrite. - -Testcase: igt/gem_userptr_blits/forbidden-operations -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97519 -Signed-off-by: Chris Wilson -Reviewed-by: Joonas Lahtinen -Link: http://patchwork.freedesktop.org/patch/msgid/20161003124516.12388-2-chris@chris-wilson.co.uk -(cherry picked from commit 5f12b80a0b42da253691ca03828033014bb786eb) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/i915_drv.h | 24 +++++++++++------------- - 1 file changed, 11 insertions(+), 13 deletions(-) - ---- a/drivers/gpu/drm/i915/i915_drv.h -+++ b/drivers/gpu/drm/i915/i915_drv.h -@@ -2282,21 +2282,19 @@ struct drm_i915_gem_object { - /** Record of address bit 17 of each page at last unbind. */ - unsigned long *bit_17; - -- union { -- /** for phy allocated objects */ -- struct drm_dma_handle *phys_handle; -- -- struct i915_gem_userptr { -- uintptr_t ptr; -- unsigned read_only :1; -- unsigned workers :4; -+ struct i915_gem_userptr { -+ uintptr_t ptr; -+ unsigned read_only :1; -+ unsigned workers :4; - #define I915_GEM_USERPTR_MAX_WORKERS 15 - -- struct i915_mm_struct *mm; -- struct i915_mmu_object *mmu_object; -- struct work_struct *work; -- } userptr; -- }; -+ struct i915_mm_struct *mm; -+ struct i915_mmu_object *mmu_object; -+ struct work_struct *work; -+ } userptr; -+ -+ /** for phys allocated objects */ -+ struct drm_dma_handle *phys_handle; - }; - #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base) - diff --git a/kernel/kernel/files/patches/mageia/stable-drm-prime-pass-the-right-module-owner-through-to-dma_buf_export.patch b/kernel/kernel/files/patches/mageia/stable-drm-prime-pass-the-right-module-owner-through-to-dma_buf_export.patch deleted file mode 100644 index 242e1f81..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-prime-pass-the-right-module-owner-through-to-dma_buf_export.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 56a76c0123d6cb034975901c80fce2627338ef9e Mon Sep 17 00:00:00 2001 -From: Chris Wilson -Date: Wed, 5 Oct 2016 13:21:43 +0100 -Subject: drm/prime: Pass the right module owner through to dma_buf_export() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Chris Wilson - -commit 56a76c0123d6cb034975901c80fce2627338ef9e upstream. - -dma_buf_export() adds a reference to the owning module to the dmabuf (to -prevent the driver from being unloaded whilst a third party still refers -to the dmabuf). However, drm_gem_prime_export() was passing its own -THIS_MODULE (i.e. drm.ko) rather than the driver. Extract the right -owner from the device->fops instead. - -v2: Use C99 initializers to zero out unset elements of -dma_buf_export_info -v3: Extract the right module from dev->fops. - -Testcase: igt/vgem_basic/unload -Reported-by: Petri Latvala -Signed-off-by: Chris Wilson -Cc: Petri Latvala -Cc: Christian König -Tested-by: Petri Latvala -Reviewed-by: Petri Latvala -Reviewed-by: Christian König -Signed-off-by: Daniel Vetter -Link: http://patchwork.freedesktop.org/patch/msgid/20161005122145.1507-1-chris@chris-wilson.co.uk -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/drm_prime.c | 17 ++++++++++------- - include/drm/drmP.h | 3 ++- - 2 files changed, 12 insertions(+), 8 deletions(-) - ---- a/drivers/gpu/drm/drm_prime.c -+++ b/drivers/gpu/drm/drm_prime.c -@@ -335,14 +335,17 @@ static const struct dma_buf_ops drm_gem_ - * using the PRIME helpers. - */ - struct dma_buf *drm_gem_prime_export(struct drm_device *dev, -- struct drm_gem_object *obj, int flags) -+ struct drm_gem_object *obj, -+ int flags) - { -- DEFINE_DMA_BUF_EXPORT_INFO(exp_info); -- -- exp_info.ops = &drm_gem_prime_dmabuf_ops; -- exp_info.size = obj->size; -- exp_info.flags = flags; -- exp_info.priv = obj; -+ struct dma_buf_export_info exp_info = { -+ .exp_name = KBUILD_MODNAME, /* white lie for debug */ -+ .owner = dev->driver->fops->owner, -+ .ops = &drm_gem_prime_dmabuf_ops, -+ .size = obj->size, -+ .flags = flags, -+ .priv = obj, -+ }; - - if (dev->driver->gem_prime_res_obj) - exp_info.resv = dev->driver->gem_prime_res_obj(obj); ---- a/include/drm/drmP.h -+++ b/include/drm/drmP.h -@@ -938,7 +938,8 @@ static inline int drm_debugfs_remove_fil - #endif - - extern struct dma_buf *drm_gem_prime_export(struct drm_device *dev, -- struct drm_gem_object *obj, int flags); -+ struct drm_gem_object *obj, -+ int flags); - extern int drm_gem_prime_handle_to_fd(struct drm_device *dev, - struct drm_file *file_priv, uint32_t handle, uint32_t flags, - int *prime_fd); diff --git a/kernel/kernel/files/patches/mageia/stable-drm-radeon-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch b/kernel/kernel/files/patches/mageia/stable-drm-radeon-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch deleted file mode 100644 index aae96954..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-radeon-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 02cfb5fccb0f9f968f0e208d89d9769aa16267bc Mon Sep 17 00:00:00 2001 -From: Alex Deucher -Date: Wed, 12 Oct 2016 15:28:55 -0400 -Subject: drm/radeon: change vblank_time's calculation method to reduce computational error. - -From: Alex Deucher - -commit 02cfb5fccb0f9f968f0e208d89d9769aa16267bc upstream. - -Ported from Rex's amdgpu change. - -Signed-off-by: Alex Deucher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/radeon/r600_dpm.c | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - ---- a/drivers/gpu/drm/radeon/r600_dpm.c -+++ b/drivers/gpu/drm/radeon/r600_dpm.c -@@ -156,19 +156,20 @@ u32 r600_dpm_get_vblank_time(struct rade - struct drm_device *dev = rdev->ddev; - struct drm_crtc *crtc; - struct radeon_crtc *radeon_crtc; -- u32 line_time_us, vblank_lines; -+ u32 vblank_in_pixels; - u32 vblank_time_us = 0xffffffff; /* if the displays are off, vblank time is max */ - - if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) { - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { - radeon_crtc = to_radeon_crtc(crtc); - if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { -- line_time_us = (radeon_crtc->hw_mode.crtc_htotal * 1000) / -- radeon_crtc->hw_mode.clock; -- vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end - -- radeon_crtc->hw_mode.crtc_vdisplay + -- (radeon_crtc->v_border * 2); -- vblank_time_us = vblank_lines * line_time_us; -+ vblank_in_pixels = -+ radeon_crtc->hw_mode.crtc_htotal * -+ (radeon_crtc->hw_mode.crtc_vblank_end - -+ radeon_crtc->hw_mode.crtc_vdisplay + -+ (radeon_crtc->v_border * 2)); -+ -+ vblank_time_us = vblank_in_pixels * 1000 / radeon_crtc->hw_mode.clock; - break; - } - } diff --git a/kernel/kernel/files/patches/mageia/stable-drm-radeon-narrow-asic_init-for-virtualization.patch b/kernel/kernel/files/patches/mageia/stable-drm-radeon-narrow-asic_init-for-virtualization.patch deleted file mode 100644 index 0574fb0f..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-radeon-narrow-asic_init-for-virtualization.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 884031f0aacf57dad1575f96714efc80de9b19cc Mon Sep 17 00:00:00 2001 -From: Alex Deucher -Date: Mon, 19 Sep 2016 12:35:22 -0400 -Subject: drm/radeon: narrow asic_init for virtualization - -From: Alex Deucher - -commit 884031f0aacf57dad1575f96714efc80de9b19cc upstream. - -Only needed on CIK+ due to the way pci reset is handled -by the GPU. - -Signed-off-by: Alex Deucher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/radeon/radeon_device.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/drivers/gpu/drm/radeon/radeon_device.c -+++ b/drivers/gpu/drm/radeon/radeon_device.c -@@ -661,8 +661,9 @@ bool radeon_card_posted(struct radeon_de - { - uint32_t reg; - -- /* for pass through, always force asic_init */ -- if (radeon_device_is_virtual()) -+ /* for pass through, always force asic_init for CI */ -+ if (rdev->family >= CHIP_BONAIRE && -+ radeon_device_is_virtual()) - return false; - - /* required for EFI mode on macbook2,1 which uses an r5xx asic */ diff --git a/kernel/kernel/files/patches/mageia/stable-drm-radeon-si-dpm-fix-phase-shedding-setup.patch b/kernel/kernel/files/patches/mageia/stable-drm-radeon-si-dpm-fix-phase-shedding-setup.patch deleted file mode 100644 index 26bc118e..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-radeon-si-dpm-fix-phase-shedding-setup.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 427920292b00474d978d632bc03a8e4e50029af3 Mon Sep 17 00:00:00 2001 -From: Alex Deucher -Date: Tue, 27 Sep 2016 14:51:53 -0400 -Subject: drm/radeon/si/dpm: fix phase shedding setup - -From: Alex Deucher - -commit 427920292b00474d978d632bc03a8e4e50029af3 upstream. - -Used the wrong index to setup the phase shedding mask. - -Signed-off-by: Alex Deucher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/radeon/si_dpm.c | 2 +- - drivers/gpu/drm/radeon/sislands_smc.h | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/radeon/si_dpm.c -+++ b/drivers/gpu/drm/radeon/si_dpm.c -@@ -4112,7 +4112,7 @@ static int si_populate_smc_voltage_table - &rdev->pm.dpm.dyn_state.phase_shedding_limits_table)) { - si_populate_smc_voltage_table(rdev, &si_pi->vddc_phase_shed_table, table); - -- table->phaseMaskTable.lowMask[SISLANDS_SMC_VOLTAGEMASK_VDDC] = -+ table->phaseMaskTable.lowMask[SISLANDS_SMC_VOLTAGEMASK_VDDC_PHASE_SHEDDING] = - cpu_to_be32(si_pi->vddc_phase_shed_table.mask_low); - - si_write_smc_soft_register(rdev, SI_SMC_SOFT_REGISTER_phase_shedding_delay, ---- a/drivers/gpu/drm/radeon/sislands_smc.h -+++ b/drivers/gpu/drm/radeon/sislands_smc.h -@@ -194,6 +194,7 @@ typedef struct SISLANDS_SMC_SWSTATE SISL - #define SISLANDS_SMC_VOLTAGEMASK_VDDC 0 - #define SISLANDS_SMC_VOLTAGEMASK_MVDD 1 - #define SISLANDS_SMC_VOLTAGEMASK_VDDCI 2 -+#define SISLANDS_SMC_VOLTAGEMASK_VDDC_PHASE_SHEDDING 3 - #define SISLANDS_SMC_VOLTAGEMASK_MAX 4 - - struct SISLANDS_SMC_VOLTAGEMASKTABLE diff --git a/kernel/kernel/files/patches/mageia/stable-drm-vc4-fix-races-when-the-cs-reads-from-render-targets.patch b/kernel/kernel/files/patches/mageia/stable-drm-vc4-fix-races-when-the-cs-reads-from-render-targets.patch deleted file mode 100644 index a4734007..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-vc4-fix-races-when-the-cs-reads-from-render-targets.patch +++ /dev/null @@ -1,225 +0,0 @@ -From 7edabee06a5622190d59689a64f5e17d1c343cc3 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Tue, 27 Sep 2016 09:03:13 -0700 -Subject: drm/vc4: Fix races when the CS reads from render targets. - -From: Eric Anholt - -commit 7edabee06a5622190d59689a64f5e17d1c343cc3 upstream. - -With the introduction of bin/render pipelining, the previous job may -not be completed when we start binning the next one. If the previous -job wrote our VBO, IB, or CS textures, then the binning stage might -get stale or uninitialized results. - -Fixes the major rendering failure in glmark2 -b terrain. - -Signed-off-by: Eric Anholt -Fixes: ca26d28bbaa3 ("drm/vc4: improve throughput by pipelining binning and rendering jobs") -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/vc4/vc4_drv.h | 19 ++++++++++++++++++- - drivers/gpu/drm/vc4/vc4_gem.c | 13 +++++++++++++ - drivers/gpu/drm/vc4/vc4_render_cl.c | 21 +++++++++++++++++---- - drivers/gpu/drm/vc4/vc4_validate.c | 17 ++++++++++++++--- - 4 files changed, 62 insertions(+), 8 deletions(-) - ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -122,9 +122,16 @@ to_vc4_dev(struct drm_device *dev) - struct vc4_bo { - struct drm_gem_cma_object base; - -- /* seqno of the last job to render to this BO. */ -+ /* seqno of the last job to render using this BO. */ - uint64_t seqno; - -+ /* seqno of the last job to use the RCL to write to this BO. -+ * -+ * Note that this doesn't include binner overflow memory -+ * writes. -+ */ -+ uint64_t write_seqno; -+ - /* List entry for the BO's position in either - * vc4_exec_info->unref_list or vc4_dev->bo_cache.time_list - */ -@@ -216,6 +223,9 @@ struct vc4_exec_info { - /* Sequence number for this bin/render job. */ - uint64_t seqno; - -+ /* Latest write_seqno of any BO that binning depends on. */ -+ uint64_t bin_dep_seqno; -+ - /* Last current addresses the hardware was processing when the - * hangcheck timer checked on us. - */ -@@ -230,6 +240,13 @@ struct vc4_exec_info { - struct drm_gem_cma_object **bo; - uint32_t bo_count; - -+ /* List of BOs that are being written by the RCL. Other than -+ * the binner temporary storage, this is all the BOs written -+ * by the job. -+ */ -+ struct drm_gem_cma_object *rcl_write_bo[4]; -+ uint32_t rcl_write_bo_count; -+ - /* Pointers for our position in vc4->job_list */ - struct list_head head; - ---- a/drivers/gpu/drm/vc4/vc4_gem.c -+++ b/drivers/gpu/drm/vc4/vc4_gem.c -@@ -471,6 +471,11 @@ vc4_update_bo_seqnos(struct vc4_exec_inf - list_for_each_entry(bo, &exec->unref_list, unref_head) { - bo->seqno = seqno; - } -+ -+ for (i = 0; i < exec->rcl_write_bo_count; i++) { -+ bo = to_vc4_bo(&exec->rcl_write_bo[i]->base); -+ bo->write_seqno = seqno; -+ } - } - - /* Queues a struct vc4_exec_info for execution. If no job is -@@ -673,6 +678,14 @@ vc4_get_bcl(struct drm_device *dev, stru - goto fail; - - ret = vc4_validate_shader_recs(dev, exec); -+ if (ret) -+ goto fail; -+ -+ /* Block waiting on any previous rendering into the CS's VBO, -+ * IB, or textures, so that pixels are actually written by the -+ * time we try to read them. -+ */ -+ ret = vc4_wait_for_seqno(dev, exec->bin_dep_seqno, ~0ull, true); - - fail: - drm_free_large(temp); ---- a/drivers/gpu/drm/vc4/vc4_render_cl.c -+++ b/drivers/gpu/drm/vc4/vc4_render_cl.c -@@ -45,6 +45,8 @@ struct vc4_rcl_setup { - - struct drm_gem_cma_object *rcl; - u32 next_offset; -+ -+ u32 next_write_bo_index; - }; - - static inline void rcl_u8(struct vc4_rcl_setup *setup, u8 val) -@@ -407,6 +409,8 @@ static int vc4_rcl_msaa_surface_setup(st - if (!*obj) - return -EINVAL; - -+ exec->rcl_write_bo[exec->rcl_write_bo_count++] = *obj; -+ - if (surf->offset & 0xf) { - DRM_ERROR("MSAA write must be 16b aligned.\n"); - return -EINVAL; -@@ -417,7 +421,8 @@ static int vc4_rcl_msaa_surface_setup(st - - static int vc4_rcl_surface_setup(struct vc4_exec_info *exec, - struct drm_gem_cma_object **obj, -- struct drm_vc4_submit_rcl_surface *surf) -+ struct drm_vc4_submit_rcl_surface *surf, -+ bool is_write) - { - uint8_t tiling = VC4_GET_FIELD(surf->bits, - VC4_LOADSTORE_TILE_BUFFER_TILING); -@@ -440,6 +445,9 @@ static int vc4_rcl_surface_setup(struct - if (!*obj) - return -EINVAL; - -+ if (is_write) -+ exec->rcl_write_bo[exec->rcl_write_bo_count++] = *obj; -+ - if (surf->flags & VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES) { - if (surf == &exec->args->zs_write) { - DRM_ERROR("general zs write may not be a full-res.\n"); -@@ -542,6 +550,8 @@ vc4_rcl_render_config_surface_setup(stru - if (!*obj) - return -EINVAL; - -+ exec->rcl_write_bo[exec->rcl_write_bo_count++] = *obj; -+ - if (tiling > VC4_TILING_FORMAT_LT) { - DRM_ERROR("Bad tiling format\n"); - return -EINVAL; -@@ -599,15 +609,18 @@ int vc4_get_rcl(struct drm_device *dev, - if (ret) - return ret; - -- ret = vc4_rcl_surface_setup(exec, &setup.color_read, &args->color_read); -+ ret = vc4_rcl_surface_setup(exec, &setup.color_read, &args->color_read, -+ false); - if (ret) - return ret; - -- ret = vc4_rcl_surface_setup(exec, &setup.zs_read, &args->zs_read); -+ ret = vc4_rcl_surface_setup(exec, &setup.zs_read, &args->zs_read, -+ false); - if (ret) - return ret; - -- ret = vc4_rcl_surface_setup(exec, &setup.zs_write, &args->zs_write); -+ ret = vc4_rcl_surface_setup(exec, &setup.zs_write, &args->zs_write, -+ true); - if (ret) - return ret; - ---- a/drivers/gpu/drm/vc4/vc4_validate.c -+++ b/drivers/gpu/drm/vc4/vc4_validate.c -@@ -267,6 +267,9 @@ validate_indexed_prim_list(VALIDATE_ARGS - if (!ib) - return -EINVAL; - -+ exec->bin_dep_seqno = max(exec->bin_dep_seqno, -+ to_vc4_bo(&ib->base)->write_seqno); -+ - if (offset > ib->base.size || - (ib->base.size - offset) / index_size < length) { - DRM_ERROR("IB access overflow (%d + %d*%d > %zd)\n", -@@ -555,8 +558,7 @@ static bool - reloc_tex(struct vc4_exec_info *exec, - void *uniform_data_u, - struct vc4_texture_sample_info *sample, -- uint32_t texture_handle_index) -- -+ uint32_t texture_handle_index, bool is_cs) - { - struct drm_gem_cma_object *tex; - uint32_t p0 = *(uint32_t *)(uniform_data_u + sample->p_offset[0]); -@@ -714,6 +716,11 @@ reloc_tex(struct vc4_exec_info *exec, - - *validated_p0 = tex->paddr + p0; - -+ if (is_cs) { -+ exec->bin_dep_seqno = max(exec->bin_dep_seqno, -+ to_vc4_bo(&tex->base)->write_seqno); -+ } -+ - return true; - fail: - DRM_INFO("Texture p0 at %d: 0x%08x\n", sample->p_offset[0], p0); -@@ -835,7 +842,8 @@ validate_gl_shader_rec(struct drm_device - if (!reloc_tex(exec, - uniform_data_u, - &validated_shader->texture_samples[tex], -- texture_handles_u[tex])) { -+ texture_handles_u[tex], -+ i == 2)) { - return -EINVAL; - } - } -@@ -867,6 +875,9 @@ validate_gl_shader_rec(struct drm_device - uint32_t stride = *(uint8_t *)(pkt_u + o + 5); - uint32_t max_index; - -+ exec->bin_dep_seqno = max(exec->bin_dep_seqno, -+ to_vc4_bo(&vbo->base)->write_seqno); -+ - if (state->addr & 0x8) - stride |= (*(uint32_t *)(pkt_u + 100 + i * 4)) & ~0xff; - diff --git a/kernel/kernel/files/patches/mageia/stable-drm-vmwgfx-limit-the-user-space-command-buffer-size.patch b/kernel/kernel/files/patches/mageia/stable-drm-vmwgfx-limit-the-user-space-command-buffer-size.patch deleted file mode 100644 index c3ae1473..00000000 --- a/kernel/kernel/files/patches/mageia/stable-drm-vmwgfx-limit-the-user-space-command-buffer-size.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 51ab70bed997f64f091a639dbe22b629725a7faf Mon Sep 17 00:00:00 2001 -From: Thomas Hellstrom -Date: Mon, 10 Oct 2016 10:51:24 -0700 -Subject: drm/vmwgfx: Limit the user-space command buffer size - -From: Thomas Hellstrom - -commit 51ab70bed997f64f091a639dbe22b629725a7faf upstream. - -With older hardware versions, the user could specify arbitrarily large -command buffer sizes, causing a vmalloc / vmap space exhaustion. - -Signed-off-by: Thomas Hellstrom -Reviewed-by: Brian Paul -Reviewed-by: Sinclair Yeh -Signed-off-by: Sinclair Yeh -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c -+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c -@@ -3848,14 +3848,14 @@ static void *vmw_execbuf_cmdbuf(struct v - int ret; - - *header = NULL; -- if (!dev_priv->cman || kernel_commands) -- return kernel_commands; -- - if (command_size > SVGA_CB_MAX_SIZE) { - DRM_ERROR("Command buffer is too large.\n"); - return ERR_PTR(-EINVAL); - } - -+ if (!dev_priv->cman || kernel_commands) -+ return kernel_commands; -+ - /* If possible, add a little space for fencing. */ - cmdbuf_size = command_size + 512; - cmdbuf_size = min_t(size_t, cmdbuf_size, SVGA_CB_MAX_SIZE); diff --git a/kernel/kernel/files/patches/mageia/stable-genirq-generic_chip-add-irq_unmap-callback.patch b/kernel/kernel/files/patches/mageia/stable-genirq-generic_chip-add-irq_unmap-callback.patch deleted file mode 100644 index 9505a731..00000000 --- a/kernel/kernel/files/patches/mageia/stable-genirq-generic_chip-add-irq_unmap-callback.patch +++ /dev/null @@ -1,68 +0,0 @@ -From ee26c013cdee0b947e29d6cadfb9ff3341c69ff9 Mon Sep 17 00:00:00 2001 -From: Sebastian Frias -Date: Mon, 1 Aug 2016 16:27:38 +0200 -Subject: genirq/generic_chip: Add irq_unmap callback - -From: Sebastian Frias - -commit ee26c013cdee0b947e29d6cadfb9ff3341c69ff9 upstream. - -Without this patch irq_domain_disassociate() cannot properly release the -interrupt. In fact, irq_map_generic_chip() checks a bit on 'gc->installed' -but said bit is never cleared, only set. - -Commit 088f40b7b027 ("genirq: Generic chip: Add linear irq domain support") -added irq_map_generic_chip() function and also stated "This lacks a removal -function for now". - -This commit provides an implementation of an unmap function that can be -called by irq_domain_disassociate(). - -[ tglx: Made the function static and removed the export as we have neither - a prototype nor a modular user. ] - -Fixes: 088f40b7b027 ("genirq: Generic chip: Add linear irq domain support") -Signed-off-by: Sebastian Frias -Cc: Marc Zyngier -Cc: Mason -Cc: Jason Cooper -Link: http://lkml.kernel.org/r/579F5C5A.2070507@laposte.net -Signed-off-by: Thomas Gleixner -Signed-off-by: Greg Kroah-Hartman - ---- - kernel/irq/generic-chip.c | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) - ---- a/kernel/irq/generic-chip.c -+++ b/kernel/irq/generic-chip.c -@@ -411,8 +411,29 @@ int irq_map_generic_chip(struct irq_doma - } - EXPORT_SYMBOL_GPL(irq_map_generic_chip); - -+static void irq_unmap_generic_chip(struct irq_domain *d, unsigned int virq) -+{ -+ struct irq_data *data = irq_domain_get_irq_data(d, virq); -+ struct irq_domain_chip_generic *dgc = d->gc; -+ unsigned int hw_irq = data->hwirq; -+ struct irq_chip_generic *gc; -+ int irq_idx; -+ -+ gc = irq_get_domain_generic_chip(d, hw_irq); -+ if (!gc) -+ return; -+ -+ irq_idx = hw_irq % dgc->irqs_per_chip; -+ -+ clear_bit(irq_idx, &gc->installed); -+ irq_domain_set_info(d, virq, hw_irq, &no_irq_chip, NULL, NULL, NULL, -+ NULL); -+ -+} -+ - struct irq_domain_ops irq_generic_chip_ops = { - .map = irq_map_generic_chip, -+ .unmap = irq_unmap_generic_chip, - .xlate = irq_domain_xlate_onetwocell, - }; - EXPORT_SYMBOL_GPL(irq_generic_chip_ops); diff --git a/kernel/kernel/files/patches/mageia/stable-hid-add-quirk-for-akai-midimix.patch b/kernel/kernel/files/patches/mageia/stable-hid-add-quirk-for-akai-midimix.patch deleted file mode 100644 index 487050c3..00000000 --- a/kernel/kernel/files/patches/mageia/stable-hid-add-quirk-for-akai-midimix.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 4973ca9a01e2354b159acedec1b9b8eb8de02ab7 Mon Sep 17 00:00:00 2001 -From: "Steinar H. Gunderson" -Date: Sun, 9 Oct 2016 14:21:50 +0200 -Subject: HID: add quirk for Akai MIDImix. - -From: Steinar H. Gunderson - -commit 4973ca9a01e2354b159acedec1b9b8eb8de02ab7 upstream. - -The Akai MIDImix (09e8:0031) is a MIDI fader controller that speaks -regular MIDI and works well with Linux. However, initialization gets -delayed due to reports timeout: - - [3643645.631124] hid-generic 0003:09E8:0031.0020: timeout initializing reports - [3643645.632416] hid-generic 0003:09E8:0031.0020: hiddev0: USB HID v1.11 Device [AKAI MIDI Mix] on usb-0000:00:14.0-2/input0 - -Adding "usbhid.quirks=0x09e8:0x0031:0x20000000" on the kernel -command line makes the issues go away. - -Signed-off-by: Steinar H. Gunderson -Signed-off-by: Jiri Kosina -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/hid/hid-ids.h | 3 +++ - drivers/hid/usbhid/hid-quirks.c | 1 + - 2 files changed, 4 insertions(+) - ---- a/drivers/hid/hid-ids.h -+++ b/drivers/hid/hid-ids.h -@@ -64,6 +64,9 @@ - #define USB_VENDOR_ID_AKAI 0x2011 - #define USB_DEVICE_ID_AKAI_MPKMINI2 0x0715 - -+#define USB_VENDOR_ID_AKAI_09E8 0x09E8 -+#define USB_DEVICE_ID_AKAI_09E8_MIDIMIX 0x0031 -+ - #define USB_VENDOR_ID_ALCOR 0x058f - #define USB_DEVICE_ID_ALCOR_USBRS232 0x9720 - ---- a/drivers/hid/usbhid/hid-quirks.c -+++ b/drivers/hid/usbhid/hid-quirks.c -@@ -56,6 +56,7 @@ static const struct hid_blacklist { - - { USB_VENDOR_ID_AIREN, USB_DEVICE_ID_AIREN_SLIMPLUS, HID_QUIRK_NOGET }, - { USB_VENDOR_ID_AKAI, USB_DEVICE_ID_AKAI_MPKMINI2, HID_QUIRK_NO_INIT_REPORTS }, -+ { USB_VENDOR_ID_AKAI_09E8, USB_DEVICE_ID_AKAI_09E8_MIDIMIX, HID_QUIRK_NO_INIT_REPORTS }, - { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM, HID_QUIRK_NOGET }, - { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS124U, HID_QUIRK_NOGET }, - { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET }, diff --git a/kernel/kernel/files/patches/mageia/stable-hwrng-omap-only-fail-if-pm_runtime_get_sync-returns-0.patch b/kernel/kernel/files/patches/mageia/stable-hwrng-omap-only-fail-if-pm_runtime_get_sync-returns-0.patch deleted file mode 100644 index 0b54b3d5..00000000 --- a/kernel/kernel/files/patches/mageia/stable-hwrng-omap-only-fail-if-pm_runtime_get_sync-returns-0.patch +++ /dev/null @@ -1,44 +0,0 @@ -From ad8529fde9e3601180a839867a8ab041109aebb5 Mon Sep 17 00:00:00 2001 -From: Dave Gerlach -Date: Tue, 20 Sep 2016 10:25:40 -0500 -Subject: hwrng: omap - Only fail if pm_runtime_get_sync returns < 0 - -From: Dave Gerlach - -commit ad8529fde9e3601180a839867a8ab041109aebb5 upstream. - -Currently omap-rng checks the return value of pm_runtime_get_sync and -reports failure if anything is returned, however it should be checking -if ret < 0 as pm_runtime_get_sync return 0 on success but also can return -1 if the device was already active which is not a failure case. Only -values < 0 are actual failures. - -Fixes: 61dc0a446e5d ("hwrng: omap - Fix assumption that runtime_get_sync will always succeed") -Signed-off-by: Dave Gerlach -Signed-off-by: Herbert Xu -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/char/hw_random/omap-rng.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/char/hw_random/omap-rng.c -+++ b/drivers/char/hw_random/omap-rng.c -@@ -385,7 +385,7 @@ static int omap_rng_probe(struct platfor - - pm_runtime_enable(&pdev->dev); - ret = pm_runtime_get_sync(&pdev->dev); -- if (ret) { -+ if (ret < 0) { - dev_err(&pdev->dev, "Failed to runtime_get device: %d\n", ret); - pm_runtime_put_noidle(&pdev->dev); - goto err_ioremap; -@@ -443,7 +443,7 @@ static int __maybe_unused omap_rng_resum - int ret; - - ret = pm_runtime_get_sync(dev); -- if (ret) { -+ if (ret < 0) { - dev_err(dev, "Failed to runtime_get device: %d\n", ret); - pm_runtime_put_noidle(dev); - return ret; diff --git a/kernel/kernel/files/patches/mageia/stable-i40e-fix-broken-i40e_config_rss_aq-function.patch b/kernel/kernel/files/patches/mageia/stable-i40e-fix-broken-i40e_config_rss_aq-function.patch deleted file mode 100644 index d74fe900..00000000 --- a/kernel/kernel/files/patches/mageia/stable-i40e-fix-broken-i40e_config_rss_aq-function.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 776b2e15f8af7900409456292efd45af6de97172 Mon Sep 17 00:00:00 2001 -From: Jacob Keller -Date: Tue, 19 Jul 2016 16:23:30 -0700 -Subject: i40e: fix broken i40e_config_rss_aq function - -From: Jacob Keller - -commit 776b2e15f8af7900409456292efd45af6de97172 upstream. - -X722 hardware requires using the admin queue to configure RSS. This -function was previously re-written in commit e69ff813af35 ("i40e: rework -the functions to configure RSS with similar parameters"). -However, the previous refactor did not work correctly for a few reasons - -(a) it does not check whether seed is NULL before using it, resulting in -a NULL pointer dereference - -[ 402.954721] BUG: unable to handle kernel NULL pointer dereference at (null) -[ 402.955568] IP: [] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e] -[ 402.956402] PGD ad610067 PUD accc0067 PMD 0 -[ 402.957235] Oops: 0000 [#1] SMP -[ 402.958064] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_filter ebtable_ -broute bridge stp llc ebtable_nat ebtables ip6table_mangle ip6table_raw ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv -6 ip6table_security ip6table_filter ip6_tables iptable_mangle iptable_raw iptable_nat nf_conntrack_ipv4_ nf_defrag_ipv4_ nf_nat_ip -v4_ nf_nat nf_conntrack iptable_security intel_rapl i86_kg_temp_thermal coretemp kvm_intel kvm irqbypass crct10dif_clMl crc32_ -pclMl ghash_clMlni_intel iTCO_wdt iTCO_vendor_support shpchp sb_edac dcdbas pcspkr joydev ipmi_devintf wmi edac_core ipmi_ssif - acpi_ad acpi_ower_meter ipmi_si ipmi_msghandler mei_me nfsd lpc_ich mei ioatdma tpm_tis auth_rpcgss tpm nfs_acl lockd grace s -unrpc ifs nngag200 i2c_algo_bit drm_kms_helper ttm drm iigbe bnx2x i40e dca mdio ptp pps_core libcrc32c fjes crc32c_intel -[ 402.965563] CPU: 22 PID: 2461 Conm: ethtool Not tainted 4.6.0-rc7_1.2-ABNidQ+ #20 -[ 402.966719] Hardware name: Dell Inc. PowerEdge R720/0C4Y3R, BIOS 2.5.2 01/28/2015 -[ 402.967862] task: ffff880219b51dc0 ti: ffff8800b3408000 task.ti: ffff8800b3408000 -[ 402.969046] RIP: 0010:[] [] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e] -[ 402.970339] RSP: 0018:ffff8800b340ba90 EFLAGS: 00010246 -[ 402.971616] RAX: 0000000000000000 RBX: ffff88042ec14000 RCX: 0000000000000200 -[ 402.972961] RDX: ffff880428eb9200 RSI: 0000000000000000 RDI: ffff88042ec14000 -[ 402.974312] RBP: ffff8800b340baf8 R08: ffff880237ada8f0 R09: ffff880428eb9200 -[ 402.975709] R10: ffff880428eb9200 R11: 0000000000000000 R12: ffff88042ec2e000 -[ 402.977104] R13: ffff88042ec2e000 R14: ffff88042ec14000 R15: ffff88022ea00800 -[ 402.978541] FS: 00007f84fd054700(0000) GS:ffff880237ac0000(0000) knlGS:0000000000000000 -[ 402.980003] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 -[ 402.981508] CR2: 0000000000000000 CR3: 000000003289e000 CR4: 00000000000406e0 -[ 402.983028] Stack: -[ 402.984578] 0000000002000200 0000000000000000 ffff88023ffeda68 ffff88023ffef000 -[ 402.986187] 0000000000000268 ffff8800b340bbf8 ffff88023ffedd80 0000000088ce4f1d -[ 402.987844] ffff88042ec14000 ffff88022ea00800 ffff88042ec2e000 ffff88042ec14000 -[ 402.989509] Call Trace: -[ 402.991200] [] i40e_config_rss+0x11f/0x1c0 [i40e] -[ 402.992924] [] i40e_set_rifh+0ic0/0x130 [i40e] -[ 402.994684] [] ethtool_set_rifh+0x1f7/0x300 -[ 402.996446] [] ? cred_has_capability+0io6b/0x100 -[ 402.998203] [] ? selinux_capable+0x12/0x20 -[ 402.999968] [] ? security_capable+0x4b/0x70 -[ 403.001707] [] dev_ethtool+0x1423/0x2290 -[ 403.003461] [] dev_ioctl+0x191/0io630 -[ 403.005186] [] ? lru_cache_add+0x3a/0i80 -[ 403.006942] [] ? _raw_spin_unlock+0ie/0x20 -[ 403.008691] [] sock_do_ioctl+0x45/0i50 -[ 403.010421] [] sock_ioctl+0x209/0x2d0 -[ 403.012173] [] do_vfs_ioctl+0u4/0io6c0 -[ 403.013911] [] SyS_ioctl+0x79/0x90 -[ 403.015710] [] entry_SYSCALL_64_fastpath+0x1a/0u4 -[ 403.017500] Code: 90 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 89 fb 48 83 ec 40 4c 8b a7 e0 05 00 00 65 48 8b 04 25 28 00 00 00 48 89 45 d0 31 c0 <48> 8b 06 41 0f b7 bc 24 f2 0f 00 00 48 89 45 9c 48 8b 46 08 48 -[ 403.021454] RIP [] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e] -[ 403.023395] RSP -[ 403.025271] CR2: 0000000000000000 -[ 403.027169] ---[ end trace 64561b528cf61cf0 ]--- - -(b) it does not even bother to use the passed in *lut parameter which -defines the requested lookup table. Instead it uses its own round robin -table. - -Fix these issues by re-writing it to be similar to i40e_config_rss_reg -and i40e_get_rss_aq. - -Fixes: e69ff813af35 ("i40e: rework the functions to configure RSS with similar parameters", 2015-10-21) -Signed-off-by: Jacob Keller -Tested-by: Andrew Bowers -Signed-off-by: Jeff Kirsher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/net/ethernet/intel/i40e/i40e_main.c | 57 +++++++++++----------------- - 1 file changed, 23 insertions(+), 34 deletions(-) - ---- a/drivers/net/ethernet/intel/i40e/i40e_main.c -+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c -@@ -7990,45 +7990,34 @@ static int i40e_setup_misc_vector(struct - static int i40e_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed, - u8 *lut, u16 lut_size) - { -- struct i40e_aqc_get_set_rss_key_data rss_key; - struct i40e_pf *pf = vsi->back; - struct i40e_hw *hw = &pf->hw; -- bool pf_lut = false; -- u8 *rss_lut; -- int ret, i; -+ int ret = 0; - -- memcpy(&rss_key, seed, sizeof(rss_key)); -- -- rss_lut = kzalloc(pf->rss_table_size, GFP_KERNEL); -- if (!rss_lut) -- return -ENOMEM; -- -- /* Populate the LUT with max no. of queues in round robin fashion */ -- for (i = 0; i < vsi->rss_table_size; i++) -- rss_lut[i] = i % vsi->rss_size; -- -- ret = i40e_aq_set_rss_key(hw, vsi->id, &rss_key); -- if (ret) { -- dev_info(&pf->pdev->dev, -- "Cannot set RSS key, err %s aq_err %s\n", -- i40e_stat_str(&pf->hw, ret), -- i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); -- goto config_rss_aq_out; -+ if (seed) { -+ struct i40e_aqc_get_set_rss_key_data *seed_dw = -+ (struct i40e_aqc_get_set_rss_key_data *)seed; -+ ret = i40e_aq_set_rss_key(hw, vsi->id, seed_dw); -+ if (ret) { -+ dev_info(&pf->pdev->dev, -+ "Cannot set RSS key, err %s aq_err %s\n", -+ i40e_stat_str(hw, ret), -+ i40e_aq_str(hw, hw->aq.asq_last_status)); -+ return ret; -+ } - } -+ if (lut) { -+ bool pf_lut = vsi->type == I40E_VSI_MAIN ? true : false; - -- if (vsi->type == I40E_VSI_MAIN) -- pf_lut = true; -- -- ret = i40e_aq_set_rss_lut(hw, vsi->id, pf_lut, rss_lut, -- vsi->rss_table_size); -- if (ret) -- dev_info(&pf->pdev->dev, -- "Cannot set RSS lut, err %s aq_err %s\n", -- i40e_stat_str(&pf->hw, ret), -- i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); -- --config_rss_aq_out: -- kfree(rss_lut); -+ ret = i40e_aq_set_rss_lut(hw, vsi->id, pf_lut, lut, lut_size); -+ if (ret) { -+ dev_info(&pf->pdev->dev, -+ "Cannot set RSS lut, err %s aq_err %s\n", -+ i40e_stat_str(hw, ret), -+ i40e_aq_str(hw, hw->aq.asq_last_status)); -+ return ret; -+ } -+ } - return ret; - } - diff --git a/kernel/kernel/files/patches/mageia/stable-i40e-remove-a-stray-unlock.patch b/kernel/kernel/files/patches/mageia/stable-i40e-remove-a-stray-unlock.patch deleted file mode 100644 index 045b5d78..00000000 --- a/kernel/kernel/files/patches/mageia/stable-i40e-remove-a-stray-unlock.patch +++ /dev/null @@ -1,32 +0,0 @@ -From be0cb0a66a1d426f7cd9b170c008725044ae147a Mon Sep 17 00:00:00 2001 -From: Dan Carpenter -Date: Wed, 3 Aug 2016 22:01:07 +0300 -Subject: i40e: remove a stray unlock - -From: Dan Carpenter - -commit be0cb0a66a1d426f7cd9b170c008725044ae147a upstream. - -We shifted the locking around a bit but forgot to delete this unlock so -now it can unlock twice. - -Fixes: cd3be169a5ff ('i40e: Move the mutex lock in i40e_client_unregister') -Signed-off-by: Dan Carpenter -Tested-by: Andrew Bowers -Signed-off-by: Jeff Kirsher -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/net/ethernet/intel/i40e/i40e_client.c | 1 - - 1 file changed, 1 deletion(-) - ---- a/drivers/net/ethernet/intel/i40e/i40e_client.c -+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c -@@ -1009,7 +1009,6 @@ int i40e_unregister_client(struct i40e_c - if (!i40e_client_is_registered(client)) { - pr_info("i40e: Client %s has not been registered\n", - client->name); -- mutex_unlock(&i40e_client_mutex); - ret = -ENODEV; - goto out; - } diff --git a/kernel/kernel/files/patches/mageia/stable-ib-hfi1-move-iowait_init-to-priv-allocate.patch b/kernel/kernel/files/patches/mageia/stable-ib-hfi1-move-iowait_init-to-priv-allocate.patch deleted file mode 100644 index f2d43851..00000000 --- a/kernel/kernel/files/patches/mageia/stable-ib-hfi1-move-iowait_init-to-priv-allocate.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 5a648dfad033bf5f945795c4e56ee7577f24f3e9 Mon Sep 17 00:00:00 2001 -From: Mike Marciniszyn -Date: Tue, 6 Sep 2016 04:36:53 -0700 -Subject: IB/hfi1: Move iowait_init() to priv allocate - -From: Mike Marciniszyn - -commit 5a648dfad033bf5f945795c4e56ee7577f24f3e9 upstream. - -The call is misplaced in the reset calldown function -and causes issues with lockdep assertions that are to -be added. - -Fixes: Commit a2c2d608957c ("staging/rdma/hfi1: Remove create_qp functionality") -Reviewed-by: Ira Weiny -Reviewed-by: Dennis Dalessandro -Signed-off-by: Mike Marciniszyn -Signed-off-by: Dennis Dalessandro -Signed-off-by: Doug Ledford -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/infiniband/hw/hfi1/qp.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - ---- a/drivers/infiniband/hw/hfi1/qp.c -+++ b/drivers/infiniband/hw/hfi1/qp.c -@@ -808,6 +808,13 @@ void *qp_priv_alloc(struct rvt_dev_info - kfree(priv); - return ERR_PTR(-ENOMEM); - } -+ iowait_init( -+ &priv->s_iowait, -+ 1, -+ _hfi1_do_send, -+ iowait_sleep, -+ iowait_wakeup, -+ iowait_sdma_drained); - setup_timer(&priv->s_rnr_timer, hfi1_rc_rnr_retry, (unsigned long)qp); - qp->s_timer.function = hfi1_rc_timeout; - return priv; -@@ -873,13 +880,6 @@ void notify_qp_reset(struct rvt_qp *qp) - { - struct hfi1_qp_priv *priv = qp->priv; - -- iowait_init( -- &priv->s_iowait, -- 1, -- _hfi1_do_send, -- iowait_sleep, -- iowait_wakeup, -- iowait_sdma_drained); - priv->r_adefered = 0; - clear_ahg(qp); - } diff --git a/kernel/kernel/files/patches/mageia/stable-ib-mlx5-fix-steering-resource-leak.patch b/kernel/kernel/files/patches/mageia/stable-ib-mlx5-fix-steering-resource-leak.patch deleted file mode 100644 index 5ef7c7a4..00000000 --- a/kernel/kernel/files/patches/mageia/stable-ib-mlx5-fix-steering-resource-leak.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 7055a29471eebf4b62687944694222635ed44b09 Mon Sep 17 00:00:00 2001 -From: Maor Gottlieb -Date: Sun, 28 Aug 2016 14:16:30 +0300 -Subject: IB/mlx5: Fix steering resource leak - -From: Maor Gottlieb - -commit 7055a29471eebf4b62687944694222635ed44b09 upstream. - -Fix multicast flow rule leak on adding unicast rule failure. - -Fixes: 038d2ef87572 ('IB/mlx5: Add flow steering support') -Signed-off-by: Maor Gottlieb -Signed-off-by: Leon Romanovsky -Signed-off-by: Doug Ledford -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/infiniband/hw/mlx5/main.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/infiniband/hw/mlx5/main.c -+++ b/drivers/infiniband/hw/mlx5/main.c -@@ -1843,6 +1843,7 @@ static struct mlx5_ib_flow_handler *crea - &leftovers_specs[LEFTOVERS_UC].flow_attr, - dst); - if (IS_ERR(handler_ucast)) { -+ mlx5_del_flow_rule(handler->rule); - kfree(handler); - handler = handler_ucast; - } else { diff --git a/kernel/kernel/files/patches/mageia/stable-ib-qib-remove-qpt_mask-global.patch b/kernel/kernel/files/patches/mageia/stable-ib-qib-remove-qpt_mask-global.patch deleted file mode 100644 index 9ecc8063..00000000 --- a/kernel/kernel/files/patches/mageia/stable-ib-qib-remove-qpt_mask-global.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 84b3adc2430eafd2eb703570075c3c141ea0ff13 Mon Sep 17 00:00:00 2001 -From: Dennis Dalessandro -Date: Sun, 25 Sep 2016 07:41:05 -0700 -Subject: IB/qib: Remove qpt_mask global - -From: Dennis Dalessandro - -commit 84b3adc2430eafd2eb703570075c3c141ea0ff13 upstream. - -There is no need to have a global qpt_mask as that does not support the -multiple chip model which qib has. Instead rely on the value which -exists already in the device data (dd). - -Fixes: 898fa52b4ac3 "IB/qib: Remove qpn, qp tables and related variables from qib" -Reviewed-by: Mike Marciniszyn -Signed-off-by: Dennis Dalessandro -Signed-off-by: Doug Ledford -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/infiniband/hw/qib/qib.h | 1 - - drivers/infiniband/hw/qib/qib_qp.c | 13 +++---------- - drivers/infiniband/hw/qib/qib_verbs.c | 2 -- - 3 files changed, 3 insertions(+), 13 deletions(-) - ---- a/drivers/infiniband/hw/qib/qib.h -+++ b/drivers/infiniband/hw/qib/qib.h -@@ -1131,7 +1131,6 @@ extern spinlock_t qib_devs_lock; - extern struct qib_devdata *qib_lookup(int unit); - extern u32 qib_cpulist_count; - extern unsigned long *qib_cpulist; --extern u16 qpt_mask; - extern unsigned qib_cc_table_size; - - int qib_init(struct qib_devdata *, int); ---- a/drivers/infiniband/hw/qib/qib_qp.c -+++ b/drivers/infiniband/hw/qib/qib_qp.c -@@ -41,14 +41,6 @@ - - #include "qib.h" - --/* -- * mask field which was present in now deleted qib_qpn_table -- * is not present in rvt_qpn_table. Defining the same field -- * as qpt_mask here instead of adding the mask field to -- * rvt_qpn_table. -- */ --u16 qpt_mask; -- - static inline unsigned mk_qpn(struct rvt_qpn_table *qpt, - struct rvt_qpn_map *map, unsigned off) - { -@@ -57,7 +49,7 @@ static inline unsigned mk_qpn(struct rvt - - static inline unsigned find_next_offset(struct rvt_qpn_table *qpt, - struct rvt_qpn_map *map, unsigned off, -- unsigned n) -+ unsigned n, u16 qpt_mask) - { - if (qpt_mask) { - off++; -@@ -179,6 +171,7 @@ int qib_alloc_qpn(struct rvt_dev_info *r - struct qib_ibdev *verbs_dev = container_of(rdi, struct qib_ibdev, rdi); - struct qib_devdata *dd = container_of(verbs_dev, struct qib_devdata, - verbs_dev); -+ u16 qpt_mask = dd->qpn_mask; - - if (type == IB_QPT_SMI || type == IB_QPT_GSI) { - unsigned n; -@@ -215,7 +208,7 @@ int qib_alloc_qpn(struct rvt_dev_info *r - goto bail; - } - offset = find_next_offset(qpt, map, offset, -- dd->n_krcv_queues); -+ dd->n_krcv_queues, qpt_mask); - qpn = mk_qpn(qpt, map, offset); - /* - * This test differs from alloc_pidmap(). ---- a/drivers/infiniband/hw/qib/qib_verbs.c -+++ b/drivers/infiniband/hw/qib/qib_verbs.c -@@ -1606,8 +1606,6 @@ int qib_register_ib_device(struct qib_de - /* Only need to initialize non-zero fields. */ - setup_timer(&dev->mem_timer, mem_timer, (unsigned long)dev); - -- qpt_mask = dd->qpn_mask; -- - INIT_LIST_HEAD(&dev->piowait); - INIT_LIST_HEAD(&dev->dmawait); - INIT_LIST_HEAD(&dev->txwait); diff --git a/kernel/kernel/files/patches/mageia/stable-ib-rdmavt-correct-sparse-annotation.patch b/kernel/kernel/files/patches/mageia/stable-ib-rdmavt-correct-sparse-annotation.patch deleted file mode 100644 index cb694653..00000000 --- a/kernel/kernel/files/patches/mageia/stable-ib-rdmavt-correct-sparse-annotation.patch +++ /dev/null @@ -1,44 +0,0 @@ -From eefa1d8961584c5b76afded94960ca4344bc638b Mon Sep 17 00:00:00 2001 -From: Mike Marciniszyn -Date: Tue, 6 Sep 2016 04:36:33 -0700 -Subject: IB/rdmavt: Correct sparse annotation - -From: Mike Marciniszyn - -commit eefa1d8961584c5b76afded94960ca4344bc638b upstream. - -The __must_hold() is sufficent to correct the sparse -context imbalance inside a function. - -Per Documentation/sparse.txt: -__must_hold - The specified lock is held on function entry and exit. - -Fixes: Commit c0a67f6ba356 ("IB/rdmavt: Annotate rvt_reset_qp()") -Reviewed-by: Dennis Dalessandro -Signed-off-by: Mike Marciniszyn -Signed-off-by: Dennis Dalessandro -Signed-off-by: Doug Ledford -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/infiniband/sw/rdmavt/qp.c | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - ---- a/drivers/infiniband/sw/rdmavt/qp.c -+++ b/drivers/infiniband/sw/rdmavt/qp.c -@@ -501,12 +501,9 @@ static void rvt_remove_qp(struct rvt_dev - */ - static void rvt_reset_qp(struct rvt_dev_info *rdi, struct rvt_qp *qp, - enum ib_qp_type type) -- __releases(&qp->s_lock) -- __releases(&qp->s_hlock) -- __releases(&qp->r_lock) -- __acquires(&qp->r_lock) -- __acquires(&qp->s_hlock) -- __acquires(&qp->s_lock) -+ __must_hold(&qp->r_lock) -+ __must_hold(&qp->s_hlock) -+ __must_hold(&qp->s_lock) - { - if (qp->state != IB_QPS_RESET) { - qp->state = IB_QPS_RESET; diff --git a/kernel/kernel/files/patches/mageia/stable-iio-ad5755-fix-off-by-one-on-devnr-limit-check.patch b/kernel/kernel/files/patches/mageia/stable-iio-ad5755-fix-off-by-one-on-devnr-limit-check.patch deleted file mode 100644 index 039a4f3a..00000000 --- a/kernel/kernel/files/patches/mageia/stable-iio-ad5755-fix-off-by-one-on-devnr-limit-check.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 9d47964bfd471f0dd4c89f28556aec68bffa0020 Mon Sep 17 00:00:00 2001 -From: Colin Ian King -Date: Mon, 25 Jul 2016 23:40:01 +0100 -Subject: iio: ad5755: fix off-by-one on devnr limit check - -From: Colin Ian King - -commit 9d47964bfd471f0dd4c89f28556aec68bffa0020 upstream. - -The comparison for devnr limits is off-by-one, the current check -allows 0 to AD5755_NUM_CHANNELS and the limit should be in fact -0 to AD5755_NUM_CHANNELS - 1. This can lead to an out of bounds -write to pdata->dac[devnr]. Fix this by replacing > with >= on the -comparison. - -Signed-off-by: Colin Ian King -Fixes: c947459979c6 ("iio: ad5755: add support for dt bindings") -Signed-off-by: Jonathan Cameron -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/iio/dac/ad5755.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/iio/dac/ad5755.c -+++ b/drivers/iio/dac/ad5755.c -@@ -655,7 +655,7 @@ static struct ad5755_platform_data *ad57 - - devnr = 0; - for_each_child_of_node(np, pp) { -- if (devnr > AD5755_NUM_CHANNELS) { -+ if (devnr >= AD5755_NUM_CHANNELS) { - dev_err(dev, - "There is to many channels defined in DT\n"); - goto error_out; diff --git a/kernel/kernel/files/patches/mageia/stable-iio-light-us5182d-add-missing-error-code-assignment-before-test.patch b/kernel/kernel/files/patches/mageia/stable-iio-light-us5182d-add-missing-error-code-assignment-before-test.patch deleted file mode 100644 index 1187350f..00000000 --- a/kernel/kernel/files/patches/mageia/stable-iio-light-us5182d-add-missing-error-code-assignment-before-test.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 281269f8a0b00f5c95de5158e8595ed51bdb4b0a Mon Sep 17 00:00:00 2001 -From: Christophe JAILLET -Date: Wed, 10 Aug 2016 07:18:16 +0200 -Subject: iio: light: us5182d: Add missing error code assignment before test - -From: Christophe JAILLET - -commit 281269f8a0b00f5c95de5158e8595ed51bdb4b0a upstream. - -It is likely that checking the result of 'pm_runtime_set_active' is -expected here. - -Fixes: f0e5f57d3ac2 ("iio: light: us8152d: Add power management support") - -Signed-off-by: Christophe JAILLET -Signed-off-by: Jonathan Cameron -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/iio/light/us5182d.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/iio/light/us5182d.c -+++ b/drivers/iio/light/us5182d.c -@@ -894,7 +894,7 @@ static int us5182d_probe(struct i2c_clie - goto out_err; - - if (data->default_continuous) { -- pm_runtime_set_active(&client->dev); -+ ret = pm_runtime_set_active(&client->dev); - if (ret < 0) - goto out_err; - } diff --git a/kernel/kernel/files/patches/mageia/stable-mm-hugetlb-check-for-reserved-hugepages-during-memory-offline.patch b/kernel/kernel/files/patches/mageia/stable-mm-hugetlb-check-for-reserved-hugepages-during-memory-offline.patch deleted file mode 100644 index b2dff957..00000000 --- a/kernel/kernel/files/patches/mageia/stable-mm-hugetlb-check-for-reserved-hugepages-during-memory-offline.patch +++ /dev/null @@ -1,140 +0,0 @@ -From 082d5b6b60e9f25e1511557fcfcb21eedd267446 Mon Sep 17 00:00:00 2001 -From: Gerald Schaefer -Date: Fri, 7 Oct 2016 17:01:10 -0700 -Subject: mm/hugetlb: check for reserved hugepages during memory offline - -From: Gerald Schaefer - -commit 082d5b6b60e9f25e1511557fcfcb21eedd267446 upstream. - -In dissolve_free_huge_pages(), free hugepages will be dissolved without -making sure that there are enough of them left to satisfy hugepage -reservations. - -Fix this by adding a return value to dissolve_free_huge_pages() and -checking h->free_huge_pages vs. h->resv_huge_pages. Note that this may -lead to the situation where dissolve_free_huge_page() returns an error -and all free hugepages that were dissolved before that error are lost, -while the memory block still cannot be set offline. - -Fixes: c8721bbb ("mm: memory-hotplug: enable memory hotplug to handle hugepage") -Link: http://lkml.kernel.org/r/20160926172811.94033-3-gerald.schaefer@de.ibm.com -Signed-off-by: Gerald Schaefer -Acked-by: Michal Hocko -Acked-by: Naoya Horiguchi -Cc: "Kirill A . Shutemov" -Cc: Vlastimil Babka -Cc: Mike Kravetz -Cc: "Aneesh Kumar K . V" -Cc: Martin Schwidefsky -Cc: Heiko Carstens -Cc: Rui Teng -Cc: Dave Hansen -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman - ---- - include/linux/hugetlb.h | 6 +++--- - mm/hugetlb.c | 26 +++++++++++++++++++++----- - mm/memory_hotplug.c | 4 +++- - 3 files changed, 27 insertions(+), 9 deletions(-) - ---- a/include/linux/hugetlb.h -+++ b/include/linux/hugetlb.h -@@ -450,8 +450,8 @@ static inline pgoff_t basepage_index(str - return __basepage_index(page); - } - --extern void dissolve_free_huge_pages(unsigned long start_pfn, -- unsigned long end_pfn); -+extern int dissolve_free_huge_pages(unsigned long start_pfn, -+ unsigned long end_pfn); - static inline bool hugepage_migration_supported(struct hstate *h) - { - #ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION -@@ -518,7 +518,7 @@ static inline pgoff_t basepage_index(str - { - return page->index; - } --#define dissolve_free_huge_pages(s, e) do {} while (0) -+#define dissolve_free_huge_pages(s, e) 0 - #define hugepage_migration_supported(h) false - - static inline spinlock_t *huge_pte_lockptr(struct hstate *h, ---- a/mm/hugetlb.c -+++ b/mm/hugetlb.c -@@ -1437,22 +1437,32 @@ static int free_pool_huge_page(struct hs - - /* - * Dissolve a given free hugepage into free buddy pages. This function does -- * nothing for in-use (including surplus) hugepages. -+ * nothing for in-use (including surplus) hugepages. Returns -EBUSY if the -+ * number of free hugepages would be reduced below the number of reserved -+ * hugepages. - */ --static void dissolve_free_huge_page(struct page *page) -+static int dissolve_free_huge_page(struct page *page) - { -+ int rc = 0; -+ - spin_lock(&hugetlb_lock); - if (PageHuge(page) && !page_count(page)) { - struct page *head = compound_head(page); - struct hstate *h = page_hstate(head); - int nid = page_to_nid(head); -+ if (h->free_huge_pages - h->resv_huge_pages == 0) { -+ rc = -EBUSY; -+ goto out; -+ } - list_del(&head->lru); - h->free_huge_pages--; - h->free_huge_pages_node[nid]--; - h->max_huge_pages--; - update_and_free_page(h, head); - } -+out: - spin_unlock(&hugetlb_lock); -+ return rc; - } - - /* -@@ -1460,16 +1470,22 @@ static void dissolve_free_huge_page(stru - * make specified memory blocks removable from the system. - * Note that this will dissolve a free gigantic hugepage completely, if any - * part of it lies within the given range. -+ * Also note that if dissolve_free_huge_page() returns with an error, all -+ * free hugepages that were dissolved before that error are lost. - */ --void dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn) -+int dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn) - { - unsigned long pfn; -+ int rc = 0; - - if (!hugepages_supported()) -- return; -+ return rc; - - for (pfn = start_pfn; pfn < end_pfn; pfn += 1 << minimum_order) -- dissolve_free_huge_page(pfn_to_page(pfn)); -+ if (rc = dissolve_free_huge_page(pfn_to_page(pfn))) -+ break; -+ -+ return rc; - } - - /* ---- a/mm/memory_hotplug.c -+++ b/mm/memory_hotplug.c -@@ -1945,7 +1945,9 @@ repeat: - * dissolve free hugepages in the memory block before doing offlining - * actually in order to make hugetlbfs's object counting consistent. - */ -- dissolve_free_huge_pages(start_pfn, end_pfn); -+ ret = dissolve_free_huge_pages(start_pfn, end_pfn); -+ if (ret) -+ goto failed_removal; - /* check again */ - offlined_pages = check_pages_isolated(start_pfn, end_pfn); - if (offlined_pages < 0) { diff --git a/kernel/kernel/files/patches/mageia/stable-mwifiex-correct-aid-value-during-tdls-setup.patch b/kernel/kernel/files/patches/mageia/stable-mwifiex-correct-aid-value-during-tdls-setup.patch deleted file mode 100644 index cf253222..00000000 --- a/kernel/kernel/files/patches/mageia/stable-mwifiex-correct-aid-value-during-tdls-setup.patch +++ /dev/null @@ -1,36 +0,0 @@ -From b64db1b252e9974a43a51ba083fa7d03e4716167 Mon Sep 17 00:00:00 2001 -From: Xinming Hu -Date: Tue, 9 Aug 2016 20:20:44 +0530 -Subject: mwifiex: correct aid value during tdls setup - -From: Xinming Hu - -commit b64db1b252e9974a43a51ba083fa7d03e4716167 upstream. - -AID gets updated during TDLS setup, but modified value isn't reflected -in "priv->assoc_rsp_buf". This causes TDLS setup failure. The problem is -fixed here. - -Fixes: 4aff53ef18e4a4 ("mwifiex: parsing aid while receiving..") -Signed-off-by: Xinming Hu -Signed-off-by: Amitkumar Karwar -Signed-off-by: Kalle Valo -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/net/wireless/marvell/mwifiex/join.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/drivers/net/wireless/marvell/mwifiex/join.c -+++ b/drivers/net/wireless/marvell/mwifiex/join.c -@@ -669,9 +669,8 @@ int mwifiex_ret_802_11_associate(struct - priv->assoc_rsp_size = min(le16_to_cpu(resp->size) - S_DS_GEN, - sizeof(priv->assoc_rsp_buf)); - -- memcpy(priv->assoc_rsp_buf, &resp->params, priv->assoc_rsp_size); -- - assoc_rsp->a_id = cpu_to_le16(aid); -+ memcpy(priv->assoc_rsp_buf, &resp->params, priv->assoc_rsp_size); - - if (status_code) { - priv->adapter->dbg.num_cmd_assoc_failure++; diff --git a/kernel/kernel/files/patches/mageia/stable-mwifiex-fix-failed-to-reconnect-after-interface-disabled-enabled.patch b/kernel/kernel/files/patches/mageia/stable-mwifiex-fix-failed-to-reconnect-after-interface-disabled-enabled.patch deleted file mode 100644 index 4eafe773..00000000 --- a/kernel/kernel/files/patches/mageia/stable-mwifiex-fix-failed-to-reconnect-after-interface-disabled-enabled.patch +++ /dev/null @@ -1,39 +0,0 @@ -From c8ccf3ade7851054f82bf88f5fcd393a394038a3 Mon Sep 17 00:00:00 2001 -From: Amitkumar Karwar -Date: Mon, 25 Jul 2016 21:21:06 +0530 -Subject: mwifiex: fix failed to reconnect after interface disabled/enabled - -From: Amitkumar Karwar - -commit c8ccf3ade7851054f82bf88f5fcd393a394038a3 upstream. - -Recent patch "mwifiex: fix NULL pointer" skips extended scan event -handling when suspend is in progress. It created a problem for scan -after interface disabled/enabled case. - -This patch solves the problem by checking netif_running() status. - -Fixes:16d25da94f3d654 ("mwifiex: fix NULL pointer dereference during suspend") -Signed-off-by: Amitkumar Karwar -Signed-off-by: Kalle Valo -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/net/wireless/marvell/mwifiex/sta_event.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/marvell/mwifiex/sta_event.c -+++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c -@@ -708,7 +708,11 @@ int mwifiex_process_sta_event(struct mwi - - case EVENT_EXT_SCAN_REPORT: - mwifiex_dbg(adapter, EVENT, "event: EXT_SCAN Report\n"); -- if (adapter->ext_scan && !priv->scan_aborting) -+ /* We intend to skip this event during suspend, but handle -+ * it in interface disabled case -+ */ -+ if (adapter->ext_scan && (!priv->scan_aborting || -+ !netif_running(priv->netdev))) - ret = mwifiex_handle_event_ext_scan_report(priv, - adapter->event_skb->data); - diff --git a/kernel/kernel/files/patches/mageia/stable-posix_acl-clear-sgid-bit-when-setting-file-permissions.patch b/kernel/kernel/files/patches/mageia/stable-posix_acl-clear-sgid-bit-when-setting-file-permissions.patch deleted file mode 100644 index f5d12375..00000000 --- a/kernel/kernel/files/patches/mageia/stable-posix_acl-clear-sgid-bit-when-setting-file-permissions.patch +++ /dev/null @@ -1,408 +0,0 @@ -From 073931017b49d9458aa351605b43a7e34598caef Mon Sep 17 00:00:00 2001 -From: Jan Kara -Date: Mon, 19 Sep 2016 17:39:09 +0200 -Subject: posix_acl: Clear SGID bit when setting file permissions - -From: Jan Kara - -commit 073931017b49d9458aa351605b43a7e34598caef upstream. - -When file permissions are modified via chmod(2) and the user is not in -the owning group or capable of CAP_FSETID, the setgid bit is cleared in -inode_change_ok(). Setting a POSIX ACL via setxattr(2) sets the file -permissions as well as the new ACL, but doesn't clear the setgid bit in -a similar way; this allows to bypass the check in chmod(2). Fix that. - -References: CVE-2016-7097 -Reviewed-by: Christoph Hellwig -Reviewed-by: Jeff Layton -Signed-off-by: Jan Kara -Signed-off-by: Andreas Gruenbacher -Signed-off-by: Juerg Haefliger -Signed-off-by: Greg Kroah-Hartman - ---- - fs/9p/acl.c | 40 +++++++++++++++++----------------------- - fs/btrfs/acl.c | 6 ++---- - fs/ceph/acl.c | 6 ++---- - fs/ext2/acl.c | 12 ++++-------- - fs/ext4/acl.c | 12 ++++-------- - fs/f2fs/acl.c | 6 ++---- - fs/gfs2/acl.c | 12 +++--------- - fs/hfsplus/posix_acl.c | 4 ++-- - fs/jffs2/acl.c | 9 ++++----- - fs/jfs/acl.c | 6 ++---- - fs/ocfs2/acl.c | 10 ++++------ - fs/orangefs/acl.c | 15 +++++---------- - fs/posix_acl.c | 31 +++++++++++++++++++++++++++++++ - fs/reiserfs/xattr_acl.c | 8 ++------ - fs/xfs/xfs_acl.c | 13 ++++--------- - include/linux/posix_acl.h | 1 + - 16 files changed, 89 insertions(+), 102 deletions(-) - ---- a/fs/9p/acl.c -+++ b/fs/9p/acl.c -@@ -276,32 +276,26 @@ static int v9fs_xattr_set_acl(const stru - switch (handler->flags) { - case ACL_TYPE_ACCESS: - if (acl) { -- umode_t mode = inode->i_mode; -- retval = posix_acl_equiv_mode(acl, &mode); -- if (retval < 0) -+ struct iattr iattr; -+ -+ retval = posix_acl_update_mode(inode, &iattr.ia_mode, &acl); -+ if (retval) - goto err_out; -- else { -- struct iattr iattr; -- if (retval == 0) { -- /* -- * ACL can be represented -- * by the mode bits. So don't -- * update ACL. -- */ -- acl = NULL; -- value = NULL; -- size = 0; -- } -- /* Updte the mode bits */ -- iattr.ia_mode = ((mode & S_IALLUGO) | -- (inode->i_mode & ~S_IALLUGO)); -- iattr.ia_valid = ATTR_MODE; -- /* FIXME should we update ctime ? -- * What is the following setxattr update the -- * mode ? -+ if (!acl) { -+ /* -+ * ACL can be represented -+ * by the mode bits. So don't -+ * update ACL. - */ -- v9fs_vfs_setattr_dotl(dentry, &iattr); -+ value = NULL; -+ size = 0; - } -+ iattr.ia_valid = ATTR_MODE; -+ /* FIXME should we update ctime ? -+ * What is the following setxattr update the -+ * mode ? -+ */ -+ v9fs_vfs_setattr_dotl(dentry, &iattr); - } - break; - case ACL_TYPE_DEFAULT: ---- a/fs/btrfs/acl.c -+++ b/fs/btrfs/acl.c -@@ -79,11 +79,9 @@ static int __btrfs_set_acl(struct btrfs_ - case ACL_TYPE_ACCESS: - name = XATTR_NAME_POSIX_ACL_ACCESS; - if (acl) { -- ret = posix_acl_equiv_mode(acl, &inode->i_mode); -- if (ret < 0) -+ ret = posix_acl_update_mode(inode, &inode->i_mode, &acl); -+ if (ret) - return ret; -- if (ret == 0) -- acl = NULL; - } - ret = 0; - break; ---- a/fs/ceph/acl.c -+++ b/fs/ceph/acl.c -@@ -95,11 +95,9 @@ int ceph_set_acl(struct inode *inode, st - case ACL_TYPE_ACCESS: - name = XATTR_NAME_POSIX_ACL_ACCESS; - if (acl) { -- ret = posix_acl_equiv_mode(acl, &new_mode); -- if (ret < 0) -+ ret = posix_acl_update_mode(inode, &new_mode, &acl); -+ if (ret) - goto out; -- if (ret == 0) -- acl = NULL; - } - break; - case ACL_TYPE_DEFAULT: ---- a/fs/ext2/acl.c -+++ b/fs/ext2/acl.c -@@ -190,15 +190,11 @@ ext2_set_acl(struct inode *inode, struct - case ACL_TYPE_ACCESS: - name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS; - if (acl) { -- error = posix_acl_equiv_mode(acl, &inode->i_mode); -- if (error < 0) -+ error = posix_acl_update_mode(inode, &inode->i_mode, &acl); -+ if (error) - return error; -- else { -- inode->i_ctime = CURRENT_TIME_SEC; -- mark_inode_dirty(inode); -- if (error == 0) -- acl = NULL; -- } -+ inode->i_ctime = CURRENT_TIME_SEC; -+ mark_inode_dirty(inode); - } - break; - ---- a/fs/ext4/acl.c -+++ b/fs/ext4/acl.c -@@ -193,15 +193,11 @@ __ext4_set_acl(handle_t *handle, struct - case ACL_TYPE_ACCESS: - name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS; - if (acl) { -- error = posix_acl_equiv_mode(acl, &inode->i_mode); -- if (error < 0) -+ error = posix_acl_update_mode(inode, &inode->i_mode, &acl); -+ if (error) - return error; -- else { -- inode->i_ctime = ext4_current_time(inode); -- ext4_mark_inode_dirty(handle, inode); -- if (error == 0) -- acl = NULL; -- } -+ inode->i_ctime = ext4_current_time(inode); -+ ext4_mark_inode_dirty(handle, inode); - } - break; - ---- a/fs/f2fs/acl.c -+++ b/fs/f2fs/acl.c -@@ -210,12 +210,10 @@ static int __f2fs_set_acl(struct inode * - case ACL_TYPE_ACCESS: - name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS; - if (acl) { -- error = posix_acl_equiv_mode(acl, &inode->i_mode); -- if (error < 0) -+ error = posix_acl_update_mode(inode, &inode->i_mode, &acl); -+ if (error) - return error; - set_acl_inode(inode, inode->i_mode); -- if (error == 0) -- acl = NULL; - } - break; - ---- a/fs/gfs2/acl.c -+++ b/fs/gfs2/acl.c -@@ -92,17 +92,11 @@ int __gfs2_set_acl(struct inode *inode, - if (type == ACL_TYPE_ACCESS) { - umode_t mode = inode->i_mode; - -- error = posix_acl_equiv_mode(acl, &mode); -- if (error < 0) -+ error = posix_acl_update_mode(inode, &inode->i_mode, &acl); -+ if (error) - return error; -- -- if (error == 0) -- acl = NULL; -- -- if (mode != inode->i_mode) { -- inode->i_mode = mode; -+ if (mode != inode->i_mode) - mark_inode_dirty(inode); -- } - } - - if (acl) { ---- a/fs/hfsplus/posix_acl.c -+++ b/fs/hfsplus/posix_acl.c -@@ -65,8 +65,8 @@ int hfsplus_set_posix_acl(struct inode * - case ACL_TYPE_ACCESS: - xattr_name = XATTR_NAME_POSIX_ACL_ACCESS; - if (acl) { -- err = posix_acl_equiv_mode(acl, &inode->i_mode); -- if (err < 0) -+ err = posix_acl_update_mode(inode, &inode->i_mode, &acl); -+ if (err) - return err; - } - err = 0; ---- a/fs/jffs2/acl.c -+++ b/fs/jffs2/acl.c -@@ -233,9 +233,10 @@ int jffs2_set_acl(struct inode *inode, s - case ACL_TYPE_ACCESS: - xprefix = JFFS2_XPREFIX_ACL_ACCESS; - if (acl) { -- umode_t mode = inode->i_mode; -- rc = posix_acl_equiv_mode(acl, &mode); -- if (rc < 0) -+ umode_t mode; -+ -+ rc = posix_acl_update_mode(inode, &mode, &acl); -+ if (rc) - return rc; - if (inode->i_mode != mode) { - struct iattr attr; -@@ -247,8 +248,6 @@ int jffs2_set_acl(struct inode *inode, s - if (rc < 0) - return rc; - } -- if (rc == 0) -- acl = NULL; - } - break; - case ACL_TYPE_DEFAULT: ---- a/fs/jfs/acl.c -+++ b/fs/jfs/acl.c -@@ -78,13 +78,11 @@ static int __jfs_set_acl(tid_t tid, stru - case ACL_TYPE_ACCESS: - ea_name = XATTR_NAME_POSIX_ACL_ACCESS; - if (acl) { -- rc = posix_acl_equiv_mode(acl, &inode->i_mode); -- if (rc < 0) -+ rc = posix_acl_update_mode(inode, &inode->i_mode, &acl); -+ if (rc) - return rc; - inode->i_ctime = CURRENT_TIME; - mark_inode_dirty(inode); -- if (rc == 0) -- acl = NULL; - } - break; - case ACL_TYPE_DEFAULT: ---- a/fs/ocfs2/acl.c -+++ b/fs/ocfs2/acl.c -@@ -241,13 +241,11 @@ int ocfs2_set_acl(handle_t *handle, - case ACL_TYPE_ACCESS: - name_index = OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS; - if (acl) { -- umode_t mode = inode->i_mode; -- ret = posix_acl_equiv_mode(acl, &mode); -- if (ret < 0) -- return ret; -+ umode_t mode; - -- if (ret == 0) -- acl = NULL; -+ ret = posix_acl_update_mode(inode, &mode, &acl); -+ if (ret) -+ return ret; - - ret = ocfs2_acl_set_mode(inode, di_bh, - handle, mode); ---- a/fs/orangefs/acl.c -+++ b/fs/orangefs/acl.c -@@ -73,14 +73,11 @@ int orangefs_set_acl(struct inode *inode - case ACL_TYPE_ACCESS: - name = XATTR_NAME_POSIX_ACL_ACCESS; - if (acl) { -- umode_t mode = inode->i_mode; -- /* -- * can we represent this with the traditional file -- * mode permission bits? -- */ -- error = posix_acl_equiv_mode(acl, &mode); -- if (error < 0) { -- gossip_err("%s: posix_acl_equiv_mode err: %d\n", -+ umode_t mode; -+ -+ error = posix_acl_update_mode(inode, &mode, &acl); -+ if (error) { -+ gossip_err("%s: posix_acl_update_mode err: %d\n", - __func__, - error); - return error; -@@ -90,8 +87,6 @@ int orangefs_set_acl(struct inode *inode - SetModeFlag(orangefs_inode); - inode->i_mode = mode; - mark_inode_dirty_sync(inode); -- if (error == 0) -- acl = NULL; - } - break; - case ACL_TYPE_DEFAULT: ---- a/fs/posix_acl.c -+++ b/fs/posix_acl.c -@@ -626,6 +626,37 @@ no_mem: - } - EXPORT_SYMBOL_GPL(posix_acl_create); - -+/** -+ * posix_acl_update_mode - update mode in set_acl -+ * -+ * Update the file mode when setting an ACL: compute the new file permission -+ * bits based on the ACL. In addition, if the ACL is equivalent to the new -+ * file mode, set *acl to NULL to indicate that no ACL should be set. -+ * -+ * As with chmod, clear the setgit bit if the caller is not in the owning group -+ * or capable of CAP_FSETID (see inode_change_ok). -+ * -+ * Called from set_acl inode operations. -+ */ -+int posix_acl_update_mode(struct inode *inode, umode_t *mode_p, -+ struct posix_acl **acl) -+{ -+ umode_t mode = inode->i_mode; -+ int error; -+ -+ error = posix_acl_equiv_mode(*acl, &mode); -+ if (error < 0) -+ return error; -+ if (error == 0) -+ *acl = NULL; -+ if (!in_group_p(inode->i_gid) && -+ !capable_wrt_inode_uidgid(inode, CAP_FSETID)) -+ mode &= ~S_ISGID; -+ *mode_p = mode; -+ return 0; -+} -+EXPORT_SYMBOL(posix_acl_update_mode); -+ - /* - * Fix up the uids and gids in posix acl extended attributes in place. - */ ---- a/fs/reiserfs/xattr_acl.c -+++ b/fs/reiserfs/xattr_acl.c -@@ -242,13 +242,9 @@ __reiserfs_set_acl(struct reiserfs_trans - case ACL_TYPE_ACCESS: - name = XATTR_NAME_POSIX_ACL_ACCESS; - if (acl) { -- error = posix_acl_equiv_mode(acl, &inode->i_mode); -- if (error < 0) -+ error = posix_acl_update_mode(inode, &inode->i_mode, &acl); -+ if (error) - return error; -- else { -- if (error == 0) -- acl = NULL; -- } - } - break; - case ACL_TYPE_DEFAULT: ---- a/fs/xfs/xfs_acl.c -+++ b/fs/xfs/xfs_acl.c -@@ -257,16 +257,11 @@ xfs_set_acl(struct inode *inode, struct - return error; - - if (type == ACL_TYPE_ACCESS) { -- umode_t mode = inode->i_mode; -- error = posix_acl_equiv_mode(acl, &mode); -- -- if (error <= 0) { -- acl = NULL; -- -- if (error < 0) -- return error; -- } -+ umode_t mode; - -+ error = posix_acl_update_mode(inode, &mode, &acl); -+ if (error) -+ return error; - error = xfs_set_mode(inode, mode); - if (error) - return error; ---- a/include/linux/posix_acl.h -+++ b/include/linux/posix_acl.h -@@ -93,6 +93,7 @@ extern int set_posix_acl(struct inode *, - extern int posix_acl_chmod(struct inode *, umode_t); - extern int posix_acl_create(struct inode *, umode_t *, struct posix_acl **, - struct posix_acl **); -+extern int posix_acl_update_mode(struct inode *, umode_t *, struct posix_acl **); - - extern int simple_set_acl(struct inode *, struct posix_acl *, int); - extern int simple_acl_create(struct inode *, struct inode *); diff --git a/kernel/kernel/files/patches/mageia/stable-power-bq24257-fix-use-of-uninitialized-pointer-bq-charger.patch b/kernel/kernel/files/patches/mageia/stable-power-bq24257-fix-use-of-uninitialized-pointer-bq-charger.patch deleted file mode 100644 index c02dec4e..00000000 --- a/kernel/kernel/files/patches/mageia/stable-power-bq24257-fix-use-of-uninitialized-pointer-bq-charger.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 0610735928ee47870e083d5901caa371089216f1 Mon Sep 17 00:00:00 2001 -From: Georges Savoundararadj -Date: Wed, 7 Sep 2016 18:38:15 -0700 -Subject: power: bq24257: Fix use of uninitialized pointer bq->charger - -From: Georges Savoundararadj - -commit 0610735928ee47870e083d5901caa371089216f1 upstream. - -bq->charger is initialized in bq24257_power_supply_init. -Therefore, bq24257_power_supply_init should be called before the -registration of the IRQ handler bq24257_irq_handler_thread that calls -power_supply_changed(bq->charger). - -Signed-off-by: Georges Savoundararadj -Cc: Aurelien Chanot -Cc: Andreas Dannenberg -Cc: Sebastian Reichel -Cc: David Woodhouse -Fixes: 2219a935963e ("power_supply: Add TI BQ24257 charger driver") -Signed-off-by: Sebastian Reichel -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/power/bq24257_charger.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - ---- a/drivers/power/bq24257_charger.c -+++ b/drivers/power/bq24257_charger.c -@@ -1068,6 +1068,12 @@ static int bq24257_probe(struct i2c_clie - return ret; - } - -+ ret = bq24257_power_supply_init(bq); -+ if (ret < 0) { -+ dev_err(dev, "Failed to register power supply\n"); -+ return ret; -+ } -+ - ret = devm_request_threaded_irq(dev, client->irq, NULL, - bq24257_irq_handler_thread, - IRQF_TRIGGER_FALLING | -@@ -1078,12 +1084,6 @@ static int bq24257_probe(struct i2c_clie - return ret; - } - -- ret = bq24257_power_supply_init(bq); -- if (ret < 0) { -- dev_err(dev, "Failed to register power supply\n"); -- return ret; -- } -- - ret = sysfs_create_group(&bq->charger->dev.kobj, &bq24257_attr_group); - if (ret < 0) { - dev_err(dev, "Can't create sysfs entries\n"); diff --git a/kernel/kernel/files/patches/mageia/stable-revert-drm-i915-check-live-status-before-reading-edid.patch b/kernel/kernel/files/patches/mageia/stable-revert-drm-i915-check-live-status-before-reading-edid.patch deleted file mode 100644 index 238b9566..00000000 --- a/kernel/kernel/files/patches/mageia/stable-revert-drm-i915-check-live-status-before-reading-edid.patch +++ /dev/null @@ -1,142 +0,0 @@ -From 23f889bdf6ee5cfff012d8b09f6bec920c691696 Mon Sep 17 00:00:00 2001 -From: David Weinehall -Date: Wed, 17 Aug 2016 15:47:48 +0300 -Subject: Revert "drm/i915: Check live status before reading edid" - -From: David Weinehall - -commit 23f889bdf6ee5cfff012d8b09f6bec920c691696 upstream. - -This reverts commit 237ed86c693d8a8e4db476976aeb30df4deac74b. - -Our current implementation of live status check (repeat 9 times -with 10ms delays between each attempt as a workaround for -buggy displays) imposes a rather serious penalty, time wise, -on intel_hdmi_detect(). Since we we already skip live status -checks on platforms before gen 7, and since we seem to have -coped quite well before the live status check was introduced -for newer platforms too, the previous behaviour is probably -preferable, at least unless someone can point to a use-case -that the live status check improves (apart from "Bspec says so".) - -Signed-off-by: David Weinehall -Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid") -Fixes: f8d03ea0053b ("drm/i915: increase the tries for HDMI hotplug live status checking") -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97139 -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94014 -Acked-by: Chris Wilson -Signed-off-by: Jani Nikula -Link: http://patchwork.freedesktop.org/patch/msgid/20160817124748.31208-1-david.weinehall@linux.intel.com -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_dp.c | 2 - - drivers/gpu/drm/i915/intel_drv.h | 2 - - drivers/gpu/drm/i915/intel_hdmi.c | 43 ++++++++------------------------------ - 3 files changed, 11 insertions(+), 36 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_dp.c -+++ b/drivers/gpu/drm/i915/intel_dp.c -@@ -4148,7 +4148,7 @@ static bool bxt_digital_port_connected(s - * - * Return %true if @port is connected, %false otherwise. - */ --bool intel_digital_port_connected(struct drm_i915_private *dev_priv, -+static bool intel_digital_port_connected(struct drm_i915_private *dev_priv, - struct intel_digital_port *port) - { - if (HAS_PCH_IBX(dev_priv)) ---- a/drivers/gpu/drm/i915/intel_drv.h -+++ b/drivers/gpu/drm/i915/intel_drv.h -@@ -1388,8 +1388,6 @@ void intel_edp_drrs_disable(struct intel - void intel_edp_drrs_invalidate(struct drm_device *dev, - unsigned frontbuffer_bits); - void intel_edp_drrs_flush(struct drm_device *dev, unsigned frontbuffer_bits); --bool intel_digital_port_connected(struct drm_i915_private *dev_priv, -- struct intel_digital_port *port); - - void - intel_dp_program_link_training_pattern(struct intel_dp *intel_dp, ---- a/drivers/gpu/drm/i915/intel_hdmi.c -+++ b/drivers/gpu/drm/i915/intel_hdmi.c -@@ -1422,24 +1422,22 @@ intel_hdmi_dp_dual_mode_detect(struct dr - } - - static bool --intel_hdmi_set_edid(struct drm_connector *connector, bool force) -+intel_hdmi_set_edid(struct drm_connector *connector) - { - struct drm_i915_private *dev_priv = to_i915(connector->dev); - struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); -- struct edid *edid = NULL; -+ struct edid *edid; - bool connected = false; - -- if (force) { -- intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS); -+ intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS); - -- edid = drm_get_edid(connector, -- intel_gmbus_get_adapter(dev_priv, -- intel_hdmi->ddc_bus)); -+ edid = drm_get_edid(connector, -+ intel_gmbus_get_adapter(dev_priv, -+ intel_hdmi->ddc_bus)); - -- intel_hdmi_dp_dual_mode_detect(connector, edid != NULL); -+ intel_hdmi_dp_dual_mode_detect(connector, edid != NULL); - -- intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS); -- } -+ intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS); - - to_intel_connector(connector)->detect_edid = edid; - if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) { -@@ -1465,37 +1463,16 @@ static enum drm_connector_status - intel_hdmi_detect(struct drm_connector *connector, bool force) - { - enum drm_connector_status status; -- struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); - struct drm_i915_private *dev_priv = to_i915(connector->dev); -- bool live_status = false; -- unsigned int try; - - DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", - connector->base.id, connector->name); - - intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS); - -- for (try = 0; !live_status && try < 9; try++) { -- if (try) -- msleep(10); -- live_status = intel_digital_port_connected(dev_priv, -- hdmi_to_dig_port(intel_hdmi)); -- } -- -- if (!live_status) { -- DRM_DEBUG_KMS("HDMI live status down\n"); -- /* -- * Live status register is not reliable on all intel platforms. -- * So consider live_status only for certain platforms, for -- * others, read EDID to determine presence of sink. -- */ -- if (INTEL_INFO(dev_priv)->gen < 7 || IS_IVYBRIDGE(dev_priv)) -- live_status = true; -- } -- - intel_hdmi_unset_edid(connector); - -- if (intel_hdmi_set_edid(connector, live_status)) { -+ if (intel_hdmi_set_edid(connector)) { - struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); - - hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI; -@@ -1521,7 +1498,7 @@ intel_hdmi_force(struct drm_connector *c - if (connector->status != connector_status_connected) - return; - -- intel_hdmi_set_edid(connector, true); -+ intel_hdmi_set_edid(connector); - hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI; - } - diff --git a/kernel/kernel/files/patches/mageia/stable-rt2x00usb-fix-error-return-code.patch b/kernel/kernel/files/patches/mageia/stable-rt2x00usb-fix-error-return-code.patch deleted file mode 100644 index 620b2a7a..00000000 --- a/kernel/kernel/files/patches/mageia/stable-rt2x00usb-fix-error-return-code.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 410280bac6224e066f4cf0b87db08f0418a135b6 Mon Sep 17 00:00:00 2001 -From: Christophe Jaillet -Date: Thu, 11 Aug 2016 16:38:54 +0200 -Subject: rt2x00usb: Fix error return code - -From: Christophe Jaillet - -commit 410280bac6224e066f4cf0b87db08f0418a135b6 upstream. - -We know that 'retval = 0' because it has been tested a few lines above. -So, if 'devm_kmalloc' fails, 0 will be returned instead of an error code. -Return -ENOMEM instead. - -Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB") -Signed-off-by: Christophe JAILLET -Acked-by: Stanislaw Gruszka -Signed-off-by: Kalle Valo -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c -@@ -831,8 +831,10 @@ int rt2x00usb_probe(struct usb_interface - rt2x00dev->anchor = devm_kmalloc(&usb_dev->dev, - sizeof(struct usb_anchor), - GFP_KERNEL); -- if (!rt2x00dev->anchor) -+ if (!rt2x00dev->anchor) { -+ retval = -ENOMEM; - goto exit_free_reg; -+ } - - init_usb_anchor(rt2x00dev->anchor); - return 0; diff --git a/kernel/kernel/files/patches/mageia/stable-scsi-cxlflash-remove-the-device-cleanly-in-the-system-shutdown-path.patch b/kernel/kernel/files/patches/mageia/stable-scsi-cxlflash-remove-the-device-cleanly-in-the-system-shutdown-path.patch deleted file mode 100644 index a29bf7cc..00000000 --- a/kernel/kernel/files/patches/mageia/stable-scsi-cxlflash-remove-the-device-cleanly-in-the-system-shutdown-path.patch +++ /dev/null @@ -1,80 +0,0 @@ -From babf985d1e1b0677cb264acd01319d2b9c8f4327 Mon Sep 17 00:00:00 2001 -From: Uma Krishnan -Date: Fri, 2 Sep 2016 15:39:16 -0500 -Subject: scsi: cxlflash: Remove the device cleanly in the system shutdown path - -From: Uma Krishnan - -commit babf985d1e1b0677cb264acd01319d2b9c8f4327 upstream. - -Commit 704c4b0ddc03 ("cxlflash: Shutdown notify support for CXL Flash -cards") was recently introduced to notify the AFU when a system is going -down. Due to the position of the cxlflash driver in the device stack, -cxlflash devices are _always_ removed during a reboot/shutdown. This can -lead to a crash if the cxlflash shutdown hook is invoked _after_ the -shutdown hook for the owning virtual PHB. Furthermore, the current -implementation of shutdown/remove hooks for cxlflash are not tolerant to -being invoked when the device is not enabled. This can also lead to a -crash in situations where the remove hook is invoked after the device -has been removed via the vPHBs shutdown hook. An example of this -scenario would be an EEH reset failure while a reboot/shutdown is in -progress. - -To solve both problems, the shutdown hook for cxlflash is updated to -simply remove the device. This path already includes the AFU -notification and thus this solution will continue to perform the -original intent. At the same time, the remove hook is updated to protect -against being called when the device is not enabled. - -Fixes: 704c4b0ddc03 ("cxlflash: Shutdown notify support for CXL Flash -cards") -Signed-off-by: Uma Krishnan -Acked-by: Matthew R. Ochs -Signed-off-by: Martin K. Petersen -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/scsi/cxlflash/main.c | 18 ++++++------------ - 1 file changed, 6 insertions(+), 12 deletions(-) - ---- a/drivers/scsi/cxlflash/main.c -+++ b/drivers/scsi/cxlflash/main.c -@@ -823,17 +823,6 @@ static void notify_shutdown(struct cxlfl - } - - /** -- * cxlflash_shutdown() - shutdown handler -- * @pdev: PCI device associated with the host. -- */ --static void cxlflash_shutdown(struct pci_dev *pdev) --{ -- struct cxlflash_cfg *cfg = pci_get_drvdata(pdev); -- -- notify_shutdown(cfg, false); --} -- --/** - * cxlflash_remove() - PCI entry point to tear down host - * @pdev: PCI device associated with the host. - * -@@ -844,6 +833,11 @@ static void cxlflash_remove(struct pci_d - struct cxlflash_cfg *cfg = pci_get_drvdata(pdev); - ulong lock_flags; - -+ if (!pci_is_enabled(pdev)) { -+ pr_debug("%s: Device is disabled\n", __func__); -+ return; -+ } -+ - /* If a Task Management Function is active, wait for it to complete - * before continuing with remove. - */ -@@ -2685,7 +2679,7 @@ static struct pci_driver cxlflash_driver - .id_table = cxlflash_pci_table, - .probe = cxlflash_probe, - .remove = cxlflash_remove, -- .shutdown = cxlflash_shutdown, -+ .shutdown = cxlflash_remove, - .err_handler = &cxlflash_err_handler, - }; - diff --git a/kernel/kernel/files/patches/mageia/stable-spi-spi-fsl-dspi-drop-extra-spi_master_put-in-device-remove-function.patch b/kernel/kernel/files/patches/mageia/stable-spi-spi-fsl-dspi-drop-extra-spi_master_put-in-device-remove-function.patch deleted file mode 100644 index 342c96ec..00000000 --- a/kernel/kernel/files/patches/mageia/stable-spi-spi-fsl-dspi-drop-extra-spi_master_put-in-device-remove-function.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 6999aeabbb703a81a204cb6f9f8f151759a99ac4 Mon Sep 17 00:00:00 2001 -From: Wei Yongjun -Date: Sat, 20 Aug 2016 15:25:32 +0000 -Subject: spi: spi-fsl-dspi: Drop extra spi_master_put in device remove function - -From: Wei Yongjun - -commit 6999aeabbb703a81a204cb6f9f8f151759a99ac4 upstream. - -The call sequence spi_alloc_master/spi_register_master/spi_unregister_master -is complete; it reduces the device reference count to zero, which and results -in device memory being freed. The subsequent call to spi_master_put is -unnecessary and results in an access to free memory. Drop it. - -Fixes: 9298bc727385 ("spi: spi-fsl-dspi: Remove spi-bitbang") -Signed-off-by: Wei Yongjun -Signed-off-by: Mark Brown -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/spi/spi-fsl-dspi.c | 1 - - 1 file changed, 1 deletion(-) - ---- a/drivers/spi/spi-fsl-dspi.c -+++ b/drivers/spi/spi-fsl-dspi.c -@@ -760,7 +760,6 @@ static int dspi_remove(struct platform_d - /* Disconnect from the SPI framework */ - clk_disable_unprepare(dspi->clk); - spi_unregister_master(dspi->master); -- spi_master_put(dspi->master); - - return 0; - } diff --git a/kernel/kernel/files/patches/mageia/stable-staging-android-ion-hisi-fix-dependencies.patch b/kernel/kernel/files/patches/mageia/stable-staging-android-ion-hisi-fix-dependencies.patch deleted file mode 100644 index 2e5bc67f..00000000 --- a/kernel/kernel/files/patches/mageia/stable-staging-android-ion-hisi-fix-dependencies.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 4a236d01b5e0d7e6f4ee9e6c4056fce10b38e8ad Mon Sep 17 00:00:00 2001 -From: Arnd Bergmann -Date: Thu, 15 Sep 2016 17:57:40 +0200 -Subject: staging: android ion/hisi: fix dependencies - -From: Arnd Bergmann - -commit 4a236d01b5e0d7e6f4ee9e6c4056fce10b38e8ad upstream. - -The newly added Hi6220 Ion code fails to build when the ION_OF helpers -are not present: - -drivers/staging/android/ion/hisilicon/hi6220_ion.o: In function `hi6220_ion_remove': -hi6220_ion.c:(.text.hi6220_ion_remove+0x4c): undefined reference to `ion_destroy_platform_data' -drivers/staging/android/ion/hisilicon/hi6220_ion.o: In function `hi6220_ion_probe': -hi6220_ion.c:(.text.hi6220_ion_probe+0x5c): undefined reference to `ion_parse_dt' -hi6220_ion.c:(.text.hi6220_ion_probe+0xf8): undefined reference to `ion_destroy_platform_data' - -This selects the symbol when needed. - -Fixes: 2b40182a19bc ("staging: android: ion: Add ion driver for Hi6220 SoC platform") -Signed-off-by: Arnd Bergmann -Acked-by: Laura Abbott -Reviewed-by: Sumit Semwal -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/staging/android/ion/Kconfig | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/staging/android/ion/Kconfig -+++ b/drivers/staging/android/ion/Kconfig -@@ -36,6 +36,7 @@ config ION_TEGRA - config ION_HISI - tristate "Ion for Hisilicon" - depends on ARCH_HISI && ION -+ select ION_OF - help - Choose this option if you wish to use ion on Hisilicon Platform. - diff --git a/kernel/kernel/files/patches/mageia/stable-staging-ks7010-declare-private-functions-static.patch b/kernel/kernel/files/patches/mageia/stable-staging-ks7010-declare-private-functions-static.patch deleted file mode 100644 index d7b8117a..00000000 --- a/kernel/kernel/files/patches/mageia/stable-staging-ks7010-declare-private-functions-static.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 9afe11e956766eaac4643adaaf49f223dd536c92 Mon Sep 17 00:00:00 2001 -From: Nicholas Mc Guire -Date: Mon, 25 Jul 2016 21:22:27 +0200 -Subject: staging: ks7010: declare private functions static - -From: Nicholas Mc Guire - -commit 9afe11e956766eaac4643adaaf49f223dd536c92 upstream. - -Private functions in ks_hostif.c can be declared static. - -Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository") - -Signed-off-by: Nicholas Mc Guire -Reviewed-by: Wolfram Sang -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/staging/ks7010/ks_hostif.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/staging/ks7010/ks_hostif.c -+++ b/drivers/staging/ks7010/ks_hostif.c -@@ -69,7 +69,7 @@ inline u32 get_DWORD(struct ks_wlan_priv - return data; - } - --void ks_wlan_hw_wakeup_task(struct work_struct *work) -+static void ks_wlan_hw_wakeup_task(struct work_struct *work) - { - struct ks_wlan_private *priv = - container_of(work, struct ks_wlan_private, ks_wlan_wakeup_task); -@@ -1509,7 +1509,7 @@ void hostif_infrastructure_set_request(s - ks_wlan_hw_tx(priv, pp, hif_align_size(sizeof(*pp)), NULL, NULL, NULL); - } - --void hostif_infrastructure_set2_request(struct ks_wlan_private *priv) -+static void hostif_infrastructure_set2_request(struct ks_wlan_private *priv) - { - struct hostif_infrastructure_set2_request_t *pp; - uint16_t capability; diff --git a/kernel/kernel/files/patches/mageia/stable-staging-ks7010-fix-wait_for_completion_interruptible_timeout-return-handling.patch b/kernel/kernel/files/patches/mageia/stable-staging-ks7010-fix-wait_for_completion_interruptible_timeout-return-handling.patch deleted file mode 100644 index 9cdf0a7d..00000000 --- a/kernel/kernel/files/patches/mageia/stable-staging-ks7010-fix-wait_for_completion_interruptible_timeout-return-handling.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 9d29f14db1095f52ca00b8162b242d6fce07d19f Mon Sep 17 00:00:00 2001 -From: Nicholas Mc Guire -Date: Mon, 25 Jul 2016 21:21:50 +0200 -Subject: staging: ks7010: fix wait_for_completion_interruptible_timeout return handling - -From: Nicholas Mc Guire - -commit 9d29f14db1095f52ca00b8162b242d6fce07d19f upstream. - -wait_for_completion_interruptible_timeout return 0 on timeout and --ERESTARTSYS if interrupted. The check for -!wait_for_completion_interruptible_timeout() would report an interrupt -as timeout. Further, while HZ/50 will work most of the time it could -fail for HZ < 50, so this is switched to msecs_to_jiffies(20). - -Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository") - -Signed-off-by: Nicholas Mc Guire -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/staging/ks7010/ks_hostif.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - ---- a/drivers/staging/ks7010/ks_hostif.c -+++ b/drivers/staging/ks7010/ks_hostif.c -@@ -74,11 +74,15 @@ void ks_wlan_hw_wakeup_task(struct work_ - struct ks_wlan_private *priv = - container_of(work, struct ks_wlan_private, ks_wlan_wakeup_task); - int ps_status = atomic_read(&priv->psstatus.status); -+ long time_left; - - if (ps_status == PS_SNOOZE) { - ks_wlan_hw_wakeup_request(priv); -- if (!wait_for_completion_interruptible_timeout(&priv->psstatus.wakeup_wait, HZ / 50)) { /* 20ms timeout */ -- DPRINTK(1, "wake up timeout !!!\n"); -+ time_left = wait_for_completion_interruptible_timeout( -+ &priv->psstatus.wakeup_wait, -+ msecs_to_jiffies(20)); -+ if (time_left <= 0) { -+ DPRINTK(1, "wake up timeout or interrupted !!!\n"); - schedule_work(&priv->ks_wlan_wakeup_task); - return; - } diff --git a/kernel/kernel/files/patches/mageia/stable-staging-r8188eu-fix-scheduling-while-atomic-splat.patch b/kernel/kernel/files/patches/mageia/stable-staging-r8188eu-fix-scheduling-while-atomic-splat.patch deleted file mode 100644 index ab357ae2..00000000 --- a/kernel/kernel/files/patches/mageia/stable-staging-r8188eu-fix-scheduling-while-atomic-splat.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 1335a9516d3d52f157ad87456efdd8dc9ae1747b Mon Sep 17 00:00:00 2001 -From: Larry Finger -Date: Sun, 5 Jun 2016 14:11:19 -0500 -Subject: staging: r8188eu: Fix scheduling while atomic splat - -From: Larry Finger - -commit 1335a9516d3d52f157ad87456efdd8dc9ae1747b upstream. - -Commit fadbe0cd5292851608e2e01b91d9295fa287b9fe ("staging: rtl8188eu: -Remove rtw_zmalloc(), wrapper for kzalloc()") changed all allocation -calls to be GFP_KERNEL even though the original wrapper was testing -to determine if the caller was in atomic mode. Most of the mistakes -were corrected with commit 33dc85c3c667209c930b2dac5ccbc2a365e06b7a -("staging: r8188eu: Fix scheduling while atomic error introduced in -commit fadbe0cd"); however, two kzalloc calls were missed as the -call only happens when the driver is shutting down. - -Fixes: fadbe0cd5292851608e2e01b91d9295fa287b9fe ("staging: rtl8188eu: Remove rtw_zmalloc(), wrapper for kzalloc()") -Signed-off-by: Larry Finger -Cc: navin patidar -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/staging/rtl8188eu/core/rtw_cmd.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/staging/rtl8188eu/core/rtw_cmd.c -+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c -@@ -670,13 +670,13 @@ u8 rtw_addbareq_cmd(struct adapter *pada - u8 res = _SUCCESS; - - -- ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); -+ ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); - if (!ph2c) { - res = _FAIL; - goto exit; - } - -- paddbareq_parm = kzalloc(sizeof(struct addBaReq_parm), GFP_KERNEL); -+ paddbareq_parm = kzalloc(sizeof(struct addBaReq_parm), GFP_ATOMIC); - if (!paddbareq_parm) { - kfree(ph2c); - res = _FAIL; diff --git a/kernel/kernel/files/patches/mageia/stable-staging-sm750fb-correctly-set-clock_phase-bit-of-display-controller.patch b/kernel/kernel/files/patches/mageia/stable-staging-sm750fb-correctly-set-clock_phase-bit-of-display-controller.patch deleted file mode 100644 index 630a49f1..00000000 --- a/kernel/kernel/files/patches/mageia/stable-staging-sm750fb-correctly-set-clock_phase-bit-of-display-controller.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 992f961480d23e9ef9e686e512a419efef723523 Mon Sep 17 00:00:00 2001 -From: Phil Turnbull -Date: Fri, 2 Sep 2016 15:35:31 -0400 -Subject: staging: sm750fb: Correctly set CLOCK_PHASE bit of display controller. - -From: Phil Turnbull - -commit 992f961480d23e9ef9e686e512a419efef723523 upstream. - -Commit 6fba39cf32a3 ("staging: sm750fb: use BIT macro for -PANEL_DISPLAY_CTRL single-bit fields") accidentally changed the -CLOCK_PHASE logic from '|=' to '=' which clears all the previously set -bits. - -Fixes: 6fba39cf32a3 ("staging: sm750fb: use BIT macro for PANEL_DISPLAY_CTRL single-bit fields") -Signed-off-by: Phil Turnbull -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/staging/sm750fb/ddk750_mode.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/staging/sm750fb/ddk750_mode.c -+++ b/drivers/staging/sm750fb/ddk750_mode.c -@@ -63,7 +63,7 @@ static unsigned long displayControlAdjus - dispControl |= (CRT_DISPLAY_CTRL_CRTSELECT | CRT_DISPLAY_CTRL_RGBBIT); - - /* Set bit 14 of display controller */ -- dispControl = DISPLAY_CTRL_CLOCK_PHASE; -+ dispControl |= DISPLAY_CTRL_CLOCK_PHASE; - - POKE32(CRT_DISPLAY_CTRL, dispControl); - diff --git a/kernel/kernel/files/patches/mageia/stable-uio-fix-dmem_region_start-computation.patch b/kernel/kernel/files/patches/mageia/stable-uio-fix-dmem_region_start-computation.patch deleted file mode 100644 index 9f33eed3..00000000 --- a/kernel/kernel/files/patches/mageia/stable-uio-fix-dmem_region_start-computation.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 4d31a2588ae37a5d0f61f4d956454e9504846aeb Mon Sep 17 00:00:00 2001 -From: Jan Viktorin -Date: Tue, 17 May 2016 11:22:17 +0200 -Subject: uio: fix dmem_region_start computation - -From: Jan Viktorin - -commit 4d31a2588ae37a5d0f61f4d956454e9504846aeb upstream. - -The variable i contains a total number of resources (including -IORESOURCE_IRQ). However, we want the dmem_region_start to point -after the last resource of type IORESOURCE_MEM. The original behaviour -leads (very likely) to skipping several UIO mapping regions and makes -them useless. Fix this by computing dmem_region_start from the uiomem -which points to the last used UIO mapping. - -Fixes: 0a0c3b5a24bd ("Add new uio device for dynamic memory allocation") - -Signed-off-by: Jan Viktorin -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/uio/uio_dmem_genirq.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/uio/uio_dmem_genirq.c -+++ b/drivers/uio/uio_dmem_genirq.c -@@ -229,7 +229,7 @@ static int uio_dmem_genirq_probe(struct - ++uiomem; - } - -- priv->dmem_region_start = i; -+ priv->dmem_region_start = uiomem - &uioinfo->mem[0]; - priv->num_dmem_regions = pdata->num_dynamic_regions; - - for (i = 0; i < pdata->num_dynamic_regions; ++i) { diff --git a/kernel/kernel/files/patches/mageia/x86-smpboot-Init-apic-mapping-before-usage.patch b/kernel/kernel/files/patches/mageia/x86-smpboot-Init-apic-mapping-before-usage.patch new file mode 100644 index 00000000..6c2e766a --- /dev/null +++ b/kernel/kernel/files/patches/mageia/x86-smpboot-Init-apic-mapping-before-usage.patch @@ -0,0 +1,61 @@ +From 1e90a13d0c3dc94512af1ccb2b6563e8297838fa Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Sat, 29 Oct 2016 13:42:42 +0200 +Subject: [PATCH] x86/smpboot: Init apic mapping before usage + +The recent changes, which forced the registration of the boot cpu on UP +systems, which do not have ACPI tables, have been fixed for systems w/o +local APIC, but left a wreckage for systems which have neither ACPI nor +mptables, but the CPU has an APIC, e.g. virtualbox. + +The boot process crashes in prefill_possible_map() as it wants to register +the boot cpu, which needs to access the local apic, but the local APIC is +not yet mapped. + +There is no reason why init_apic_mapping() can't be invoked before +prefill_possible_map(). So instead of playing another silly early mapping +game, as the ACPI/mptables code does, we just move init_apic_mapping() +before the call to prefill_possible_map(). + +In hindsight, I should have noticed that combination earlier. + +Sorry for the churn (also in stable)! + +Fixes: ff8560512b8d ("x86/boot/smp: Don't try to poke disabled/non-existent APIC") +Reported-and-debugged-by: Michal Necasek +Reported-and-tested-by: Wolfgang Bauer +Cc: prarit@redhat.com +Cc: ville.syrjala@linux.intel.com +Cc: michael.thayer@oracle.com +Cc: knut.osmundsen@oracle.com +Cc: frank.mehnert@oracle.com +Cc: Borislav Petkov +Cc: stable@vger.kernel.org +Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1610282114380.5053@nanos +Signed-off-by: Thomas Gleixner +--- + arch/x86/kernel/setup.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c +index bbfbca5..9c337b0 100644 +--- a/arch/x86/kernel/setup.c ++++ b/arch/x86/kernel/setup.c +@@ -1222,11 +1222,16 @@ void __init setup_arch(char **cmdline_p) + if (smp_found_config) + get_smp_config(); + ++ /* ++ * Systems w/o ACPI and mptables might not have it mapped the local ++ * APIC yet, but prefill_possible_map() might need to access it. ++ */ ++ init_apic_mappings(); ++ + prefill_possible_map(); + + init_cpu_to_node(); + +- init_apic_mappings(); + io_apic_init_mappings(); + + kvm_guest_init(); diff --git a/kernel/kernel/pspec.xml b/kernel/kernel/pspec.xml index 55a7b2e9..e505d91d 100644 --- a/kernel/kernel/pspec.xml +++ b/kernel/kernel/pspec.xml @@ -28,89 +28,9 @@ - patches/linux/patch-4.8.5.xz - + patches/linux/patch-4.8.6.xz + - patches/mageia/stable-drm-vc4-fix-races-when-the-cs-reads-from-render-targets.patch - patches/mageia/stable-drm-prime-pass-the-right-module-owner-through-to-dma_buf_export.patch - patches/mageia/stable-drm-i915-backlight-setup-and-cache-pwm-alternate-increment-value.patch - patches/mageia/stable-drm-i915-backlight-setup-backlight-pwm-alternate-increment-on-backlight-enable.patch - patches/mageia/stable-drm-amdgpu-fix-ib-alignment-for-uvd.patch - patches/mageia/stable-drm-amdgpu-dce10-disable-hpd-on-local-panels.patch - patches/mageia/stable-drm-amdgpu-dce8-disable-hpd-on-local-panels.patch - patches/mageia/stable-drm-amdgpu-dce11-disable-hpd-on-local-panels.patch - patches/mageia/stable-drm-amdgpu-dce11-add-missing-drm_mode_config_cleanup-call.patch - patches/mageia/stable-drm-amdgpu-initialize-the-context-reset_counter-in-amdgpu_ctx_init.patch - patches/mageia/stable-drm-amdgpu-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch - patches/mageia/stable-drm-radeon-narrow-asic_init-for-virtualization.patch - patches/mageia/stable-drm-radeon-si-dpm-fix-phase-shedding-setup.patch - patches/mageia/stable-drm-radeon-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch - patches/mageia/stable-drm-vmwgfx-limit-the-user-space-command-buffer-size.patch - patches/mageia/stable-drm-fsl-dcu-fix-endian-issue-when-using-clk_register_divider.patch - patches/mageia/stable-drm-amd-powerplay-fix-mclk-not-switching-back-after-multi-head-was-disabled.patch - patches/mageia/stable-hid-add-quirk-for-akai-midimix.patch - patches/mageia/stable-drm-i915-skl-update-plane-watermarks-atomically-during-plane-updates.patch - patches/mageia/stable-drm-i915-move-crtc-updating-in-atomic_commit-into-it-s-own-hook.patch - patches/mageia/stable-drm-i915-skl-update-ddb-values-atomically-with-wms-plane-attrs.patch - patches/mageia/stable-drm-i915-skl-don-t-try-to-update-plane-watermarks-if-they-haven-t-changed.patch - patches/mageia/stable-drm-i915-gen9-only-add-the-planes-actually-affected-by-ddb-changes.patch - patches/mageia/stable-drm-i915-gen9-fix-the-wawmmemoryreadlatency-implementation.patch - patches/mageia/stable-drm-i915-gen9-minimum-scanlines-for-y-tile-is-not-always-4.patch - patches/mageia/stable-drm-i915-gen9-fix-plane_blocks_per_line-on-watermarks-calculations.patch - patches/mageia/stable-drm-i915-gen9-fix-the-watermark-res_blocks-value.patch - patches/mageia/stable-drm-i915-sagv-is-not-skl-only-so-rename-a-few-things.patch - patches/mageia/stable-drm-i915-introduce-intel_has_sagv.patch - patches/mageia/stable-drm-i915-kbl-kbl-also-needs-to-run-the-sagv-code.patch - patches/mageia/stable-revert-drm-i915-check-live-status-before-reading-edid.patch - patches/mageia/stable-drm-i915-account-for-tseg-size-when-determining-865g-stolen-base.patch - patches/mageia/stable-drm-i915-skl-ensure-pipes-with-changed-wms-get-added-to-the-state.patch - patches/mageia/stable-drm-i915-allow-pch-dpll-sharing-regardless-of-dpll_sdvo_high_speed.patch - patches/mageia/stable-drm-i915-move-long-hpd-handling-into-the-hotplug-work.patch - patches/mageia/stable-drm-i915-allow-dp-to-work-w-o-edid.patch - patches/mageia/stable-drm-i915-just-clear-the-mmiodebug-before-a-register-access.patch - patches/mageia/stable-drm-i915-unalias-obj-phys_handle-and-obj-userptr.patch - patches/mageia/stable-posix_acl-clear-sgid-bit-when-setting-file-permissions.patch - patches/mageia/stable-rt2x00usb-fix-error-return-code.patch - patches/mageia/stable-scsi-cxlflash-remove-the-device-cleanly-in-the-system-shutdown-path.patch - patches/mageia/stable-genirq-generic_chip-add-irq_unmap-callback.patch - patches/mageia/stable-coresight-remove-erroneous-dma_free_coherent-in-tmc_probe.patch - patches/mageia/stable-uio-fix-dmem_region_start-computation.patch - patches/mageia/stable-arm-clk-imx35-fix-name-for-ckil-clk.patch - patches/mageia/stable-spi-spi-fsl-dspi-drop-extra-spi_master_put-in-device-remove-function.patch - patches/mageia/stable-i40e-remove-a-stray-unlock.patch - patches/mageia/stable-i40e-fix-broken-i40e_config_rss_aq-function.patch - patches/mageia/stable-mwifiex-correct-aid-value-during-tdls-setup.patch - patches/mageia/stable-mwifiex-fix-failed-to-reconnect-after-interface-disabled-enabled.patch - patches/mageia/stable-ath10k-add-wmi_service_periodic_chan_stat_support-wmi-service.patch - patches/mageia/stable-ath10k-fix-sending-frame-in-management-path-in-push-txq-logic.patch - patches/mageia/stable-ath10k-fix-reporting-channel-survey-data.patch - patches/mageia/stable-ath10k-fix-throughput-regression-in-multi-client-mode.patch - patches/mageia/stable-crypto-marvell-don-t-overwrite-default-creq-state-during-initialization.patch - patches/mageia/stable-crypto-gcm-fix-iv-buffer-size-in-crypto_gcm_setkey.patch - patches/mageia/stable-crypto-marvell-update-transformation-context-for-each-dequeued-req.patch - patches/mageia/stable-crypto-arm-ghash-ce-add-missing-async-import-export.patch - patches/mageia/stable-crypto-ccp-fix-return-value-check-in-ccp_dmaengine_register.patch - patches/mageia/stable-hwrng-omap-only-fail-if-pm_runtime_get_sync-returns-0.patch - patches/mageia/stable-asoc-topology-fix-error-return-code-in-soc_tplg_dapm_widget_create.patch - patches/mageia/stable-asoc-dapm-fix-possible-uninitialized-variable-in-snd_soc_dapm_get_volsw.patch - patches/mageia/stable-asoc-dapm-fix-value-setting-for-_enum_double-mux-s-second-channel.patch - patches/mageia/stable-asoc-dapm-fix-kcontrol-creation-for-output-driver-widget.patch - patches/mageia/stable-asoc-sst-bxt-rt298-fix-obsoleted-initializers-for-array.patch - patches/mageia/stable-asoc-sst-bxt-da7219_max98357a-fix-obsoleted-initializers-for-array.patch - patches/mageia/stable-iio-ad5755-fix-off-by-one-on-devnr-limit-check.patch - patches/mageia/stable-iio-light-us5182d-add-missing-error-code-assignment-before-test.patch - patches/mageia/stable-staging-android-ion-hisi-fix-dependencies.patch - patches/mageia/stable-staging-sm750fb-correctly-set-clock_phase-bit-of-display-controller.patch - patches/mageia/stable-staging-r8188eu-fix-scheduling-while-atomic-splat.patch - patches/mageia/stable-staging-ks7010-fix-wait_for_completion_interruptible_timeout-return-handling.patch - patches/mageia/stable-staging-ks7010-declare-private-functions-static.patch - patches/mageia/stable-ib-hfi1-move-iowait_init-to-priv-allocate.patch - patches/mageia/stable-ib-rdmavt-correct-sparse-annotation.patch - patches/mageia/stable-ib-qib-remove-qpt_mask-global.patch - patches/mageia/stable-ib-mlx5-fix-steering-resource-leak.patch - patches/mageia/stable-power-bq24257-fix-use-of-uninitialized-pointer-bq-charger.patch - patches/mageia/stable-dmaengine-ipu-remove-bogus-no_irq-reference.patch - patches/mageia/stable-mm-hugetlb-check-for-reserved-hugepages-during-memory-offline.patch patches/mageia/Revert-ipmi-Start-the-timer-and-thread-on-internal-m.patch patches/mageia/x86-pci-toshiba-equium-a60-assign-busses.patch @@ -118,6 +38,7 @@ patches/mageia/x86-default_poweroff_up_machines.patch patches/mageia/x86-increase-default-minimum-vmalloc-area-by-64MB-to-192MB.patch patches/mageia/Revert-cpufreq-pcc-Enable-autoload-of-pcc-cpufreq-fo.patch + patches/mageia/x86-smpboot-Init-apic-mapping-before-usage.patch patches/mageia/Revert-x86-mm-mtrr-Remove-kernel-internal-MTRR-inter.patch patches/mageia/base-cacheinfo-silence-DT-warnings.patch patches/mageia/kernel-governor-cpupower-Correct-return-type-of-cpu_power_is_cpu_onl.patch @@ -142,10 +63,10 @@ patches/mageia/linux-BFQ-v8r4.patch patches/mageia/nvmepatch1-V4.patch patches/mageia/nvmepatch2-V4.patch - patches/mageia/nvmepatch3-V4.patch - patches/mageia/fs-aufs-4.7.patch - patches/mageia/fs-aufs-4.7-modular.patch - patches/mageia/fs-aufs-4.7-ver-fix.patch + patches/mageia/nvmepatch3-V4.patch + patches/mageia/dm-raid-fix-compat_features-validation.patch + patches/mageia/fs-aufs-4.8.patch + patches/mageia/fs-aufs-4.8-modular.patch patches/mageia/firewire-ieee1394-module-aliases.patch patches/mageia/char-agp-intel-new-Q57-id.patch @@ -166,7 +87,7 @@ patches/mageia/gpu-drm-mach64-linux-3.14-buildfix.patch patches/mageia/gpu-drm-mach64-3.17-buildfix.patch patches/mageia/gpu-drm-mach64-3.18-buildfix.patch - patches/mageia/drm-i915-gen9-fix-DDB-partitioning-for-multi-screen-cases.patch + patches/mageia/gpu-drm-i915-gen9-fix-DDB-partitioning-for-multi-screen-cases.patch patches/mageia/input-i8042-quirks-for-Fujitsu-Lifebook-A544-and-Lif.patch patches/mageia/net-sis190-fix-list-usage.patch patches/mageia/net-netfilter-IFWLOG.patch @@ -275,8 +196,8 @@ - 2016-10-30 - 4.8.5 + 2016-11-01 + 4.8.6 Version Bump. security