From: Greg Kroah-Hartman Date: Tue, 24 Aug 2010 18:35:00 +0000 (-0700) Subject: .35 patches X-Git-Tag: v2.6.32.21~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=36fd7e295c366c2925e89376fa6c24d9fe6d8709;p=thirdparty%2Fkernel%2Fstable-queue.git .35 patches --- diff --git a/queue-2.6.35/powerpc-fix-typo-in-uimage-target.patch b/queue-2.6.35/powerpc-fix-typo-in-uimage-target.patch new file mode 100644 index 00000000000..e82c55d3d4c --- /dev/null +++ b/queue-2.6.35/powerpc-fix-typo-in-uimage-target.patch @@ -0,0 +1,34 @@ +From c686ecf5040d287a68d4fca7f1948472f556a6d3 Mon Sep 17 00:00:00 2001 +From: Anatolij Gustschin +Date: Sun, 15 Aug 2010 22:26:56 +0000 +Subject: powerpc: Fix typo in uImage target + +From: Anatolij Gustschin + +commit c686ecf5040d287a68d4fca7f1948472f556a6d3 upstream. + +Commit e32e78c5ee8aadef020fbaecbe6fb741ed9029fd +(powerpc: fix build with make 3.82) introduced a +typo in uImage target and broke building uImage: + +make: *** No rule to make target `uImage'. Stop. + +Signed-off-by: Anatolij Gustschin +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/powerpc/Makefile ++++ b/arch/powerpc/Makefile +@@ -164,7 +164,7 @@ drivers-$(CONFIG_OPROFILE) += arch/power + all: zImage + + # With make 3.82 we cannot mix normal and wildcard targets +-BOOT_TARGETS1 := zImage zImage.initrd uImaged ++BOOT_TARGETS1 := zImage zImage.initrd uImage + BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% + + PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2) diff --git a/queue-2.6.35/powerpc-initialise-paca-kstack-before-early_setup_secondary.patch b/queue-2.6.35/powerpc-initialise-paca-kstack-before-early_setup_secondary.patch new file mode 100644 index 00000000000..135b25c8848 --- /dev/null +++ b/queue-2.6.35/powerpc-initialise-paca-kstack-before-early_setup_secondary.patch @@ -0,0 +1,51 @@ +From f761622e59433130bc33ad086ce219feee9eb961 Mon Sep 17 00:00:00 2001 +From: Matt Evans +Date: Thu, 12 Aug 2010 20:58:28 +0000 +Subject: powerpc: Initialise paca->kstack before early_setup_secondary + +From: Matt Evans + +commit f761622e59433130bc33ad086ce219feee9eb961 upstream. + +As early setup calls down to slb_initialize(), we must have kstack +initialised before checking "should we add a bolted SLB entry for our kstack?" + +Failing to do so means stack access requires an SLB miss exception to refill +an entry dynamically, if the stack isn't accessible via SLB(0) (kernel text +& static data). It's not always allowable to take such a miss, and +intermittent crashes will result. + +Primary CPUs don't have this issue; an SLB entry is not bolted for their +stack anyway (as that lives within SLB(0)). This patch therefore only +affects the init of secondaries. + +Signed-off-by: Matt Evans +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kernel/head_64.S | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/powerpc/kernel/head_64.S ++++ b/arch/powerpc/kernel/head_64.S +@@ -572,9 +572,6 @@ __secondary_start: + /* Set thread priority to MEDIUM */ + HMT_MEDIUM + +- /* Do early setup for that CPU (stab, slb, hash table pointer) */ +- bl .early_setup_secondary +- + /* Initialize the kernel stack. Just a repeat for iSeries. */ + LOAD_REG_ADDR(r3, current_set) + sldi r28,r24,3 /* get current_set[cpu#] */ +@@ -582,6 +579,9 @@ __secondary_start: + addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD + std r1,PACAKSAVE(r13) + ++ /* Do early setup for that CPU (stab, slb, hash table pointer) */ ++ bl .early_setup_secondary ++ + /* Clear backchain so we get nice backtraces */ + li r7,0 + mtlr r7 diff --git a/queue-2.6.35/series b/queue-2.6.35/series index 50d218c60c8..00dc0210e5f 100644 --- a/queue-2.6.35/series +++ b/queue-2.6.35/series @@ -95,3 +95,9 @@ drm-radeon-kms-dce3-switch-pads-to-ddc-mode-when-going-i2c.patch drm-radeon-kms-fix-sideport-detection-on-newer-rs880-boards.patch drm-radeon-kms-fix-gtt-vram-overlapping-test.patch drm-stop-information-leak-of-old-kernel-stack.patch +staging-batman-adv-unify-orig_hash_lock-spinlock-handling-to-avoid-deadlocks.patch +staging-batman-adv-create-batman_if-only-on-register-event.patch +staging-batman-adv-don-t-use-net_dev-after-dev_put.patch +staging-batman-adv-don-t-write-in-not-allocated-packet_buff.patch +powerpc-fix-typo-in-uimage-target.patch +powerpc-initialise-paca-kstack-before-early_setup_secondary.patch diff --git a/queue-2.6.35/staging-batman-adv-create-batman_if-only-on-register-event.patch b/queue-2.6.35/staging-batman-adv-create-batman_if-only-on-register-event.patch new file mode 100644 index 00000000000..0ea6a84899a --- /dev/null +++ b/queue-2.6.35/staging-batman-adv-create-batman_if-only-on-register-event.patch @@ -0,0 +1,45 @@ +From 1189f130f89b73eecb6117c0fc5e90abbcb7faa0 Mon Sep 17 00:00:00 2001 +From: Sven Eckelmann +Date: Sat, 21 Aug 2010 14:18:08 +0200 +Subject: Staging: batman-adv: Create batman_if only on register event + +From: Sven Eckelmann + +commit 1189f130f89b73eecb6117c0fc5e90abbcb7faa0 upstream. + +We try to get all events for all net_devices to be able to add special +sysfs folders for the batman-adv configuration. This also includes such +events like NETDEV_POST_INIT which has no valid kobject according to +v2.6.32-rc3-13-g7ffbe3f. This would create an oops in that situation. + +It is enough to create the batman_if only on NETDEV_REGISTER events +because we will also receive those events for devices which already +existed when we registered the notifier call. + +Signed-off-by: Sven Eckelmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/batman-adv/hard-interface.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/staging/batman-adv/hard-interface.c ++++ b/drivers/staging/batman-adv/hard-interface.c +@@ -397,15 +397,13 @@ static int hard_if_event(struct notifier + /* FIXME: each batman_if will be attached to a softif */ + struct bat_priv *bat_priv = netdev_priv(soft_device); + +- if (!batman_if) +- batman_if = hardif_add_interface(net_dev); ++ if (!batman_if && event == NETDEV_REGISTER) ++ batman_if = hardif_add_interface(net_dev); + + if (!batman_if) + goto out; + + switch (event) { +- case NETDEV_REGISTER: +- break; + case NETDEV_UP: + hardif_activate_interface(bat_priv, batman_if); + break; diff --git a/queue-2.6.35/staging-batman-adv-don-t-use-net_dev-after-dev_put.patch b/queue-2.6.35/staging-batman-adv-don-t-use-net_dev-after-dev_put.patch new file mode 100644 index 00000000000..03124f9c291 --- /dev/null +++ b/queue-2.6.35/staging-batman-adv-don-t-use-net_dev-after-dev_put.patch @@ -0,0 +1,80 @@ +From 51a00eaf6e008b60943af6ab68c17ac3622208dc Mon Sep 17 00:00:00 2001 +From: Sven Eckelmann +Date: Sat, 21 Aug 2010 14:18:09 +0200 +Subject: Staging: batman-adv: Don't use net_dev after dev_put + +From: Sven Eckelmann + +commit 51a00eaf6e008b60943af6ab68c17ac3622208dc upstream. + +dev_put allows a device to be freed when all its references are dropped. +After that we are not allowed to access that information anymore. Access +to the data structure of a net_device must be surrounded a dev_hold +and ended using dev_put. + +batman-adv adds a device to its own management structure in +hardif_add_interface and will release it in hardif_remove_interface. +Thus it must hold a reference all the time between those functions to +prevent any access to the already released net_device structure. + +Reported-by: Tim Glaremin +Signed-off-by: Sven Eckelmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/batman-adv/hard-interface.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +--- a/drivers/staging/batman-adv/hard-interface.c ++++ b/drivers/staging/batman-adv/hard-interface.c +@@ -194,8 +194,6 @@ static void hardif_activate_interface(st + if (batman_if->if_status != IF_INACTIVE) + return; + +- dev_hold(batman_if->net_dev); +- + update_mac_addresses(batman_if); + batman_if->if_status = IF_TO_BE_ACTIVATED; + +@@ -222,8 +220,6 @@ static void hardif_deactivate_interface( + (batman_if->if_status != IF_TO_BE_ACTIVATED)) + return; + +- dev_put(batman_if->net_dev); +- + batman_if->if_status = IF_INACTIVE; + + printk(KERN_INFO "batman-adv:Interface deactivated: %s\n", +@@ -321,12 +317,14 @@ static struct batman_if *hardif_add_inte + if (ret != 1) + goto out; + ++ dev_hold(net_dev); ++ + batman_if = kmalloc(sizeof(struct batman_if), GFP_ATOMIC); + if (!batman_if) { + printk(KERN_ERR "batman-adv:" + "Can't add interface (%s): out of memory\n", + net_dev->name); +- goto out; ++ goto release_dev; + } + + batman_if->dev = kstrdup(net_dev->name, GFP_ATOMIC); +@@ -350,6 +348,8 @@ free_dev: + kfree(batman_if->dev); + free_if: + kfree(batman_if); ++release_dev: ++ dev_put(net_dev); + out: + return NULL; + } +@@ -378,6 +378,7 @@ static void hardif_remove_interface(stru + batman_if->if_status = IF_TO_BE_REMOVED; + list_del_rcu(&batman_if->list); + sysfs_del_hardif(&batman_if->hardif_obj); ++ dev_put(batman_if->net_dev); + call_rcu(&batman_if->rcu, hardif_free_interface); + } + diff --git a/queue-2.6.35/staging-batman-adv-don-t-write-in-not-allocated-packet_buff.patch b/queue-2.6.35/staging-batman-adv-don-t-write-in-not-allocated-packet_buff.patch new file mode 100644 index 00000000000..901c6c9dd25 --- /dev/null +++ b/queue-2.6.35/staging-batman-adv-don-t-write-in-not-allocated-packet_buff.patch @@ -0,0 +1,52 @@ +From f86b9984250fa2b71ce36d4693a939a58579583b Mon Sep 17 00:00:00 2001 +From: Sven Eckelmann +Date: Sat, 21 Aug 2010 14:18:10 +0200 +Subject: Staging: batman-adv: Don't write in not allocated packet_buff + +From: Sven Eckelmann + +commit f86b9984250fa2b71ce36d4693a939a58579583b upstream. + +Each net_device in a system will automatically managed as a possible +batman_if and holds different informations like a buffer with a prepared +originator messages. To reduce the memory usage, the packet_buff will +only be allocated when the interface is really added/enabled for +batman-adv. + +The function to update the hw address information inside the packet_buff +just assumes that the packet_buff is always initialised and thus the +kernel will just oops when we try to change the hw address of a not +already fully enabled interface. + +We must always check if the packet_buff is allocated before we try to +change information inside of it. + +Reported-by: Tim Glaremin +Reported-by: Kazuki Shimada +Signed-off-by: Sven Eckelmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/batman-adv/hard-interface.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/staging/batman-adv/hard-interface.c ++++ b/drivers/staging/batman-adv/hard-interface.c +@@ -128,6 +128,9 @@ static bool hardif_is_iface_up(struct ba + + static void update_mac_addresses(struct batman_if *batman_if) + { ++ if (!batman_if || !batman_if->packet_buff) ++ return; ++ + addr_to_string(batman_if->addr_str, batman_if->net_dev->dev_addr); + + memcpy(((struct batman_packet *)(batman_if->packet_buff))->orig, +@@ -338,6 +341,7 @@ static struct batman_if *hardif_add_inte + batman_if->if_num = -1; + batman_if->net_dev = net_dev; + batman_if->if_status = IF_NOT_IN_USE; ++ batman_if->packet_buff = NULL; + INIT_LIST_HEAD(&batman_if->list); + + check_known_mac_addr(batman_if->net_dev->dev_addr); diff --git a/queue-2.6.35/staging-batman-adv-unify-orig_hash_lock-spinlock-handling-to-avoid-deadlocks.patch b/queue-2.6.35/staging-batman-adv-unify-orig_hash_lock-spinlock-handling-to-avoid-deadlocks.patch new file mode 100644 index 00000000000..b813e4d4c93 --- /dev/null +++ b/queue-2.6.35/staging-batman-adv-unify-orig_hash_lock-spinlock-handling-to-avoid-deadlocks.patch @@ -0,0 +1,80 @@ +From 9abc10238e1df7ce81c58a441f65efd5e905b9e8 Mon Sep 17 00:00:00 2001 +From: Marek Lindner +Date: Mon, 9 Aug 2010 23:56:39 +0200 +Subject: Staging: batman-adv: unify orig_hash_lock spinlock handling to avoid deadlocks + +From: Marek Lindner + +commit 9abc10238e1df7ce81c58a441f65efd5e905b9e8 upstream. + +The orig_hash_lock spinlock always has to be locked with IRQs being +disabled to avoid deadlocks between code that is being executed in +IRQ context and code that is being executed in non-IRQ context. + +Reported-by: Sven Eckelmann +Signed-off-by: Marek Lindner +Signed-off-by: Sven Eckelmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/batman-adv/originator.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +--- a/drivers/staging/batman-adv/originator.c ++++ b/drivers/staging/batman-adv/originator.c +@@ -401,11 +401,12 @@ static int orig_node_add_if(struct orig_ + int orig_hash_add_if(struct batman_if *batman_if, int max_if_num) + { + struct orig_node *orig_node; ++ unsigned long flags; + HASHIT(hashit); + + /* resize all orig nodes because orig_node->bcast_own(_sum) depend on + * if_num */ +- spin_lock(&orig_hash_lock); ++ spin_lock_irqsave(&orig_hash_lock, flags); + + while (hash_iterate(orig_hash, &hashit)) { + orig_node = hashit.bucket->data; +@@ -414,11 +415,11 @@ int orig_hash_add_if(struct batman_if *b + goto err; + } + +- spin_unlock(&orig_hash_lock); ++ spin_unlock_irqrestore(&orig_hash_lock, flags); + return 0; + + err: +- spin_unlock(&orig_hash_lock); ++ spin_unlock_irqrestore(&orig_hash_lock, flags); + return -ENOMEM; + } + +@@ -480,12 +481,13 @@ int orig_hash_del_if(struct batman_if *b + { + struct batman_if *batman_if_tmp; + struct orig_node *orig_node; ++ unsigned long flags; + HASHIT(hashit); + int ret; + + /* resize all orig nodes because orig_node->bcast_own(_sum) depend on + * if_num */ +- spin_lock(&orig_hash_lock); ++ spin_lock_irqsave(&orig_hash_lock, flags); + + while (hash_iterate(orig_hash, &hashit)) { + orig_node = hashit.bucket->data; +@@ -512,10 +514,10 @@ int orig_hash_del_if(struct batman_if *b + rcu_read_unlock(); + + batman_if->if_num = -1; +- spin_unlock(&orig_hash_lock); ++ spin_unlock_irqrestore(&orig_hash_lock, flags); + return 0; + + err: +- spin_unlock(&orig_hash_lock); ++ spin_unlock_irqrestore(&orig_hash_lock, flags); + return -ENOMEM; + }