Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-06-10 12:55:00 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-06-10 12:56:08 +0200
commit842fa5c056cc0d9b4ea8162e630cb474c043e395 (patch)
tree0d7ea9b5c11b7092ee7241afe5fc2c09d51cb0ef
parent3717d57427f3c9a43cc4b610611b0ac0ef6c8be2 (diff)
treewide: Use DEVICE_ATTR_WO (bsc#1137739).
- Refresh patches.arch/s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan.
-rw-r--r--patches.arch/s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan27
-rw-r--r--patches.drivers/treewide-Use-DEVICE_ATTR_WO.patch125
-rw-r--r--series.conf1
3 files changed, 143 insertions, 10 deletions
diff --git a/patches.arch/s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan b/patches.arch/s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan
index 47f559027e..9e3308d697 100644
--- a/patches.arch/s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan
+++ b/patches.arch/s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan
@@ -1,9 +1,11 @@
+From b7cb707c373094ce4008d4a6ac9b6b366ec52da5 Mon Sep 17 00:00:00 2001
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Date: Wed, 9 Jan 2019 13:00:03 +0100
-Subject: s390/smp: fix CPU hotplug deadlock with CPU rescan
-Git-commit: b7cb707c373094ce4008d4a6ac9b6b366ec52da5
-Patch-mainline: v5.0 or v5.0-rc3 (next release)
+Subject: [PATCH] s390/smp: fix CPU hotplug deadlock with CPU rescan
+
References: git-fixes
+Patch-mainline: v5.0-rc4
+Git-commit: b7cb707c373094ce4008d4a6ac9b6b366ec52da5
smp_rescan_cpus() is called without the device_hotplug_lock, which can lead
to a dedlock when a new CPU is found and immediately set online by a udev
@@ -47,17 +49,17 @@ Fix this by taking the device_hotplug_lock in the CPU rescan path.
Cc: <stable@vger.kernel.org>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-[ ptesarik: Context adjusted, because SLE15 does not contain upstream
- commit 6cbaefb4bf2ce6746e49c972289702133b347ffa. ]
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
- arch/s390/kernel/smp.c | 4 ++++
- drivers/s390/char/sclp_config.c | 2 ++
+ arch/s390/kernel/smp.c | 4 ++++
+ drivers/s390/char/sclp_config.c | 2 ++
2 files changed, 6 insertions(+)
+diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
+index f82b3d3c36e2..307a1c86ea21 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
-@@ -1163,7 +1163,11 @@ static ssize_t __ref rescan_store(struct
+@@ -1166,7 +1166,11 @@ static ssize_t __ref rescan_store(struct device *dev,
{
int rc;
@@ -68,10 +70,12 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
+ unlock_device_hotplug();
return rc ? rc : count;
}
- static DEVICE_ATTR(rescan, 0200, NULL, rescan_store);
+ static DEVICE_ATTR_WO(rescan);
+diff --git a/drivers/s390/char/sclp_config.c b/drivers/s390/char/sclp_config.c
+index 194ffd5c8580..039b2074db7e 100644
--- a/drivers/s390/char/sclp_config.c
+++ b/drivers/s390/char/sclp_config.c
-@@ -59,7 +59,9 @@ static void sclp_cpu_capability_notify(s
+@@ -60,7 +60,9 @@ static void sclp_cpu_capability_notify(struct work_struct *work)
static void __ref sclp_cpu_change_notify(struct work_struct *work)
{
@@ -81,3 +85,6 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
}
static void sclp_conf_receiver_fn(struct evbuf_header *evbuf)
+--
+2.20.1
+
diff --git a/patches.drivers/treewide-Use-DEVICE_ATTR_WO.patch b/patches.drivers/treewide-Use-DEVICE_ATTR_WO.patch
new file mode 100644
index 0000000000..ba6a7cc995
--- /dev/null
+++ b/patches.drivers/treewide-Use-DEVICE_ATTR_WO.patch
@@ -0,0 +1,125 @@
+From 6cbaefb4bf2ce6746e49c972289702133b347ffa Mon Sep 17 00:00:00 2001
+From: Joe Perches <joe@perches.com>
+Date: Tue, 19 Dec 2017 10:15:09 -0800
+Subject: [PATCH] treewide: Use DEVICE_ATTR_WO
+
+References: bsc#1137739
+Patch-mainline: v4.16-rc1
+Git-commit: 6cbaefb4bf2ce6746e49c972289702133b347ffa
+
+Convert DEVICE_ATTR uses to DEVICE_ATTR_WO where possible.
+
+Done with perl script:
+
+$ git grep -w --name-only DEVICE_ATTR | \
+ xargs perl -i -e 'local $/; while (<>) { s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(?:\s*S_IWUSR\s*|\s*0200\s*)\)?\s*,\s*NULL\s*,\s*\s_store\s*\)/DEVICE_ATTR_WO(\1)/g; print;}'
+
+Signed-off-by: Joe Perches <joe@perches.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/s390/kernel/smp.c | 2 +-
+ arch/x86/kernel/cpu/microcode/core.c | 2 +-
+ drivers/input/touchscreen/elants_i2c.c | 2 +-
+ drivers/net/ethernet/ibm/ibmvnic.c | 2 +-
+ drivers/net/wimax/i2400m/sysfs.c | 3 +--
+ drivers/scsi/lpfc/lpfc_attr.c | 3 +--
+ drivers/thermal/thermal_sysfs.c | 2 +-
+ 7 files changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
+index b8c1a85bcf2d..a919b2f0141d 100644
+--- a/arch/s390/kernel/smp.c
++++ b/arch/s390/kernel/smp.c
+@@ -1151,7 +1151,7 @@ static ssize_t __ref rescan_store(struct device *dev,
+ rc = smp_rescan_cpus();
+ return rc ? rc : count;
+ }
+-static DEVICE_ATTR(rescan, 0200, NULL, rescan_store);
++static DEVICE_ATTR_WO(rescan);
+ #endif /* CONFIG_HOTPLUG_CPU */
+
+ static int __init s390_smp_init(void)
+diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
+index c4fa4a85d4cb..09c74b0560dd 100644
+--- a/arch/x86/kernel/cpu/microcode/core.c
++++ b/arch/x86/kernel/cpu/microcode/core.c
+@@ -560,7 +560,7 @@ static ssize_t pf_show(struct device *dev,
+ return sprintf(buf, "0x%x\n", uci->cpu_sig.pf);
+ }
+
+-static DEVICE_ATTR(reload, 0200, NULL, reload_store);
++static DEVICE_ATTR_WO(reload);
+ static DEVICE_ATTR(version, 0400, version_show, NULL);
+ static DEVICE_ATTR(processor_flags, 0400, pf_show, NULL);
+
+diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
+index e102d7764bc2..98613910d756 100644
+--- a/drivers/input/touchscreen/elants_i2c.c
++++ b/drivers/input/touchscreen/elants_i2c.c
+@@ -999,7 +999,7 @@ static ssize_t show_iap_mode(struct device *dev,
+ "Normal" : "Recovery");
+ }
+
+-static DEVICE_ATTR(calibrate, S_IWUSR, NULL, calibrate_store);
++static DEVICE_ATTR_WO(calibrate);
+ static DEVICE_ATTR(iap_mode, S_IRUGO, show_iap_mode, NULL);
+ static DEVICE_ATTR(update_fw, S_IWUSR, NULL, write_update_fw);
+
+diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
+index 1dc4aef37d3a..42b96e1a1b13 100644
+--- a/drivers/net/ethernet/ibm/ibmvnic.c
++++ b/drivers/net/ethernet/ibm/ibmvnic.c
+@@ -4411,7 +4411,7 @@ static ssize_t failover_store(struct device *dev, struct device_attribute *attr,
+ return count;
+ }
+
+-static DEVICE_ATTR(failover, 0200, NULL, failover_store);
++static DEVICE_ATTR_WO(failover);
+
+ static unsigned long ibmvnic_get_desired_dma(struct vio_dev *vdev)
+ {
+diff --git a/drivers/net/wimax/i2400m/sysfs.c b/drivers/net/wimax/i2400m/sysfs.c
+index 1237109f251a..8c67df11105c 100644
+--- a/drivers/net/wimax/i2400m/sysfs.c
++++ b/drivers/net/wimax/i2400m/sysfs.c
+@@ -65,8 +65,7 @@ error_bad_value:
+ }
+
+ static
+-DEVICE_ATTR(i2400m_idle_timeout, S_IWUSR,
+- NULL, i2400m_idle_timeout_store);
++DEVICE_ATTR_WO(i2400m_idle_timeout);
+
+ static
+ struct attribute *i2400m_dev_attrs[] = {
+diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
+index ea8d382bc2eb..a28618c3eb63 100644
+--- a/drivers/scsi/lpfc/lpfc_attr.c
++++ b/drivers/scsi/lpfc/lpfc_attr.c
+@@ -2384,8 +2384,7 @@ lpfc_soft_wwn_enable_store(struct device *dev, struct device_attribute *attr,
+
+ return count;
+ }
+-static DEVICE_ATTR(lpfc_soft_wwn_enable, S_IWUSR, NULL,
+- lpfc_soft_wwn_enable_store);
++static DEVICE_ATTR_WO(lpfc_soft_wwn_enable);
+
+ /**
+ * lpfc_soft_wwpn_show - Return the cfg soft ww port name of the adapter
+diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
+index 2bc964392924..ba81c9080f6e 100644
+--- a/drivers/thermal/thermal_sysfs.c
++++ b/drivers/thermal/thermal_sysfs.c
+@@ -317,7 +317,7 @@ emul_temp_store(struct device *dev, struct device_attribute *attr,
+
+ return ret ? ret : count;
+ }
+-static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store);
++static DEVICE_ATTR_WO(emul_temp);
+ #endif
+
+ static ssize_t
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 4f6067a1cf..9cb1a92ce6 100644
--- a/series.conf
+++ b/series.conf
@@ -12680,6 +12680,7 @@
patches.fixes/firmware-provide-helpers-for-registering-the-syfs-lo.patch
patches.fixes/firmware-fix-detecting-error-on-register_reboot_noti.patch
patches.drivers/test_firmware-fix-setting-old-custom-fw-path-back-on
+ patches.drivers/treewide-Use-DEVICE_ATTR_WO.patch
patches.drivers/test_firmware-fix-missing-unlock-on-error-in-config_
patches.drivers/device-property-Define-type-of-PROPERTY_ENRTY_-macro.patch
patches.suse/dev-mem-Add-bounce-buffer-for-copy-out.patch