From: Greg Kroah-Hartman Date: Wed, 12 Nov 2014 00:20:17 +0000 (+0900) Subject: 3.14-stable patches X-Git-Tag: v3.10.60~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b1cf0716182438db3786f1a625bce261bef6c702;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: acer-wmi-add-acpi_backlight-video-quirk-for-the-acer-kav80.patch drm-radeon-dpm-disable-ulv-support-on-si.patch drm-radeon-remove-invalid-pci-id.patch drm-vmwgfx-filter-out-modes-those-cannot-be-supported-by-the-current-vram-size.patch i2c-at91-don-t-account-as-iowait.patch pinctrl-baytrail-show-output-gpio-state-correctly-on-intel-baytrail.patch powerpc-use-device_online-offline-instead-of-cpu_up-down.patch rbd-fix-error-recovery-in-rbd_obj_read_sync.patch regulator-max77693-fix-use-of-uninitialized-regulator-config.patch sysfs-driver-core-fix-glue-dir-race-condition-by-gdp_mutex.patch --- diff --git a/queue-3.14/acer-wmi-add-acpi_backlight-video-quirk-for-the-acer-kav80.patch b/queue-3.14/acer-wmi-add-acpi_backlight-video-quirk-for-the-acer-kav80.patch new file mode 100644 index 00000000000..adb3232f6fa --- /dev/null +++ b/queue-3.14/acer-wmi-add-acpi_backlight-video-quirk-for-the-acer-kav80.patch @@ -0,0 +1,47 @@ +From 183fd8fcd7f8afb7ac5ec68f83194872f9fecc84 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 22 Oct 2014 16:06:38 +0200 +Subject: acer-wmi: Add acpi_backlight=video quirk for the Acer KAV80 + +From: Hans de Goede + +commit 183fd8fcd7f8afb7ac5ec68f83194872f9fecc84 upstream. + +The acpi-video backlight interface on the Acer KAV80 is broken, and worse +it causes the entire machine to slow down significantly after a suspend/resume. + +Blacklist it, and use the acer-wmi backlight interface instead. Note that +the KAV80 is somewhat unique in that it is the only Acer model where we +fall back to acer-wmi after blacklisting, rather then using the native +(e.g. intel) backlight driver. This is done because there is no native +backlight interface on this model. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1128309 +Signed-off-by: Hans de Goede +Signed-off-by: Darren Hart +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/platform/x86/acer-wmi.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/platform/x86/acer-wmi.c ++++ b/drivers/platform/x86/acer-wmi.c +@@ -570,6 +570,17 @@ static const struct dmi_system_id video_ + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5750"), + }, + }, ++ { ++ /* ++ * Note no video_set_backlight_video_vendor, we must use the ++ * acer interface, as there is no native backlight interface. ++ */ ++ .ident = "Acer KAV80", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Acer"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "KAV80"), ++ }, ++ }, + {} + }; + diff --git a/queue-3.14/drm-radeon-dpm-disable-ulv-support-on-si.patch b/queue-3.14/drm-radeon-dpm-disable-ulv-support-on-si.patch new file mode 100644 index 00000000000..fbb04c0e1ca --- /dev/null +++ b/queue-3.14/drm-radeon-dpm-disable-ulv-support-on-si.patch @@ -0,0 +1,32 @@ +From 6fa455935ab956248b165f150ec6ae9106210077 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 13 Oct 2014 12:44:49 -0400 +Subject: drm/radeon/dpm: disable ulv support on SI + +From: Alex Deucher + +commit 6fa455935ab956248b165f150ec6ae9106210077 upstream. + +Causes problems on some boards. + +bug: +https://bugs.freedesktop.org/show_bug.cgi?id=82889 + +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/si_dpm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/radeon/si_dpm.c ++++ b/drivers/gpu/drm/radeon/si_dpm.c +@@ -6200,7 +6200,7 @@ static void si_parse_pplib_clock_info(st + if ((rps->class2 & ATOM_PPLIB_CLASSIFICATION2_ULV) && + index == 0) { + /* XXX disable for A0 tahiti */ +- si_pi->ulv.supported = true; ++ si_pi->ulv.supported = false; + si_pi->ulv.pl = *pl; + si_pi->ulv.one_pcie_lane_in_ulv = false; + si_pi->ulv.volt_change_delay = SISLANDS_ULVVOLTAGECHANGEDELAY_DFLT; diff --git a/queue-3.14/drm-radeon-remove-invalid-pci-id.patch b/queue-3.14/drm-radeon-remove-invalid-pci-id.patch new file mode 100644 index 00000000000..b4461492c6e --- /dev/null +++ b/queue-3.14/drm-radeon-remove-invalid-pci-id.patch @@ -0,0 +1,30 @@ +From 8c3e434769b1707fd2d24de5a2eb25fedc634c4a Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Sun, 26 Oct 2014 15:18:42 -0400 +Subject: drm/radeon: remove invalid pci id + +From: Alex Deucher + +commit 8c3e434769b1707fd2d24de5a2eb25fedc634c4a upstream. + +0x4c6e is a secondary device id so should not be used +by the driver. + +Noticed-by: Mark Kettenis +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + include/drm/drm_pciids.h | 1 - + 1 file changed, 1 deletion(-) + +--- a/include/drm/drm_pciids.h ++++ b/include/drm/drm_pciids.h +@@ -74,7 +74,6 @@ + {0x1002, 0x4C64, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \ + {0x1002, 0x4C66, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \ + {0x1002, 0x4C67, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \ +- {0x1002, 0x4C6E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|RADEON_IS_MOBILITY}, \ + {0x1002, 0x4E44, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ + {0x1002, 0x4E45, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ + {0x1002, 0x4E46, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ diff --git a/queue-3.14/drm-vmwgfx-filter-out-modes-those-cannot-be-supported-by-the-current-vram-size.patch b/queue-3.14/drm-vmwgfx-filter-out-modes-those-cannot-be-supported-by-the-current-vram-size.patch new file mode 100644 index 00000000000..950186eead9 --- /dev/null +++ b/queue-3.14/drm-vmwgfx-filter-out-modes-those-cannot-be-supported-by-the-current-vram-size.patch @@ -0,0 +1,80 @@ +From 9a72384d86b26cb8a2b25106677e1197f606668f Mon Sep 17 00:00:00 2001 +From: Sinclair Yeh +Date: Fri, 31 Oct 2014 09:58:06 +0100 +Subject: drm/vmwgfx: Filter out modes those cannot be supported by the current VRAM size. + +From: Sinclair Yeh + +commit 9a72384d86b26cb8a2b25106677e1197f606668f upstream. + +When screen objects are enabled, the bpp is assumed to be 32, otherwise +it is set to 16. + +v2: +* Use u32 instead of u64 for assumed_bpp. +* Fixed mechanism to check for screen objects +* Limit the back buffer size to VRAM. + +Signed-off-by: Sinclair Yeh +Reviewed-by: Thomas Hellstrom +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 +++++- + drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 16 +++++++++++++--- + 2 files changed, 18 insertions(+), 4 deletions(-) + +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +@@ -688,7 +688,11 @@ static int vmw_driver_load(struct drm_de + goto out_err0; + } + +- if (unlikely(dev_priv->prim_bb_mem < dev_priv->vram_size)) ++ /* ++ * Limit back buffer size to VRAM size. Remove this once ++ * screen targets are implemented. ++ */ ++ if (dev_priv->prim_bb_mem > dev_priv->vram_size) + dev_priv->prim_bb_mem = dev_priv->vram_size; + + mutex_unlock(&dev_priv->hw_mutex); +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +@@ -1954,6 +1954,14 @@ int vmw_du_connector_fill_modes(struct d + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) + }; + int i; ++ u32 assumed_bpp = 2; ++ ++ /* ++ * If using screen objects, then assume 32-bpp because that's what the ++ * SVGA device is assuming ++ */ ++ if (dev_priv->sou_priv) ++ assumed_bpp = 4; + + /* Add preferred mode */ + { +@@ -1964,8 +1972,9 @@ int vmw_du_connector_fill_modes(struct d + mode->vdisplay = du->pref_height; + vmw_guess_mode_timing(mode); + +- if (vmw_kms_validate_mode_vram(dev_priv, mode->hdisplay * 2, +- mode->vdisplay)) { ++ if (vmw_kms_validate_mode_vram(dev_priv, ++ mode->hdisplay * assumed_bpp, ++ mode->vdisplay)) { + drm_mode_probed_add(connector, mode); + } else { + drm_mode_destroy(dev, mode); +@@ -1987,7 +1996,8 @@ int vmw_du_connector_fill_modes(struct d + bmode->vdisplay > max_height) + continue; + +- if (!vmw_kms_validate_mode_vram(dev_priv, bmode->hdisplay * 2, ++ if (!vmw_kms_validate_mode_vram(dev_priv, ++ bmode->hdisplay * assumed_bpp, + bmode->vdisplay)) + continue; + diff --git a/queue-3.14/i2c-at91-don-t-account-as-iowait.patch b/queue-3.14/i2c-at91-don-t-account-as-iowait.patch new file mode 100644 index 00000000000..453c7e1df48 --- /dev/null +++ b/queue-3.14/i2c-at91-don-t-account-as-iowait.patch @@ -0,0 +1,32 @@ +From 11cfbfb098b22d3e57f1f2be217cad20e2d48463 Mon Sep 17 00:00:00 2001 +From: Wolfram Sang +Date: Mon, 3 Nov 2014 21:16:16 +0100 +Subject: i2c: at91: don't account as iowait + +From: Wolfram Sang + +commit 11cfbfb098b22d3e57f1f2be217cad20e2d48463 upstream. + +iowait is for blkio [1]. I2C shouldn't use it. + +[1] https://lkml.org/lkml/2014/11/3/317 + +Signed-off-by: Wolfram Sang +Acked-by: Ludovic Desroches +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/i2c/busses/i2c-at91.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/i2c/busses/i2c-at91.c ++++ b/drivers/i2c/busses/i2c-at91.c +@@ -434,7 +434,7 @@ static int at91_do_twi_transfer(struct a + } + } + +- ret = wait_for_completion_io_timeout(&dev->cmd_complete, ++ ret = wait_for_completion_timeout(&dev->cmd_complete, + dev->adapter.timeout); + if (ret == 0) { + dev_err(dev->dev, "controller timed out\n"); diff --git a/queue-3.14/pinctrl-baytrail-show-output-gpio-state-correctly-on-intel-baytrail.patch b/queue-3.14/pinctrl-baytrail-show-output-gpio-state-correctly-on-intel-baytrail.patch new file mode 100644 index 00000000000..df0894c0016 --- /dev/null +++ b/queue-3.14/pinctrl-baytrail-show-output-gpio-state-correctly-on-intel-baytrail.patch @@ -0,0 +1,36 @@ +From d90c33818967c5e5371961604ad98b4dea4fa3f4 Mon Sep 17 00:00:00 2001 +From: David Cohen +Date: Tue, 14 Oct 2014 10:54:37 -0700 +Subject: pinctrl: baytrail: show output gpio state correctly on Intel Baytrail + +From: David Cohen + +commit d90c33818967c5e5371961604ad98b4dea4fa3f4 upstream. + +Even if a gpio pin is set to output, we still need to set INPUT_EN +functionality (by clearing INPUT_EN bit) to be able to read the pin's +level. + +E.g. without this change, we'll always read low level state from sysfs. + +Cc: Mathias Nyman +Signed-off-by: David Cohen +Reviewed-by: Felipe Balbi +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pinctrl/pinctrl-baytrail.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/pinctrl/pinctrl-baytrail.c ++++ b/drivers/pinctrl/pinctrl-baytrail.c +@@ -263,7 +263,7 @@ static int byt_gpio_direction_output(str + spin_lock_irqsave(&vg->lock, flags); + + reg_val = readl(reg) | BYT_DIR_MASK; +- reg_val &= ~BYT_OUTPUT_EN; ++ reg_val &= ~(BYT_OUTPUT_EN | BYT_INPUT_EN); + + if (value) + writel(reg_val | BYT_LEVEL, reg); diff --git a/queue-3.14/powerpc-use-device_online-offline-instead-of-cpu_up-down.patch b/queue-3.14/powerpc-use-device_online-offline-instead-of-cpu_up-down.patch new file mode 100644 index 00000000000..6e1a2c99111 --- /dev/null +++ b/queue-3.14/powerpc-use-device_online-offline-instead-of-cpu_up-down.patch @@ -0,0 +1,54 @@ +From 10ccaf178b2b961d8bca252d647ed7ed8aae2a20 Mon Sep 17 00:00:00 2001 +From: Dan Streetman +Date: Fri, 31 Oct 2014 15:41:34 -0400 +Subject: powerpc: use device_online/offline() instead of cpu_up/down() + +From: Dan Streetman + +commit 10ccaf178b2b961d8bca252d647ed7ed8aae2a20 upstream. + +In powerpc pseries platform dlpar operations, use device_online() and +device_offline() instead of cpu_up() and cpu_down(). + +Calling cpu_up/down() directly does not update the cpu device offline +field, which is used to online/offline a cpu from sysfs. Calling +device_online/offline() instead keeps the sysfs cpu online value +correct. The hotplug lock, which is required to be held when calling +device_online/offline(), is already held when dlpar_online/offline_cpu() +are called, since they are called only from cpu_probe|release_store(). + +This patch fixes errors on phyp (PowerVM) systems that have cpu(s) +added/removed using dlpar operations; without this patch, the +/sys/devices/system/cpu/cpuN/online nodes do not correctly show the +online state of added/removed cpus. + +Signed-off-by: Dan Streetman +Cc: Nathan Fontenot +Fixes: 0902a9044fa5 ("Driver core: Use generic offline/online for CPU offline/online") +Signed-off-by: Michael Ellerman +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/platforms/pseries/dlpar.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/powerpc/platforms/pseries/dlpar.c ++++ b/arch/powerpc/platforms/pseries/dlpar.c +@@ -380,7 +380,7 @@ static int dlpar_online_cpu(struct devic + BUG_ON(get_cpu_current_state(cpu) + != CPU_STATE_OFFLINE); + cpu_maps_update_done(); +- rc = cpu_up(cpu); ++ rc = device_online(get_cpu_device(cpu)); + if (rc) + goto out; + cpu_maps_update_begin(); +@@ -463,7 +463,7 @@ static int dlpar_offline_cpu(struct devi + if (get_cpu_current_state(cpu) == CPU_STATE_ONLINE) { + set_preferred_offline_state(cpu, CPU_STATE_OFFLINE); + cpu_maps_update_done(); +- rc = cpu_down(cpu); ++ rc = device_offline(get_cpu_device(cpu)); + if (rc) + goto out; + cpu_maps_update_begin(); diff --git a/queue-3.14/rbd-fix-error-recovery-in-rbd_obj_read_sync.patch b/queue-3.14/rbd-fix-error-recovery-in-rbd_obj_read_sync.patch new file mode 100644 index 00000000000..457fb5afafe --- /dev/null +++ b/queue-3.14/rbd-fix-error-recovery-in-rbd_obj_read_sync.patch @@ -0,0 +1,36 @@ +From a8d4205623ae965e36c68629db306ca0695a2771 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Wed, 22 Oct 2014 09:17:24 +0200 +Subject: rbd: Fix error recovery in rbd_obj_read_sync() + +From: Jan Kara + +commit a8d4205623ae965e36c68629db306ca0695a2771 upstream. + +When we fail to allocate page vector in rbd_obj_read_sync() we just +basically ignore the problem and continue which will result in an oops +later. Fix the problem by returning proper error. + +CC: Yehuda Sadeh +CC: Sage Weil +CC: ceph-devel@vger.kernel.org +Coverity-id: 1226882 +Signed-off-by: Jan Kara +Signed-off-by: Ilya Dryomov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/rbd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/block/rbd.c ++++ b/drivers/block/rbd.c +@@ -3217,7 +3217,7 @@ static int rbd_obj_read_sync(struct rbd_ + page_count = (u32) calc_pages_for(offset, length); + pages = ceph_alloc_page_vector(page_count, GFP_KERNEL); + if (IS_ERR(pages)) +- ret = PTR_ERR(pages); ++ return PTR_ERR(pages); + + ret = -ENOMEM; + obj_request = rbd_obj_request_create(object_name, offset, length, diff --git a/queue-3.14/regulator-max77693-fix-use-of-uninitialized-regulator-config.patch b/queue-3.14/regulator-max77693-fix-use-of-uninitialized-regulator-config.patch new file mode 100644 index 00000000000..0dfffd81f3a --- /dev/null +++ b/queue-3.14/regulator-max77693-fix-use-of-uninitialized-regulator-config.patch @@ -0,0 +1,37 @@ +From ca0c37a0b489bb14bf3e1549e7a8d0c9a17f4919 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Mon, 3 Nov 2014 15:07:05 +0100 +Subject: regulator: max77693: Fix use of uninitialized regulator config + +From: Krzysztof Kozlowski + +commit ca0c37a0b489bb14bf3e1549e7a8d0c9a17f4919 upstream. + +Driver allocated on stack struct regulator_config but didn't initialize +it fully. Few fields (driver_data, ena_gpio) were left untouched. This +lead to using random ena_gpio values as GPIOs for max77693 regulators. + +On occasion these values could match real GPIO numbers leading to +interfering with other drivers and to unsuccessful enable/disable of +regulator. + +Signed-off-by: Krzysztof Kozlowski +Fixes: 80b022e29bfd ("regulator: max77693: Add max77693 regualtor driver.") +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/regulator/max77693.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/regulator/max77693.c ++++ b/drivers/regulator/max77693.c +@@ -232,7 +232,7 @@ static int max77693_pmic_probe(struct pl + struct max77693_pmic_dev *max77693_pmic; + struct max77693_regulator_data *rdata = NULL; + int num_rdata, i; +- struct regulator_config config; ++ struct regulator_config config = { }; + + num_rdata = max77693_pmic_init_rdata(&pdev->dev, &rdata); + if (!rdata || num_rdata <= 0) { diff --git a/queue-3.14/series b/queue-3.14/series index c689eff3249..bb2cd770ee5 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -188,3 +188,13 @@ usb-gadget-function-acm-make-f_acm-pass-usb20cv-chapter9.patch usb-gadget-udc-core-fix-kernel-oops-with-soft-connect.patch usb-gadget-f_fs-remove-redundant-ffs_data_get.patch sched-use-rq-rd-in-sched_setaffinity-under-rcu-read-lock.patch +drm-vmwgfx-filter-out-modes-those-cannot-be-supported-by-the-current-vram-size.patch +drm-radeon-dpm-disable-ulv-support-on-si.patch +drm-radeon-remove-invalid-pci-id.patch +rbd-fix-error-recovery-in-rbd_obj_read_sync.patch +acer-wmi-add-acpi_backlight-video-quirk-for-the-acer-kav80.patch +pinctrl-baytrail-show-output-gpio-state-correctly-on-intel-baytrail.patch +powerpc-use-device_online-offline-instead-of-cpu_up-down.patch +regulator-max77693-fix-use-of-uninitialized-regulator-config.patch +i2c-at91-don-t-account-as-iowait.patch +sysfs-driver-core-fix-glue-dir-race-condition-by-gdp_mutex.patch diff --git a/queue-3.14/sysfs-driver-core-fix-glue-dir-race-condition-by-gdp_mutex.patch b/queue-3.14/sysfs-driver-core-fix-glue-dir-race-condition-by-gdp_mutex.patch new file mode 100644 index 00000000000..df6c1128f00 --- /dev/null +++ b/queue-3.14/sysfs-driver-core-fix-glue-dir-race-condition-by-gdp_mutex.patch @@ -0,0 +1,103 @@ +From e4a60d139060975eb956717e4f63ae348d4d8cc5 Mon Sep 17 00:00:00 2001 +From: Yijing Wang +Date: Fri, 7 Nov 2014 12:05:49 +0800 +Subject: sysfs: driver core: Fix glue dir race condition by gdp_mutex + +From: Yijing Wang + +commit e4a60d139060975eb956717e4f63ae348d4d8cc5 upstream. + +There is a race condition when removing glue directory. +It can be reproduced in following test: + +path 1: Add first child device +device_add() + get_device_parent() + /*find parent from glue_dirs.list*/ + list_for_each_entry(k, &dev->class->p->glue_dirs.list, entry) + if (k->parent == parent_kobj) { + kobj = kobject_get(k); + break; + } + .... + class_dir_create_and_add() + +path2: Remove last child device under glue dir +device_del() + cleanup_device_parent() + cleanup_glue_dir() + kobject_put(glue_dir); + +If path2 has been called cleanup_glue_dir(), but not +call kobject_put(glue_dir), the glue dir is still +in parent's kset list. Meanwhile, path1 find the glue +dir from the glue_dirs.list. Path2 may release glue dir +before path1 call kobject_get(). So kernel will report +the warning and bug_on. + +This is a "classic" problem we have of a kref in a list +that can be found while the last instance could be removed +at the same time. + +This patch reuse gdp_mutex to fix this race condition. + +The following calltrace is captured in kernel 3.4, but +the latest kernel still has this bug. + +----------------------------------------------------- +<4>[ 3965.441471] WARNING: at ...include/linux/kref.h:41 kobject_get+0x33/0x40() +<4>[ 3965.441474] Hardware name: Romley +<4>[ 3965.441475] Modules linked in: isd_iop(O) isd_xda(O)... +... +<4>[ 3965.441605] Call Trace: +<4>[ 3965.441611] [] warn_slowpath_common+0x7a/0xb0 +<4>[ 3965.441615] [] warn_slowpath_null+0x15/0x20 +<4>[ 3965.441618] [] kobject_get+0x33/0x40 +<4>[ 3965.441624] [] get_device_parent.isra.11+0x135/0x1f0 +<4>[ 3965.441627] [] device_add+0xd4/0x6d0 +<4>[ 3965.441631] [] ? dev_set_name+0x3c/0x40 +.... +<2>[ 3965.441912] kernel BUG at ..../fs/sysfs/group.c:65! +<4>[ 3965.441915] invalid opcode: 0000 [#1] SMP +... +<4>[ 3965.686743] [] sysfs_create_group+0xe/0x10 +<4>[ 3965.686748] [] blk_trace_init_sysfs+0x14/0x20 +<4>[ 3965.686753] [] blk_register_queue+0x3b/0x120 +<4>[ 3965.686756] [] add_disk+0x1cc/0x490 +.... +------------------------------------------------------- + +Signed-off-by: Yijing Wang +Signed-off-by: Weng Meiling +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/core.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -741,12 +741,12 @@ class_dir_create_and_add(struct class *c + return &dir->kobj; + } + ++static DEFINE_MUTEX(gdp_mutex); + + static struct kobject *get_device_parent(struct device *dev, + struct device *parent) + { + if (dev->class) { +- static DEFINE_MUTEX(gdp_mutex); + struct kobject *kobj = NULL; + struct kobject *parent_kobj; + struct kobject *k; +@@ -810,7 +810,9 @@ static void cleanup_glue_dir(struct devi + glue_dir->kset != &dev->class->p->glue_dirs) + return; + ++ mutex_lock(&gdp_mutex); + kobject_put(glue_dir); ++ mutex_unlock(&gdp_mutex); + } + + static void cleanup_device_parent(struct device *dev)