]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Sep 2019 18:28:23 +0000 (20:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Sep 2019 18:28:23 +0000 (20:28 +0200)
added patches:
nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch

queue-4.14/nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch b/queue-4.14/nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch
new file mode 100644 (file)
index 0000000..74bde3f
--- /dev/null
@@ -0,0 +1,51 @@
+From e70d8b287301eb6d7c7761c6171c56af62110ea3 Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Sun, 28 Jul 2019 18:42:55 +0200
+Subject: nvmem: Use the same permissions for eeprom as for nvmem
+
+From: Jean Delvare <jdelvare@suse.de>
+
+commit e70d8b287301eb6d7c7761c6171c56af62110ea3 upstream.
+
+The compatibility "eeprom" attribute is currently root-only no
+matter what the configuration says. The "nvmem" attribute does
+respect the setting of the root_only configuration bit, so do the
+same for "eeprom".
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Fixes: b6c217ab9be6 ("nvmem: Add backwards compatibility support for older EEPROM drivers.")
+Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
+Cc: Andrew Lunn <andrew@lunn.ch>
+Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Cc: Arnd Bergmann <arnd@arndb.de>
+Link: https://lore.kernel.org/r/20190728184255.563332e6@endymion
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/nvmem/core.c |   15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -407,10 +407,17 @@ static int nvmem_setup_compat(struct nvm
+       if (!config->base_dev)
+               return -EINVAL;
+-      if (nvmem->read_only)
+-              nvmem->eeprom = bin_attr_ro_root_nvmem;
+-      else
+-              nvmem->eeprom = bin_attr_rw_root_nvmem;
++      if (nvmem->read_only) {
++              if (config->root_only)
++                      nvmem->eeprom = bin_attr_ro_root_nvmem;
++              else
++                      nvmem->eeprom = bin_attr_ro_nvmem;
++      } else {
++              if (config->root_only)
++                      nvmem->eeprom = bin_attr_rw_root_nvmem;
++              else
++                      nvmem->eeprom = bin_attr_rw_nvmem;
++      }
+       nvmem->eeprom.attr.name = "eeprom";
+       nvmem->eeprom.size = nvmem->size;
+ #ifdef CONFIG_DEBUG_LOCK_ALLOC
index ffc835a009dbf0e0d7f7cbe07762b98638993436..41d6c2930dbcd986388dfb470d627719c22ff8b3 100644 (file)
@@ -41,3 +41,4 @@ firmware-ti_sci-always-request-response-from-firmware.patch
 drm-mediatek-mtk_drm_drv.c-add-of_node_put-before-goto.patch
 revert-bluetooth-btusb-driver-to-enable-the-usb-wakeup-feature.patch
 platform-x86-pmc_atom-add-cb4063-beckhoff-automation-board-to-critclk_systems-dmi-table.patch
+nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch