]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 19 Sep 2015 15:56:34 +0000 (08:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 19 Sep 2015 15:56:34 +0000 (08:56 -0700)
added patches:
drivercore-fix-unregistration-path-of-platform-devices.patch
hpfs-update-ctime-and-mtime-on-directory-modification.patch

queue-3.14/drivercore-fix-unregistration-path-of-platform-devices.patch [new file with mode: 0644]
queue-3.14/hpfs-update-ctime-and-mtime-on-directory-modification.patch [new file with mode: 0644]
queue-3.14/series

diff --git a/queue-3.14/drivercore-fix-unregistration-path-of-platform-devices.patch b/queue-3.14/drivercore-fix-unregistration-path-of-platform-devices.patch
new file mode 100644 (file)
index 0000000..c065471
--- /dev/null
@@ -0,0 +1,67 @@
+From 7f5dcaf1fdf289767a126a0a5cc3ef39b5254b06 Mon Sep 17 00:00:00 2001
+From: Grant Likely <grant.likely@linaro.org>
+Date: Sun, 7 Jun 2015 15:20:11 +0100
+Subject: drivercore: Fix unregistration path of platform devices
+
+From: Grant Likely <grant.likely@linaro.org>
+
+commit 7f5dcaf1fdf289767a126a0a5cc3ef39b5254b06 upstream.
+
+The unregister path of platform_device is broken. On registration, it
+will register all resources with either a parent already set, or
+type==IORESOURCE_{IO,MEM}. However, on unregister it will release
+everything with type==IORESOURCE_{IO,MEM}, but ignore the others. There
+are also cases where resources don't get registered in the first place,
+like with devices created by of_platform_populate()*.
+
+Fix the unregister path to be symmetrical with the register path by
+checking the parent pointer instead of the type field to decide which
+resources to unregister. This is safe because the upshot of the
+registration path algorithm is that registered resources have a parent
+pointer, and non-registered resources do not.
+
+* It can be argued that of_platform_populate() should be registering
+  it's resources, and they argument has some merit. However, there are
+  quite a few platforms that end up broken if we try to do that due to
+  overlapping resources in the device tree. Until that is fixed, we need
+  to solve the immediate problem.
+
+Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
+Cc: Wolfram Sang <wsa@the-dreams.de>
+Cc: Rob Herring <robh@kernel.org>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+Signed-off-by: Grant Likely <grant.likely@linaro.org>
+Tested-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Signed-off-by: Rob Herring <robh@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/base/platform.c |    8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+--- a/drivers/base/platform.c
++++ b/drivers/base/platform.c
+@@ -354,9 +354,7 @@ int platform_device_add(struct platform_
+       while (--i >= 0) {
+               struct resource *r = &pdev->resource[i];
+-              unsigned long type = resource_type(r);
+-
+-              if (type == IORESOURCE_MEM || type == IORESOURCE_IO)
++              if (r->parent)
+                       release_resource(r);
+       }
+@@ -387,9 +385,7 @@ void platform_device_del(struct platform
+               for (i = 0; i < pdev->num_resources; i++) {
+                       struct resource *r = &pdev->resource[i];
+-                      unsigned long type = resource_type(r);
+-
+-                      if (type == IORESOURCE_MEM || type == IORESOURCE_IO)
++                      if (r->parent)
+                               release_resource(r);
+               }
+       }
diff --git a/queue-3.14/hpfs-update-ctime-and-mtime-on-directory-modification.patch b/queue-3.14/hpfs-update-ctime-and-mtime-on-directory-modification.patch
new file mode 100644 (file)
index 0000000..3c4c677
--- /dev/null
@@ -0,0 +1,110 @@
+From f49a26e7718dd30b49e3541e3e25aecf5e7294e2 Mon Sep 17 00:00:00 2001
+From: Mikulas Patocka <mikulas@twibright.com>
+Date: Wed, 2 Sep 2015 22:51:53 +0200
+Subject: hpfs: update ctime and mtime on directory modification
+
+From: Mikulas Patocka <mikulas@twibright.com>
+
+commit f49a26e7718dd30b49e3541e3e25aecf5e7294e2 upstream.
+
+Update ctime and mtime when a directory is modified. (though OS/2 doesn't
+update them anyway)
+
+Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/hpfs/namei.c |   25 ++++++++++++++++++++++++-
+ 1 file changed, 24 insertions(+), 1 deletion(-)
+
+--- a/fs/hpfs/namei.c
++++ b/fs/hpfs/namei.c
+@@ -8,6 +8,17 @@
+ #include <linux/sched.h>
+ #include "hpfs_fn.h"
++static void hpfs_update_directory_times(struct inode *dir)
++{
++      time_t t = get_seconds();
++      if (t == dir->i_mtime.tv_sec &&
++          t == dir->i_ctime.tv_sec)
++              return;
++      dir->i_mtime.tv_sec = dir->i_ctime.tv_sec = t;
++      dir->i_mtime.tv_nsec = dir->i_ctime.tv_nsec = 0;
++      hpfs_write_inode_nolock(dir);
++}
++
+ static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
+ {
+       const unsigned char *name = dentry->d_name.name;
+@@ -99,6 +110,7 @@ static int hpfs_mkdir(struct inode *dir,
+               result->i_mode = mode | S_IFDIR;
+               hpfs_write_inode_nolock(result);
+       }
++      hpfs_update_directory_times(dir);
+       d_instantiate(dentry, result);
+       hpfs_unlock(dir->i_sb);
+       return 0;
+@@ -187,6 +199,7 @@ static int hpfs_create(struct inode *dir
+               result->i_mode = mode | S_IFREG;
+               hpfs_write_inode_nolock(result);
+       }
++      hpfs_update_directory_times(dir);
+       d_instantiate(dentry, result);
+       hpfs_unlock(dir->i_sb);
+       return 0;
+@@ -262,6 +275,7 @@ static int hpfs_mknod(struct inode *dir,
+       insert_inode_hash(result);
+       hpfs_write_inode_nolock(result);
++      hpfs_update_directory_times(dir);
+       d_instantiate(dentry, result);
+       brelse(bh);
+       hpfs_unlock(dir->i_sb);
+@@ -340,6 +354,7 @@ static int hpfs_symlink(struct inode *di
+       insert_inode_hash(result);
+       hpfs_write_inode_nolock(result);
++      hpfs_update_directory_times(dir);
+       d_instantiate(dentry, result);
+       hpfs_unlock(dir->i_sb);
+       return 0;
+@@ -423,6 +438,8 @@ again:
+ out1:
+       hpfs_brelse4(&qbh);
+ out:
++      if (!err)
++              hpfs_update_directory_times(dir);
+       hpfs_unlock(dir->i_sb);
+       return err;
+ }
+@@ -477,6 +494,8 @@ static int hpfs_rmdir(struct inode *dir,
+ out1:
+       hpfs_brelse4(&qbh);
+ out:
++      if (!err)
++              hpfs_update_directory_times(dir);
+       hpfs_unlock(dir->i_sb);
+       return err;
+ }
+@@ -595,7 +614,7 @@ static int hpfs_rename(struct inode *old
+               goto end1;
+       }
+-      end:
++end:
+       hpfs_i(i)->i_parent_dir = new_dir->i_ino;
+       if (S_ISDIR(i->i_mode)) {
+               inc_nlink(new_dir);
+@@ -610,6 +629,10 @@ static int hpfs_rename(struct inode *old
+               brelse(bh);
+       }
+ end1:
++      if (!err) {
++              hpfs_update_directory_times(old_dir);
++              hpfs_update_directory_times(new_dir);
++      }
+       hpfs_unlock(i->i_sb);
+       return err;
+ }
index 976cf23b21ac3605dde1038a20fc223c9742e0f2..cffa3d16c2337957b8bfd504a1bc7558dab04a4d 100644 (file)
@@ -25,3 +25,5 @@ doc-abi-testing-configfs-usb-gadget-sourcesink.patch
 auxdisplay-ks0108-fix-refcount.patch
 of-address-don-t-loop-forever-in-of_find_matching_node_by_address.patch
 arm-omap2-dra7-clockdomain-change-l4per2_7xx_clkdm-to-sw_wkup.patch
+drivercore-fix-unregistration-path-of-platform-devices.patch
+hpfs-update-ctime-and-mtime-on-directory-modification.patch