Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-03 14:01:48 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-03 14:01:48 +0200
commit6e7841b930f100ee638c8e341358f5ae64106681 (patch)
tree8a3d108ead667c9fbf00d39983033ad293e62f38
parente2a50948b882d11691c918dfc102575df01b3f4b (diff)
parent99bec9897614c7a370baccb785637d21448313ae (diff)
Merge branch 'users/ykaukab/SLE15/for-next' into SLE15
Pull ipmi fixes from Mian Yousaf Kaukab
-rw-r--r--patches.drivers/0001-i2c-Make-i2c_unregister_device-NULL-aware.patch43
-rw-r--r--patches.drivers/0002-ipmi_ssif-Remove-duplicate-NULL-check.patch37
-rw-r--r--patches.drivers/0003-ipmi-Fix-I2C-client-removal-in-the-SSIF-driver.patch126
-rw-r--r--series.conf3
4 files changed, 209 insertions, 0 deletions
diff --git a/patches.drivers/0001-i2c-Make-i2c_unregister_device-NULL-aware.patch b/patches.drivers/0001-i2c-Make-i2c_unregister_device-NULL-aware.patch
new file mode 100644
index 0000000000..0f5a6b74cb
--- /dev/null
+++ b/patches.drivers/0001-i2c-Make-i2c_unregister_device-NULL-aware.patch
@@ -0,0 +1,43 @@
+From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Date: Tue, 31 Oct 2017 16:21:35 +0200
+Subject: i2c: Make i2c_unregister_device() NULL-aware
+
+Git-commit: 7b43dd19c9b13a3f5478b9d88a49a5495399ad29
+Patch-mainline: v4.15-rc1
+References: bsc#1108193
+
+It's a common pattern to be NULL-aware when freeing resources.
+
+Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ drivers/i2c/i2c-core.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
+index 7b08f3446bfc..706164b4c5be 100644
+--- a/drivers/i2c/i2c-core.c
++++ b/drivers/i2c/i2c-core.c
+@@ -819,6 +819,8 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
+ */
+ void i2c_unregister_device(struct i2c_client *client)
+ {
++ if (!client)
++ return;
+ if (client->dev.of_node)
+ of_node_clear_flag(client->dev.of_node, OF_POPULATED);
+ if (ACPI_COMPANION(&client->dev))
+@@ -1436,8 +1438,7 @@ static int __unregister_client(struct device *dev, void *dummy)
+ static int __unregister_dummy(struct device *dev, void *dummy)
+ {
+ struct i2c_client *client = i2c_verify_client(dev);
+- if (client)
+- i2c_unregister_device(client);
++ i2c_unregister_device(client);
+ return 0;
+ }
+
+--
+2.11.0
+
diff --git a/patches.drivers/0002-ipmi_ssif-Remove-duplicate-NULL-check.patch b/patches.drivers/0002-ipmi_ssif-Remove-duplicate-NULL-check.patch
new file mode 100644
index 0000000000..65bd6b49f3
--- /dev/null
+++ b/patches.drivers/0002-ipmi_ssif-Remove-duplicate-NULL-check.patch
@@ -0,0 +1,37 @@
+From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Date: Tue, 31 Oct 2017 16:21:38 +0200
+Subject: ipmi_ssif: Remove duplicate NULL check
+
+Git-commit: e45af3d372f1d4339663dcbef28665f5b15d448c
+Patch-mainline: v4.16-rc1
+References: bsc#1108193
+
+Since i2c_unregister_device() became NULL-aware we may remove duplicate
+NULL check.
+
+Cc: Corey Minyard <minyard@acm.org>
+Cc: openipmi-developer@lists.sourceforge.net
+Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Corey Minyard <cminyard@mvista.com>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ drivers/char/ipmi/ipmi_ssif.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
+index 3cfaec728604..f929e72bdac8 100644
+--- a/drivers/char/ipmi/ipmi_ssif.c
++++ b/drivers/char/ipmi/ipmi_ssif.c
+@@ -2071,8 +2071,7 @@ static int ssif_platform_remove(struct platform_device *dev)
+ return 0;
+
+ mutex_lock(&ssif_infos_mutex);
+- if (addr_info->client)
+- i2c_unregister_device(addr_info->client);
++ i2c_unregister_device(addr_info->client);
+
+ list_del(&addr_info->link);
+ kfree(addr_info);
+--
+2.11.0
+
diff --git a/patches.drivers/0003-ipmi-Fix-I2C-client-removal-in-the-SSIF-driver.patch b/patches.drivers/0003-ipmi-Fix-I2C-client-removal-in-the-SSIF-driver.patch
new file mode 100644
index 0000000000..faf8ce60f9
--- /dev/null
+++ b/patches.drivers/0003-ipmi-Fix-I2C-client-removal-in-the-SSIF-driver.patch
@@ -0,0 +1,126 @@
+From: Corey Minyard <cminyard@mvista.com>
+Date: Thu, 30 Aug 2018 13:06:21 -0500
+Subject: ipmi: Fix I2C client removal in the SSIF driver
+
+Git-commit: 0745dde62835be7e2afe62fcdb482fcad79cb743
+Patch-mainline: v4.19-rc4
+References: bsc#1108193
+
+The SSIF driver was removing any client that came in through the
+platform interface, but it should only remove clients that it
+added. On a failure in the probe function, this could result
+in the following oops when the driver is removed and the
+client gets unregistered twice:
+
+ CPU: 107 PID: 30266 Comm: rmmod Not tainted 4.18.0+ #80
+ Hardware name: Cavium Inc. Saber/Saber, BIOS Cavium reference firmware version 7.0 08/04/2018
+ pstate: 60400009 (nZCv daif +PAN -UAO)
+ pc : kernfs_find_ns+0x28/0x120
+ lr : kernfs_find_and_get_ns+0x40/0x60
+ sp : ffff00002310fb50
+ x29: ffff00002310fb50 x28: ffff800a8240f800
+ x27: 0000000000000000 x26: 0000000000000000
+ x25: 0000000056000000 x24: ffff000009073000
+ x23: ffff000008998b38 x22: 0000000000000000
+ x21: ffff800ed86de820 x20: 0000000000000000
+ x19: ffff00000913a1d8 x18: 0000000000000000
+ x17: 0000000000000000 x16: 0000000000000000
+ x15: 0000000000000000 x14: 5300737265766972
+ x13: 643d4d4554535953 x12: 0000000000000030
+ x11: 0000000000000030 x10: 0101010101010101
+ x9 : ffff800ea06cc3f9 x8 : 0000000000000000
+ x7 : 0000000000000141 x6 : ffff000009073000
+ x5 : ffff800adb706b00 x4 : 0000000000000000
+ x3 : 00000000ffffffff x2 : 0000000000000000
+ x1 : ffff000008998b38 x0 : ffff000008356760
+ Process rmmod (pid: 30266, stack limit = 0x00000000e218418d)
+ Call trace:
+ kernfs_find_ns+0x28/0x120
+ kernfs_find_and_get_ns+0x40/0x60
+ sysfs_unmerge_group+0x2c/0x6c
+ dpm_sysfs_remove+0x34/0x70
+ device_del+0x58/0x30c
+ device_unregister+0x30/0x7c
+ i2c_unregister_device+0x84/0x90 [i2c_core]
+ ssif_platform_remove+0x38/0x98 [ipmi_ssif]
+ platform_drv_remove+0x2c/0x6c
+ device_release_driver_internal+0x168/0x1f8
+ driver_detach+0x50/0xbc
+ bus_remove_driver+0x74/0xe8
+ driver_unregister+0x34/0x5c
+ platform_driver_unregister+0x20/0x2c
+ cleanup_ipmi_ssif+0x50/0xd82c [ipmi_ssif]
+ __arm64_sys_delete_module+0x1b4/0x220
+ el0_svc_handler+0x104/0x160
+ el0_svc+0x8/0xc
+ Code: aa1e03e0 aa0203f6 aa0103f7 d503201f (7940e280)
+ ---[ end trace 09f0e34cce8e2d8c ]---
+ Kernel panic - not syncing: Fatal exception
+ SMP: stopping secondary CPUs
+ Kernel Offset: disabled
+ CPU features: 0x23800c38
+
+So track the clients that the SSIF driver adds and only remove
+those.
+
+Reported-by: George Cherian <george.cherian@cavium.com>
+Signed-off-by: Corey Minyard <cminyard@mvista.com>
+Tested-by: George Cherian <george.cherian@cavium.com>
+Cc: <stable@vger.kernel.org> # 4.14.x
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ drivers/char/ipmi/ipmi_ssif.c | 17 ++++++-----------
+ 1 file changed, 6 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
+index c12edc8e91df..265d6a6583bc 100644
+--- a/drivers/char/ipmi/ipmi_ssif.c
++++ b/drivers/char/ipmi/ipmi_ssif.c
+@@ -181,6 +181,8 @@ struct ssif_addr_info {
+ struct device *dev;
+ struct i2c_client *client;
+
++ struct i2c_client *added_client;
++
+ struct mutex clients_mutex;
+ struct list_head clients;
+
+@@ -1641,15 +1643,7 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id)
+
+ out:
+ if (rv) {
+- /*
+- * Note that if addr_info->client is assigned, we
+- * leave it. The i2c client hangs around even if we
+- * return a failure here, and the failure here is not
+- * propagated back to the i2c code. This seems to be
+- * design intent, strange as it may be. But if we
+- * don't leave it, ssif_platform_remove will not remove
+- * the client like it should.
+- */
++ addr_info->client = NULL;
+ dev_err(&client->dev, "Unable to start IPMI SSIF: %d\n", rv);
+ kfree(ssif_info);
+ }
+@@ -1669,7 +1663,8 @@ static int ssif_adapter_handler(struct device *adev, void *opaque)
+ if (adev->type != &i2c_adapter_type)
+ return 0;
+
+- i2c_new_device(to_i2c_adapter(adev), &addr_info->binfo);
++ addr_info->added_client = i2c_new_device(to_i2c_adapter(adev),
++ &addr_info->binfo);
+
+ if (!addr_info->adapter_name)
+ return 1; /* Only try the first I2C adapter by default. */
+@@ -1842,7 +1837,7 @@ static int ssif_platform_remove(struct platform_device *dev)
+ return 0;
+
+ mutex_lock(&ssif_infos_mutex);
+- i2c_unregister_device(addr_info->client);
++ i2c_unregister_device(addr_info->added_client);
+
+ list_del(&addr_info->link);
+ kfree(addr_info);
+--
+2.11.0
+
diff --git a/series.conf b/series.conf
index 1f2def58dd..297acb2892 100644
--- a/series.conf
+++ b/series.conf
@@ -8729,6 +8729,7 @@
patches.drivers/0001-ACPI-APD-Add-clock-frequency-for-ThunderX2-I2C-contr.patch
patches.drivers/0003-i2c-xlp9xx-Get-clock-frequency-with-clk-API.patch
patches.drivers/0004-i2c-xlp9xx-Handle-I2C_M_RECV_LEN-in-msg-flags.patch
+ patches.drivers/0001-i2c-Make-i2c_unregister_device-NULL-aware.patch
patches.drivers/ALSA-line6-add-support-for-POD-HD-DESKTOP
patches.drivers/ALSA-usb-audio-Apply-vendor-ID-matching-for-sample-r
patches.drivers/usb-core-Add-a-helper-function-to-check-the-validity
@@ -12224,6 +12225,7 @@
patches.drivers/power-supply-axp288_charger-Properly-stop-work-on-pr
patches.drivers/ipmi-use-dynamic-memory-for-DMI-driver-override.patch
patches.suse/ipmi-powernv-Fix-error-return-code-in-ipmi_powernv_p.patch
+ patches.drivers/0002-ipmi_ssif-Remove-duplicate-NULL-check.patch
patches.fixes/0001-HID-multitouch-Only-look-at-non-touch-fields-in-firs.patch
patches.drivers/HID-add-quirk-for-another-PIXART-OEM-mouse-used-by-H.patch
patches.fixes/0001-HID-quirks-Fix-keyboard-touchpad-on-Toshiba-Click-Mi.patch
@@ -18899,6 +18901,7 @@
patches.drm/drm-nouveau-TBDdevinit-don-t-fail-when-PMU-PRE_OS-is.patch
patches.drm/drm-nouveau-disp-fix-DP-disable-race.patch
patches.drivers/ipmi-Move-BT-capabilities-detection-to-the-detect-ca.patch
+ patches.drivers/0003-ipmi-Fix-I2C-client-removal-in-the-SSIF-driver.patch
patches.drivers/Revert-PCI-Add-ACS-quirk-for-Intel-300-series
patches.drivers/switchtec-Fix-Spectre-v1-vulnerability.patch
patches.arch/s390-sles15-15-04-crypto-paes-fix.patch