From 4896ce8beed2d0196b819cfb0f00c851fb38d865 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 15 Feb 2011 08:30:57 -0800 Subject: [PATCH] .36 patches --- ...t-wait-if-queue-already-has-requests.patch | 49 ++++++ ...ix-unstable-i-o-with-canon-camcorder.patch | 79 ++++++++++ ...the-p1022ds-dma-nodes-used-for-audio.patch | 39 +++++ ...werpc-fix-hcall-tracepoint-recursion.patch | 84 +++++++++++ ...ix-some-6xx-7xxx-cpu-setup-functions.patch | 139 ++++++++++++++++++ ...-numa-fix-bug-in-unmap_cpu_from_node.patch | 40 +++++ queue-2.6.36/series | 6 + 7 files changed, 436 insertions(+) create mode 100644 queue-2.6.36/cfq-iosched-don-t-wait-if-queue-already-has-requests.patch create mode 100644 queue-2.6.36/firewire-core-fix-unstable-i-o-with-canon-camcorder.patch create mode 100644 queue-2.6.36/powerpc-85xx-fix-compatible-properties-of-the-p1022ds-dma-nodes-used-for-audio.patch create mode 100644 queue-2.6.36/powerpc-fix-hcall-tracepoint-recursion.patch create mode 100644 queue-2.6.36/powerpc-fix-some-6xx-7xxx-cpu-setup-functions.patch create mode 100644 queue-2.6.36/powerpc-numa-fix-bug-in-unmap_cpu_from_node.patch diff --git a/queue-2.6.36/cfq-iosched-don-t-wait-if-queue-already-has-requests.patch b/queue-2.6.36/cfq-iosched-don-t-wait-if-queue-already-has-requests.patch new file mode 100644 index 00000000000..db503d22a85 --- /dev/null +++ b/queue-2.6.36/cfq-iosched-don-t-wait-if-queue-already-has-requests.patch @@ -0,0 +1,49 @@ +From 02a8f01b5a9f396d0327977af4c232d0f94c45fd Mon Sep 17 00:00:00 2001 +From: Justin TerAvest +Date: Wed, 9 Feb 2011 14:20:03 +0100 +Subject: cfq-iosched: Don't wait if queue already has requests. + +From: Justin TerAvest + +commit 02a8f01b5a9f396d0327977af4c232d0f94c45fd upstream. + +Commit 7667aa0630407bc07dc38dcc79d29cc0a65553c1 added logic to wait for +the last queue of the group to become busy (have at least one request), +so that the group does not lose out for not being continuously +backlogged. The commit did not check for the condition that the last +queue already has some requests. As a result, if the queue already has +requests, wait_busy is set. Later on, cfq_select_queue() checks the +flag, and decides that since the queue has a request now and wait_busy +is set, the queue is expired. This results in early expiration of the +queue. + +This patch fixes the problem by adding a check to see if queue already +has requests. If it does, wait_busy is not set. As a result, time slices +do not expire early. + +The queues with more than one request are usually buffered writers. +Testing shows improvement in isolation between buffered writers. + +Signed-off-by: Justin TerAvest +Reviewed-by: Gui Jianfeng +Acked-by: Vivek Goyal +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + block/cfq-iosched.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/block/cfq-iosched.c ++++ b/block/cfq-iosched.c +@@ -3402,6 +3402,10 @@ static bool cfq_should_wait_busy(struct + { + struct cfq_io_context *cic = cfqd->active_cic; + ++ /* If the queue already has requests, don't wait */ ++ if (!RB_EMPTY_ROOT(&cfqq->sort_list)) ++ return false; ++ + /* If there are other queues in the group, don't wait */ + if (cfqq->cfqg->nr_cfqq > 1) + return false; diff --git a/queue-2.6.36/firewire-core-fix-unstable-i-o-with-canon-camcorder.patch b/queue-2.6.36/firewire-core-fix-unstable-i-o-with-canon-camcorder.patch new file mode 100644 index 00000000000..0a6f12f157f --- /dev/null +++ b/queue-2.6.36/firewire-core-fix-unstable-i-o-with-canon-camcorder.patch @@ -0,0 +1,79 @@ +From 6044565af458e7fa6e748bff437ecc49dea88d79 Mon Sep 17 00:00:00 2001 +From: Stefan Richter +Date: Sat, 15 Jan 2011 18:19:48 +0100 +Subject: firewire: core: fix unstable I/O with Canon camcorder + +From: Stefan Richter + +commit 6044565af458e7fa6e748bff437ecc49dea88d79 upstream. + +Regression since commit 10389536742c, "firewire: core: check for 1394a +compliant IRM, fix inaccessibility of Sony camcorder": + +The camcorder Canon MV5i generates lots of bus resets when asynchronous +requests are sent to it (e.g. Config ROM read requests or FCP Command +write requests) if the camcorder is not root node. This causes drop- +outs in videos or makes the camcorder entirely inaccessible. +https://bugzilla.redhat.com/show_bug.cgi?id=633260 + +Fix this by allowing any Canon device, even if it is a pre-1394a IRM +like MV5i are, to remain root node (if it is at least Cycle Master +capable). With the FireWire controller cards that I tested, MV5i always +becomes root node when plugged in and left to its own devices. + +Reported-by: Ralf Lange +Signed-off-by: Stefan Richter +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/firewire/core-card.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/drivers/firewire/core-card.c ++++ b/drivers/firewire/core-card.c +@@ -75,6 +75,8 @@ static size_t config_rom_length = 1 + 4 + #define BIB_IRMC ((1) << 31) + #define NODE_CAPABILITIES 0x0c0083c0 /* per IEEE 1394 clause 8.3.2.6.5.2 */ + ++#define CANON_OUI 0x000085 ++ + static void generate_config_rom(struct fw_card *card, __be32 *config_rom) + { + struct fw_descriptor *desc; +@@ -284,6 +286,7 @@ static void bm_work(struct work_struct * + bool root_device_is_running; + bool root_device_is_cmc; + bool irm_is_1394_1995_only; ++ bool keep_this_irm; + + spin_lock_irq(&card->lock); + +@@ -305,6 +308,10 @@ static void bm_work(struct work_struct * + irm_is_1394_1995_only = irm_device && irm_device->config_rom && + (irm_device->config_rom[2] & 0x000000f0) == 0; + ++ /* Canon MV5i works unreliably if it is not root node. */ ++ keep_this_irm = irm_device && irm_device->config_rom && ++ irm_device->config_rom[3] >> 8 == CANON_OUI; ++ + root_id = root_node->node_id; + irm_id = card->irm_node->node_id; + local_id = card->local_node->node_id; +@@ -333,7 +340,7 @@ static void bm_work(struct work_struct * + goto pick_me; + } + +- if (irm_is_1394_1995_only) { ++ if (irm_is_1394_1995_only && !keep_this_irm) { + new_root_id = local_id; + fw_notify("%s, making local node (%02x) root.\n", + "IRM is not 1394a compliant", new_root_id); +@@ -382,7 +389,7 @@ static void bm_work(struct work_struct * + + spin_lock_irq(&card->lock); + +- if (rcode != RCODE_COMPLETE) { ++ if (rcode != RCODE_COMPLETE && !keep_this_irm) { + /* + * The lock request failed, maybe the IRM + * isn't really IRM capable after all. Let's diff --git a/queue-2.6.36/powerpc-85xx-fix-compatible-properties-of-the-p1022ds-dma-nodes-used-for-audio.patch b/queue-2.6.36/powerpc-85xx-fix-compatible-properties-of-the-p1022ds-dma-nodes-used-for-audio.patch new file mode 100644 index 00000000000..6f5ef93d540 --- /dev/null +++ b/queue-2.6.36/powerpc-85xx-fix-compatible-properties-of-the-p1022ds-dma-nodes-used-for-audio.patch @@ -0,0 +1,39 @@ +From b2e0861e51f2961954330dcafe6d148ee3ab5cff Mon Sep 17 00:00:00 2001 +From: Timur Tabi +Date: Fri, 3 Dec 2010 10:52:14 -0600 +Subject: powerpc/85xx: fix compatible properties of the P1022DS DMA nodes used for audio + +From: Timur Tabi + +commit b2e0861e51f2961954330dcafe6d148ee3ab5cff upstream. + +In order to prevent the fsl_dma driver from claiming the DMA channels that the +P1022DS audio driver needs, the compatible properties for those nodes must say +"fsl,ssi-dma-channel" instead of "fsl,eloplus-dma-channel". + +Signed-off-by: Timur Tabi +Signed-off-by: Kumar Gala +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/boot/dts/p1022ds.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/powerpc/boot/dts/p1022ds.dts ++++ b/arch/powerpc/boot/dts/p1022ds.dts +@@ -280,13 +280,13 @@ + ranges = <0x0 0xc100 0x200>; + cell-index = <1>; + dma00: dma-channel@0 { +- compatible = "fsl,eloplus-dma-channel"; ++ compatible = "fsl,ssi-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupts = <76 2>; + }; + dma01: dma-channel@80 { +- compatible = "fsl,eloplus-dma-channel"; ++ compatible = "fsl,ssi-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupts = <77 2>; diff --git a/queue-2.6.36/powerpc-fix-hcall-tracepoint-recursion.patch b/queue-2.6.36/powerpc-fix-hcall-tracepoint-recursion.patch new file mode 100644 index 00000000000..4710fcbefb7 --- /dev/null +++ b/queue-2.6.36/powerpc-fix-hcall-tracepoint-recursion.patch @@ -0,0 +1,84 @@ +From 57cdfdf829a850a317425ed93c6a576c9ee6329c Mon Sep 17 00:00:00 2001 +From: Anton Blanchard +Date: Thu, 21 Oct 2010 00:52:12 +0000 +Subject: powerpc: Fix hcall tracepoint recursion + +From: Anton Blanchard + +commit 57cdfdf829a850a317425ed93c6a576c9ee6329c upstream. + +Spinlocks on shared processor partitions use H_YIELD to notify the +hypervisor we are waiting on another virtual CPU. Unfortunately this means +the hcall tracepoints can recurse. + +The patch below adds a percpu depth and checks it on both the entry and +exit hcall tracepoints. + +Signed-off-by: Anton Blanchard +Acked-by: Steven Rostedt +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/platforms/pseries/lpar.c | 37 ++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +--- a/arch/powerpc/platforms/pseries/lpar.c ++++ b/arch/powerpc/platforms/pseries/lpar.c +@@ -680,6 +680,13 @@ EXPORT_SYMBOL(arch_free_page); + /* NB: reg/unreg are called while guarded with the tracepoints_mutex */ + extern long hcall_tracepoint_refcount; + ++/* ++ * Since the tracing code might execute hcalls we need to guard against ++ * recursion. One example of this are spinlocks calling H_YIELD on ++ * shared processor partitions. ++ */ ++static DEFINE_PER_CPU(unsigned int, hcall_trace_depth); ++ + void hcall_tracepoint_regfunc(void) + { + hcall_tracepoint_refcount++; +@@ -692,12 +699,42 @@ void hcall_tracepoint_unregfunc(void) + + void __trace_hcall_entry(unsigned long opcode, unsigned long *args) + { ++ unsigned long flags; ++ unsigned int *depth; ++ ++ local_irq_save(flags); ++ ++ depth = &__get_cpu_var(hcall_trace_depth); ++ ++ if (*depth) ++ goto out; ++ ++ (*depth)++; + trace_hcall_entry(opcode, args); ++ (*depth)--; ++ ++out: ++ local_irq_restore(flags); + } + + void __trace_hcall_exit(long opcode, unsigned long retval, + unsigned long *retbuf) + { ++ unsigned long flags; ++ unsigned int *depth; ++ ++ local_irq_save(flags); ++ ++ depth = &__get_cpu_var(hcall_trace_depth); ++ ++ if (*depth) ++ goto out; ++ ++ (*depth)++; + trace_hcall_exit(opcode, retval, retbuf); ++ (*depth)--; ++ ++out: ++ local_irq_restore(flags); + } + #endif diff --git a/queue-2.6.36/powerpc-fix-some-6xx-7xxx-cpu-setup-functions.patch b/queue-2.6.36/powerpc-fix-some-6xx-7xxx-cpu-setup-functions.patch new file mode 100644 index 00000000000..755250d9564 --- /dev/null +++ b/queue-2.6.36/powerpc-fix-some-6xx-7xxx-cpu-setup-functions.patch @@ -0,0 +1,139 @@ +From 1f1936ff3febf38d582177ea319eaa278f32c91f Mon Sep 17 00:00:00 2001 +From: Benjamin Herrenschmidt +Date: Thu, 20 Jan 2011 20:35:23 +0000 +Subject: powerpc: Fix some 6xx/7xxx CPU setup functions + +From: Benjamin Herrenschmidt + +commit 1f1936ff3febf38d582177ea319eaa278f32c91f upstream. + +Some of those functions try to adjust the CPU features, for example +to remove NAP support on some revisions. However, they seem to use +r5 as an index into the CPU table entry, which might have been right +a long time ago but no longer is. r4 is the right register to use. + +This probably caused some off behaviours on some PowerMac variants +using 750cx or 7455 processor revisions. + +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kernel/cpu_setup_6xx.S | 40 ++++++++++++++++++------------------ + 1 file changed, 20 insertions(+), 20 deletions(-) + +--- a/arch/powerpc/kernel/cpu_setup_6xx.S ++++ b/arch/powerpc/kernel/cpu_setup_6xx.S +@@ -18,7 +18,7 @@ + #include + + _GLOBAL(__setup_cpu_603) +- mflr r4 ++ mflr r5 + BEGIN_MMU_FTR_SECTION + li r10,0 + mtspr SPRN_SPRG_603_LRU,r10 /* init SW LRU tracking */ +@@ -27,60 +27,60 @@ BEGIN_FTR_SECTION + bl __init_fpu_registers + END_FTR_SECTION_IFCLR(CPU_FTR_FPU_UNAVAILABLE) + bl setup_common_caches +- mtlr r4 ++ mtlr r5 + blr + _GLOBAL(__setup_cpu_604) +- mflr r4 ++ mflr r5 + bl setup_common_caches + bl setup_604_hid0 +- mtlr r4 ++ mtlr r5 + blr + _GLOBAL(__setup_cpu_750) +- mflr r4 ++ mflr r5 + bl __init_fpu_registers + bl setup_common_caches + bl setup_750_7400_hid0 +- mtlr r4 ++ mtlr r5 + blr + _GLOBAL(__setup_cpu_750cx) +- mflr r4 ++ mflr r5 + bl __init_fpu_registers + bl setup_common_caches + bl setup_750_7400_hid0 + bl setup_750cx +- mtlr r4 ++ mtlr r5 + blr + _GLOBAL(__setup_cpu_750fx) +- mflr r4 ++ mflr r5 + bl __init_fpu_registers + bl setup_common_caches + bl setup_750_7400_hid0 + bl setup_750fx +- mtlr r4 ++ mtlr r5 + blr + _GLOBAL(__setup_cpu_7400) +- mflr r4 ++ mflr r5 + bl __init_fpu_registers + bl setup_7400_workarounds + bl setup_common_caches + bl setup_750_7400_hid0 +- mtlr r4 ++ mtlr r5 + blr + _GLOBAL(__setup_cpu_7410) +- mflr r4 ++ mflr r5 + bl __init_fpu_registers + bl setup_7410_workarounds + bl setup_common_caches + bl setup_750_7400_hid0 + li r3,0 + mtspr SPRN_L2CR2,r3 +- mtlr r4 ++ mtlr r5 + blr + _GLOBAL(__setup_cpu_745x) +- mflr r4 ++ mflr r5 + bl setup_common_caches + bl setup_745x_specifics +- mtlr r4 ++ mtlr r5 + blr + + /* Enable caches for 603's, 604, 750 & 7400 */ +@@ -194,10 +194,10 @@ setup_750cx: + cror 4*cr0+eq,4*cr0+eq,4*cr1+eq + cror 4*cr0+eq,4*cr0+eq,4*cr2+eq + bnelr +- lwz r6,CPU_SPEC_FEATURES(r5) ++ lwz r6,CPU_SPEC_FEATURES(r4) + li r7,CPU_FTR_CAN_NAP + andc r6,r6,r7 +- stw r6,CPU_SPEC_FEATURES(r5) ++ stw r6,CPU_SPEC_FEATURES(r4) + blr + + /* 750fx specific +@@ -225,12 +225,12 @@ BEGIN_FTR_SECTION + andis. r11,r11,L3CR_L3E@h + beq 1f + END_FTR_SECTION_IFSET(CPU_FTR_L3CR) +- lwz r6,CPU_SPEC_FEATURES(r5) ++ lwz r6,CPU_SPEC_FEATURES(r4) + andi. r0,r6,CPU_FTR_L3_DISABLE_NAP + beq 1f + li r7,CPU_FTR_CAN_NAP + andc r6,r6,r7 +- stw r6,CPU_SPEC_FEATURES(r5) ++ stw r6,CPU_SPEC_FEATURES(r4) + 1: + mfspr r11,SPRN_HID0 + diff --git a/queue-2.6.36/powerpc-numa-fix-bug-in-unmap_cpu_from_node.patch b/queue-2.6.36/powerpc-numa-fix-bug-in-unmap_cpu_from_node.patch new file mode 100644 index 00000000000..3406d691537 --- /dev/null +++ b/queue-2.6.36/powerpc-numa-fix-bug-in-unmap_cpu_from_node.patch @@ -0,0 +1,40 @@ +From 429f4d8d20b91e4a6c239f951c06a56a6ac22957 Mon Sep 17 00:00:00 2001 +From: Anton Blanchard +Date: Sat, 29 Jan 2011 12:37:16 +0000 +Subject: powerpc/numa: Fix bug in unmap_cpu_from_node + +From: Anton Blanchard + +commit 429f4d8d20b91e4a6c239f951c06a56a6ac22957 upstream. + +When converting to the new cpumask code I screwed up: + +- if (cpu_isset(cpu, numa_cpumask_lookup_table[node])) { +- cpu_clear(cpu, numa_cpumask_lookup_table[node]); ++ if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) { ++ cpumask_set_cpu(cpu, node_to_cpumask_map[node]); + +This was introduced in commit 25863de07af9 (powerpc/cpumask: Convert NUMA code +to new cpumask API) + +Fix it. + +Signed-off-by: Anton Blanchard +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/mm/numa.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -181,7 +181,7 @@ static void unmap_cpu_from_node(unsigned + dbg("removing cpu %lu from node %d\n", cpu, node); + + if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) { +- cpumask_set_cpu(cpu, node_to_cpumask_map[node]); ++ cpumask_clear_cpu(cpu, node_to_cpumask_map[node]); + } else { + printk(KERN_ERR "WARNING: cpu %lu not found in node %d\n", + cpu, node); diff --git a/queue-2.6.36/series b/queue-2.6.36/series index 8ae06a3baab..ac9c75d3e84 100644 --- a/queue-2.6.36/series +++ b/queue-2.6.36/series @@ -122,3 +122,9 @@ memcg-fix-account-leak-at-failure-of-memsw-acconting.patch mmc-bfin_sdh-fix-alloc-size-for-private-data.patch mm-page-allocator-adjust-the-per-cpu-counter-threshold-when-memory-is-low.patch klist-fix-object-alignment-on-64-bit.patch +cfq-iosched-don-t-wait-if-queue-already-has-requests.patch +powerpc-85xx-fix-compatible-properties-of-the-p1022ds-dma-nodes-used-for-audio.patch +powerpc-fix-hcall-tracepoint-recursion.patch +powerpc-numa-fix-bug-in-unmap_cpu_from_node.patch +powerpc-fix-some-6xx-7xxx-cpu-setup-functions.patch +firewire-core-fix-unstable-i-o-with-canon-camcorder.patch -- 2.47.2