aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/sysctl/kernel.txt5
-rw-r--r--MAINTAINERS8
-rw-r--r--arch/sh/kernel/cpu/sh4/sq.c10
-rw-r--r--arch/x86_64/kernel/smp.c2
-rw-r--r--drivers/acpi/acpi_memhotplug.c13
-rw-r--r--drivers/char/hvsi.c8
-rw-r--r--drivers/char/hw_random/omap-rng.c51
-rw-r--r--drivers/edac/edac_mc.h1
-rw-r--r--drivers/i2c/busses/scx200_acb.c7
-rw-r--r--drivers/ieee1394/sbp2.c3
-rw-r--r--drivers/isdn/hardware/eicon/divasync.h1
-rw-r--r--drivers/md/linear.c6
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c8
-rw-r--r--drivers/video/aty/aty128fb.c10
-rw-r--r--drivers/video/au1100fb.c18
-rw-r--r--fs/befs/linuxvfs.c11
-rw-r--r--fs/reiserfs/file.c2
-rw-r--r--fs/reiserfs/inode.c26
-rw-r--r--fs/reiserfs/ioctl.c2
-rw-r--r--fs/udf/ialloc.c11
-rw-r--r--fs/ufs/balloc.c2
-rw-r--r--fs/ufs/util.c17
-rw-r--r--include/linux/debug_locks.h2
-rw-r--r--include/linux/sched.h8
-rw-r--r--include/linux/vmstat.h8
-rw-r--r--kernel/fork.c4
-rw-r--r--kernel/futex.c1
-rw-r--r--kernel/futex_compat.c6
-rw-r--r--kernel/power/process.c26
-rw-r--r--kernel/printk.c4
-rw-r--r--kernel/resource.c9
-rw-r--r--lib/spinlock_debug.c10
-rw-r--r--mm/fadvise.c3
-rw-r--r--mm/memory_hotplug.c44
-rw-r--r--net/sunrpc/cache.c6
35 files changed, 217 insertions, 136 deletions
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index b0c7ab93dcb9..7345c338080a 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -211,9 +211,8 @@ Controls the kernel's behaviour when an oops or BUG is encountered.
211 211
2120: try to continue operation 2120: try to continue operation
213 213
2141: delay a few seconds (to give klogd time to record the oops output) and 2141: panic immediatly. If the `panic' sysctl is also non-zero then the
215 then panic. If the `panic' sysctl is also non-zero then the machine will 215 machine will be rebooted.
216 be rebooted.
217 216
218============================================================== 217==============================================================
219 218
diff --git a/MAINTAINERS b/MAINTAINERS
index bac3f706f75e..bd82e99a8c21 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2641,6 +2641,14 @@ M: dbrownell@users.sourceforge.net
2641L: spi-devel-general@lists.sourceforge.net 2641L: spi-devel-general@lists.sourceforge.net
2642S: Maintained 2642S: Maintained
2643 2643
2644STABLE BRANCH:
2645P: Greg Kroah-Hartman
2646M: greg@kroah.com
2647P: Chris Wright
2648M: chrisw@sous-sol.org
2649L: stable@kernel.org
2650S: Maintained
2651
2644TPM DEVICE DRIVER 2652TPM DEVICE DRIVER
2645P: Kylene Hall 2653P: Kylene Hall
2646M: kjhall@us.ibm.com 2654M: kjhall@us.ibm.com
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index 781dbb11c038..b09805f3ee23 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -421,18 +421,22 @@ static struct miscdevice sq_dev = {
421 421
422static int __init sq_api_init(void) 422static int __init sq_api_init(void)
423{ 423{
424 int ret;
424 printk(KERN_NOTICE "sq: Registering store queue API.\n"); 425 printk(KERN_NOTICE "sq: Registering store queue API.\n");
425 426
426#ifdef CONFIG_PROC_FS
427 create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0); 427 create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0);
428#endif
429 428
430 return misc_register(&sq_dev); 429 ret = misc_register(&sq_dev);
430 if (ret)
431 remove_proc_entry("sq_mapping", NULL);
432
433 return ret;
431} 434}
432 435
433static void __exit sq_api_exit(void) 436static void __exit sq_api_exit(void)
434{ 437{
435 misc_deregister(&sq_dev); 438 misc_deregister(&sq_dev);
439 remove_proc_entry("sq_mapping", NULL);
436} 440}
437 441
438module_init(sq_api_init); 442module_init(sq_api_init);
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
index 5a1c0a3bf872..06af6ca60129 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86_64/kernel/smp.c
@@ -203,7 +203,7 @@ int __cpuinit init_smp_flush(void)
203{ 203{
204 int i; 204 int i;
205 for_each_cpu_mask(i, cpu_possible_map) { 205 for_each_cpu_mask(i, cpu_possible_map) {
206 spin_lock_init(&per_cpu(flush_state.tlbstate_lock, i)); 206 spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock);
207 } 207 }
208 return 0; 208 return 0;
209} 209}
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 81e970adeab3..b0d4b147b19e 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -129,11 +129,15 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
129 struct acpi_memory_info *info, *n; 129 struct acpi_memory_info *info, *n;
130 130
131 131
132 if (!list_empty(&mem_device->res_list))
133 return 0;
134
132 status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS, 135 status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,
133 acpi_memory_get_resource, mem_device); 136 acpi_memory_get_resource, mem_device);
134 if (ACPI_FAILURE(status)) { 137 if (ACPI_FAILURE(status)) {
135 list_for_each_entry_safe(info, n, &mem_device->res_list, list) 138 list_for_each_entry_safe(info, n, &mem_device->res_list, list)
136 kfree(info); 139 kfree(info);
140 INIT_LIST_HEAD(&mem_device->res_list);
137 return -EINVAL; 141 return -EINVAL;
138 } 142 }
139 143
@@ -230,17 +234,10 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
230 * (i.e. memory-hot-remove function) 234 * (i.e. memory-hot-remove function)
231 */ 235 */
232 list_for_each_entry(info, &mem_device->res_list, list) { 236 list_for_each_entry(info, &mem_device->res_list, list) {
233 u64 start_pfn, end_pfn; 237 if (info->enabled) { /* just sanity check...*/
234
235 start_pfn = info->start_addr >> PAGE_SHIFT;
236 end_pfn = (info->start_addr + info->length - 1) >> PAGE_SHIFT;
237
238 if (pfn_valid(start_pfn) || pfn_valid(end_pfn)) {
239 /* already enabled. try next area */
240 num_enabled++; 238 num_enabled++;
241 continue; 239 continue;
242 } 240 }
243
244 result = add_memory(node, info->start_addr, info->length); 241 result = add_memory(node, info->start_addr, info->length);
245 if (result) 242 if (result)
246 continue; 243 continue;
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c
index 41db8060e8f7..017f755632a3 100644
--- a/drivers/char/hvsi.c
+++ b/drivers/char/hvsi.c
@@ -311,7 +311,8 @@ static void hvsi_recv_control(struct hvsi_struct *hp, uint8_t *packet,
311 /* CD went away; no more connection */ 311 /* CD went away; no more connection */
312 pr_debug("hvsi%i: CD dropped\n", hp->index); 312 pr_debug("hvsi%i: CD dropped\n", hp->index);
313 hp->mctrl &= TIOCM_CD; 313 hp->mctrl &= TIOCM_CD;
314 if (!(hp->tty->flags & CLOCAL)) 314 /* If userland hasn't done an open(2) yet, hp->tty is NULL. */
315 if (hp->tty && !(hp->tty->flags & CLOCAL))
315 *to_hangup = hp->tty; 316 *to_hangup = hp->tty;
316 } 317 }
317 break; 318 break;
@@ -986,10 +987,7 @@ static void hvsi_write_worker(void *arg)
986 start_j = 0; 987 start_j = 0;
987#endif /* DEBUG */ 988#endif /* DEBUG */
988 wake_up_all(&hp->emptyq); 989 wake_up_all(&hp->emptyq);
989 if (test_bit(TTY_DO_WRITE_WAKEUP, &hp->tty->flags) 990 tty_wakeup(hp->tty);
990 && hp->tty->ldisc.write_wakeup)
991 hp->tty->ldisc.write_wakeup(hp->tty);
992 wake_up_interruptible(&hp->tty->write_wait);
993 } 991 }
994 992
995out: 993out:
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 819516b35a79..a01d796d1eeb 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -25,12 +25,12 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/random.h> 27#include <linux/random.h>
28#include <linux/clk.h>
28#include <linux/err.h> 29#include <linux/err.h>
29#include <linux/device.h> 30#include <linux/platform_device.h>
30#include <linux/hw_random.h> 31#include <linux/hw_random.h>
31 32
32#include <asm/io.h> 33#include <asm/io.h>
33#include <asm/hardware/clock.h>
34 34
35#define RNG_OUT_REG 0x00 /* Output register */ 35#define RNG_OUT_REG 0x00 /* Output register */
36#define RNG_STAT_REG 0x04 /* Status register 36#define RNG_STAT_REG 0x04 /* Status register
@@ -52,7 +52,7 @@
52 52
53static void __iomem *rng_base; 53static void __iomem *rng_base;
54static struct clk *rng_ick; 54static struct clk *rng_ick;
55static struct device *rng_dev; 55static struct platform_device *rng_dev;
56 56
57static u32 omap_rng_read_reg(int reg) 57static u32 omap_rng_read_reg(int reg)
58{ 58{
@@ -83,9 +83,8 @@ static struct hwrng omap_rng_ops = {
83 .data_read = omap_rng_data_read, 83 .data_read = omap_rng_data_read,
84}; 84};
85 85
86static int __init omap_rng_probe(struct device *dev) 86static int __init omap_rng_probe(struct platform_device *pdev)
87{ 87{
88 struct platform_device *pdev = to_platform_device(dev);
89 struct resource *res, *mem; 88 struct resource *res, *mem;
90 int ret; 89 int ret;
91 90
@@ -95,16 +94,14 @@ static int __init omap_rng_probe(struct device *dev)
95 */ 94 */
96 BUG_ON(rng_dev); 95 BUG_ON(rng_dev);
97 96
98 if (cpu_is_omap24xx()) { 97 if (cpu_is_omap24xx()) {
99 rng_ick = clk_get(NULL, "rng_ick"); 98 rng_ick = clk_get(NULL, "rng_ick");
100 if (IS_ERR(rng_ick)) { 99 if (IS_ERR(rng_ick)) {
101 dev_err(dev, "Could not get rng_ick\n"); 100 dev_err(&pdev->dev, "Could not get rng_ick\n");
102 ret = PTR_ERR(rng_ick); 101 ret = PTR_ERR(rng_ick);
103 return ret; 102 return ret;
104 } 103 } else
105 else { 104 clk_enable(rng_ick);
106 clk_use(rng_ick);
107 }
108 } 105 }
109 106
110 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 107 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -117,7 +114,7 @@ static int __init omap_rng_probe(struct device *dev)
117 if (mem == NULL) 114 if (mem == NULL)
118 return -EBUSY; 115 return -EBUSY;
119 116
120 dev_set_drvdata(dev, mem); 117 dev_set_drvdata(&pdev->dev, mem);
121 rng_base = (u32 __iomem *)io_p2v(res->start); 118 rng_base = (u32 __iomem *)io_p2v(res->start);
122 119
123 ret = hwrng_register(&omap_rng_ops); 120 ret = hwrng_register(&omap_rng_ops);
@@ -127,25 +124,25 @@ static int __init omap_rng_probe(struct device *dev)
127 return ret; 124 return ret;
128 } 125 }
129 126
130 dev_info(dev, "OMAP Random Number Generator ver. %02x\n", 127 dev_info(&pdev->dev, "OMAP Random Number Generator ver. %02x\n",
131 omap_rng_read_reg(RNG_REV_REG)); 128 omap_rng_read_reg(RNG_REV_REG));
132 omap_rng_write_reg(RNG_MASK_REG, 0x1); 129 omap_rng_write_reg(RNG_MASK_REG, 0x1);
133 130
134 rng_dev = dev; 131 rng_dev = pdev;
135 132
136 return 0; 133 return 0;
137} 134}
138 135
139static int __exit omap_rng_remove(struct device *dev) 136static int __exit omap_rng_remove(struct platform_device *pdev)
140{ 137{
141 struct resource *mem = dev_get_drvdata(dev); 138 struct resource *mem = dev_get_drvdata(&pdev->dev);
142 139
143 hwrng_unregister(&omap_rng_ops); 140 hwrng_unregister(&omap_rng_ops);
144 141
145 omap_rng_write_reg(RNG_MASK_REG, 0x0); 142 omap_rng_write_reg(RNG_MASK_REG, 0x0);
146 143
147 if (cpu_is_omap24xx()) { 144 if (cpu_is_omap24xx()) {
148 clk_unuse(rng_ick); 145 clk_disable(rng_ick);
149 clk_put(rng_ick); 146 clk_put(rng_ick);
150 } 147 }
151 148
@@ -157,18 +154,16 @@ static int __exit omap_rng_remove(struct device *dev)
157 154
158#ifdef CONFIG_PM 155#ifdef CONFIG_PM
159 156
160static int omap_rng_suspend(struct device *dev, pm_message_t message, u32 level) 157static int omap_rng_suspend(struct platform_device *pdev, pm_message_t message)
161{ 158{
162 omap_rng_write_reg(RNG_MASK_REG, 0x0); 159 omap_rng_write_reg(RNG_MASK_REG, 0x0);
163
164 return 0; 160 return 0;
165} 161}
166 162
167static int omap_rng_resume(struct device *dev, pm_message_t message, u32 level) 163static int omap_rng_resume(struct platform_device *pdev)
168{ 164{
169 omap_rng_write_reg(RNG_MASK_REG, 0x1); 165 omap_rng_write_reg(RNG_MASK_REG, 0x1);
170 166 return 0;
171 return 1;
172} 167}
173 168
174#else 169#else
@@ -179,9 +174,11 @@ static int omap_rng_resume(struct device *dev, pm_message_t message, u32 level)
179#endif 174#endif
180 175
181 176
182static struct device_driver omap_rng_driver = { 177static struct platform_driver omap_rng_driver = {
183 .name = "omap_rng", 178 .driver = {
184 .bus = &platform_bus_type, 179 .name = "omap_rng",
180 .owner = THIS_MODULE,
181 },
185 .probe = omap_rng_probe, 182 .probe = omap_rng_probe,
186 .remove = __exit_p(omap_rng_remove), 183 .remove = __exit_p(omap_rng_remove),
187 .suspend = omap_rng_suspend, 184 .suspend = omap_rng_suspend,
@@ -193,12 +190,12 @@ static int __init omap_rng_init(void)
193 if (!cpu_is_omap16xx() && !cpu_is_omap24xx()) 190 if (!cpu_is_omap16xx() && !cpu_is_omap24xx())
194 return -ENODEV; 191 return -ENODEV;
195 192
196 return driver_register(&omap_rng_driver); 193 return platform_driver_register(&omap_rng_driver);
197} 194}
198 195
199static void __exit omap_rng_exit(void) 196static void __exit omap_rng_exit(void)
200{ 197{
201 driver_unregister(&omap_rng_driver); 198 platform_driver_unregister(&omap_rng_driver);
202} 199}
203 200
204module_init(omap_rng_init); 201module_init(omap_rng_init);
diff --git a/drivers/edac/edac_mc.h b/drivers/edac/edac_mc.h
index bf6ab8a8d5ed..a1cfd4e3c97d 100644
--- a/drivers/edac/edac_mc.h
+++ b/drivers/edac/edac_mc.h
@@ -29,6 +29,7 @@
29#include <linux/rcupdate.h> 29#include <linux/rcupdate.h>
30#include <linux/completion.h> 30#include <linux/completion.h>
31#include <linux/kobject.h> 31#include <linux/kobject.h>
32#include <linux/platform_device.h>
32 33
33#define EDAC_MC_LABEL_LEN 31 34#define EDAC_MC_LABEL_LEN 31
34#define MC_PROC_NAME_MAX_LEN 7 35#define MC_PROC_NAME_MAX_LEN 7
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index ced309ff056f..eae9e81be375 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -232,7 +232,7 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface)
232 unsigned long timeout; 232 unsigned long timeout;
233 233
234 timeout = jiffies + POLL_TIMEOUT; 234 timeout = jiffies + POLL_TIMEOUT;
235 while (time_before(jiffies, timeout)) { 235 while (1) {
236 status = inb(ACBST); 236 status = inb(ACBST);
237 237
238 /* Reset the status register to avoid the hang */ 238 /* Reset the status register to avoid the hang */
@@ -242,7 +242,10 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface)
242 scx200_acb_machine(iface, status); 242 scx200_acb_machine(iface, status);
243 return; 243 return;
244 } 244 }
245 yield(); 245 if (time_after(jiffies, timeout))
246 break;
247 cpu_relax();
248 cond_resched();
246 } 249 }
247 250
248 dev_err(&iface->adapter.dev, "timeout in state %s\n", 251 dev_err(&iface->adapter.dev, "timeout in state %s\n",
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index aaa74f293aaf..b08755e2e68f 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -2515,6 +2515,9 @@ static int sbp2scsi_slave_configure(struct scsi_device *sdev)
2515 sdev->skip_ms_page_8 = 1; 2515 sdev->skip_ms_page_8 = 1;
2516 if (scsi_id->workarounds & SBP2_WORKAROUND_FIX_CAPACITY) 2516 if (scsi_id->workarounds & SBP2_WORKAROUND_FIX_CAPACITY)
2517 sdev->fix_capacity = 1; 2517 sdev->fix_capacity = 1;
2518 if (scsi_id->ne->guid_vendor_id == 0x0010b9 && /* Maxtor's OUI */
2519 (sdev->type == TYPE_DISK || sdev->type == TYPE_RBC))
2520 sdev->allow_restart = 1;
2518 return 0; 2521 return 0;
2519} 2522}
2520 2523
diff --git a/drivers/isdn/hardware/eicon/divasync.h b/drivers/isdn/hardware/eicon/divasync.h
index 0a5be7f969f2..af3eb9e795b5 100644
--- a/drivers/isdn/hardware/eicon/divasync.h
+++ b/drivers/isdn/hardware/eicon/divasync.h
@@ -256,7 +256,6 @@ typedef struct
256#define NO_ORDER_CHECK_MASK 0x00000010 256#define NO_ORDER_CHECK_MASK 0x00000010
257#define LOW_CHANNEL_MASK 0x00000020 257#define LOW_CHANNEL_MASK 0x00000020
258#define NO_HSCX30_MASK 0x00000040 258#define NO_HSCX30_MASK 0x00000040
259#define MODE_MASK 0x00000080
260#define SET_BOARD 0x00001000 259#define SET_BOARD 0x00001000
261#define SET_CRC4 0x00030000 260#define SET_CRC4 0x00030000
262#define SET_L1_TRISTATE 0x00040000 261#define SET_L1_TRISTATE 0x00040000
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index ff83c9b5979e..b99c19c7eb22 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -162,7 +162,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
162 goto out; 162 goto out;
163 } 163 }
164 164
165 min_spacing = mddev->array_size; 165 min_spacing = conf->array_size;
166 sector_div(min_spacing, PAGE_SIZE/sizeof(struct dev_info *)); 166 sector_div(min_spacing, PAGE_SIZE/sizeof(struct dev_info *));
167 167
168 /* min_spacing is the minimum spacing that will fit the hash 168 /* min_spacing is the minimum spacing that will fit the hash
@@ -171,7 +171,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
171 * that is larger than min_spacing as use the size of that as 171 * that is larger than min_spacing as use the size of that as
172 * the actual spacing 172 * the actual spacing
173 */ 173 */
174 conf->hash_spacing = mddev->array_size; 174 conf->hash_spacing = conf->array_size;
175 for (i=0; i < cnt-1 ; i++) { 175 for (i=0; i < cnt-1 ; i++) {
176 sector_t sz = 0; 176 sector_t sz = 0;
177 int j; 177 int j;
@@ -228,7 +228,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
228 curr_offset = 0; 228 curr_offset = 0;
229 i = 0; 229 i = 0;
230 for (curr_offset = 0; 230 for (curr_offset = 0;
231 curr_offset < mddev->array_size; 231 curr_offset < conf->array_size;
232 curr_offset += conf->hash_spacing) { 232 curr_offset += conf->hash_spacing) {
233 233
234 while (i < mddev->raid_disks-1 && 234 while (i < mddev->raid_disks-1 &&
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 212268881857..dc79b0a0059f 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -173,6 +173,9 @@ pnpacpi_parse_allocated_address_space(struct pnp_resource_table *res_table,
173 return; 173 return;
174 } 174 }
175 175
176 if (p->producer_consumer == ACPI_PRODUCER)
177 return;
178
176 if (p->resource_type == ACPI_MEMORY_RANGE) 179 if (p->resource_type == ACPI_MEMORY_RANGE)
177 pnpacpi_parse_allocated_memresource(res_table, 180 pnpacpi_parse_allocated_memresource(res_table,
178 p->minimum, p->address_length); 181 p->minimum, p->address_length);
@@ -252,9 +255,14 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
252 break; 255 break;
253 256
254 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64: 257 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
258 if (res->data.ext_address64.producer_consumer == ACPI_PRODUCER)
259 return AE_OK;
255 break; 260 break;
256 261
257 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: 262 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
263 if (res->data.extended_irq.producer_consumer == ACPI_PRODUCER)
264 return AE_OK;
265
258 for (i = 0; i < res->data.extended_irq.interrupt_count; i++) { 266 for (i = 0; i < res->data.extended_irq.interrupt_count; i++) {
259 pnpacpi_parse_allocated_irqresource(res_table, 267 pnpacpi_parse_allocated_irqresource(res_table,
260 res->data.extended_irq.interrupts[i], 268 res->data.extended_irq.interrupts[i],
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 8b08121b390b..3e827e04a2aa 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1913,9 +1913,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
1913 u8 chip_rev; 1913 u8 chip_rev;
1914 u32 dac; 1914 u32 dac;
1915 1915
1916 if (!par->vram_size) /* may have already been probed */
1917 par->vram_size = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF;
1918
1919 /* Get the chip revision */ 1916 /* Get the chip revision */
1920 chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F; 1917 chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F;
1921 1918
@@ -2028,9 +2025,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
2028 2025
2029 aty128_init_engine(par); 2026 aty128_init_engine(par);
2030 2027
2031 if (register_framebuffer(info) < 0)
2032 return 0;
2033
2034 par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM); 2028 par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM);
2035 par->pdev = pdev; 2029 par->pdev = pdev;
2036 par->asleep = 0; 2030 par->asleep = 0;
@@ -2040,6 +2034,9 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
2040 aty128_bl_init(par); 2034 aty128_bl_init(par);
2041#endif 2035#endif
2042 2036
2037 if (register_framebuffer(info) < 0)
2038 return 0;
2039
2043 printk(KERN_INFO "fb%d: %s frame buffer device on %s\n", 2040 printk(KERN_INFO "fb%d: %s frame buffer device on %s\n",
2044 info->node, info->fix.id, video_card); 2041 info->node, info->fix.id, video_card);
2045 2042
@@ -2089,7 +2086,6 @@ static int __devinit aty128_probe(struct pci_dev *pdev, const struct pci_device_
2089 par = info->par; 2086 par = info->par;
2090 2087
2091 info->pseudo_palette = par->pseudo_palette; 2088 info->pseudo_palette = par->pseudo_palette;
2092 info->fix = aty128fb_fix;
2093 2089
2094 /* Virtualize mmio region */ 2090 /* Virtualize mmio region */
2095 info->fix.mmio_start = reg_addr; 2091 info->fix.mmio_start = reg_addr;
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index a92a91fef16f..f25d5d648333 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -156,7 +156,7 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
156 156
157 info->fix.visual = FB_VISUAL_TRUECOLOR; 157 info->fix.visual = FB_VISUAL_TRUECOLOR;
158 info->fix.line_length = info->var.xres_virtual << 1; /* depth=16 */ 158 info->fix.line_length = info->var.xres_virtual << 1; /* depth=16 */
159 } 159 }
160 } else { 160 } else {
161 /* mono */ 161 /* mono */
162 info->fix.visual = FB_VISUAL_MONO10; 162 info->fix.visual = FB_VISUAL_MONO10;
@@ -164,20 +164,16 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
164 } 164 }
165 165
166 info->screen_size = info->fix.line_length * info->var.yres_virtual; 166 info->screen_size = info->fix.line_length * info->var.yres_virtual;
167 info->var.rotate = ((fbdev->panel->control_base&LCD_CONTROL_SM_MASK) \
168 >> LCD_CONTROL_SM_BIT) * 90;
167 169
168 /* Determine BPP mode and format */ 170 /* Determine BPP mode and format */
169 fbdev->regs->lcd_control = fbdev->panel->control_base | 171 fbdev->regs->lcd_control = fbdev->panel->control_base;
170 ((info->var.rotate/90) << LCD_CONTROL_SM_BIT);
171
172 fbdev->regs->lcd_intenable = 0;
173 fbdev->regs->lcd_intstatus = 0;
174
175 fbdev->regs->lcd_horztiming = fbdev->panel->horztiming; 172 fbdev->regs->lcd_horztiming = fbdev->panel->horztiming;
176
177 fbdev->regs->lcd_verttiming = fbdev->panel->verttiming; 173 fbdev->regs->lcd_verttiming = fbdev->panel->verttiming;
178
179 fbdev->regs->lcd_clkcontrol = fbdev->panel->clkcontrol_base; 174 fbdev->regs->lcd_clkcontrol = fbdev->panel->clkcontrol_base;
180 175 fbdev->regs->lcd_intenable = 0;
176 fbdev->regs->lcd_intstatus = 0;
181 fbdev->regs->lcd_dmaaddr0 = LCD_DMA_SA_N(fbdev->fb_phys); 177 fbdev->regs->lcd_dmaaddr0 = LCD_DMA_SA_N(fbdev->fb_phys);
182 178
183 if (panel_is_dual(fbdev->panel)) { 179 if (panel_is_dual(fbdev->panel)) {
@@ -206,6 +202,8 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
206 202
207 /* Resume controller */ 203 /* Resume controller */
208 fbdev->regs->lcd_control |= LCD_CONTROL_GO; 204 fbdev->regs->lcd_control |= LCD_CONTROL_GO;
205 mdelay(10);
206 au1100fb_fb_blank(VESA_NO_BLANKING, info);
209 207
210 return 0; 208 return 0;
211} 209}
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index fcaeead9696b..50cfca5c7efd 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -512,7 +512,11 @@ befs_utf2nls(struct super_block *sb, const char *in,
512 wchar_t uni; 512 wchar_t uni;
513 int unilen, utflen; 513 int unilen, utflen;
514 char *result; 514 char *result;
515 int maxlen = in_len; /* The utf8->nls conversion can't make more chars */ 515 /* The utf8->nls conversion won't make the final nls string bigger
516 * than the utf one, but if the string is pure ascii they'll have the
517 * same width and an extra char is needed to save the additional \0
518 */
519 int maxlen = in_len + 1;
516 520
517 befs_debug(sb, "---> utf2nls()"); 521 befs_debug(sb, "---> utf2nls()");
518 522
@@ -588,7 +592,10 @@ befs_nls2utf(struct super_block *sb, const char *in,
588 wchar_t uni; 592 wchar_t uni;
589 int unilen, utflen; 593 int unilen, utflen;
590 char *result; 594 char *result;
591 int maxlen = 3 * in_len; 595 /* There're nls characters that will translate to 3-chars-wide UTF-8
596 * characters, a additional byte is needed to save the final \0
597 * in special cases */
598 int maxlen = (3 * in_len) + 1;
592 599
593 befs_debug(sb, "---> nls2utf()\n"); 600 befs_debug(sb, "---> nls2utf()\n");
594 601
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index f318b58510fd..1627edd50810 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -48,8 +48,8 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
48 return 0; 48 return 0;
49 } 49 }
50 50
51 reiserfs_write_lock(inode->i_sb);
52 mutex_lock(&inode->i_mutex); 51 mutex_lock(&inode->i_mutex);
52 reiserfs_write_lock(inode->i_sb);
53 /* freeing preallocation only involves relogging blocks that 53 /* freeing preallocation only involves relogging blocks that
54 * are already in the current transaction. preallocation gets 54 * are already in the current transaction. preallocation gets
55 * freed at the end of each transaction, so it is impossible for 55 * freed at the end of each transaction, so it is impossible for
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 12dfdcfbee3d..52f1e2136546 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -39,14 +39,10 @@ void reiserfs_delete_inode(struct inode *inode)
39 39
40 /* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */ 40 /* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */
41 if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) { /* also handles bad_inode case */ 41 if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) { /* also handles bad_inode case */
42 mutex_lock(&inode->i_mutex);
43
44 reiserfs_delete_xattrs(inode); 42 reiserfs_delete_xattrs(inode);
45 43
46 if (journal_begin(&th, inode->i_sb, jbegin_count)) { 44 if (journal_begin(&th, inode->i_sb, jbegin_count))
47 mutex_unlock(&inode->i_mutex);
48 goto out; 45 goto out;
49 }
50 reiserfs_update_inode_transaction(inode); 46 reiserfs_update_inode_transaction(inode);
51 47
52 err = reiserfs_delete_object(&th, inode); 48 err = reiserfs_delete_object(&th, inode);
@@ -57,12 +53,8 @@ void reiserfs_delete_inode(struct inode *inode)
57 if (!err) 53 if (!err)
58 DQUOT_FREE_INODE(inode); 54 DQUOT_FREE_INODE(inode);
59 55
60 if (journal_end(&th, inode->i_sb, jbegin_count)) { 56 if (journal_end(&th, inode->i_sb, jbegin_count))
61 mutex_unlock(&inode->i_mutex);
62 goto out; 57 goto out;
63 }
64
65 mutex_unlock(&inode->i_mutex);
66 58
67 /* check return value from reiserfs_delete_object after 59 /* check return value from reiserfs_delete_object after
68 * ending the transaction 60 * ending the transaction
@@ -2348,6 +2340,7 @@ static int reiserfs_write_full_page(struct page *page,
2348 unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT; 2340 unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT;
2349 int error = 0; 2341 int error = 0;
2350 unsigned long block; 2342 unsigned long block;
2343 sector_t last_block;
2351 struct buffer_head *head, *bh; 2344 struct buffer_head *head, *bh;
2352 int partial = 0; 2345 int partial = 0;
2353 int nr = 0; 2346 int nr = 0;
@@ -2395,10 +2388,19 @@ static int reiserfs_write_full_page(struct page *page,
2395 } 2388 }
2396 bh = head; 2389 bh = head;
2397 block = page->index << (PAGE_CACHE_SHIFT - s->s_blocksize_bits); 2390 block = page->index << (PAGE_CACHE_SHIFT - s->s_blocksize_bits);
2391 last_block = (i_size_read(inode) - 1) >> inode->i_blkbits;
2398 /* first map all the buffers, logging any direct items we find */ 2392 /* first map all the buffers, logging any direct items we find */
2399 do { 2393 do {
2400 if ((checked || buffer_dirty(bh)) && (!buffer_mapped(bh) || 2394 if (block > last_block) {
2401 (buffer_mapped(bh) 2395 /*
2396 * This can happen when the block size is less than
2397 * the page size. The corresponding bytes in the page
2398 * were zero filled above
2399 */
2400 clear_buffer_dirty(bh);
2401 set_buffer_uptodate(bh);
2402 } else if ((checked || buffer_dirty(bh)) &&
2403 (!buffer_mapped(bh) || (buffer_mapped(bh)
2402 && bh->b_blocknr == 2404 && bh->b_blocknr ==
2403 0))) { 2405 0))) {
2404 /* not mapped yet, or it points to a direct item, search 2406 /* not mapped yet, or it points to a direct item, search
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
index 745c88100895..a986b5e1e288 100644
--- a/fs/reiserfs/ioctl.c
+++ b/fs/reiserfs/ioctl.c
@@ -116,12 +116,12 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp)
116 if (REISERFS_I(inode)->i_flags & i_nopack_mask) { 116 if (REISERFS_I(inode)->i_flags & i_nopack_mask) {
117 return 0; 117 return 0;
118 } 118 }
119 reiserfs_write_lock(inode->i_sb);
120 119
121 /* we need to make sure nobody is changing the file size beneath 120 /* we need to make sure nobody is changing the file size beneath
122 ** us 121 ** us
123 */ 122 */
124 mutex_lock(&inode->i_mutex); 123 mutex_lock(&inode->i_mutex);
124 reiserfs_write_lock(inode->i_sb);
125 125
126 write_from = inode->i_size & (blocksize - 1); 126 write_from = inode->i_size & (blocksize - 1);
127 /* if we are on a block boundary, we are already unpacked. */ 127 /* if we are on a block boundary, we are already unpacked. */
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c
index 3873c672cb4c..33323473e3c4 100644
--- a/fs/udf/ialloc.c
+++ b/fs/udf/ialloc.c
@@ -75,6 +75,12 @@ struct inode * udf_new_inode (struct inode *dir, int mode, int * err)
75 } 75 }
76 *err = -ENOSPC; 76 *err = -ENOSPC;
77 77
78 UDF_I_UNIQUE(inode) = 0;
79 UDF_I_LENEXTENTS(inode) = 0;
80 UDF_I_NEXT_ALLOC_BLOCK(inode) = 0;
81 UDF_I_NEXT_ALLOC_GOAL(inode) = 0;
82 UDF_I_STRAT4096(inode) = 0;
83
78 block = udf_new_block(dir->i_sb, NULL, UDF_I_LOCATION(dir).partitionReferenceNum, 84 block = udf_new_block(dir->i_sb, NULL, UDF_I_LOCATION(dir).partitionReferenceNum,
79 start, err); 85 start, err);
80 if (*err) 86 if (*err)
@@ -84,11 +90,6 @@ struct inode * udf_new_inode (struct inode *dir, int mode, int * err)
84 } 90 }
85 91
86 mutex_lock(&sbi->s_alloc_mutex); 92 mutex_lock(&sbi->s_alloc_mutex);
87 UDF_I_UNIQUE(inode) = 0;
88 UDF_I_LENEXTENTS(inode) = 0;
89 UDF_I_NEXT_ALLOC_BLOCK(inode) = 0;
90 UDF_I_NEXT_ALLOC_GOAL(inode) = 0;
91 UDF_I_STRAT4096(inode) = 0;
92 if (UDF_SB_LVIDBH(sb)) 93 if (UDF_SB_LVIDBH(sb))
93 { 94 {
94 struct logicalVolHeaderDesc *lvhd; 95 struct logicalVolHeaderDesc *lvhd;
diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c
index b01804baa120..b82381475779 100644
--- a/fs/ufs/balloc.c
+++ b/fs/ufs/balloc.c
@@ -248,7 +248,7 @@ static void ufs_change_blocknr(struct inode *inode, unsigned int baseblk,
248 248
249 if (likely(cur_index != index)) { 249 if (likely(cur_index != index)) {
250 page = ufs_get_locked_page(mapping, index); 250 page = ufs_get_locked_page(mapping, index);
251 if (IS_ERR(page)) 251 if (!page || IS_ERR(page)) /* it was truncated or EIO */
252 continue; 252 continue;
253 } else 253 } else
254 page = locked_page; 254 page = locked_page;
diff --git a/fs/ufs/util.c b/fs/ufs/util.c
index 337cf2c46d10..22f820a9b15c 100644
--- a/fs/ufs/util.c
+++ b/fs/ufs/util.c
@@ -251,12 +251,12 @@ struct page *ufs_get_locked_page(struct address_space *mapping,
251{ 251{
252 struct page *page; 252 struct page *page;
253 253
254try_again:
255 page = find_lock_page(mapping, index); 254 page = find_lock_page(mapping, index);
256 if (!page) { 255 if (!page) {
257 page = read_cache_page(mapping, index, 256 page = read_cache_page(mapping, index,
258 (filler_t*)mapping->a_ops->readpage, 257 (filler_t*)mapping->a_ops->readpage,
259 NULL); 258 NULL);
259
260 if (IS_ERR(page)) { 260 if (IS_ERR(page)) {
261 printk(KERN_ERR "ufs_change_blocknr: " 261 printk(KERN_ERR "ufs_change_blocknr: "
262 "read_cache_page error: ino %lu, index: %lu\n", 262 "read_cache_page error: ino %lu, index: %lu\n",
@@ -266,6 +266,14 @@ try_again:
266 266
267 lock_page(page); 267 lock_page(page);
268 268
269 if (unlikely(page->mapping == NULL)) {
270 /* Truncate got there first */
271 unlock_page(page);
272 page_cache_release(page);
273 page = NULL;
274 goto out;
275 }
276
269 if (!PageUptodate(page) || PageError(page)) { 277 if (!PageUptodate(page) || PageError(page)) {
270 unlock_page(page); 278 unlock_page(page);
271 page_cache_release(page); 279 page_cache_release(page);
@@ -275,15 +283,8 @@ try_again:
275 mapping->host->i_ino, index); 283 mapping->host->i_ino, index);
276 284
277 page = ERR_PTR(-EIO); 285 page = ERR_PTR(-EIO);
278 goto out;
279 } 286 }
280 } 287 }
281
282 if (unlikely(!page->mapping || !page_has_buffers(page))) {
283 unlock_page(page);
284 page_cache_release(page);
285 goto try_again;/*we really need these buffers*/
286 }
287out: 288out:
288 return page; 289 return page;
289} 290}
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index 6a7047851e48..88dafa246d87 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -1,6 +1,8 @@
1#ifndef __LINUX_DEBUG_LOCKING_H 1#ifndef __LINUX_DEBUG_LOCKING_H
2#define __LINUX_DEBUG_LOCKING_H 2#define __LINUX_DEBUG_LOCKING_H
3 3
4struct task_struct;
5
4extern int debug_locks; 6extern int debug_locks;
5extern int debug_locks_silent; 7extern int debug_locks_silent;
6 8
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6afa72e080cb..6674fc1e51bf 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1558,6 +1558,14 @@ static inline void freeze(struct task_struct *p)
1558} 1558}
1559 1559
1560/* 1560/*
1561 * Sometimes we may need to cancel the previous 'freeze' request
1562 */
1563static inline void do_not_freeze(struct task_struct *p)
1564{
1565 p->flags &= ~PF_FREEZE;
1566}
1567
1568/*
1561 * Wake up a frozen process 1569 * Wake up a frozen process
1562 */ 1570 */
1563static inline int thaw_process(struct task_struct *p) 1571static inline int thaw_process(struct task_struct *p)
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 1ab806c47514..2d9b1b60798a 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -41,23 +41,23 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states);
41 41
42static inline void __count_vm_event(enum vm_event_item item) 42static inline void __count_vm_event(enum vm_event_item item)
43{ 43{
44 __get_cpu_var(vm_event_states.event[item])++; 44 __get_cpu_var(vm_event_states).event[item]++;
45} 45}
46 46
47static inline void count_vm_event(enum vm_event_item item) 47static inline void count_vm_event(enum vm_event_item item)
48{ 48{
49 get_cpu_var(vm_event_states.event[item])++; 49 get_cpu_var(vm_event_states).event[item]++;
50 put_cpu(); 50 put_cpu();
51} 51}
52 52
53static inline void __count_vm_events(enum vm_event_item item, long delta) 53static inline void __count_vm_events(enum vm_event_item item, long delta)
54{ 54{
55 __get_cpu_var(vm_event_states.event[item]) += delta; 55 __get_cpu_var(vm_event_states).event[item] += delta;
56} 56}
57 57
58static inline void count_vm_events(enum vm_event_item item, long delta) 58static inline void count_vm_events(enum vm_event_item item, long delta)
59{ 59{
60 get_cpu_var(vm_event_states.event[item]) += delta; 60 get_cpu_var(vm_event_states).event[item] += delta;
61 put_cpu(); 61 put_cpu();
62} 62}
63 63
diff --git a/kernel/fork.c b/kernel/fork.c
index 1b0f7b1e0881..aa36c43783cc 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1387,8 +1387,10 @@ long do_fork(unsigned long clone_flags,
1387 1387
1388 if (clone_flags & CLONE_VFORK) { 1388 if (clone_flags & CLONE_VFORK) {
1389 wait_for_completion(&vfork); 1389 wait_for_completion(&vfork);
1390 if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE)) 1390 if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE)) {
1391 current->ptrace_message = nr;
1391 ptrace_notify ((PTRACE_EVENT_VFORK_DONE << 8) | SIGTRAP); 1392 ptrace_notify ((PTRACE_EVENT_VFORK_DONE << 8) | SIGTRAP);
1393 }
1392 } 1394 }
1393 } else { 1395 } else {
1394 free_pid(pid); 1396 free_pid(pid);
diff --git a/kernel/futex.c b/kernel/futex.c
index dda2049692a2..c2b2e0b83abf 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -948,6 +948,7 @@ static int unqueue_me(struct futex_q *q)
948 /* In the common case we don't take the spinlock, which is nice. */ 948 /* In the common case we don't take the spinlock, which is nice. */
949 retry: 949 retry:
950 lock_ptr = q->lock_ptr; 950 lock_ptr = q->lock_ptr;
951 barrier();
951 if (lock_ptr != 0) { 952 if (lock_ptr != 0) {
952 spin_lock(lock_ptr); 953 spin_lock(lock_ptr);
953 /* 954 /*
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
index d1aab1a452cc..c5cca3f65cb7 100644
--- a/kernel/futex_compat.c
+++ b/kernel/futex_compat.c
@@ -39,7 +39,7 @@ void compat_exit_robust_list(struct task_struct *curr)
39{ 39{
40 struct compat_robust_list_head __user *head = curr->compat_robust_list; 40 struct compat_robust_list_head __user *head = curr->compat_robust_list;
41 struct robust_list __user *entry, *pending; 41 struct robust_list __user *entry, *pending;
42 unsigned int limit = ROBUST_LIST_LIMIT, pi; 42 unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
43 compat_uptr_t uentry, upending; 43 compat_uptr_t uentry, upending;
44 compat_long_t futex_offset; 44 compat_long_t futex_offset;
45 45
@@ -59,10 +59,10 @@ void compat_exit_robust_list(struct task_struct *curr)
59 * if it exists: 59 * if it exists:
60 */ 60 */
61 if (fetch_robust_entry(&upending, &pending, 61 if (fetch_robust_entry(&upending, &pending,
62 &head->list_op_pending, &pi)) 62 &head->list_op_pending, &pip))
63 return; 63 return;
64 if (upending) 64 if (upending)
65 handle_futex_death((void *)pending + futex_offset, curr, pi); 65 handle_futex_death((void *)pending + futex_offset, curr, pip);
66 66
67 while (compat_ptr(uentry) != &head->list) { 67 while (compat_ptr(uentry) != &head->list) {
68 /* 68 /*
diff --git a/kernel/power/process.c b/kernel/power/process.c
index b2a5f671d6cd..72e72d2c61e6 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -66,13 +66,25 @@ static inline void freeze_process(struct task_struct *p)
66 } 66 }
67} 67}
68 68
69static void cancel_freezing(struct task_struct *p)
70{
71 unsigned long flags;
72
73 if (freezing(p)) {
74 pr_debug(" clean up: %s\n", p->comm);
75 do_not_freeze(p);
76 spin_lock_irqsave(&p->sighand->siglock, flags);
77 recalc_sigpending_tsk(p);
78 spin_unlock_irqrestore(&p->sighand->siglock, flags);
79 }
80}
81
69/* 0 = success, else # of processes that we failed to stop */ 82/* 0 = success, else # of processes that we failed to stop */
70int freeze_processes(void) 83int freeze_processes(void)
71{ 84{
72 int todo, nr_user, user_frozen; 85 int todo, nr_user, user_frozen;
73 unsigned long start_time; 86 unsigned long start_time;
74 struct task_struct *g, *p; 87 struct task_struct *g, *p;
75 unsigned long flags;
76 88
77 printk( "Stopping tasks: " ); 89 printk( "Stopping tasks: " );
78 start_time = jiffies; 90 start_time = jiffies;
@@ -85,6 +97,10 @@ int freeze_processes(void)
85 continue; 97 continue;
86 if (frozen(p)) 98 if (frozen(p))
87 continue; 99 continue;
100 if (p->state == TASK_TRACED && frozen(p->parent)) {
101 cancel_freezing(p);
102 continue;
103 }
88 if (p->mm && !(p->flags & PF_BORROWED_MM)) { 104 if (p->mm && !(p->flags & PF_BORROWED_MM)) {
89 /* The task is a user-space one. 105 /* The task is a user-space one.
90 * Freeze it unless there's a vfork completion 106 * Freeze it unless there's a vfork completion
@@ -126,13 +142,7 @@ int freeze_processes(void)
126 do_each_thread(g, p) { 142 do_each_thread(g, p) {
127 if (freezeable(p) && !frozen(p)) 143 if (freezeable(p) && !frozen(p))
128 printk(KERN_ERR " %s\n", p->comm); 144 printk(KERN_ERR " %s\n", p->comm);
129 if (freezing(p)) { 145 cancel_freezing(p);
130 pr_debug(" clean up: %s\n", p->comm);
131 p->flags &= ~PF_FREEZE;
132 spin_lock_irqsave(&p->sighand->siglock, flags);
133 recalc_sigpending_tsk(p);
134 spin_unlock_irqrestore(&p->sighand->siglock, flags);
135 }
136 } while_each_thread(g, p); 146 } while_each_thread(g, p);
137 read_unlock(&tasklist_lock); 147 read_unlock(&tasklist_lock);
138 return todo; 148 return todo;
diff --git a/kernel/printk.c b/kernel/printk.c
index 65ca0688f86f..1149365e989e 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -799,6 +799,9 @@ void release_console_sem(void)
799 up(&secondary_console_sem); 799 up(&secondary_console_sem);
800 return; 800 return;
801 } 801 }
802
803 console_may_schedule = 0;
804
802 for ( ; ; ) { 805 for ( ; ; ) {
803 spin_lock_irqsave(&logbuf_lock, flags); 806 spin_lock_irqsave(&logbuf_lock, flags);
804 wake_klogd |= log_start - log_end; 807 wake_klogd |= log_start - log_end;
@@ -812,7 +815,6 @@ void release_console_sem(void)
812 local_irq_restore(flags); 815 local_irq_restore(flags);
813 } 816 }
814 console_locked = 0; 817 console_locked = 0;
815 console_may_schedule = 0;
816 up(&console_sem); 818 up(&console_sem);
817 spin_unlock_irqrestore(&logbuf_lock, flags); 819 spin_unlock_irqrestore(&logbuf_lock, flags);
818 if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait)) { 820 if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait)) {
diff --git a/kernel/resource.c b/kernel/resource.c
index 0dd3a857579e..46286434af80 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -244,6 +244,7 @@ int find_next_system_ram(struct resource *res)
244 244
245 start = res->start; 245 start = res->start;
246 end = res->end; 246 end = res->end;
247 BUG_ON(start >= end);
247 248
248 read_lock(&resource_lock); 249 read_lock(&resource_lock);
249 for (p = iomem_resource.child; p ; p = p->sibling) { 250 for (p = iomem_resource.child; p ; p = p->sibling) {
@@ -254,15 +255,17 @@ int find_next_system_ram(struct resource *res)
254 p = NULL; 255 p = NULL;
255 break; 256 break;
256 } 257 }
257 if (p->start >= start) 258 if ((p->end >= start) && (p->start < end))
258 break; 259 break;
259 } 260 }
260 read_unlock(&resource_lock); 261 read_unlock(&resource_lock);
261 if (!p) 262 if (!p)
262 return -1; 263 return -1;
263 /* copy data */ 264 /* copy data */
264 res->start = p->start; 265 if (res->start < p->start)
265 res->end = p->end; 266 res->start = p->start;
267 if (res->end > p->end)
268 res->end = p->end;
266 return 0; 269 return 0;
267} 270}
268#endif 271#endif
diff --git a/lib/spinlock_debug.c b/lib/spinlock_debug.c
index 3d9c4dc965ed..58c577dd82e5 100644
--- a/lib/spinlock_debug.c
+++ b/lib/spinlock_debug.c
@@ -162,6 +162,7 @@ static void rwlock_bug(rwlock_t *lock, const char *msg)
162 162
163#define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg) 163#define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg)
164 164
165#if 0 /* __write_lock_debug() can lock up - maybe this can too? */
165static void __read_lock_debug(rwlock_t *lock) 166static void __read_lock_debug(rwlock_t *lock)
166{ 167{
167 int print_once = 1; 168 int print_once = 1;
@@ -184,12 +185,12 @@ static void __read_lock_debug(rwlock_t *lock)
184 } 185 }
185 } 186 }
186} 187}
188#endif
187 189
188void _raw_read_lock(rwlock_t *lock) 190void _raw_read_lock(rwlock_t *lock)
189{ 191{
190 RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic"); 192 RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic");
191 if (unlikely(!__raw_read_trylock(&lock->raw_lock))) 193 __raw_read_lock(&lock->raw_lock);
192 __read_lock_debug(lock);
193} 194}
194 195
195int _raw_read_trylock(rwlock_t *lock) 196int _raw_read_trylock(rwlock_t *lock)
@@ -235,6 +236,7 @@ static inline void debug_write_unlock(rwlock_t *lock)
235 lock->owner_cpu = -1; 236 lock->owner_cpu = -1;
236} 237}
237 238
239#if 0 /* This can cause lockups */
238static void __write_lock_debug(rwlock_t *lock) 240static void __write_lock_debug(rwlock_t *lock)
239{ 241{
240 int print_once = 1; 242 int print_once = 1;
@@ -257,12 +259,12 @@ static void __write_lock_debug(rwlock_t *lock)
257 } 259 }
258 } 260 }
259} 261}
262#endif
260 263
261void _raw_write_lock(rwlock_t *lock) 264void _raw_write_lock(rwlock_t *lock)
262{ 265{
263 debug_write_lock_before(lock); 266 debug_write_lock_before(lock);
264 if (unlikely(!__raw_write_trylock(&lock->raw_lock))) 267 __raw_write_lock(&lock->raw_lock);
265 __write_lock_debug(lock);
266 debug_write_lock_after(lock); 268 debug_write_lock_after(lock);
267} 269}
268 270
diff --git a/mm/fadvise.c b/mm/fadvise.c
index 60a5d55e51d9..168c78a121bb 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -73,7 +73,6 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
73 file->f_ra.ra_pages = bdi->ra_pages * 2; 73 file->f_ra.ra_pages = bdi->ra_pages * 2;
74 break; 74 break;
75 case POSIX_FADV_WILLNEED: 75 case POSIX_FADV_WILLNEED:
76 case POSIX_FADV_NOREUSE:
77 if (!mapping->a_ops->readpage) { 76 if (!mapping->a_ops->readpage) {
78 ret = -EINVAL; 77 ret = -EINVAL;
79 break; 78 break;
@@ -94,6 +93,8 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
94 if (ret > 0) 93 if (ret > 0)
95 ret = 0; 94 ret = 0;
96 break; 95 break;
96 case POSIX_FADV_NOREUSE:
97 break;
97 case POSIX_FADV_DONTNEED: 98 case POSIX_FADV_DONTNEED:
98 if (!bdi_write_congested(mapping->backing_dev_info)) 99 if (!bdi_write_congested(mapping->backing_dev_info))
99 filemap_flush(mapping); 100 filemap_flush(mapping);
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 01c9fb97c619..c37319542b70 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -52,6 +52,9 @@ static int __add_section(struct zone *zone, unsigned long phys_start_pfn)
52 int nr_pages = PAGES_PER_SECTION; 52 int nr_pages = PAGES_PER_SECTION;
53 int ret; 53 int ret;
54 54
55 if (pfn_valid(phys_start_pfn))
56 return -EEXIST;
57
55 ret = sparse_add_one_section(zone, phys_start_pfn, nr_pages); 58 ret = sparse_add_one_section(zone, phys_start_pfn, nr_pages);
56 59
57 if (ret < 0) 60 if (ret < 0)
@@ -76,15 +79,22 @@ int __add_pages(struct zone *zone, unsigned long phys_start_pfn,
76{ 79{
77 unsigned long i; 80 unsigned long i;
78 int err = 0; 81 int err = 0;
82 int start_sec, end_sec;
83 /* during initialize mem_map, align hot-added range to section */
84 start_sec = pfn_to_section_nr(phys_start_pfn);
85 end_sec = pfn_to_section_nr(phys_start_pfn + nr_pages - 1);
79 86
80 for (i = 0; i < nr_pages; i += PAGES_PER_SECTION) { 87 for (i = start_sec; i <= end_sec; i++) {
81 err = __add_section(zone, phys_start_pfn + i); 88 err = __add_section(zone, i << PFN_SECTION_SHIFT);
82 89
83 /* We want to keep adding the rest of the 90 /*
84 * sections if the first ones already exist 91 * EEXIST is finally dealed with by ioresource collision
92 * check. see add_memory() => register_memory_resource()
93 * Warning will be printed if there is collision.
85 */ 94 */
86 if (err && (err != -EEXIST)) 95 if (err && (err != -EEXIST))
87 break; 96 break;
97 err = 0;
88 } 98 }
89 99
90 return err; 100 return err;
@@ -156,7 +166,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
156 res.flags = IORESOURCE_MEM; /* we just need system ram */ 166 res.flags = IORESOURCE_MEM; /* we just need system ram */
157 section_end = res.end; 167 section_end = res.end;
158 168
159 while (find_next_system_ram(&res) >= 0) { 169 while ((res.start < res.end) && (find_next_system_ram(&res) >= 0)) {
160 start_pfn = (unsigned long)(res.start >> PAGE_SHIFT); 170 start_pfn = (unsigned long)(res.start >> PAGE_SHIFT);
161 nr_pages = (unsigned long) 171 nr_pages = (unsigned long)
162 ((res.end + 1 - res.start) >> PAGE_SHIFT); 172 ((res.end + 1 - res.start) >> PAGE_SHIFT);
@@ -213,10 +223,9 @@ static void rollback_node_hotadd(int nid, pg_data_t *pgdat)
213} 223}
214 224
215/* add this memory to iomem resource */ 225/* add this memory to iomem resource */
216static void register_memory_resource(u64 start, u64 size) 226static struct resource *register_memory_resource(u64 start, u64 size)
217{ 227{
218 struct resource *res; 228 struct resource *res;
219
220 res = kzalloc(sizeof(struct resource), GFP_KERNEL); 229 res = kzalloc(sizeof(struct resource), GFP_KERNEL);
221 BUG_ON(!res); 230 BUG_ON(!res);
222 231
@@ -228,7 +237,18 @@ static void register_memory_resource(u64 start, u64 size)
228 printk("System RAM resource %llx - %llx cannot be added\n", 237 printk("System RAM resource %llx - %llx cannot be added\n",
229 (unsigned long long)res->start, (unsigned long long)res->end); 238 (unsigned long long)res->start, (unsigned long long)res->end);
230 kfree(res); 239 kfree(res);
240 res = NULL;
231 } 241 }
242 return res;
243}
244
245static void release_memory_resource(struct resource *res)
246{
247 if (!res)
248 return;
249 release_resource(res);
250 kfree(res);
251 return;
232} 252}
233 253
234 254
@@ -237,8 +257,13 @@ int add_memory(int nid, u64 start, u64 size)
237{ 257{
238 pg_data_t *pgdat = NULL; 258 pg_data_t *pgdat = NULL;
239 int new_pgdat = 0; 259 int new_pgdat = 0;
260 struct resource *res;
240 int ret; 261 int ret;
241 262
263 res = register_memory_resource(start, size);
264 if (!res)
265 return -EEXIST;
266
242 if (!node_online(nid)) { 267 if (!node_online(nid)) {
243 pgdat = hotadd_new_pgdat(nid, start); 268 pgdat = hotadd_new_pgdat(nid, start);
244 if (!pgdat) 269 if (!pgdat)
@@ -268,14 +293,13 @@ int add_memory(int nid, u64 start, u64 size)
268 BUG_ON(ret); 293 BUG_ON(ret);
269 } 294 }
270 295
271 /* register this memory as resource */
272 register_memory_resource(start, size);
273
274 return ret; 296 return ret;
275error: 297error:
276 /* rollback pgdat allocation and others */ 298 /* rollback pgdat allocation and others */
277 if (new_pgdat) 299 if (new_pgdat)
278 rollback_node_hotadd(nid, pgdat); 300 rollback_node_hotadd(nid, pgdat);
301 if (res)
302 release_memory_resource(res);
279 303
280 return ret; 304 return ret;
281} 305}
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 7026b0866b7b..00cb388ece03 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -71,7 +71,12 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail,
71 new = detail->alloc(); 71 new = detail->alloc();
72 if (!new) 72 if (!new)
73 return NULL; 73 return NULL;
74 /* must fully initialise 'new', else
75 * we might get lose if we need to
76 * cache_put it soon.
77 */
74 cache_init(new); 78 cache_init(new);
79 detail->init(new, key);
75 80
76 write_lock(&detail->hash_lock); 81 write_lock(&detail->hash_lock);
77 82
@@ -85,7 +90,6 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail,
85 return tmp; 90 return tmp;
86 } 91 }
87 } 92 }
88 detail->init(new, key);
89 new->next = *head; 93 new->next = *head;
90 *head = new; 94 *head = new;
91 detail->entries++; 95 detail->entries++;