From: Greg Kroah-Hartman Date: Tue, 26 Nov 2013 23:21:14 +0000 (-0800) Subject: 3.10-stable patches X-Git-Tag: v3.11.10~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=46152526ed0687cb7fba1ca2f3045f8b05bba54e;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: configfs-fix-race-between-dentry-put-and-lookup.patch cris-media-platform-drivers-fix-build.patch dmi-add-support-for-exact-dmi-matches-in-addition-to-substring-matching.patch drm-i915-no-lvds-hardware-on-intel-d410pt-and-d425kt.patch drm-i915-quirk-away-phantom-lvds-on-intel-s-d510mo-mainboard.patch s390-vtime-correct-idle-time-calculation.patch --- diff --git a/queue-3.10/configfs-fix-race-between-dentry-put-and-lookup.patch b/queue-3.10/configfs-fix-race-between-dentry-put-and-lookup.patch new file mode 100644 index 00000000000..c869f8e606c --- /dev/null +++ b/queue-3.10/configfs-fix-race-between-dentry-put-and-lookup.patch @@ -0,0 +1,94 @@ +From 76ae281f6307331aa063288edb6422ae99f435f0 Mon Sep 17 00:00:00 2001 +From: Junxiao Bi +Date: Thu, 21 Nov 2013 14:31:56 -0800 +Subject: configfs: fix race between dentry put and lookup + +From: Junxiao Bi + +commit 76ae281f6307331aa063288edb6422ae99f435f0 upstream. + +A race window in configfs, it starts from one dentry is UNHASHED and end +before configfs_d_iput is called. In this window, if a lookup happen, +since the original dentry was UNHASHED, so a new dentry will be +allocated, and then in configfs_attach_attr(), sd->s_dentry will be +updated to the new dentry. Then in configfs_d_iput(), +BUG_ON(sd->s_dentry != dentry) will be triggered and system panic. + +sys_open: sys_close: + ... fput + dput + dentry_kill + __d_drop <--- dentry unhashed here, + but sd->dentry still point + to this dentry. + + lookup_real + configfs_lookup + configfs_attach_attr---> update sd->s_dentry + to new allocated dentry here. + + d_kill + configfs_d_iput <--- BUG_ON(sd->s_dentry != dentry) + triggered here. + +To fix it, change configfs_d_iput to not update sd->s_dentry if +sd->s_count > 2, that means there are another dentry is using the sd +beside the one that is going to be put. Use configfs_dirent_lock in +configfs_attach_attr to sync with configfs_d_iput. + +With the following steps, you can reproduce the bug. + +1. enable ocfs2, this will mount configfs at /sys/kernel/config and + fill configure in it. + +2. run the following script. + while [ 1 ]; do cat /sys/kernel/config/cluster/$your_cluster_name/idle_timeout_ms > /dev/null; done & + while [ 1 ]; do cat /sys/kernel/config/cluster/$your_cluster_name/idle_timeout_ms > /dev/null; done & + +Signed-off-by: Junxiao Bi +Cc: Joel Becker +Cc: Al Viro +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/configfs/dir.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +--- a/fs/configfs/dir.c ++++ b/fs/configfs/dir.c +@@ -56,10 +56,19 @@ static void configfs_d_iput(struct dentr + struct configfs_dirent *sd = dentry->d_fsdata; + + if (sd) { +- BUG_ON(sd->s_dentry != dentry); + /* Coordinate with configfs_readdir */ + spin_lock(&configfs_dirent_lock); +- sd->s_dentry = NULL; ++ /* Coordinate with configfs_attach_attr where will increase ++ * sd->s_count and update sd->s_dentry to new allocated one. ++ * Only set sd->dentry to null when this dentry is the only ++ * sd owner. ++ * If not do so, configfs_d_iput may run just after ++ * configfs_attach_attr and set sd->s_dentry to null ++ * even it's still in use. ++ */ ++ if (atomic_read(&sd->s_count) <= 2) ++ sd->s_dentry = NULL; ++ + spin_unlock(&configfs_dirent_lock); + configfs_put(sd); + } +@@ -426,8 +435,11 @@ static int configfs_attach_attr(struct c + struct configfs_attribute * attr = sd->s_element; + int error; + ++ spin_lock(&configfs_dirent_lock); + dentry->d_fsdata = configfs_get(sd); + sd->s_dentry = dentry; ++ spin_unlock(&configfs_dirent_lock); ++ + error = configfs_create(dentry, (attr->ca_mode & S_IALLUGO) | S_IFREG, + configfs_init_file); + if (error) { diff --git a/queue-3.10/cris-media-platform-drivers-fix-build.patch b/queue-3.10/cris-media-platform-drivers-fix-build.patch new file mode 100644 index 00000000000..adf81505bd3 --- /dev/null +++ b/queue-3.10/cris-media-platform-drivers-fix-build.patch @@ -0,0 +1,56 @@ +From 72a0c5571351f5184195754d23db3e14495b2080 Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +Date: Tue, 12 Nov 2013 15:06:49 -0800 +Subject: cris: media platform drivers: fix build + +From: Mauro Carvalho Chehab + +commit 72a0c5571351f5184195754d23db3e14495b2080 upstream. + +On cris arch, the functions below aren't defined: + + drivers/media/platform/sh_veu.c: In function 'sh_veu_reg_read': + + drivers/media/platform/sh_veu.c:228:2: error: implicit declaration of function 'ioread32' [-Werror=implicit-function-declaration] + drivers/media/platform/sh_veu.c: In function 'sh_veu_reg_write': + + drivers/media/platform/sh_veu.c:234:2: error: implicit declaration of function 'iowrite32' [-Werror=implicit-function-declaration] + drivers/media/platform/vsp1/vsp1.h: In function 'vsp1_read': + drivers/media/platform/vsp1/vsp1.h:66:2: error: implicit declaration of function 'ioread32' [-Werror=implicit-function-declaration] + drivers/media/platform/vsp1/vsp1.h: In function 'vsp1_write': + drivers/media/platform/vsp1/vsp1.h:71:2: error: implicit declaration of function 'iowrite32' [-Werror=implicit-function-declaration] + drivers/media/platform/vsp1/vsp1.h: In function 'vsp1_read': + drivers/media/platform/vsp1/vsp1.h:66:2: error: implicit declaration of function 'ioread32' [-Werror=implicit-function-declaration] + drivers/media/platform/vsp1/vsp1.h: In function 'vsp1_write': + drivers/media/platform/vsp1/vsp1.h:71:2: error: implicit declaration of function 'iowrite32' [-Werror=implicit-function-declaration] + drivers/media/platform/soc_camera/rcar_vin.c: In function 'rcar_vin_setup': + drivers/media/platform/soc_camera/rcar_vin.c:284:3: error: implicit declaration of function 'iowrite32' [-Werror=implicit-function-declaration] + + drivers/media/platform/soc_camera/rcar_vin.c: In function 'rcar_vin_request_capture_stop': + drivers/media/platform/soc_camera/rcar_vin.c:353:2: error: implicit declaration of function 'ioread32' [-Werror=implicit-function-declaration] + +Yet, they're available, as CONFIG_GENERIC_IOMAP is defined. What happens +is that asm/io.h was not including asm-generic/iomap.h. + +Suggested-by: Ben Hutchings +Signed-off-by: Mauro Carvalho Chehab +Cc: Mikael Starvik +Cc: Jesper Nilsson +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + arch/cris/include/asm/io.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/cris/include/asm/io.h ++++ b/arch/cris/include/asm/io.h +@@ -3,6 +3,7 @@ + + #include /* for __va, __pa */ + #include ++#include + #include + + struct cris_io_operations diff --git a/queue-3.10/dmi-add-support-for-exact-dmi-matches-in-addition-to-substring-matching.patch b/queue-3.10/dmi-add-support-for-exact-dmi-matches-in-addition-to-substring-matching.patch new file mode 100644 index 00000000000..e4f4db488df --- /dev/null +++ b/queue-3.10/dmi-add-support-for-exact-dmi-matches-in-addition-to-substring-matching.patch @@ -0,0 +1,82 @@ +From 5017b2851373ee15c7035151853bb1448800cae2 Mon Sep 17 00:00:00 2001 +From: Jani Nikula +Date: Wed, 3 Jul 2013 15:05:02 -0700 +Subject: dmi: add support for exact DMI matches in addition to substring matching + +From: Jani Nikula + +commit 5017b2851373ee15c7035151853bb1448800cae2 upstream. + +dmi_match() considers a substring match to be a successful match. This is +not always sufficient to distinguish between DMI data for different +systems. Add support for exact string matching using strcmp() in addition +to the substring matching using strstr(). + +The specific use case in the i915 driver is to allow us to use an exact +match for D510MO, without also incorrectly matching D510MOV: + + { + .ident = "Intel D510MO", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Intel"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "D510MO"), + }, + } + +Signed-off-by: Jani Nikula +Cc: +Cc: Chris Wilson +Cc: Cornel Panceac +Acked-by: Daniel Vetter +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/firmware/dmi_scan.c | 12 +++++++++--- + include/linux/mod_devicetable.h | 6 ++++-- + 2 files changed, 13 insertions(+), 5 deletions(-) + +--- a/drivers/firmware/dmi_scan.c ++++ b/drivers/firmware/dmi_scan.c +@@ -551,9 +551,15 @@ static bool dmi_matches(const struct dmi + int s = dmi->matches[i].slot; + if (s == DMI_NONE) + break; +- if (dmi_ident[s] +- && strstr(dmi_ident[s], dmi->matches[i].substr)) +- continue; ++ if (dmi_ident[s]) { ++ if (!dmi->matches[i].exact_match && ++ strstr(dmi_ident[s], dmi->matches[i].substr)) ++ continue; ++ else if (dmi->matches[i].exact_match && ++ !strcmp(dmi_ident[s], dmi->matches[i].substr)) ++ continue; ++ } ++ + /* No match */ + return false; + } +--- a/include/linux/mod_devicetable.h ++++ b/include/linux/mod_devicetable.h +@@ -456,7 +456,8 @@ enum dmi_field { + }; + + struct dmi_strmatch { +- unsigned char slot; ++ unsigned char slot:7; ++ unsigned char exact_match:1; + char substr[79]; + }; + +@@ -474,7 +475,8 @@ struct dmi_system_id { + */ + #define dmi_device_id dmi_system_id + +-#define DMI_MATCH(a, b) { a, b } ++#define DMI_MATCH(a, b) { .slot = a, .substr = b } ++#define DMI_EXACT_MATCH(a, b) { .slot = a, .substr = b, .exact_match = 1 } + + #define PLATFORM_NAME_SIZE 20 + #define PLATFORM_MODULE_PREFIX "platform:" diff --git a/queue-3.10/drm-i915-no-lvds-hardware-on-intel-d410pt-and-d425kt.patch b/queue-3.10/drm-i915-no-lvds-hardware-on-intel-d410pt-and-d425kt.patch new file mode 100644 index 00000000000..ded1619e10d --- /dev/null +++ b/queue-3.10/drm-i915-no-lvds-hardware-on-intel-d410pt-and-d425kt.patch @@ -0,0 +1,51 @@ +From 645378d85ee524e429aa4cf52806047b56cdc596 Mon Sep 17 00:00:00 2001 +From: Rob Pearce +Date: Sun, 27 Oct 2013 16:13:42 +0000 +Subject: drm/i915: No LVDS hardware on Intel D410PT and D425KT + +From: Rob Pearce + +commit 645378d85ee524e429aa4cf52806047b56cdc596 upstream. + +The Intel D410PT(LW) and D425KT Mini-ITX desktop boards both show up as +having LVDS but the hardware is not populated. This patch adds them to +the list of such systems. Patch is against 3.11.4 + +v2: Patch revised to match the D425KT exactly as the D425KTW does have +LVDS. According to Intel's documentation, the D410PTL and D410PLTW +don't. + +Signed-off-by: Rob Pearce +[danvet: Pimp commit message to my liking and add cc: stable.] +Signed-off-by: Daniel Vetter +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_lvds.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/drivers/gpu/drm/i915/intel_lvds.c ++++ b/drivers/gpu/drm/i915/intel_lvds.c +@@ -871,6 +871,22 @@ static const struct dmi_system_id intel_ + }, + { + .callback = intel_no_lvds_dmi_callback, ++ .ident = "Intel D410PT", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "Intel"), ++ DMI_MATCH(DMI_BOARD_NAME, "D410PT"), ++ }, ++ }, ++ { ++ .callback = intel_no_lvds_dmi_callback, ++ .ident = "Intel D425KT", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "Intel"), ++ DMI_EXACT_MATCH(DMI_BOARD_NAME, "D425KT"), ++ }, ++ }, ++ { ++ .callback = intel_no_lvds_dmi_callback, + .ident = "Intel D510MO", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Intel"), diff --git a/queue-3.10/drm-i915-quirk-away-phantom-lvds-on-intel-s-d510mo-mainboard.patch b/queue-3.10/drm-i915-quirk-away-phantom-lvds-on-intel-s-d510mo-mainboard.patch new file mode 100644 index 00000000000..f598fb25020 --- /dev/null +++ b/queue-3.10/drm-i915-quirk-away-phantom-lvds-on-intel-s-d510mo-mainboard.patch @@ -0,0 +1,45 @@ +From e5614f0c2d0f4d7f0b8ef745d34593baf2c5dbf8 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Wed, 3 Jul 2013 15:05:03 -0700 +Subject: drm/i915: quirk away phantom LVDS on Intel's D510MO mainboard + +From: Chris Wilson + +commit e5614f0c2d0f4d7f0b8ef745d34593baf2c5dbf8 upstream. + +This replaceable mainboard only has a VGA-out, yet it claims to also have +a connected LVDS header. + +Addresses https://bugs.freedesktop.org/show_bug.cgi?id=63860 + +[jani.nikula@intel.com: use DMI_EXACT_MATCH for board name.] +Signed-off-by: Chris Wilson +Signed-off-by: Jani Nikula +Reported-by: +Cc: Cornel Panceac +Acked-by: Daniel Vetter +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_lvds.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/gpu/drm/i915/intel_lvds.c ++++ b/drivers/gpu/drm/i915/intel_lvds.c +@@ -869,6 +869,14 @@ static const struct dmi_system_id intel_ + DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Q900"), + }, + }, ++ { ++ .callback = intel_no_lvds_dmi_callback, ++ .ident = "Intel D510MO", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "Intel"), ++ DMI_EXACT_MATCH(DMI_BOARD_NAME, "D510MO"), ++ }, ++ }, + + { } /* terminating entry */ + }; diff --git a/queue-3.10/s390-vtime-correct-idle-time-calculation.patch b/queue-3.10/s390-vtime-correct-idle-time-calculation.patch new file mode 100644 index 00000000000..f0722083054 --- /dev/null +++ b/queue-3.10/s390-vtime-correct-idle-time-calculation.patch @@ -0,0 +1,53 @@ +From 4560e7c3317c7a2b370e36dadd3a3bac2ed70818 Mon Sep 17 00:00:00 2001 +From: Martin Schwidefsky +Date: Mon, 28 Oct 2013 12:15:32 +0100 +Subject: s390/vtime: correct idle time calculation + +From: Martin Schwidefsky + +commit 4560e7c3317c7a2b370e36dadd3a3bac2ed70818 upstream. + +Use the ACCESS_ONCE macro for both accesses to idle->sequence in the +loops to calculate the idle time. If only one access uses the macro, +the compiler is free to cache the value for the second access which +can cause endless loops. + +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/kernel/smp.c | 4 ++-- + arch/s390/kernel/vtime.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/s390/kernel/smp.c ++++ b/arch/s390/kernel/smp.c +@@ -933,7 +933,7 @@ static ssize_t show_idle_count(struct de + idle_count = ACCESS_ONCE(idle->idle_count); + if (ACCESS_ONCE(idle->clock_idle_enter)) + idle_count++; +- } while ((sequence & 1) || (idle->sequence != sequence)); ++ } while ((sequence & 1) || (ACCESS_ONCE(idle->sequence) != sequence)); + return sprintf(buf, "%llu\n", idle_count); + } + static DEVICE_ATTR(idle_count, 0444, show_idle_count, NULL); +@@ -951,7 +951,7 @@ static ssize_t show_idle_time(struct dev + idle_time = ACCESS_ONCE(idle->idle_time); + idle_enter = ACCESS_ONCE(idle->clock_idle_enter); + idle_exit = ACCESS_ONCE(idle->clock_idle_exit); +- } while ((sequence & 1) || (idle->sequence != sequence)); ++ } while ((sequence & 1) || (ACCESS_ONCE(idle->sequence) != sequence)); + idle_time += idle_enter ? ((idle_exit ? : now) - idle_enter) : 0; + return sprintf(buf, "%llu\n", idle_time >> 12); + } +--- a/arch/s390/kernel/vtime.c ++++ b/arch/s390/kernel/vtime.c +@@ -190,7 +190,7 @@ cputime64_t s390_get_idle_time(int cpu) + sequence = ACCESS_ONCE(idle->sequence); + idle_enter = ACCESS_ONCE(idle->clock_idle_enter); + idle_exit = ACCESS_ONCE(idle->clock_idle_exit); +- } while ((sequence & 1) || (idle->sequence != sequence)); ++ } while ((sequence & 1) || (ACCESS_ONCE(idle->sequence) != sequence)); + return idle_enter ? ((idle_exit ?: now) - idle_enter) : 0; + } + diff --git a/queue-3.10/series b/queue-3.10/series index 7ffef4eb849..84c48d9ca4a 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -72,3 +72,9 @@ sunrpc-fix-a-data-corruption-issue-when-retransmitting-rpc-calls.patch mei-nfc-fix-memory-leak-in-error-path.patch usb-hub-clear-port-reset-change-during-init-resume.patch rt2800usb-slow-down-tx-status-polling.patch +s390-vtime-correct-idle-time-calculation.patch +configfs-fix-race-between-dentry-put-and-lookup.patch +cris-media-platform-drivers-fix-build.patch +dmi-add-support-for-exact-dmi-matches-in-addition-to-substring-matching.patch +drm-i915-quirk-away-phantom-lvds-on-intel-s-d510mo-mainboard.patch +drm-i915-no-lvds-hardware-on-intel-d410pt-and-d425kt.patch