]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.kernel.org/patch-2.6.27.14-15
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.kernel.org / patch-2.6.27.14-15
1 From: Greg Kroah-Hartman <gregkh@suse.de>
2 Subject: Linux 2.6.27.15
3
4 Upstream 2.6.27.15 release from kernel.org
5
6 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
7
8 diff --git a/Makefile b/Makefile
9 index b2263f8..a2dcd97 100644
10 --- a/Makefile
11 +++ b/Makefile
12 @@ -1,7 +1,7 @@
13 VERSION = 2
14 PATCHLEVEL = 6
15 SUBLEVEL = 27
16 -EXTRAVERSION = .14
17 +EXTRAVERSION = .15
18 NAME = Trembling Tortoise
19
20 # *DOCUMENTATION*
21 diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c
22 index 6568942..a15baac 100644
23 --- a/arch/ia64/sn/kernel/io_acpi_init.c
24 +++ b/arch/ia64/sn/kernel/io_acpi_init.c
25 @@ -232,7 +232,7 @@ exit:
26 static unsigned int
27 get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
28 {
29 - unsigned long adr;
30 + unsigned long long adr;
31 acpi_handle child;
32 unsigned int devfn;
33 int function;
34 @@ -292,8 +292,8 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
35 static acpi_status
36 find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv)
37 {
38 - unsigned long bbn = -1;
39 - unsigned long adr;
40 + unsigned long long bbn = -1;
41 + unsigned long long adr;
42 acpi_handle parent = NULL;
43 acpi_status status;
44 unsigned int devfn;
45 @@ -348,7 +348,7 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
46 unsigned int host_devfn;
47 struct sn_pcidev_match pcidev_match;
48 acpi_handle rootbus_handle;
49 - unsigned long segment;
50 + unsigned long long segment;
51 acpi_status status;
52
53 rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle;
54 diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
55 index 2e7515e..04aa00b 100644
56 --- a/arch/m68knommu/Kconfig
57 +++ b/arch/m68knommu/Kconfig
58 @@ -14,6 +14,10 @@ config MMU
59 bool
60 default n
61
62 +config NO_DMA
63 + bool
64 + default y
65 +
66 config FPU
67 bool
68 default n
69 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
70 index 388bae2..d0561fe 100644
71 --- a/arch/x86/Kconfig
72 +++ b/arch/x86/Kconfig
73 @@ -123,6 +123,9 @@ config GENERIC_TIME_VSYSCALL
74 config ARCH_HAS_CPU_RELAX
75 def_bool y
76
77 +config ARCH_HAS_DEFAULT_IDLE
78 + def_bool y
79 +
80 config ARCH_HAS_CACHE_LINE_SIZE
81 def_bool y
82
83 diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
84 index c2502eb..a4805b3 100644
85 --- a/arch/x86/kernel/acpi/cstate.c
86 +++ b/arch/x86/kernel/acpi/cstate.c
87 @@ -56,6 +56,7 @@ static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */
88 static short mwait_supported[ACPI_PROCESSOR_MAX_POWER];
89
90 #define MWAIT_SUBSTATE_MASK (0xf)
91 +#define MWAIT_CSTATE_MASK (0xf)
92 #define MWAIT_SUBSTATE_SIZE (4)
93
94 #define CPUID_MWAIT_LEAF (5)
95 @@ -98,7 +99,8 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
96 cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx);
97
98 /* Check whether this particular cx_type (in CST) is supported or not */
99 - cstate_type = (cx->address >> MWAIT_SUBSTATE_SIZE) + 1;
100 + cstate_type = ((cx->address >> MWAIT_SUBSTATE_SIZE) &
101 + MWAIT_CSTATE_MASK) + 1;
102 edx_part = edx >> (cstate_type * MWAIT_SUBSTATE_SIZE);
103 num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK;
104
105 diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c
106 index 24e6094..dbeab3c 100644
107 --- a/arch/x86/lib/usercopy_32.c
108 +++ b/arch/x86/lib/usercopy_32.c
109 @@ -49,7 +49,7 @@ do { \
110 " jmp 2b\n" \
111 ".previous\n" \
112 _ASM_EXTABLE(0b,3b) \
113 - : "=d"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1), \
114 + : "=&d"(res), "=&c"(count), "=&a" (__d0), "=&S" (__d1), \
115 "=&D" (__d2) \
116 : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \
117 : "memory"); \
118 @@ -211,7 +211,7 @@ long strnlen_user(const char __user *s, long n)
119 " .align 4\n"
120 " .long 0b,2b\n"
121 ".previous"
122 - :"=r" (n), "=D" (s), "=a" (res), "=c" (tmp)
123 + :"=&r" (n), "=&D" (s), "=&a" (res), "=&c" (tmp)
124 :"0" (n), "1" (s), "2" (0), "3" (mask)
125 :"cc");
126 return res & mask;
127 diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c
128 index f4df6e7..500b930 100644
129 --- a/arch/x86/lib/usercopy_64.c
130 +++ b/arch/x86/lib/usercopy_64.c
131 @@ -32,7 +32,7 @@ do { \
132 " jmp 2b\n" \
133 ".previous\n" \
134 _ASM_EXTABLE(0b,3b) \
135 - : "=r"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1), \
136 + : "=&r"(res), "=&c"(count), "=&a" (__d0), "=&S" (__d1), \
137 "=&D" (__d2) \
138 : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \
139 : "memory"); \
140 @@ -86,7 +86,7 @@ unsigned long __clear_user(void __user *addr, unsigned long size)
141 ".previous\n"
142 _ASM_EXTABLE(0b,3b)
143 _ASM_EXTABLE(1b,2b)
144 - : [size8] "=c"(size), [dst] "=&D" (__d0)
145 + : [size8] "=&c"(size), [dst] "=&D" (__d0)
146 : [size1] "r"(size & 7), "[size8]" (size / 8), "[dst]"(addr),
147 [zero] "r" (0UL), [eight] "r" (8UL));
148 return size;
149 diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
150 index 43e2f84..5b719a0 100644
151 --- a/arch/x86/mm/pageattr.c
152 +++ b/arch/x86/mm/pageattr.c
153 @@ -582,6 +582,36 @@ out_unlock:
154 return 0;
155 }
156
157 +static int __cpa_process_fault(struct cpa_data *cpa, unsigned long vaddr,
158 + int primary)
159 +{
160 + /*
161 + * Ignore all non primary paths.
162 + */
163 + if (!primary)
164 + return 0;
165 +
166 + /*
167 + * Ignore the NULL PTE for kernel identity mapping, as it is expected
168 + * to have holes.
169 + * Also set numpages to '1' indicating that we processed cpa req for
170 + * one virtual address page and its pfn. TBD: numpages can be set based
171 + * on the initial value and the level returned by lookup_address().
172 + */
173 + if (within(vaddr, PAGE_OFFSET,
174 + PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT))) {
175 + cpa->numpages = 1;
176 + cpa->pfn = __pa(vaddr) >> PAGE_SHIFT;
177 + return 0;
178 + } else {
179 + WARN(1, KERN_WARNING "CPA: called for zero pte. "
180 + "vaddr = %lx cpa->vaddr = %lx\n", vaddr,
181 + cpa->vaddr);
182 +
183 + return -EINVAL;
184 + }
185 +}
186 +
187 static int __change_page_attr(struct cpa_data *cpa, int primary)
188 {
189 unsigned long address = cpa->vaddr;
190 @@ -592,17 +622,11 @@ static int __change_page_attr(struct cpa_data *cpa, int primary)
191 repeat:
192 kpte = lookup_address(address, &level);
193 if (!kpte)
194 - return 0;
195 + return __cpa_process_fault(cpa, address, primary);
196
197 old_pte = *kpte;
198 - if (!pte_val(old_pte)) {
199 - if (!primary)
200 - return 0;
201 - WARN(1, KERN_WARNING "CPA: called for zero pte. "
202 - "vaddr = %lx cpa->vaddr = %lx\n", address,
203 - cpa->vaddr);
204 - return -EINVAL;
205 - }
206 + if (!pte_val(old_pte))
207 + return __cpa_process_fault(cpa, address, primary);
208
209 if (level == PG_LEVEL_4K) {
210 pte_t new_pte;
211 @@ -676,12 +700,7 @@ static int cpa_process_alias(struct cpa_data *cpa)
212 * mapping already:
213 */
214 if (!(within(cpa->vaddr, PAGE_OFFSET,
215 - PAGE_OFFSET + (max_low_pfn_mapped << PAGE_SHIFT))
216 -#ifdef CONFIG_X86_64
217 - || within(cpa->vaddr, PAGE_OFFSET + (1UL<<32),
218 - PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT))
219 -#endif
220 - )) {
221 + PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT)))) {
222
223 alias_cpa = *cpa;
224 alias_cpa.vaddr = (unsigned long) __va(cpa->pfn << PAGE_SHIFT);
225 diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
226 index 8e07718..95e76ce 100644
227 --- a/arch/x86/pci/irq.c
228 +++ b/arch/x86/pci/irq.c
229 @@ -573,6 +573,7 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
230 case PCI_DEVICE_ID_INTEL_ICH7_1:
231 case PCI_DEVICE_ID_INTEL_ICH7_30:
232 case PCI_DEVICE_ID_INTEL_ICH7_31:
233 + case PCI_DEVICE_ID_INTEL_TGP_LPC:
234 case PCI_DEVICE_ID_INTEL_ESB2_0:
235 case PCI_DEVICE_ID_INTEL_ICH8_0:
236 case PCI_DEVICE_ID_INTEL_ICH8_1:
237 diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
238 index 831883b..5e57a80 100644
239 --- a/drivers/acpi/ac.c
240 +++ b/drivers/acpi/ac.c
241 @@ -85,7 +85,7 @@ struct acpi_ac {
242 struct power_supply charger;
243 #endif
244 struct acpi_device * device;
245 - unsigned long state;
246 + unsigned long long state;
247 };
248
249 #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
250 diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
251 index 5f1127a..2b77316 100644
252 --- a/drivers/acpi/acpi_memhotplug.c
253 +++ b/drivers/acpi/acpi_memhotplug.c
254 @@ -194,8 +194,7 @@ acpi_memory_get_device(acpi_handle handle,
255
256 static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
257 {
258 - unsigned long current_status;
259 -
260 + unsigned long long current_status;
261
262 /* Get device present/absent information from the _STA */
263 if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA",
264 @@ -264,7 +263,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
265 acpi_status status;
266 struct acpi_object_list arg_list;
267 union acpi_object arg;
268 - unsigned long current_status;
269 + unsigned long long current_status;
270
271
272 /* Issue the _EJ0 command */
273 diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
274 index d3d0886..e2ab023 100644
275 --- a/drivers/acpi/asus_acpi.c
276 +++ b/drivers/acpi/asus_acpi.c
277 @@ -753,7 +753,7 @@ static int get_lcd_state(void)
278 /* That's what the AML code does */
279 lcd = out_obj.integer.value >> 8;
280 } else if (hotk->model == F3Sa) {
281 - unsigned long tmp;
282 + unsigned long long tmp;
283 union acpi_object param;
284 struct acpi_object_list input;
285 acpi_status status;
286 @@ -1244,6 +1244,8 @@ static int asus_hotk_get_info(void)
287 "default values\n", string);
288 printk(KERN_NOTICE
289 " send /proc/acpi/dsdt to the developers\n");
290 + kfree(model);
291 + return -ENODEV;
292 }
293 hotk->methods = &model_conf[hotk->model];
294 return AE_OK;
295 diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
296 index b1c723f..e5ca3a0 100644
297 --- a/drivers/acpi/battery.c
298 +++ b/drivers/acpi/battery.c
299 @@ -472,7 +472,7 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
300
301 static int acpi_battery_update(struct acpi_battery *battery)
302 {
303 - int result;
304 + int result, old_present = acpi_battery_present(battery);
305 result = acpi_battery_get_status(battery);
306 if (result)
307 return result;
308 @@ -483,7 +483,8 @@ static int acpi_battery_update(struct acpi_battery *battery)
309 return 0;
310 }
311 #endif
312 - if (!battery->update_time) {
313 + if (!battery->update_time ||
314 + old_present != acpi_battery_present(battery)) {
315 result = acpi_battery_get_info(battery);
316 if (result)
317 return result;
318 diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c
319 index 61b6c5b..23a51e4 100644
320 --- a/drivers/acpi/bay.c
321 +++ b/drivers/acpi/bay.c
322 @@ -90,7 +90,7 @@ static int is_ejectable(acpi_handle handle)
323 */
324 static int bay_present(struct bay *bay)
325 {
326 - unsigned long sta;
327 + unsigned long long sta;
328 acpi_status status;
329
330 if (bay) {
331 diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
332 index c54f38e..60c34ed 100644
333 --- a/drivers/acpi/bus.c
334 +++ b/drivers/acpi/bus.c
335 @@ -77,7 +77,7 @@ EXPORT_SYMBOL(acpi_bus_get_device);
336 int acpi_bus_get_status(struct acpi_device *device)
337 {
338 acpi_status status = AE_OK;
339 - unsigned long sta = 0;
340 + unsigned long long sta = 0;
341
342
343 if (!device)
344 @@ -155,7 +155,7 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
345 int result = 0;
346 acpi_status status = 0;
347 struct acpi_device *device = NULL;
348 - unsigned long psc = 0;
349 + unsigned long long psc = 0;
350
351
352 result = acpi_bus_get_device(handle, &device);
353 diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
354 index 59352d9..9e8e8a6 100644
355 --- a/drivers/acpi/button.c
356 +++ b/drivers/acpi/button.c
357 @@ -145,7 +145,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
358 {
359 struct acpi_button *button = seq->private;
360 acpi_status status;
361 - unsigned long state;
362 + unsigned long long state;
363
364 if (!button || !button->device)
365 return 0;
366 @@ -253,7 +253,7 @@ static int acpi_button_remove_fs(struct acpi_device *device)
367 -------------------------------------------------------------------------- */
368 static int acpi_lid_send_state(struct acpi_button *button)
369 {
370 - unsigned long state;
371 + unsigned long long state;
372 acpi_status status;
373
374 status = acpi_evaluate_integer(button->device->handle, "_LID", NULL,
375 diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
376 index 3c25ec7..cfa5fd6 100644
377 --- a/drivers/acpi/container.c
378 +++ b/drivers/acpi/container.c
379 @@ -76,7 +76,7 @@ static int is_device_present(acpi_handle handle)
380 {
381 acpi_handle temp;
382 acpi_status status;
383 - unsigned long sta;
384 + unsigned long long sta;
385
386
387 status = acpi_get_handle(handle, "_STA", &temp);
388 diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
389 index 4613b9c..279a5a6 100644
390 --- a/drivers/acpi/dispatcher/dsmethod.c
391 +++ b/drivers/acpi/dispatcher/dsmethod.c
392 @@ -103,6 +103,9 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
393 NULL);
394 acpi_ex_enter_interpreter();
395 }
396 +
397 + acpi_ds_clear_implicit_return(walk_state);
398 +
399 #ifdef ACPI_DISASSEMBLER
400 if (ACPI_FAILURE(status)) {
401
402 diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
403 index 25d2161..e28469e 100644
404 --- a/drivers/acpi/dock.c
405 +++ b/drivers/acpi/dock.c
406 @@ -229,7 +229,7 @@ EXPORT_SYMBOL_GPL(is_dock_device);
407 */
408 static int dock_present(struct dock_station *ds)
409 {
410 - unsigned long sta;
411 + unsigned long long sta;
412 acpi_status status;
413
414 if (ds) {
415 @@ -730,13 +730,13 @@ static DEVICE_ATTR(undock, S_IWUSR, NULL, write_undock);
416 static ssize_t show_dock_uid(struct device *dev,
417 struct device_attribute *attr, char *buf)
418 {
419 - unsigned long lbuf;
420 + unsigned long long lbuf;
421 acpi_status status = acpi_evaluate_integer(dock_station->handle,
422 "_UID", NULL, &lbuf);
423 if (ACPI_FAILURE(status))
424 return 0;
425
426 - return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf);
427 + return snprintf(buf, PAGE_SIZE, "%llx\n", lbuf);
428 }
429 static DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
430
431 diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
432 index 9ab3fb9..566206a 100644
433 --- a/drivers/acpi/ec.c
434 +++ b/drivers/acpi/ec.c
435 @@ -769,6 +769,7 @@ static acpi_status
436 ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
437 {
438 acpi_status status;
439 + unsigned long long tmp = 0;
440
441 struct acpi_ec *ec = context;
442 status = acpi_walk_resources(handle, METHOD_NAME__CRS,
443 @@ -778,11 +779,14 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
444
445 /* Get GPE bit assignment (EC events). */
446 /* TODO: Add support for _GPE returning a package */
447 - status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe);
448 + status = acpi_evaluate_integer(handle, "_GPE", NULL, &tmp);
449 if (ACPI_FAILURE(status))
450 return status;
451 + ec->gpe = tmp;
452 /* Use the global lock for all EC transactions? */
453 - acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock);
454 + tmp = 0;
455 + acpi_evaluate_integer(handle, "_GLK", NULL, &tmp);
456 + ec->global_lock = tmp;
457 ec->handle = handle;
458 return AE_CTRL_TERMINATE;
459 }
460 diff --git a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c
461 index b0817e1..337fb04 100644
462 --- a/drivers/acpi/namespace/nsutils.c
463 +++ b/drivers/acpi/namespace/nsutils.c
464 @@ -314,9 +314,15 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)
465 *
466 * strlen() + 1 covers the first name_seg, which has no path separator
467 */
468 - if (acpi_ns_valid_root_prefix(next_external_char[0])) {
469 + if (acpi_ns_valid_root_prefix(*next_external_char)) {
470 info->fully_qualified = TRUE;
471 next_external_char++;
472 +
473 + /* Skip redundant root_prefix, like \\_SB.PCI0.SBRG.EC0 */
474 +
475 + while (acpi_ns_valid_root_prefix(*next_external_char)) {
476 + next_external_char++;
477 + }
478 } else {
479 /*
480 * Handle Carat prefixes
481 diff --git a/drivers/acpi/namespace/nsxfname.c b/drivers/acpi/namespace/nsxfname.c
482 index a287ed5..3cb910d 100644
483 --- a/drivers/acpi/namespace/nsxfname.c
484 +++ b/drivers/acpi/namespace/nsxfname.c
485 @@ -253,6 +253,7 @@ acpi_get_object_info(acpi_handle handle, struct acpi_buffer * buffer)
486 node = acpi_ns_map_handle_to_node(handle);
487 if (!node) {
488 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
489 + status = AE_BAD_PARAMETER;
490 goto cleanup;
491 }
492
493 diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
494 index cb9864e..25ceae9 100644
495 --- a/drivers/acpi/numa.c
496 +++ b/drivers/acpi/numa.c
497 @@ -258,7 +258,7 @@ int __init acpi_numa_init(void)
498
499 int acpi_get_pxm(acpi_handle h)
500 {
501 - unsigned long pxm;
502 + unsigned long long pxm;
503 acpi_status status;
504 acpi_handle handle;
505 acpi_handle phandle = h;
506 diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
507 index b0d40aa..f5beb8a 100644
508 --- a/drivers/acpi/osl.c
509 +++ b/drivers/acpi/osl.c
510 @@ -608,7 +608,7 @@ static void acpi_os_derive_pci_id_2(acpi_handle rhandle, /* upper bound */
511 acpi_handle handle;
512 struct acpi_pci_id *pci_id = *id;
513 acpi_status status;
514 - unsigned long temp;
515 + unsigned long long temp;
516 acpi_object_type type;
517
518 acpi_get_parent(chandle, &handle);
519 @@ -620,8 +620,7 @@ static void acpi_os_derive_pci_id_2(acpi_handle rhandle, /* upper bound */
520 if ((ACPI_FAILURE(status)) || (type != ACPI_TYPE_DEVICE))
521 return;
522
523 - status =
524 - acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
525 + status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
526 &temp);
527 if (ACPI_SUCCESS(status)) {
528 u32 val;
529 diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
530 index 15e1702..a05e2a3 100644
531 --- a/drivers/acpi/parser/psparse.c
532 +++ b/drivers/acpi/parser/psparse.c
533 @@ -641,10 +641,12 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
534 ACPI_WALK_METHOD_RESTART;
535 }
536 } else {
537 - /* On error, delete any return object */
538 + /* On error, delete any return object or implicit return */
539
540 acpi_ut_remove_reference(previous_walk_state->
541 return_desc);
542 + acpi_ds_clear_implicit_return
543 + (previous_walk_state);
544 }
545 }
546
547 diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
548 index cf47805..0ea8a9f 100644
549 --- a/drivers/acpi/pci_link.c
550 +++ b/drivers/acpi/pci_link.c
551 @@ -796,10 +796,6 @@ static int irqrouter_resume(struct sys_device *dev)
552 struct list_head *node = NULL;
553 struct acpi_pci_link *link = NULL;
554
555 -
556 - /* Make sure SCI is enabled again (Apple firmware bug?) */
557 - acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1);
558 -
559 list_for_each(node, &acpi_link.entries) {
560 link = list_entry(node, struct acpi_pci_link, node);
561 if (!link) {
562 diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
563 index c3fed31..18ff4e5 100644
564 --- a/drivers/acpi/pci_root.c
565 +++ b/drivers/acpi/pci_root.c
566 @@ -190,7 +190,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
567 struct acpi_pci_root *root = NULL;
568 struct acpi_pci_root *tmp;
569 acpi_status status = AE_OK;
570 - unsigned long value = 0;
571 + unsigned long long value = 0;
572 acpi_handle handle = NULL;
573 struct acpi_device *child;
574
575 diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c
576 index 8d4a568..cd1f446 100644
577 --- a/drivers/acpi/pci_slot.c
578 +++ b/drivers/acpi/pci_slot.c
579 @@ -76,10 +76,10 @@ static struct acpi_pci_driver acpi_pci_slot_driver = {
580 };
581
582 static int
583 -check_slot(acpi_handle handle, unsigned long *sun)
584 +check_slot(acpi_handle handle, unsigned long long *sun)
585 {
586 int device = -1;
587 - unsigned long adr, sta;
588 + unsigned long long adr, sta;
589 acpi_status status;
590 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
591
592 @@ -132,7 +132,7 @@ static acpi_status
593 register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
594 {
595 int device;
596 - unsigned long sun;
597 + unsigned long long sun;
598 char name[SLOT_NAME_SIZE];
599 struct acpi_pci_slot *slot;
600 struct pci_slot *pci_slot;
601 @@ -182,7 +182,7 @@ static acpi_status
602 walk_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
603 {
604 int device, function;
605 - unsigned long adr;
606 + unsigned long long adr;
607 acpi_status status;
608 acpi_handle dummy_handle;
609 acpi_walk_callback user_function;
610 @@ -239,7 +239,7 @@ static int
611 walk_root_bridge(acpi_handle handle, acpi_walk_callback user_function)
612 {
613 int seg, bus;
614 - unsigned long tmp;
615 + unsigned long long tmp;
616 acpi_status status;
617 acpi_handle dummy_handle;
618 struct pci_bus *pci_bus;
619 diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
620 index 4ab21cb..89e5d2a 100644
621 --- a/drivers/acpi/power.c
622 +++ b/drivers/acpi/power.c
623 @@ -131,7 +131,7 @@ acpi_power_get_context(acpi_handle handle,
624 static int acpi_power_get_state(struct acpi_power_resource *resource, int *state)
625 {
626 acpi_status status = AE_OK;
627 - unsigned long sta = 0;
628 + unsigned long long sta = 0;
629
630
631 if (!resource || !state)
632 diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
633 index ee68ac5..8a27871 100644
634 --- a/drivers/acpi/processor_core.c
635 +++ b/drivers/acpi/processor_core.c
636 @@ -563,7 +563,7 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
637
638 /* Check if it is a Device with HID and UID */
639 if (has_uid) {
640 - unsigned long value;
641 + unsigned long long value;
642 status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID,
643 NULL, &value);
644 if (ACPI_FAILURE(status)) {
645 @@ -875,7 +875,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
646 static int is_processor_present(acpi_handle handle)
647 {
648 acpi_status status;
649 - unsigned long sta = 0;
650 + unsigned long long sta = 0;
651
652
653 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
654 diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
655 index cf5b1b7..81b40ed 100644
656 --- a/drivers/acpi/processor_idle.c
657 +++ b/drivers/acpi/processor_idle.c
658 @@ -1587,6 +1587,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
659
660 if (acpi_idle_bm_check()) {
661 if (dev->safe_state) {
662 + dev->last_state = dev->safe_state;
663 return dev->safe_state->enter(dev, dev->safe_state);
664 } else {
665 local_irq_disable();
666 diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
667 index 80c251e..f8129c7 100644
668 --- a/drivers/acpi/processor_perflib.c
669 +++ b/drivers/acpi/processor_perflib.c
670 @@ -126,7 +126,7 @@ static struct notifier_block acpi_ppc_notifier_block = {
671 static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
672 {
673 acpi_status status = 0;
674 - unsigned long ppc = 0;
675 + unsigned long long ppc = 0;
676
677
678 if (!pr)
679 diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
680 index a56fc6c..3097b75 100644
681 --- a/drivers/acpi/processor_throttling.c
682 +++ b/drivers/acpi/processor_throttling.c
683 @@ -274,7 +274,7 @@ static int acpi_processor_throttling_notifier(unsigned long event, void *data)
684 static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
685 {
686 acpi_status status = 0;
687 - unsigned long tpc = 0;
688 + unsigned long long tpc = 0;
689
690 if (!pr)
691 return -EINVAL;
692 diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c
693 index a4e3767..81d23d3 100644
694 --- a/drivers/acpi/sbshc.c
695 +++ b/drivers/acpi/sbshc.c
696 @@ -258,7 +258,7 @@ extern int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
697 static int acpi_smbus_hc_add(struct acpi_device *device)
698 {
699 int status;
700 - unsigned long val;
701 + unsigned long long val;
702 struct acpi_smb_hc *hc;
703
704 if (!device)
705 diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
706 index 0450761..afa66f4 100644
707 --- a/drivers/acpi/scan.c
708 +++ b/drivers/acpi/scan.c
709 @@ -1262,6 +1262,16 @@ acpi_add_single_object(struct acpi_device **child,
710 acpi_device_set_id(device, parent, handle, type);
711
712 /*
713 + * The ACPI device is attached to acpi handle before getting
714 + * the power/wakeup/peformance flags. Otherwise OS can't get
715 + * the corresponding ACPI device by the acpi handle in the course
716 + * of getting the power/wakeup/performance flags.
717 + */
718 + result = acpi_device_set_context(device, type);
719 + if (result)
720 + goto end;
721 +
722 + /*
723 * Power Management
724 * ----------------
725 */
726 @@ -1291,8 +1301,6 @@ acpi_add_single_object(struct acpi_device **child,
727 goto end;
728 }
729
730 - if ((result = acpi_device_set_context(device, type)))
731 - goto end;
732
733 result = acpi_device_register(device, parent);
734
735 diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
736 index 3706469..e7e0aac 100644
737 --- a/drivers/acpi/sleep/main.c
738 +++ b/drivers/acpi/sleep/main.c
739 @@ -344,6 +344,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
740 DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
741 },
742 },
743 + {
744 + .callback = init_old_suspend_ordering,
745 + .ident = "HP xw4600 Workstation",
746 + .matches = {
747 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
748 + DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"),
749 + },
750 + },
751 {},
752 };
753 #endif /* CONFIG_SUSPEND */
754 @@ -492,7 +500,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
755 acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
756 struct acpi_device *adev;
757 char acpi_method[] = "_SxD";
758 - unsigned long d_min, d_max;
759 + unsigned long long d_min, d_max;
760
761 if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
762 printk(KERN_DEBUG "ACPI handle has no context!\n");
763 diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
764 index 9127036..47abb94 100644
765 --- a/drivers/acpi/thermal.c
766 +++ b/drivers/acpi/thermal.c
767 @@ -246,18 +246,18 @@ static const struct file_operations acpi_thermal_polling_fops = {
768 static int acpi_thermal_get_temperature(struct acpi_thermal *tz)
769 {
770 acpi_status status = AE_OK;
771 -
772 + unsigned long long tmp;
773
774 if (!tz)
775 return -EINVAL;
776
777 tz->last_temperature = tz->temperature;
778
779 - status =
780 - acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tz->temperature);
781 + status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp);
782 if (ACPI_FAILURE(status))
783 return -ENODEV;
784
785 + tz->temperature = tmp;
786 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n",
787 tz->temperature));
788
789 @@ -267,17 +267,16 @@ static int acpi_thermal_get_temperature(struct acpi_thermal *tz)
790 static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz)
791 {
792 acpi_status status = AE_OK;
793 -
794 + unsigned long long tmp;
795
796 if (!tz)
797 return -EINVAL;
798
799 - status =
800 - acpi_evaluate_integer(tz->device->handle, "_TZP", NULL,
801 - &tz->polling_frequency);
802 + status = acpi_evaluate_integer(tz->device->handle, "_TZP", NULL, &tmp);
803 if (ACPI_FAILURE(status))
804 return -ENODEV;
805
806 + tz->polling_frequency = tmp;
807 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n",
808 tz->polling_frequency));
809
810 @@ -356,6 +355,7 @@ do { \
811 static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
812 {
813 acpi_status status = AE_OK;
814 + unsigned long long tmp;
815 struct acpi_handle_list devices;
816 int valid = 0;
817 int i;
818 @@ -363,7 +363,8 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
819 /* Critical Shutdown (required) */
820 if (flag & ACPI_TRIPS_CRITICAL) {
821 status = acpi_evaluate_integer(tz->device->handle,
822 - "_CRT", NULL, &tz->trips.critical.temperature);
823 + "_CRT", NULL, &tmp);
824 + tz->trips.critical.temperature = tmp;
825 /*
826 * Treat freezing temperatures as invalid as well; some
827 * BIOSes return really low values and cause reboots at startup.
828 @@ -399,12 +400,13 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
829 /* Critical Sleep (optional) */
830 if (flag & ACPI_TRIPS_HOT) {
831 status = acpi_evaluate_integer(tz->device->handle,
832 - "_HOT", NULL, &tz->trips.hot.temperature);
833 + "_HOT", NULL, &tmp);
834 if (ACPI_FAILURE(status)) {
835 tz->trips.hot.flags.valid = 0;
836 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
837 "No hot threshold\n"));
838 } else {
839 + tz->trips.hot.temperature = tmp;
840 tz->trips.hot.flags.valid = 1;
841 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
842 "Found hot threshold [%lu]\n",
843 @@ -418,33 +420,40 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
844 if (psv == -1) {
845 status = AE_SUPPORT;
846 } else if (psv > 0) {
847 - tz->trips.passive.temperature = CELSIUS_TO_KELVIN(psv);
848 + tmp = CELSIUS_TO_KELVIN(psv);
849 status = AE_OK;
850 } else {
851 status = acpi_evaluate_integer(tz->device->handle,
852 - "_PSV", NULL, &tz->trips.passive.temperature);
853 + "_PSV", NULL, &tmp);
854 }
855
856 if (ACPI_FAILURE(status))
857 tz->trips.passive.flags.valid = 0;
858 else {
859 + tz->trips.passive.temperature = tmp;
860 tz->trips.passive.flags.valid = 1;
861 if (flag == ACPI_TRIPS_INIT) {
862 status = acpi_evaluate_integer(
863 tz->device->handle, "_TC1",
864 - NULL, &tz->trips.passive.tc1);
865 + NULL, &tmp);
866 if (ACPI_FAILURE(status))
867 tz->trips.passive.flags.valid = 0;
868 + else
869 + tz->trips.passive.tc1 = tmp;
870 status = acpi_evaluate_integer(
871 tz->device->handle, "_TC2",
872 - NULL, &tz->trips.passive.tc2);
873 + NULL, &tmp);
874 if (ACPI_FAILURE(status))
875 tz->trips.passive.flags.valid = 0;
876 + else
877 + tz->trips.passive.tc2 = tmp;
878 status = acpi_evaluate_integer(
879 tz->device->handle, "_TSP",
880 - NULL, &tz->trips.passive.tsp);
881 + NULL, &tmp);
882 if (ACPI_FAILURE(status))
883 tz->trips.passive.flags.valid = 0;
884 + else
885 + tz->trips.passive.tsp = tmp;
886 }
887 }
888 }
889 @@ -479,7 +488,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
890
891 if (flag & ACPI_TRIPS_ACTIVE) {
892 status = acpi_evaluate_integer(tz->device->handle,
893 - name, NULL, &tz->trips.active[i].temperature);
894 + name, NULL, &tmp);
895 if (ACPI_FAILURE(status)) {
896 tz->trips.active[i].flags.valid = 0;
897 if (i == 0)
898 @@ -500,8 +509,10 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
899 tz->trips.active[i - 2].temperature :
900 CELSIUS_TO_KELVIN(act));
901 break;
902 - } else
903 + } else {
904 + tz->trips.active[i].temperature = tmp;
905 tz->trips.active[i].flags.valid = 1;
906 + }
907 }
908
909 name[2] = 'L';
910 diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
911 index 1009261..e827be3 100644
912 --- a/drivers/acpi/utils.c
913 +++ b/drivers/acpi/utils.c
914 @@ -256,7 +256,7 @@ EXPORT_SYMBOL(acpi_extract_package);
915 acpi_status
916 acpi_evaluate_integer(acpi_handle handle,
917 acpi_string pathname,
918 - struct acpi_object_list *arguments, unsigned long *data)
919 + struct acpi_object_list *arguments, unsigned long long *data)
920 {
921 acpi_status status = AE_OK;
922 union acpi_object *element;
923 @@ -288,7 +288,7 @@ acpi_evaluate_integer(acpi_handle handle,
924 *data = element->integer.value;
925 kfree(element);
926
927 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%lu]\n", *data));
928 + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data));
929
930 return AE_OK;
931 }
932 diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
933 index e8a51a1..42e1e84 100644
934 --- a/drivers/acpi/video.c
935 +++ b/drivers/acpi/video.c
936 @@ -291,20 +291,20 @@ static int acpi_video_device_lcd_set_level(struct acpi_video_device *device,
937 int level);
938 static int acpi_video_device_lcd_get_level_current(
939 struct acpi_video_device *device,
940 - unsigned long *level);
941 + unsigned long long *level);
942 static int acpi_video_get_next_level(struct acpi_video_device *device,
943 u32 level_current, u32 event);
944 static void acpi_video_switch_brightness(struct acpi_video_device *device,
945 int event);
946 static int acpi_video_device_get_state(struct acpi_video_device *device,
947 - unsigned long *state);
948 + unsigned long long *state);
949 static int acpi_video_output_get(struct output_device *od);
950 static int acpi_video_device_set_state(struct acpi_video_device *device, int state);
951
952 /*backlight device sysfs support*/
953 static int acpi_video_get_brightness(struct backlight_device *bd)
954 {
955 - unsigned long cur_level;
956 + unsigned long long cur_level;
957 int i;
958 struct acpi_video_device *vd =
959 (struct acpi_video_device *)bl_get_data(bd);
960 @@ -336,7 +336,7 @@ static struct backlight_ops acpi_backlight_ops = {
961 /*video output device sysfs support*/
962 static int acpi_video_output_get(struct output_device *od)
963 {
964 - unsigned long state;
965 + unsigned long long state;
966 struct acpi_video_device *vd =
967 (struct acpi_video_device *)dev_get_drvdata(&od->dev);
968 acpi_video_device_get_state(vd, &state);
969 @@ -370,7 +370,7 @@ static int video_get_cur_state(struct thermal_cooling_device *cdev, char *buf)
970 {
971 struct acpi_device *device = cdev->devdata;
972 struct acpi_video_device *video = acpi_driver_data(device);
973 - unsigned long level;
974 + unsigned long long level;
975 int state;
976
977 acpi_video_device_lcd_get_level_current(video, &level);
978 @@ -410,7 +410,7 @@ static struct thermal_cooling_device_ops video_cooling_ops = {
979 /* device */
980
981 static int
982 -acpi_video_device_query(struct acpi_video_device *device, unsigned long *state)
983 +acpi_video_device_query(struct acpi_video_device *device, unsigned long long *state)
984 {
985 int status;
986
987 @@ -421,7 +421,7 @@ acpi_video_device_query(struct acpi_video_device *device, unsigned long *state)
988
989 static int
990 acpi_video_device_get_state(struct acpi_video_device *device,
991 - unsigned long *state)
992 + unsigned long long *state)
993 {
994 int status;
995
996 @@ -436,7 +436,7 @@ acpi_video_device_set_state(struct acpi_video_device *device, int state)
997 int status;
998 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
999 struct acpi_object_list args = { 1, &arg0 };
1000 - unsigned long ret;
1001 + unsigned long long ret;
1002
1003
1004 arg0.integer.value = state;
1005 @@ -482,6 +482,7 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
1006 int status = AE_OK;
1007 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
1008 struct acpi_object_list args = { 1, &arg0 };
1009 + int state;
1010
1011
1012 arg0.integer.value = level;
1013 @@ -490,12 +491,16 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
1014 status = acpi_evaluate_object(device->dev->handle, "_BCM",
1015 &args, NULL);
1016 device->brightness->curr = level;
1017 + for (state = 2; state < device->brightness->count; state++)
1018 + if (level == device->brightness->levels[state])
1019 + device->backlight->props.brightness = state - 2;
1020 +
1021 return status;
1022 }
1023
1024 static int
1025 acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
1026 - unsigned long *level)
1027 + unsigned long long *level)
1028 {
1029 if (device->cap._BQC)
1030 return acpi_evaluate_integer(device->dev->handle, "_BQC", NULL,
1031 @@ -549,7 +554,7 @@ static int
1032 acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option)
1033 {
1034 int status;
1035 - unsigned long tmp;
1036 + unsigned long long tmp;
1037 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
1038 struct acpi_object_list args = { 1, &arg0 };
1039
1040 @@ -564,7 +569,7 @@ acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option)
1041 }
1042
1043 static int
1044 -acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long *id)
1045 +acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long long *id)
1046 {
1047 int status;
1048
1049 @@ -575,7 +580,7 @@ acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long *id)
1050
1051 static int
1052 acpi_video_bus_POST_options(struct acpi_video_bus *video,
1053 - unsigned long *options)
1054 + unsigned long long *options)
1055 {
1056 int status;
1057
1058 @@ -918,7 +923,7 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset)
1059 {
1060 int status;
1061 struct acpi_video_device *dev = seq->private;
1062 - unsigned long state;
1063 + unsigned long long state;
1064
1065
1066 if (!dev)
1067 @@ -927,14 +932,14 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset)
1068 status = acpi_video_device_get_state(dev, &state);
1069 seq_printf(seq, "state: ");
1070 if (ACPI_SUCCESS(status))
1071 - seq_printf(seq, "0x%02lx\n", state);
1072 + seq_printf(seq, "0x%02llx\n", state);
1073 else
1074 seq_printf(seq, "<not supported>\n");
1075
1076 status = acpi_video_device_query(dev, &state);
1077 seq_printf(seq, "query: ");
1078 if (ACPI_SUCCESS(status))
1079 - seq_printf(seq, "0x%02lx\n", state);
1080 + seq_printf(seq, "0x%02llx\n", state);
1081 else
1082 seq_printf(seq, "<not supported>\n");
1083
1084 @@ -1217,7 +1222,7 @@ static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file)
1085 static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset)
1086 {
1087 struct acpi_video_bus *video = seq->private;
1088 - unsigned long options;
1089 + unsigned long long options;
1090 int status;
1091
1092
1093 @@ -1232,7 +1237,7 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset)
1094 printk(KERN_WARNING PREFIX
1095 "This indicates a BIOS bug. Please contact the manufacturer.\n");
1096 }
1097 - printk("%lx\n", options);
1098 + printk("%llx\n", options);
1099 seq_printf(seq, "can POST: <integrated video>");
1100 if (options & 2)
1101 seq_printf(seq, " <PCI video>");
1102 @@ -1256,7 +1261,7 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset)
1103 {
1104 struct acpi_video_bus *video = seq->private;
1105 int status;
1106 - unsigned long id;
1107 + unsigned long long id;
1108
1109
1110 if (!video)
1111 @@ -1303,7 +1308,7 @@ acpi_video_bus_write_POST(struct file *file,
1112 struct seq_file *m = file->private_data;
1113 struct acpi_video_bus *video = m->private;
1114 char str[12] = { 0 };
1115 - unsigned long opt, options;
1116 + unsigned long long opt, options;
1117
1118
1119 if (!video || count + 1 > sizeof str)
1120 @@ -1473,7 +1478,7 @@ static int
1121 acpi_video_bus_get_one_device(struct acpi_device *device,
1122 struct acpi_video_bus *video)
1123 {
1124 - unsigned long device_id;
1125 + unsigned long long device_id;
1126 int status;
1127 struct acpi_video_device *data;
1128 struct acpi_video_device_attrib* attribute;
1129 @@ -1724,7 +1729,7 @@ acpi_video_get_next_level(struct acpi_video_device *device,
1130 static void
1131 acpi_video_switch_brightness(struct acpi_video_device *device, int event)
1132 {
1133 - unsigned long level_current, level_next;
1134 + unsigned long long level_current, level_next;
1135 if (!device->brightness)
1136 return;
1137 acpi_video_device_lcd_get_level_current(device, &level_current);
1138 diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
1139 index 9330b79..ae45187 100644
1140 --- a/drivers/ata/libata-acpi.c
1141 +++ b/drivers/ata/libata-acpi.c
1142 @@ -180,7 +180,7 @@ static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev,
1143 int wait = 0;
1144 unsigned long flags;
1145 acpi_handle handle, tmphandle;
1146 - unsigned long sta;
1147 + unsigned long long sta;
1148 acpi_status status;
1149
1150 if (dev) {
1151 diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
1152 index c815f8e..394cb0c 100644
1153 --- a/drivers/ata/sata_mv.c
1154 +++ b/drivers/ata/sata_mv.c
1155 @@ -669,8 +669,8 @@ static const struct pci_device_id mv_pci_tbl[] = {
1156 { PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
1157 /* RocketRAID 1720/174x have different identifiers */
1158 { PCI_VDEVICE(TTI, 0x1720), chip_6042 },
1159 - { PCI_VDEVICE(TTI, 0x1740), chip_508x },
1160 - { PCI_VDEVICE(TTI, 0x1742), chip_508x },
1161 + { PCI_VDEVICE(TTI, 0x1740), chip_6042 },
1162 + { PCI_VDEVICE(TTI, 0x1742), chip_6042 },
1163
1164 { PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
1165 { PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
1166 @@ -883,7 +883,7 @@ static void mv_start_dma(struct ata_port *ap, void __iomem *port_mmio,
1167 struct mv_host_priv *hpriv = ap->host->private_data;
1168 int hardport = mv_hardport_from_port(ap->port_no);
1169 void __iomem *hc_mmio = mv_hc_base_from_port(
1170 - mv_host_base(ap->host), hardport);
1171 + mv_host_base(ap->host), ap->port_no);
1172 u32 hc_irq_cause, ipending;
1173
1174 /* clear EDMA event indicators, if any */
1175 diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
1176 index 8714c36..89e3b7f 100644
1177 --- a/drivers/ata/sata_nv.c
1178 +++ b/drivers/ata/sata_nv.c
1179 @@ -305,10 +305,10 @@ static irqreturn_t nv_ck804_interrupt(int irq, void *dev_instance);
1180 static int nv_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val);
1181 static int nv_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val);
1182
1183 +static int nv_noclassify_hardreset(struct ata_link *link, unsigned int *class,
1184 + unsigned long deadline);
1185 static void nv_nf2_freeze(struct ata_port *ap);
1186 static void nv_nf2_thaw(struct ata_port *ap);
1187 -static int nv_nf2_hardreset(struct ata_link *link, unsigned int *class,
1188 - unsigned long deadline);
1189 static void nv_ck804_freeze(struct ata_port *ap);
1190 static void nv_ck804_thaw(struct ata_port *ap);
1191 static int nv_adma_slave_config(struct scsi_device *sdev);
1192 @@ -352,6 +352,7 @@ enum nv_host_type
1193 NFORCE3 = NFORCE2, /* NF2 == NF3 as far as sata_nv is concerned */
1194 CK804,
1195 ADMA,
1196 + MCP5x,
1197 SWNCQ,
1198 };
1199
1200 @@ -363,10 +364,10 @@ static const struct pci_device_id nv_pci_tbl[] = {
1201 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2), CK804 },
1202 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA), CK804 },
1203 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2), CK804 },
1204 - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA), SWNCQ },
1205 - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2), SWNCQ },
1206 - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA), SWNCQ },
1207 - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2), SWNCQ },
1208 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA), MCP5x },
1209 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2), MCP5x },
1210 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA), MCP5x },
1211 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2), MCP5x },
1212 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC },
1213 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC },
1214 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC },
1215 @@ -432,14 +433,19 @@ static struct ata_port_operations nv_nf2_ops = {
1216 .inherits = &nv_common_ops,
1217 .freeze = nv_nf2_freeze,
1218 .thaw = nv_nf2_thaw,
1219 - .hardreset = nv_nf2_hardreset,
1220 + .hardreset = nv_noclassify_hardreset,
1221 };
1222
1223 -/* CK804 finally gets hardreset right */
1224 +/* For initial probing after boot and hot plugging, hardreset mostly
1225 + * works fine on CK804 but curiously, reprobing on the initial port by
1226 + * rescanning or rmmod/insmod fails to acquire the initial D2H Reg FIS
1227 + * in somewhat undeterministic way. Use noclassify hardreset.
1228 + */
1229 static struct ata_port_operations nv_ck804_ops = {
1230 .inherits = &nv_common_ops,
1231 .freeze = nv_ck804_freeze,
1232 .thaw = nv_ck804_thaw,
1233 + .hardreset = nv_noclassify_hardreset,
1234 .host_stop = nv_ck804_host_stop,
1235 };
1236
1237 @@ -467,8 +473,19 @@ static struct ata_port_operations nv_adma_ops = {
1238 .host_stop = nv_adma_host_stop,
1239 };
1240
1241 +/* Kernel bz#12351 reports that when SWNCQ is enabled, for hotplug to
1242 + * work, hardreset should be used and hardreset can't report proper
1243 + * signature, which suggests that mcp5x is closer to nf2 as long as
1244 + * reset quirkiness is concerned. Define separate ops for mcp5x with
1245 + * nv_noclassify_hardreset().
1246 + */
1247 +static struct ata_port_operations nv_mcp5x_ops = {
1248 + .inherits = &nv_common_ops,
1249 + .hardreset = nv_noclassify_hardreset,
1250 +};
1251 +
1252 static struct ata_port_operations nv_swncq_ops = {
1253 - .inherits = &nv_generic_ops,
1254 + .inherits = &nv_mcp5x_ops,
1255
1256 .qc_defer = ata_std_qc_defer,
1257 .qc_prep = nv_swncq_qc_prep,
1258 @@ -531,6 +548,15 @@ static const struct ata_port_info nv_port_info[] = {
1259 .port_ops = &nv_adma_ops,
1260 .private_data = NV_PI_PRIV(nv_adma_interrupt, &nv_adma_sht),
1261 },
1262 + /* MCP5x */
1263 + {
1264 + .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY,
1265 + .pio_mask = NV_PIO_MASK,
1266 + .mwdma_mask = NV_MWDMA_MASK,
1267 + .udma_mask = NV_UDMA_MASK,
1268 + .port_ops = &nv_mcp5x_ops,
1269 + .private_data = NV_PI_PRIV(nv_generic_interrupt, &nv_sht),
1270 + },
1271 /* SWNCQ */
1272 {
1273 .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
1274 @@ -1530,6 +1556,17 @@ static int nv_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val)
1275 return 0;
1276 }
1277
1278 +static int nv_noclassify_hardreset(struct ata_link *link, unsigned int *class,
1279 + unsigned long deadline)
1280 +{
1281 + bool online;
1282 + int rc;
1283 +
1284 + rc = sata_link_hardreset(link, sata_deb_timing_hotplug, deadline,
1285 + &online, NULL);
1286 + return online ? -EAGAIN : rc;
1287 +}
1288 +
1289 static void nv_nf2_freeze(struct ata_port *ap)
1290 {
1291 void __iomem *scr_addr = ap->host->ports[0]->ioaddr.scr_addr;
1292 @@ -1554,17 +1591,6 @@ static void nv_nf2_thaw(struct ata_port *ap)
1293 iowrite8(mask, scr_addr + NV_INT_ENABLE);
1294 }
1295
1296 -static int nv_nf2_hardreset(struct ata_link *link, unsigned int *class,
1297 - unsigned long deadline)
1298 -{
1299 - bool online;
1300 - int rc;
1301 -
1302 - rc = sata_link_hardreset(link, sata_deb_timing_hotplug, deadline,
1303 - &online, NULL);
1304 - return online ? -EAGAIN : rc;
1305 -}
1306 -
1307 static void nv_ck804_freeze(struct ata_port *ap)
1308 {
1309 void __iomem *mmio_base = ap->host->iomap[NV_MMIO_BAR];
1310 @@ -2355,14 +2381,9 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1311 if (type == CK804 && adma_enabled) {
1312 dev_printk(KERN_NOTICE, &pdev->dev, "Using ADMA mode\n");
1313 type = ADMA;
1314 - }
1315 -
1316 - if (type == SWNCQ) {
1317 - if (swncq_enabled)
1318 - dev_printk(KERN_NOTICE, &pdev->dev,
1319 - "Using SWNCQ mode\n");
1320 - else
1321 - type = GENERIC;
1322 + } else if (type == MCP5x && swncq_enabled) {
1323 + dev_printk(KERN_NOTICE, &pdev->dev, "Using SWNCQ mode\n");
1324 + type = SWNCQ;
1325 }
1326
1327 ppi[0] = &nv_port_info[type];
1328 diff --git a/drivers/char/selection.c b/drivers/char/selection.c
1329 index 2978a49..caf3fa2 100644
1330 --- a/drivers/char/selection.c
1331 +++ b/drivers/char/selection.c
1332 @@ -268,7 +268,7 @@ int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *t
1333
1334 /* Allocate a new buffer before freeing the old one ... */
1335 multiplier = use_unicode ? 3 : 1; /* chars can take up to 3 bytes */
1336 - bp = kmalloc((sel_end-sel_start)/2*multiplier+1, GFP_KERNEL);
1337 + bp = kmalloc(((sel_end-sel_start)/2+1)*multiplier, GFP_KERNEL);
1338 if (!bp) {
1339 printk(KERN_WARNING "selection: kmalloc() failed\n");
1340 clear_selection();
1341 diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
1342 index 5ce07b5..bb6e3b3 100644
1343 --- a/drivers/cpuidle/cpuidle.c
1344 +++ b/drivers/cpuidle/cpuidle.c
1345 @@ -56,7 +56,11 @@ static void cpuidle_idle_call(void)
1346 if (pm_idle_old)
1347 pm_idle_old();
1348 else
1349 +#if defined(CONFIG_ARCH_HAS_DEFAULT_IDLE)
1350 + default_idle();
1351 +#else
1352 local_irq_enable();
1353 +#endif
1354 return;
1355 }
1356
1357 @@ -67,8 +71,11 @@ static void cpuidle_idle_call(void)
1358 target_state = &dev->states[next_state];
1359
1360 /* enter the state and update stats */
1361 - dev->last_residency = target_state->enter(dev, target_state);
1362 dev->last_state = target_state;
1363 + dev->last_residency = target_state->enter(dev, target_state);
1364 + if (dev->last_state)
1365 + target_state = dev->last_state;
1366 +
1367 target_state->time += (unsigned long long)dev->last_residency;
1368 target_state->usage++;
1369
1370 diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
1371 index 8d7cf3f..f1df59f 100644
1372 --- a/drivers/cpuidle/governors/menu.c
1373 +++ b/drivers/cpuidle/governors/menu.c
1374 @@ -15,12 +15,14 @@
1375 #include <linux/tick.h>
1376
1377 #define BREAK_FUZZ 4 /* 4 us */
1378 +#define PRED_HISTORY_PCT 50
1379
1380 struct menu_device {
1381 int last_state_idx;
1382
1383 unsigned int expected_us;
1384 unsigned int predicted_us;
1385 + unsigned int current_predicted_us;
1386 unsigned int last_measured_us;
1387 unsigned int elapsed_us;
1388 };
1389 @@ -47,6 +49,12 @@ static int menu_select(struct cpuidle_device *dev)
1390 data->expected_us =
1391 (u32) ktime_to_ns(tick_nohz_get_sleep_length()) / 1000;
1392
1393 + /* Recalculate predicted_us based on prediction_history_pct */
1394 + data->predicted_us *= PRED_HISTORY_PCT;
1395 + data->predicted_us += (100 - PRED_HISTORY_PCT) *
1396 + data->current_predicted_us;
1397 + data->predicted_us /= 100;
1398 +
1399 /* find the deepest idle state that satisfies our constraints */
1400 for (i = CPUIDLE_DRIVER_STATE_START + 1; i < dev->state_count; i++) {
1401 struct cpuidle_state *s = &dev->states[i];
1402 @@ -97,7 +105,7 @@ static void menu_reflect(struct cpuidle_device *dev)
1403 measured_us = -1;
1404
1405 /* Predict time until next break event */
1406 - data->predicted_us = max(measured_us, data->last_measured_us);
1407 + data->current_predicted_us = max(measured_us, data->last_measured_us);
1408
1409 if (last_idle_us + BREAK_FUZZ <
1410 data->expected_us - target->exit_latency) {
1411 diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
1412 index c694eaa..191f01b 100644
1413 --- a/drivers/input/keyboard/atkbd.c
1414 +++ b/drivers/input/keyboard/atkbd.c
1415 @@ -884,6 +884,22 @@ static void atkbd_inventec_keymap_fixup(struct atkbd *atkbd)
1416 }
1417
1418 /*
1419 + * Samsung NC10 with Fn+F? key release not working
1420 + */
1421 +static void atkbd_samsung_keymap_fixup(struct atkbd *atkbd)
1422 +{
1423 + const unsigned int forced_release_keys[] = {
1424 + 0x82, 0x83, 0x84, 0x86, 0x88, 0x89, 0xb3, 0xf7, 0xf9,
1425 + };
1426 + int i;
1427 +
1428 + if (atkbd->set == 2)
1429 + for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++)
1430 + __set_bit(forced_release_keys[i],
1431 + atkbd->force_release_mask);
1432 +}
1433 +
1434 +/*
1435 * atkbd_set_keycode_table() initializes keyboard's keycode table
1436 * according to the selected scancode set
1437 */
1438 @@ -1486,6 +1502,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1439 .driver_data = atkbd_dell_laptop_keymap_fixup,
1440 },
1441 {
1442 + .ident = "Dell Laptop",
1443 + .matches = {
1444 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
1445 + DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
1446 + },
1447 + .callback = atkbd_setup_fixup,
1448 + .driver_data = atkbd_dell_laptop_keymap_fixup,
1449 + },
1450 + {
1451 .ident = "HP 2133",
1452 .matches = {
1453 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1454 @@ -1503,6 +1528,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1455 .callback = atkbd_setup_fixup,
1456 .driver_data = atkbd_inventec_keymap_fixup,
1457 },
1458 + {
1459 + .ident = "Samsung NC10",
1460 + .matches = {
1461 + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
1462 + DMI_MATCH(DMI_PRODUCT_NAME, "NC10"),
1463 + },
1464 + .callback = atkbd_setup_fixup,
1465 + .driver_data = atkbd_samsung_keymap_fixup,
1466 + },
1467 { }
1468 };
1469
1470 diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c
1471 index 7c6dfd0..95965a7 100644
1472 --- a/drivers/misc/asus-laptop.c
1473 +++ b/drivers/misc/asus-laptop.c
1474 @@ -139,6 +139,7 @@ ASUS_HANDLE(lcd_switch, "\\_SB.PCI0.SBRG.EC0._Q10", /* All new models */
1475 "\\_SB.PCI0.PX40.ECD0._Q10", /* L3C */
1476 "\\_SB.PCI0.PX40.EC0.Q10", /* M1A */
1477 "\\_SB.PCI0.LPCB.EC0._Q10", /* P30 */
1478 + "\\_SB.PCI0.LPCB.EC0._Q0E", /* P30/P35 */
1479 "\\_SB.PCI0.PX40.Q10", /* S1x */
1480 "\\Q10"); /* A2x, L2D, L3D, M2E */
1481
1482 @@ -280,7 +281,7 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val,
1483
1484 static int read_wireless_status(int mask)
1485 {
1486 - ulong status;
1487 + unsigned long long status;
1488 acpi_status rv = AE_OK;
1489
1490 if (!wireless_status_handle)
1491 @@ -297,7 +298,7 @@ static int read_wireless_status(int mask)
1492
1493 static int read_gps_status(void)
1494 {
1495 - ulong status;
1496 + unsigned long long status;
1497 acpi_status rv = AE_OK;
1498
1499 rv = acpi_evaluate_integer(gps_status_handle, NULL, NULL, &status);
1500 @@ -350,7 +351,7 @@ static void write_status(acpi_handle handle, int out, int mask)
1501 static void object##_led_set(struct led_classdev *led_cdev, \
1502 enum led_brightness value) \
1503 { \
1504 - object##_led_wk = value; \
1505 + object##_led_wk = (value > 0) ? 1 : 0; \
1506 queue_work(led_workqueue, &object##_led_work); \
1507 } \
1508 static void object##_led_update(struct work_struct *ignored) \
1509 @@ -404,7 +405,7 @@ static void lcd_blank(int blank)
1510
1511 static int read_brightness(struct backlight_device *bd)
1512 {
1513 - ulong value;
1514 + unsigned long long value;
1515 acpi_status rv = AE_OK;
1516
1517 rv = acpi_evaluate_integer(brightness_get_handle, NULL, NULL, &value);
1518 @@ -455,7 +456,7 @@ static ssize_t show_infos(struct device *dev,
1519 struct device_attribute *attr, char *page)
1520 {
1521 int len = 0;
1522 - ulong temp;
1523 + unsigned long long temp;
1524 char buf[16]; //enough for all info
1525 acpi_status rv = AE_OK;
1526
1527 @@ -603,7 +604,7 @@ static void set_display(int value)
1528
1529 static int read_display(void)
1530 {
1531 - ulong value = 0;
1532 + unsigned long long value = 0;
1533 acpi_status rv = AE_OK;
1534
1535 /* In most of the case, we know how to set the display, but sometime
1536 @@ -849,7 +850,7 @@ static int asus_hotk_get_info(void)
1537 {
1538 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
1539 union acpi_object *model = NULL;
1540 - ulong bsts_result, hwrs_result;
1541 + unsigned long long bsts_result, hwrs_result;
1542 char *string = NULL;
1543 acpi_status status;
1544
1545 diff --git a/drivers/misc/eeepc-laptop.c b/drivers/misc/eeepc-laptop.c
1546 index 1ee8501..616bcbd 100644
1547 --- a/drivers/misc/eeepc-laptop.c
1548 +++ b/drivers/misc/eeepc-laptop.c
1549 @@ -204,7 +204,7 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val,
1550 static int read_acpi_int(acpi_handle handle, const char *method, int *val)
1551 {
1552 acpi_status status;
1553 - ulong result;
1554 + unsigned long long result;
1555
1556 status = acpi_evaluate_integer(handle, (char *)method, NULL, &result);
1557 if (ACPI_FAILURE(status)) {
1558 diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/misc/fujitsu-laptop.c
1559 index 3e56203..efd395a 100644
1560 --- a/drivers/misc/fujitsu-laptop.c
1561 +++ b/drivers/misc/fujitsu-laptop.c
1562 @@ -224,7 +224,7 @@ static int set_lcd_level_alt(int level)
1563
1564 static int get_lcd_level(void)
1565 {
1566 - unsigned long state = 0;
1567 + unsigned long long state = 0;
1568 acpi_status status = AE_OK;
1569
1570 vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLL\n");
1571 @@ -246,7 +246,7 @@ static int get_lcd_level(void)
1572
1573 static int get_max_brightness(void)
1574 {
1575 - unsigned long state = 0;
1576 + unsigned long long state = 0;
1577 acpi_status status = AE_OK;
1578
1579 vdbg_printk(FUJLAPTOP_DBG_TRACE, "get max lcd level via RBLL\n");
1580 @@ -263,7 +263,7 @@ static int get_max_brightness(void)
1581
1582 static int get_lcd_level_alt(void)
1583 {
1584 - unsigned long state = 0;
1585 + unsigned long long state = 0;
1586 acpi_status status = AE_OK;
1587
1588 vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLS\n");
1589 @@ -384,7 +384,7 @@ static ssize_t store_lcd_level(struct device *dev,
1590
1591 static int get_irb(void)
1592 {
1593 - unsigned long state = 0;
1594 + unsigned long long state = 0;
1595 acpi_status status = AE_OK;
1596
1597 vdbg_printk(FUJLAPTOP_DBG_TRACE, "Get irb\n");
1598 diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c
1599 index 80a1363..f2257a7 100644
1600 --- a/drivers/misc/intel_menlow.c
1601 +++ b/drivers/misc/intel_menlow.c
1602 @@ -57,7 +57,7 @@ static int memory_get_int_max_bandwidth(struct thermal_cooling_device *cdev,
1603 {
1604 struct acpi_device *device = cdev->devdata;
1605 acpi_handle handle = device->handle;
1606 - unsigned long value;
1607 + unsigned long long value;
1608 struct acpi_object_list arg_list;
1609 union acpi_object arg;
1610 acpi_status status = AE_OK;
1611 @@ -90,7 +90,7 @@ static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev,
1612 {
1613 struct acpi_device *device = cdev->devdata;
1614 acpi_handle handle = device->handle;
1615 - unsigned long value;
1616 + unsigned long long value;
1617 struct acpi_object_list arg_list;
1618 union acpi_object arg;
1619 acpi_status status = AE_OK;
1620 @@ -104,7 +104,7 @@ static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev,
1621 if (ACPI_FAILURE(status))
1622 return -EFAULT;
1623
1624 - return sprintf(buf, "%ld\n", value);
1625 + return sprintf(buf, "%lld\n", value);
1626 }
1627
1628 static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
1629 @@ -115,7 +115,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
1630 struct acpi_object_list arg_list;
1631 union acpi_object arg;
1632 acpi_status status;
1633 - int temp;
1634 + unsigned long long temp;
1635 unsigned long max_state;
1636
1637 if (memory_get_int_max_bandwidth(cdev, &max_state))
1638 @@ -131,7 +131,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
1639
1640 status =
1641 acpi_evaluate_integer(handle, MEMORY_SET_BANDWIDTH, &arg_list,
1642 - (unsigned long *)&temp);
1643 + &temp);
1644
1645 printk(KERN_INFO
1646 "Bandwidth value was %d: status is %d\n", state, status);
1647 @@ -252,7 +252,8 @@ static DEFINE_MUTEX(intel_menlow_attr_lock);
1648 * @auxtype : AUX0/AUX1
1649 * @buf: syfs buffer
1650 */
1651 -static int sensor_get_auxtrip(acpi_handle handle, int index, int *value)
1652 +static int sensor_get_auxtrip(acpi_handle handle, int index,
1653 + unsigned long long *value)
1654 {
1655 acpi_status status;
1656
1657 @@ -260,7 +261,7 @@ static int sensor_get_auxtrip(acpi_handle handle, int index, int *value)
1658 return -EINVAL;
1659
1660 status = acpi_evaluate_integer(handle, index ? GET_AUX1 : GET_AUX0,
1661 - NULL, (unsigned long *)value);
1662 + NULL, value);
1663 if (ACPI_FAILURE(status))
1664 return -EIO;
1665
1666 @@ -282,13 +283,13 @@ static int sensor_set_auxtrip(acpi_handle handle, int index, int value)
1667 struct acpi_object_list args = {
1668 1, &arg
1669 };
1670 - int temp;
1671 + unsigned long long temp;
1672
1673 if (index != 0 && index != 1)
1674 return -EINVAL;
1675
1676 status = acpi_evaluate_integer(handle, index ? GET_AUX0 : GET_AUX1,
1677 - NULL, (unsigned long *)&temp);
1678 + NULL, &temp);
1679 if (ACPI_FAILURE(status))
1680 return -EIO;
1681 if ((index && value < temp) || (!index && value > temp))
1682 @@ -296,7 +297,7 @@ static int sensor_set_auxtrip(acpi_handle handle, int index, int value)
1683
1684 arg.integer.value = value;
1685 status = acpi_evaluate_integer(handle, index ? SET_AUX1 : SET_AUX0,
1686 - &args, (unsigned long *)&temp);
1687 + &args, &temp);
1688 if (ACPI_FAILURE(status))
1689 return -EIO;
1690
1691 @@ -312,7 +313,7 @@ static ssize_t aux0_show(struct device *dev,
1692 struct device_attribute *dev_attr, char *buf)
1693 {
1694 struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr);
1695 - int value;
1696 + unsigned long long value;
1697 int result;
1698
1699 result = sensor_get_auxtrip(attr->handle, 0, &value);
1700 @@ -324,7 +325,7 @@ static ssize_t aux1_show(struct device *dev,
1701 struct device_attribute *dev_attr, char *buf)
1702 {
1703 struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr);
1704 - int value;
1705 + unsigned long long value;
1706 int result;
1707
1708 result = sensor_get_auxtrip(attr->handle, 1, &value);
1709 @@ -376,7 +377,7 @@ static ssize_t bios_enabled_show(struct device *dev,
1710 struct device_attribute *attr, char *buf)
1711 {
1712 acpi_status status;
1713 - unsigned long bios_enabled;
1714 + unsigned long long bios_enabled;
1715
1716 status = acpi_evaluate_integer(NULL, BIOS_ENABLED, NULL, &bios_enabled);
1717 if (ACPI_FAILURE(status))
1718 @@ -492,7 +493,7 @@ static int __init intel_menlow_module_init(void)
1719 {
1720 int result = -ENODEV;
1721 acpi_status status;
1722 - unsigned long enable;
1723 + unsigned long long enable;
1724
1725 if (acpi_disabled)
1726 return result;
1727 diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
1728 index aa75385..be3c7dc 100644
1729 --- a/drivers/net/ixgb/ixgb_main.c
1730 +++ b/drivers/net/ixgb/ixgb_main.c
1731 @@ -977,15 +977,17 @@ ixgb_clean_rx_ring(struct ixgb_adapter *adapter)
1732
1733 for (i = 0; i < rx_ring->count; i++) {
1734 buffer_info = &rx_ring->buffer_info[i];
1735 - if (buffer_info->skb) {
1736 -
1737 + if (buffer_info->dma) {
1738 pci_unmap_single(pdev,
1739 buffer_info->dma,
1740 buffer_info->length,
1741 PCI_DMA_FROMDEVICE);
1742 + buffer_info->dma = 0;
1743 + buffer_info->length = 0;
1744 + }
1745
1746 + if (buffer_info->skb) {
1747 dev_kfree_skb(buffer_info->skb);
1748 -
1749 buffer_info->skb = NULL;
1750 }
1751 }
1752 diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
1753 index a3e4705..3baee56 100644
1754 --- a/drivers/pci/hotplug/acpiphp_glue.c
1755 +++ b/drivers/pci/hotplug/acpiphp_glue.c
1756 @@ -180,7 +180,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
1757 struct acpiphp_func *newfunc;
1758 acpi_handle tmp;
1759 acpi_status status = AE_OK;
1760 - unsigned long adr, sun;
1761 + unsigned long long adr, sun;
1762 int device, function, retval;
1763
1764 status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
1765 @@ -528,7 +528,7 @@ find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
1766 {
1767 acpi_status status;
1768 acpi_handle dummy_handle;
1769 - unsigned long tmp;
1770 + unsigned long long tmp;
1771 int device, function;
1772 struct pci_dev *dev;
1773 struct pci_bus *pci_bus = context;
1774 @@ -573,7 +573,7 @@ find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
1775 static int add_bridge(acpi_handle handle)
1776 {
1777 acpi_status status;
1778 - unsigned long tmp;
1779 + unsigned long long tmp;
1780 int seg, bus;
1781 acpi_handle dummy_handle;
1782 struct pci_bus *pci_bus;
1783 @@ -767,7 +767,7 @@ static int get_gsi_base(acpi_handle handle, u32 *gsi_base)
1784 {
1785 acpi_status status;
1786 int result = -1;
1787 - unsigned long gsb;
1788 + unsigned long long gsb;
1789 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
1790 union acpi_object *obj;
1791 void *table;
1792 @@ -808,7 +808,7 @@ static acpi_status
1793 ioapic_add(acpi_handle handle, u32 lvl, void *context, void **rv)
1794 {
1795 acpi_status status;
1796 - unsigned long sta;
1797 + unsigned long long sta;
1798 acpi_handle tmp;
1799 struct pci_dev *pdev;
1800 u32 gsi_base;
1801 @@ -872,7 +872,7 @@ static acpi_status
1802 ioapic_remove(acpi_handle handle, u32 lvl, void *context, void **rv)
1803 {
1804 acpi_status status;
1805 - unsigned long sta;
1806 + unsigned long long sta;
1807 acpi_handle tmp;
1808 u32 gsi_base;
1809 struct acpiphp_ioapic *pos, *n, *ioapic = NULL;
1810 @@ -1264,7 +1264,7 @@ static int disable_device(struct acpiphp_slot *slot)
1811 static unsigned int get_slot_status(struct acpiphp_slot *slot)
1812 {
1813 acpi_status status;
1814 - unsigned long sta = 0;
1815 + unsigned long long sta = 0;
1816 u32 dvid;
1817 struct list_head *l;
1818 struct acpiphp_func *func;
1819 diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
1820 index 2b7c45e..881fdd2 100644
1821 --- a/drivers/pci/hotplug/acpiphp_ibm.c
1822 +++ b/drivers/pci/hotplug/acpiphp_ibm.c
1823 @@ -183,7 +183,7 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
1824 union acpi_object args[2];
1825 struct acpi_object_list params = { .pointer = args, .count = 2 };
1826 acpi_status stat;
1827 - unsigned long rc;
1828 + unsigned long long rc;
1829 union apci_descriptor *ibm_slot;
1830
1831 ibm_slot = ibm_slot_from_id(hpslot_to_sun(slot));
1832 @@ -204,7 +204,7 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
1833 err("APLS evaluation failed: 0x%08x\n", stat);
1834 return -ENODEV;
1835 } else if (!rc) {
1836 - err("APLS method failed: 0x%08lx\n", rc);
1837 + err("APLS method failed: 0x%08llx\n", rc);
1838 return -ERANGE;
1839 }
1840 return 0;
1841 diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
1842 index d748698..3eee709 100644
1843 --- a/drivers/pci/hotplug/sgi_hotplug.c
1844 +++ b/drivers/pci/hotplug/sgi_hotplug.c
1845 @@ -413,7 +413,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
1846 /*
1847 * Add the slot's devices to the ACPI infrastructure */
1848 if (SN_ACPI_BASE_SUPPORT() && ssdt) {
1849 - unsigned long adr;
1850 + unsigned long long adr;
1851 struct acpi_device *pdevice;
1852 struct acpi_device *device;
1853 acpi_handle phandle;
1854 @@ -505,7 +505,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
1855 /* free the ACPI resources for the slot */
1856 if (SN_ACPI_BASE_SUPPORT() &&
1857 PCI_CONTROLLER(slot->pci_bus)->acpi_handle) {
1858 - unsigned long adr;
1859 + unsigned long long adr;
1860 struct acpi_device *device;
1861 acpi_handle phandle;
1862 acpi_handle chandle = NULL;
1863 diff --git a/drivers/serial/jsm/jsm_tty.c b/drivers/serial/jsm/jsm_tty.c
1864 index a697914..3fc7e0f 100644
1865 --- a/drivers/serial/jsm/jsm_tty.c
1866 +++ b/drivers/serial/jsm/jsm_tty.c
1867 @@ -161,6 +161,11 @@ static void jsm_tty_stop_rx(struct uart_port *port)
1868 channel->ch_bd->bd_ops->disable_receiver(channel);
1869 }
1870
1871 +static void jsm_tty_enable_ms(struct uart_port *port)
1872 +{
1873 + /* Nothing needed */
1874 +}
1875 +
1876 static void jsm_tty_break(struct uart_port *port, int break_state)
1877 {
1878 unsigned long lock_flags;
1879 @@ -345,6 +350,7 @@ static struct uart_ops jsm_ops = {
1880 .start_tx = jsm_tty_start_tx,
1881 .send_xchar = jsm_tty_send_xchar,
1882 .stop_rx = jsm_tty_stop_rx,
1883 + .enable_ms = jsm_tty_enable_ms,
1884 .break_ctl = jsm_tty_break,
1885 .startup = jsm_tty_open,
1886 .shutdown = jsm_tty_close,
1887 diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c
1888 index d8b0ba5..9c4a76a 100644
1889 --- a/drivers/usb/host/isp1760-if.c
1890 +++ b/drivers/usb/host/isp1760-if.c
1891 @@ -129,23 +129,23 @@ static struct of_platform_driver isp1760_of_driver = {
1892 #endif
1893
1894 #ifdef CONFIG_PCI
1895 -static u32 nxp_pci_io_base;
1896 -static u32 iolength;
1897 -static u32 pci_mem_phy0;
1898 -static u32 length;
1899 -static u8 __iomem *chip_addr;
1900 -static u8 __iomem *iobase;
1901 -
1902 static int __devinit isp1761_pci_probe(struct pci_dev *dev,
1903 const struct pci_device_id *id)
1904 {
1905 u8 latency, limit;
1906 __u32 reg_data;
1907 int retry_count;
1908 - int length;
1909 - int status = 1;
1910 struct usb_hcd *hcd;
1911 unsigned int devflags = 0;
1912 + int ret_status = 0;
1913 +
1914 + resource_size_t pci_mem_phy0;
1915 + resource_size_t memlength;
1916 +
1917 + u8 __iomem *chip_addr;
1918 + u8 __iomem *iobase;
1919 + resource_size_t nxp_pci_io_base;
1920 + resource_size_t iolength;
1921
1922 if (usb_disabled())
1923 return -ENODEV;
1924 @@ -168,26 +168,30 @@ static int __devinit isp1761_pci_probe(struct pci_dev *dev,
1925 iobase = ioremap_nocache(nxp_pci_io_base, iolength);
1926 if (!iobase) {
1927 printk(KERN_ERR "ioremap #1\n");
1928 - release_mem_region(nxp_pci_io_base, iolength);
1929 - return -ENOMEM;
1930 + ret_status = -ENOMEM;
1931 + goto cleanup1;
1932 }
1933 /* Grab the PLX PCI shared memory of the ISP 1761 we need */
1934 pci_mem_phy0 = pci_resource_start(dev, 3);
1935 - length = pci_resource_len(dev, 3);
1936 -
1937 - if (length < 0xffff) {
1938 - printk(KERN_ERR "memory length for this resource is less than "
1939 - "required\n");
1940 - release_mem_region(nxp_pci_io_base, iolength);
1941 - iounmap(iobase);
1942 - return -ENOMEM;
1943 + memlength = pci_resource_len(dev, 3);
1944 + if (memlength < 0xffff) {
1945 + printk(KERN_ERR "memory length for this resource is wrong\n");
1946 + ret_status = -ENOMEM;
1947 + goto cleanup2;
1948 }
1949
1950 - if (!request_mem_region(pci_mem_phy0, length, "ISP-PCI")) {
1951 + if (!request_mem_region(pci_mem_phy0, memlength, "ISP-PCI")) {
1952 printk(KERN_ERR "host controller already in use\n");
1953 - release_mem_region(nxp_pci_io_base, iolength);
1954 - iounmap(iobase);
1955 - return -EBUSY;
1956 + ret_status = -EBUSY;
1957 + goto cleanup2;
1958 + }
1959 +
1960 + /* map available memory */
1961 + chip_addr = ioremap_nocache(pci_mem_phy0,memlength);
1962 + if (!chip_addr) {
1963 + printk(KERN_ERR "Error ioremap failed\n");
1964 + ret_status = -ENOMEM;
1965 + goto cleanup3;
1966 }
1967
1968 /* bad pci latencies can contribute to overruns */
1969 @@ -210,38 +214,54 @@ static int __devinit isp1761_pci_probe(struct pci_dev *dev,
1970 * */
1971 writel(0xface, chip_addr + HC_SCRATCH_REG);
1972 udelay(100);
1973 - reg_data = readl(chip_addr + HC_SCRATCH_REG);
1974 + reg_data = readl(chip_addr + HC_SCRATCH_REG) & 0x0000ffff;
1975 retry_count--;
1976 }
1977
1978 + iounmap(chip_addr);
1979 +
1980 /* Host Controller presence is detected by writing to scratch register
1981 * and reading back and checking the contents are same or not
1982 */
1983 if (reg_data != 0xFACE) {
1984 err("scratch register mismatch %x", reg_data);
1985 - goto clean;
1986 + ret_status = -ENOMEM;
1987 + goto cleanup3;
1988 }
1989
1990 pci_set_master(dev);
1991
1992 - status = readl(iobase + 0x68);
1993 - status |= 0x900;
1994 - writel(status, iobase + 0x68);
1995 + /* configure PLX PCI chip to pass interrupts */
1996 +#define PLX_INT_CSR_REG 0x68
1997 + reg_data = readl(iobase + PLX_INT_CSR_REG);
1998 + reg_data |= 0x900;
1999 + writel(reg_data, iobase + PLX_INT_CSR_REG);
2000
2001 dev->dev.dma_mask = NULL;
2002 - hcd = isp1760_register(pci_mem_phy0, length, dev->irq,
2003 + hcd = isp1760_register(pci_mem_phy0, memlength, dev->irq,
2004 IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev),
2005 devflags);
2006 + if (IS_ERR(hcd)) {
2007 + ret_status = -ENODEV;
2008 + goto cleanup3;
2009 + }
2010 +
2011 + /* done with PLX IO access */
2012 + iounmap(iobase);
2013 + release_mem_region(nxp_pci_io_base, iolength);
2014 +
2015 pci_set_drvdata(dev, hcd);
2016 - if (!hcd)
2017 - return 0;
2018 -clean:
2019 - status = -ENODEV;
2020 + return 0;
2021 +
2022 +cleanup3:
2023 + release_mem_region(pci_mem_phy0, memlength);
2024 +cleanup2:
2025 iounmap(iobase);
2026 - release_mem_region(pci_mem_phy0, length);
2027 +cleanup1:
2028 release_mem_region(nxp_pci_io_base, iolength);
2029 - return status;
2030 + return ret_status;
2031 }
2032 +
2033 static void isp1761_pci_remove(struct pci_dev *dev)
2034 {
2035 struct usb_hcd *hcd;
2036 @@ -254,12 +274,6 @@ static void isp1761_pci_remove(struct pci_dev *dev)
2037 usb_put_hcd(hcd);
2038
2039 pci_disable_device(dev);
2040 -
2041 - iounmap(iobase);
2042 - iounmap(chip_addr);
2043 -
2044 - release_mem_region(nxp_pci_io_base, iolength);
2045 - release_mem_region(pci_mem_phy0, length);
2046 }
2047
2048 static void isp1761_pci_shutdown(struct pci_dev *dev)
2049 diff --git a/drivers/video/aty/mach64_ct.c b/drivers/video/aty/mach64_ct.c
2050 index c50c7cf..2745b85 100644
2051 --- a/drivers/video/aty/mach64_ct.c
2052 +++ b/drivers/video/aty/mach64_ct.c
2053 @@ -8,6 +8,9 @@
2054 #include <asm/io.h>
2055 #include <video/mach64.h>
2056 #include "atyfb.h"
2057 +#ifdef CONFIG_PPC
2058 +#include <asm/machdep.h>
2059 +#endif
2060
2061 #undef DEBUG
2062
2063 @@ -536,6 +539,14 @@ static int __devinit aty_init_pll_ct(const struct fb_info *info,
2064 pll->ct.xclk_post_div_real = postdividers[xpost_div];
2065 pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8;
2066
2067 +#ifdef CONFIG_PPC
2068 + if (machine_is(powermac)) {
2069 + /* Override PLL_EXT_CNTL & 0x07. */
2070 + pll->ct.xclk_post_div = xpost_div;
2071 + pll->ct.xclk_ref_div = 1;
2072 + }
2073 +#endif
2074 +
2075 #ifdef DEBUG
2076 pllmclk = (1000000 * pll->ct.mclk_fb_mult * pll->ct.mclk_fb_div) /
2077 (par->ref_clk_per * pll->ct.pll_ref_div);
2078 diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
2079 index 223647f..f254235 100644
2080 --- a/fs/cifs/connect.c
2081 +++ b/fs/cifs/connect.c
2082 @@ -1349,7 +1349,7 @@ cifs_parse_mount_options(char *options, const char *devname,
2083 }
2084
2085 static struct TCP_Server_Info *
2086 -cifs_find_tcp_session(struct sockaddr *addr)
2087 +cifs_find_tcp_session(struct sockaddr_storage *addr)
2088 {
2089 struct list_head *tmp;
2090 struct TCP_Server_Info *server;
2091 @@ -1369,11 +1369,11 @@ cifs_find_tcp_session(struct sockaddr *addr)
2092 if (server->tcpStatus == CifsNew)
2093 continue;
2094
2095 - if (addr->sa_family == AF_INET &&
2096 + if (addr->ss_family == AF_INET &&
2097 (addr4->sin_addr.s_addr !=
2098 server->addr.sockAddr.sin_addr.s_addr))
2099 continue;
2100 - else if (addr->sa_family == AF_INET6 &&
2101 + else if (addr->ss_family == AF_INET6 &&
2102 memcmp(&server->addr.sockAddr6.sin6_addr,
2103 &addr6->sin6_addr, sizeof(addr6->sin6_addr)))
2104 continue;
2105 @@ -2027,7 +2027,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2106 int rc = 0;
2107 int xid;
2108 struct socket *csocket = NULL;
2109 - struct sockaddr addr;
2110 + struct sockaddr_storage addr;
2111 struct sockaddr_in *sin_server = (struct sockaddr_in *) &addr;
2112 struct sockaddr_in6 *sin_server6 = (struct sockaddr_in6 *) &addr;
2113 struct smb_vol volume_info;
2114 @@ -2039,7 +2039,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2115
2116 /* cFYI(1, ("Entering cifs_mount. Xid: %d with: %s", xid, mount_data)); */
2117
2118 - memset(&addr, 0, sizeof(struct sockaddr));
2119 + memset(&addr, 0, sizeof(struct sockaddr_storage));
2120 memset(&volume_info, 0, sizeof(struct smb_vol));
2121 if (cifs_parse_mount_options(mount_data, devname, &volume_info)) {
2122 rc = -EINVAL;
2123 @@ -2069,9 +2069,9 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2124 rc = cifs_inet_pton(AF_INET6, volume_info.UNCip,
2125 &sin_server6->sin6_addr.in6_u);
2126 if (rc > 0)
2127 - addr.sa_family = AF_INET6;
2128 + addr.ss_family = AF_INET6;
2129 } else {
2130 - addr.sa_family = AF_INET;
2131 + addr.ss_family = AF_INET;
2132 }
2133
2134 if (rc <= 0) {
2135 @@ -2113,7 +2113,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2136
2137 srvTcp = cifs_find_tcp_session(&addr);
2138 if (!srvTcp) { /* create socket */
2139 - if (addr.sa_family == AF_INET6) {
2140 + if (addr.ss_family == AF_INET6) {
2141 cFYI(1, ("attempting ipv6 connect"));
2142 /* BB should we allow ipv6 on port 139? */
2143 /* other OS never observed in Wild doing 139 with v6 */
2144 @@ -2144,7 +2144,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2145 } else {
2146 srvTcp->noblocksnd = volume_info.noblocksnd;
2147 srvTcp->noautotune = volume_info.noautotune;
2148 - if (addr.sa_family == AF_INET6)
2149 + if (addr.ss_family == AF_INET6)
2150 memcpy(&srvTcp->addr.sockAddr6, sin_server6,
2151 sizeof(struct sockaddr_in6));
2152 else
2153 diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
2154 index eba87ff..ca46f11 100644
2155 --- a/fs/dlm/plock.c
2156 +++ b/fs/dlm/plock.c
2157 @@ -304,7 +304,9 @@ int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
2158 if (rv == -ENOENT)
2159 rv = 0;
2160 else if (rv > 0) {
2161 + locks_init_lock(fl);
2162 fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK;
2163 + fl->fl_flags = FL_POSIX;
2164 fl->fl_pid = op->info.pid;
2165 fl->fl_start = op->info.start;
2166 fl->fl_end = op->info.end;
2167 diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
2168 index 1578d7a..ddcbed8 100644
2169 --- a/fs/nfsd/nfs4state.c
2170 +++ b/fs/nfsd/nfs4state.c
2171 @@ -2767,6 +2767,25 @@ out:
2172 }
2173
2174 /*
2175 + * The NFSv4 spec allows a client to do a LOCKT without holding an OPEN,
2176 + * so we do a temporary open here just to get an open file to pass to
2177 + * vfs_test_lock. (Arguably perhaps test_lock should be done with an
2178 + * inode operation.)
2179 + */
2180 +static int nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock)
2181 +{
2182 + struct file *file;
2183 + int err;
2184 +
2185 + err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file);
2186 + if (err)
2187 + return err;
2188 + err = vfs_test_lock(file, lock);
2189 + nfsd_close(file);
2190 + return err;
2191 +}
2192 +
2193 +/*
2194 * LOCKT operation
2195 */
2196 __be32
2197 @@ -2774,7 +2793,6 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2198 struct nfsd4_lockt *lockt)
2199 {
2200 struct inode *inode;
2201 - struct file file;
2202 struct file_lock file_lock;
2203 int error;
2204 __be32 status;
2205 @@ -2822,7 +2840,6 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2206 file_lock.fl_owner = (fl_owner_t)lockt->lt_stateowner;
2207 file_lock.fl_pid = current->tgid;
2208 file_lock.fl_flags = FL_POSIX;
2209 - file_lock.fl_lmops = &nfsd_posix_mng_ops;
2210
2211 file_lock.fl_start = lockt->lt_offset;
2212 if ((lockt->lt_length == ~(u64)0) || LOFF_OVERFLOW(lockt->lt_offset, lockt->lt_length))
2213 @@ -2832,16 +2849,8 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2214
2215 nfs4_transform_lock_offset(&file_lock);
2216
2217 - /* vfs_test_lock uses the struct file _only_ to resolve the inode.
2218 - * since LOCKT doesn't require an OPEN, and therefore a struct
2219 - * file may not exist, pass vfs_test_lock a struct file with
2220 - * only the dentry:inode set.
2221 - */
2222 - memset(&file, 0, sizeof (struct file));
2223 - file.f_path.dentry = cstate->current_fh.fh_dentry;
2224 -
2225 status = nfs_ok;
2226 - error = vfs_test_lock(&file, &file_lock);
2227 + error = nfsd_test_lock(rqstp, &cstate->current_fh, &file_lock);
2228 if (error) {
2229 status = nfserrno(error);
2230 goto out;
2231 diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
2232 index a5ac0bc..c52f10d 100644
2233 --- a/include/acpi/acpi_bus.h
2234 +++ b/include/acpi/acpi_bus.h
2235 @@ -46,7 +46,7 @@ acpi_extract_package(union acpi_object *package,
2236 acpi_status
2237 acpi_evaluate_integer(acpi_handle handle,
2238 acpi_string pathname,
2239 - struct acpi_object_list *arguments, unsigned long *data);
2240 + struct acpi_object_list *arguments, unsigned long long *data);
2241 acpi_status
2242 acpi_evaluate_reference(acpi_handle handle,
2243 acpi_string pathname,
2244 diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
2245 index 4ea4f40..73d6b1c 100644
2246 --- a/include/acpi/actypes.h
2247 +++ b/include/acpi/actypes.h
2248 @@ -1225,8 +1225,8 @@ struct acpi_resource {
2249
2250 #pragma pack()
2251
2252 -#define ACPI_RS_SIZE_MIN 12
2253 #define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */
2254 +#define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
2255 #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
2256
2257 #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)
2258 diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
2259 index 9e7b49b..a5cb0c3 100644
2260 --- a/include/linux/if_vlan.h
2261 +++ b/include/linux/if_vlan.h
2262 @@ -114,6 +114,8 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev);
2263
2264 extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
2265 u16 vlan_tci, int polling);
2266 +extern int vlan_hwaccel_do_receive(struct sk_buff *skb);
2267 +
2268 #else
2269 static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
2270 {
2271 @@ -133,6 +135,11 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
2272 BUG();
2273 return NET_XMIT_SUCCESS;
2274 }
2275 +
2276 +static inline int vlan_hwaccel_do_receive(struct sk_buff *skb)
2277 +{
2278 + return 0;
2279 +}
2280 #endif
2281
2282 /**
2283 diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
2284 index 391cbf3..26b59cb 100644
2285 --- a/include/linux/pci_ids.h
2286 +++ b/include/linux/pci_ids.h
2287 @@ -2384,6 +2384,7 @@
2288 #define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8
2289 #define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9
2290 #define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0
2291 +#define PCI_DEVICE_ID_INTEL_TGP_LPC 0x27bc
2292 #define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd
2293 #define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da
2294 #define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd
2295 diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
2296 index 916061f..68ced4b 100644
2297 --- a/net/8021q/vlan_core.c
2298 +++ b/net/8021q/vlan_core.c
2299 @@ -3,11 +3,20 @@
2300 #include <linux/if_vlan.h>
2301 #include "vlan.h"
2302
2303 +struct vlan_hwaccel_cb {
2304 + struct net_device *dev;
2305 +};
2306 +
2307 +static inline struct vlan_hwaccel_cb *vlan_hwaccel_cb(struct sk_buff *skb)
2308 +{
2309 + return (struct vlan_hwaccel_cb *)skb->cb;
2310 +}
2311 +
2312 /* VLAN rx hw acceleration helper. This acts like netif_{rx,receive_skb}(). */
2313 int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
2314 u16 vlan_tci, int polling)
2315 {
2316 - struct net_device_stats *stats;
2317 + struct vlan_hwaccel_cb *cb = vlan_hwaccel_cb(skb);
2318
2319 if (skb_bond_should_drop(skb)) {
2320 dev_kfree_skb_any(skb);
2321 @@ -15,23 +24,35 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
2322 }
2323
2324 skb->vlan_tci = vlan_tci;
2325 + cb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK);
2326 +
2327 + return (polling ? netif_receive_skb(skb) : netif_rx(skb));
2328 +}
2329 +EXPORT_SYMBOL(__vlan_hwaccel_rx);
2330 +
2331 +int vlan_hwaccel_do_receive(struct sk_buff *skb)
2332 +{
2333 + struct vlan_hwaccel_cb *cb = vlan_hwaccel_cb(skb);
2334 + struct net_device *dev = cb->dev;
2335 + struct net_device_stats *stats;
2336 +
2337 netif_nit_deliver(skb);
2338
2339 - skb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK);
2340 - if (skb->dev == NULL) {
2341 - dev_kfree_skb_any(skb);
2342 - /* Not NET_RX_DROP, this is not being dropped
2343 - * due to congestion. */
2344 - return NET_RX_SUCCESS;
2345 + if (dev == NULL) {
2346 + kfree_skb(skb);
2347 + return -1;
2348 }
2349 - skb->dev->last_rx = jiffies;
2350 +
2351 + skb->dev = dev;
2352 + skb->priority = vlan_get_ingress_priority(dev, skb->vlan_tci);
2353 skb->vlan_tci = 0;
2354
2355 - stats = &skb->dev->stats;
2356 + dev->last_rx = jiffies;
2357 +
2358 + stats = &dev->stats;
2359 stats->rx_packets++;
2360 stats->rx_bytes += skb->len;
2361
2362 - skb->priority = vlan_get_ingress_priority(skb->dev, vlan_tci);
2363 switch (skb->pkt_type) {
2364 case PACKET_BROADCAST:
2365 break;
2366 @@ -43,13 +64,12 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
2367 * This allows the VLAN to have a different MAC than the
2368 * underlying device, and still route correctly. */
2369 if (!compare_ether_addr(eth_hdr(skb)->h_dest,
2370 - skb->dev->dev_addr))
2371 + dev->dev_addr))
2372 skb->pkt_type = PACKET_HOST;
2373 break;
2374 };
2375 - return (polling ? netif_receive_skb(skb) : netif_rx(skb));
2376 + return 0;
2377 }
2378 -EXPORT_SYMBOL(__vlan_hwaccel_rx);
2379
2380 struct net_device *vlan_dev_real_dev(const struct net_device *dev)
2381 {
2382 diff --git a/net/core/dev.c b/net/core/dev.c
2383 index 5a25896..f7a30f2 100644
2384 --- a/net/core/dev.c
2385 +++ b/net/core/dev.c
2386 @@ -2187,6 +2187,9 @@ int netif_receive_skb(struct sk_buff *skb)
2387 int ret = NET_RX_DROP;
2388 __be16 type;
2389
2390 + if (skb->vlan_tci && vlan_hwaccel_do_receive(skb))
2391 + return NET_RX_SUCCESS;
2392 +
2393 /* if we've gotten here through NAPI, check netpoll */
2394 if (netpoll_receive_skb(skb))
2395 return NET_RX_DROP;