]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.kernel.org/patch-2.6.27.15-16
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.kernel.org / patch-2.6.27.15-16
1 From: Greg Kroah-Hartman <gregkh@suse.de>
2 Subject: Linux 2.6.27.16
3
4 Upstream 2.6.27.16 release from kernel.org
5
6 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
7
8 diff --git a/Documentation/filesystems/sysfs-pci.txt b/Documentation/filesystems/sysfs-pci.txt
9 index 68ef488..de99749 100644
10 --- a/Documentation/filesystems/sysfs-pci.txt
11 +++ b/Documentation/filesystems/sysfs-pci.txt
12 @@ -9,6 +9,7 @@ that support it. For example, a given bus might look like this:
13 | |-- class
14 | |-- config
15 | |-- device
16 + | |-- enable
17 | |-- irq
18 | |-- local_cpus
19 | |-- resource
20 @@ -32,6 +33,7 @@ files, each with their own function.
21 class PCI class (ascii, ro)
22 config PCI config space (binary, rw)
23 device PCI device (ascii, ro)
24 + enable Whether the device is enabled (ascii, rw)
25 irq IRQ number (ascii, ro)
26 local_cpus nearby CPU mask (cpumask, ro)
27 resource PCI resource host addresses (ascii, ro)
28 @@ -57,10 +59,19 @@ used to do actual device programming from userspace. Note that some platforms
29 don't support mmapping of certain resources, so be sure to check the return
30 value from any attempted mmap.
31
32 +The 'enable' file provides a counter that indicates how many times the device
33 +has been enabled. If the 'enable' file currently returns '4', and a '1' is
34 +echoed into it, it will then return '5'. Echoing a '0' into it will decrease
35 +the count. Even when it returns to 0, though, some of the initialisation
36 +may not be reversed.
37 +
38 The 'rom' file is special in that it provides read-only access to the device's
39 ROM file, if available. It's disabled by default, however, so applications
40 should write the string "1" to the file to enable it before attempting a read
41 -call, and disable it following the access by writing "0" to the file.
42 +call, and disable it following the access by writing "0" to the file. Note
43 +that the device must be enabled for a rom read to return data succesfully.
44 +In the event a driver is not bound to the device, it can be enabled using the
45 +'enable' file, documented above.
46
47 Accessing legacy resources through sysfs
48 ----------------------------------------
49 diff --git a/Makefile b/Makefile
50 index a2dcd97..d398828 100644
51 --- a/Makefile
52 +++ b/Makefile
53 @@ -1,7 +1,7 @@
54 VERSION = 2
55 PATCHLEVEL = 6
56 SUBLEVEL = 27
57 -EXTRAVERSION = .15
58 +EXTRAVERSION = .16
59 NAME = Trembling Tortoise
60
61 # *DOCUMENTATION*
62 diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c
63 index a15baac..0c3f2a0 100644
64 --- a/arch/ia64/sn/kernel/io_acpi_init.c
65 +++ b/arch/ia64/sn/kernel/io_acpi_init.c
66 @@ -434,7 +434,7 @@ sn_acpi_slot_fixup(struct pci_dev *dev)
67 size = pci_resource_len(dev, PCI_ROM_RESOURCE);
68 addr = ioremap(pcidev_info->pdi_pio_mapped_addr[PCI_ROM_RESOURCE],
69 size);
70 - image_size = pci_get_rom_size(addr, size);
71 + image_size = pci_get_rom_size(dev, addr, size);
72 dev->resource[PCI_ROM_RESOURCE].start = (unsigned long) addr;
73 dev->resource[PCI_ROM_RESOURCE].end =
74 (unsigned long) addr + image_size - 1;
75 diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
76 index c3aa851..1a3ed90 100644
77 --- a/arch/ia64/sn/kernel/io_init.c
78 +++ b/arch/ia64/sn/kernel/io_init.c
79 @@ -269,7 +269,7 @@ sn_io_slot_fixup(struct pci_dev *dev)
80
81 rom = ioremap(pci_resource_start(dev, PCI_ROM_RESOURCE),
82 size + 1);
83 - image_size = pci_get_rom_size(rom, size + 1);
84 + image_size = pci_get_rom_size(dev, rom, size + 1);
85 dev->resource[PCI_ROM_RESOURCE].end =
86 dev->resource[PCI_ROM_RESOURCE].start +
87 image_size - 1;
88 diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
89 index f88bd0d..ffc633c 100644
90 --- a/arch/x86/kernel/apic_32.c
91 +++ b/arch/x86/kernel/apic_32.c
92 @@ -1115,7 +1115,7 @@ static int __init detect_init_APIC(void)
93 switch (boot_cpu_data.x86_vendor) {
94 case X86_VENDOR_AMD:
95 if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) ||
96 - (boot_cpu_data.x86 == 15))
97 + (boot_cpu_data.x86 >= 15))
98 break;
99 goto no_apic;
100 case X86_VENDOR_INTEL:
101 diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
102 index dd097b8..9943b4c 100644
103 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
104 +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
105 @@ -779,6 +779,9 @@ static int __init acpi_cpufreq_init(void)
106 {
107 int ret;
108
109 + if (acpi_disabled)
110 + return 0;
111 +
112 dprintk("acpi_cpufreq_init\n");
113
114 ret = acpi_cpufreq_early_init();
115 diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
116 index da1973b..3384255 100644
117 --- a/arch/x86/mm/fault.c
118 +++ b/arch/x86/mm/fault.c
119 @@ -607,8 +607,6 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
120
121 si_code = SEGV_MAPERR;
122
123 - if (notify_page_fault(regs))
124 - return;
125 if (unlikely(kmmio_fault(regs, address)))
126 return;
127
128 @@ -638,6 +636,9 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
129 if (spurious_fault(address, error_code))
130 return;
131
132 + /* kprobes don't want to hook the spurious faults. */
133 + if (notify_page_fault(regs))
134 + return;
135 /*
136 * Don't take the mm semaphore here. If we fixup a prefetch
137 * fault we could otherwise deadlock.
138 @@ -645,6 +646,9 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
139 goto bad_area_nosemaphore;
140 }
141
142 + /* kprobes don't want to hook the spurious faults. */
143 + if (notify_page_fault(regs))
144 + return;
145
146 #ifdef CONFIG_X86_32
147 /* It's safe to allow irq's after cr2 has been saved and the vmalloc
148 diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
149 index e28469e..eab790f 100644
150 --- a/drivers/acpi/dock.c
151 +++ b/drivers/acpi/dock.c
152 @@ -691,8 +691,14 @@ fdd_out:
153 static ssize_t show_docked(struct device *dev,
154 struct device_attribute *attr, char *buf)
155 {
156 - return snprintf(buf, PAGE_SIZE, "%d\n", dock_present(dock_station));
157 + struct acpi_device *tmp;
158 +
159 + struct dock_station *dock_station = *((struct dock_station **)
160 + dev->platform_data);
161
162 + if (ACPI_SUCCESS(acpi_bus_get_device(dock_station->handle, &tmp)))
163 + return snprintf(buf, PAGE_SIZE, "1\n");
164 + return snprintf(buf, PAGE_SIZE, "0\n");
165 }
166 static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL);
167
168 diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
169 index 8892b98..331a114 100644
170 --- a/drivers/acpi/executer/exconfig.c
171 +++ b/drivers/acpi/executer/exconfig.c
172 @@ -280,6 +280,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
173 struct acpi_walk_state *walk_state)
174 {
175 union acpi_operand_object *ddb_handle;
176 + struct acpi_table_header *table;
177 struct acpi_table_desc table_desc;
178 u32 table_index;
179 acpi_status status;
180 @@ -294,9 +295,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
181 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
182 case ACPI_TYPE_REGION:
183
184 - ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Load from Region %p %s\n",
185 - obj_desc,
186 - acpi_ut_get_object_type_name(obj_desc)));
187 + ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
188 + "Load table from Region %p\n", obj_desc));
189
190 /* Region must be system_memory (from ACPI spec) */
191
192 @@ -316,61 +316,112 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
193 }
194
195 /*
196 - * We will simply map the memory region for the table. However, the
197 - * memory region is technically not guaranteed to remain stable and
198 - * we may eventually have to copy the table to a local buffer.
199 + * Map the table header and get the actual table length. The region
200 + * length is not guaranteed to be the same as the table length.
201 + */
202 + table = acpi_os_map_memory(obj_desc->region.address,
203 + sizeof(struct acpi_table_header));
204 + if (!table) {
205 + return_ACPI_STATUS(AE_NO_MEMORY);
206 + }
207 +
208 + length = table->length;
209 + acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
210 +
211 + /* Must have at least an ACPI table header */
212 +
213 + if (length < sizeof(struct acpi_table_header)) {
214 + return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
215 + }
216 +
217 + /*
218 + * The memory region is not guaranteed to remain stable and we must
219 + * copy the table to a local buffer. For example, the memory region
220 + * is corrupted after suspend on some machines. Dynamically loaded
221 + * tables are usually small, so this overhead is minimal.
222 */
223 +
224 + /* Allocate a buffer for the table */
225 +
226 + table_desc.pointer = ACPI_ALLOCATE(length);
227 + if (!table_desc.pointer) {
228 + return_ACPI_STATUS(AE_NO_MEMORY);
229 + }
230 +
231 + /* Map the entire table and copy it */
232 +
233 + table = acpi_os_map_memory(obj_desc->region.address, length);
234 + if (!table) {
235 + ACPI_FREE(table_desc.pointer);
236 + return_ACPI_STATUS(AE_NO_MEMORY);
237 + }
238 +
239 + ACPI_MEMCPY(table_desc.pointer, table, length);
240 + acpi_os_unmap_memory(table, length);
241 +
242 table_desc.address = obj_desc->region.address;
243 - table_desc.length = obj_desc->region.length;
244 - table_desc.flags = ACPI_TABLE_ORIGIN_MAPPED;
245 break;
246
247 case ACPI_TYPE_BUFFER: /* Buffer or resolved region_field */
248
249 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
250 - "Load from Buffer or Field %p %s\n", obj_desc,
251 - acpi_ut_get_object_type_name(obj_desc)));
252 -
253 - length = obj_desc->buffer.length;
254 + "Load table from Buffer or Field %p\n",
255 + obj_desc));
256
257 /* Must have at least an ACPI table header */
258
259 - if (length < sizeof(struct acpi_table_header)) {
260 + if (obj_desc->buffer.length < sizeof(struct acpi_table_header)) {
261 return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
262 }
263
264 - /* Validate checksum here. It won't get validated in tb_add_table */
265 + /* Get the actual table length from the table header */
266
267 - status =
268 - acpi_tb_verify_checksum(ACPI_CAST_PTR
269 - (struct acpi_table_header,
270 - obj_desc->buffer.pointer), length);
271 - if (ACPI_FAILURE(status)) {
272 - return_ACPI_STATUS(status);
273 + table =
274 + ACPI_CAST_PTR(struct acpi_table_header,
275 + obj_desc->buffer.pointer);
276 + length = table->length;
277 +
278 + /* Table cannot extend beyond the buffer */
279 +
280 + if (length > obj_desc->buffer.length) {
281 + return_ACPI_STATUS(AE_AML_BUFFER_LIMIT);
282 + }
283 + if (length < sizeof(struct acpi_table_header)) {
284 + return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
285 }
286
287 /*
288 - * We need to copy the buffer since the original buffer could be
289 - * changed or deleted in the future
290 + * Copy the table from the buffer because the buffer could be modified
291 + * or even deleted in the future
292 */
293 table_desc.pointer = ACPI_ALLOCATE(length);
294 if (!table_desc.pointer) {
295 return_ACPI_STATUS(AE_NO_MEMORY);
296 }
297
298 - ACPI_MEMCPY(table_desc.pointer, obj_desc->buffer.pointer,
299 - length);
300 - table_desc.length = length;
301 - table_desc.flags = ACPI_TABLE_ORIGIN_ALLOCATED;
302 + ACPI_MEMCPY(table_desc.pointer, table, length);
303 + table_desc.address = ACPI_TO_INTEGER(table_desc.pointer);
304 break;
305
306 default:
307 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
308 }
309
310 - /*
311 - * Install the new table into the local data structures
312 - */
313 + /* Validate table checksum (will not get validated in tb_add_table) */
314 +
315 + status = acpi_tb_verify_checksum(table_desc.pointer, length);
316 + if (ACPI_FAILURE(status)) {
317 + ACPI_FREE(table_desc.pointer);
318 + return_ACPI_STATUS(status);
319 + }
320 +
321 + /* Complete the table descriptor */
322 +
323 + table_desc.length = length;
324 + table_desc.flags = ACPI_TABLE_ORIGIN_ALLOCATED;
325 +
326 + /* Install the new table into the local data structures */
327 +
328 status = acpi_tb_add_table(&table_desc, &table_index);
329 if (ACPI_FAILURE(status)) {
330 goto cleanup;
331 @@ -379,7 +430,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
332 /*
333 * Add the table to the namespace.
334 *
335 - * Note: We load the table objects relative to the root of the namespace.
336 + * Note: Load the table objects relative to the root of the namespace.
337 * This appears to go against the ACPI specification, but we do it for
338 * compatibility with other ACPI implementations.
339 */
340 @@ -415,7 +466,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
341 cleanup:
342 if (ACPI_FAILURE(status)) {
343
344 - /* Delete allocated buffer or mapping */
345 + /* Delete allocated table buffer */
346
347 acpi_tb_delete_table(&table_desc);
348 }
349 diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
350 index 38be586..f3cc376 100644
351 --- a/drivers/acpi/namespace/nsxfeval.c
352 +++ b/drivers/acpi/namespace/nsxfeval.c
353 @@ -45,9 +45,14 @@
354 #include <acpi/acpi.h>
355 #include <acpi/acnamesp.h>
356 #include <acpi/acinterp.h>
357 +#include <acpi/amlcode.h>
358
359 #define _COMPONENT ACPI_NAMESPACE
360 ACPI_MODULE_NAME("nsxfeval")
361 +
362 +/* Local prototypes */
363 +static void acpi_ns_resolve_references(struct acpi_evaluate_info *info);
364 +
365 #ifdef ACPI_FUTURE_USAGE
366 /*******************************************************************************
367 *
368 @@ -69,6 +74,7 @@ ACPI_MODULE_NAME("nsxfeval")
369 * be valid (non-null)
370 *
371 ******************************************************************************/
372 +
373 acpi_status
374 acpi_evaluate_object_typed(acpi_handle handle,
375 acpi_string pathname,
376 @@ -283,6 +289,10 @@ acpi_evaluate_object(acpi_handle handle,
377
378 if (ACPI_SUCCESS(status)) {
379
380 + /* Dereference Index and ref_of references */
381 +
382 + acpi_ns_resolve_references(info);
383 +
384 /* Get the size of the returned object */
385
386 status =
387 @@ -352,6 +362,74 @@ ACPI_EXPORT_SYMBOL(acpi_evaluate_object)
388
389 /*******************************************************************************
390 *
391 + * FUNCTION: acpi_ns_resolve_references
392 + *
393 + * PARAMETERS: Info - Evaluation info block
394 + *
395 + * RETURN: Info->return_object is replaced with the dereferenced object
396 + *
397 + * DESCRIPTION: Dereference certain reference objects. Called before an
398 + * internal return object is converted to an external union acpi_object.
399 + *
400 + * Performs an automatic dereference of Index and ref_of reference objects.
401 + * These reference objects are not supported by the union acpi_object, so this is a
402 + * last resort effort to return something useful. Also, provides compatibility
403 + * with other ACPI implementations.
404 + *
405 + * NOTE: does not handle references within returned package objects or nested
406 + * references, but this support could be added later if found to be necessary.
407 + *
408 + ******************************************************************************/
409 +static void acpi_ns_resolve_references(struct acpi_evaluate_info *info)
410 +{
411 + union acpi_operand_object *obj_desc = NULL;
412 + struct acpi_namespace_node *node;
413 +
414 + /* We are interested in reference objects only */
415 +
416 + if (ACPI_GET_OBJECT_TYPE(info->return_object) !=
417 + ACPI_TYPE_LOCAL_REFERENCE) {
418 + return;
419 + }
420 +
421 + /*
422 + * Two types of references are supported - those created by Index and
423 + * ref_of operators. A name reference (AML_NAMEPATH_OP) can be converted
424 + * to an union acpi_object, so it is not dereferenced here. A ddb_handle
425 + * (AML_LOAD_OP) cannot be dereferenced, nor can it be converted to
426 + * an union acpi_object.
427 + */
428 + switch (info->return_object->reference.opcode) {
429 + case AML_INDEX_OP:
430 +
431 + obj_desc = *(info->return_object->reference.where);
432 + break;
433 +
434 + case AML_REF_OF_OP:
435 +
436 + node = info->return_object->reference.object;
437 + if (node) {
438 + obj_desc = node->object;
439 + }
440 + break;
441 +
442 + default:
443 + return;
444 + }
445 +
446 + /* Replace the existing reference object */
447 +
448 + if (obj_desc) {
449 + acpi_ut_add_reference(obj_desc);
450 + acpi_ut_remove_reference(info->return_object);
451 + info->return_object = obj_desc;
452 + }
453 +
454 + return;
455 +}
456 +
457 +/*******************************************************************************
458 + *
459 * FUNCTION: acpi_walk_namespace
460 *
461 * PARAMETERS: Type - acpi_object_type to search for
462 @@ -379,6 +457,7 @@ ACPI_EXPORT_SYMBOL(acpi_evaluate_object)
463 * function, etc.
464 *
465 ******************************************************************************/
466 +
467 acpi_status
468 acpi_walk_namespace(acpi_object_type type,
469 acpi_handle start_object,
470 diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
471 index 775c97a..a885295 100644
472 --- a/drivers/acpi/tables.c
473 +++ b/drivers/acpi/tables.c
474 @@ -293,7 +293,12 @@ static void __init check_multiple_madt(void)
475
476 int __init acpi_table_init(void)
477 {
478 - acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
479 + acpi_status status;
480 +
481 + status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
482 + if (ACPI_FAILURE(status))
483 + return 1;
484 +
485 check_multiple_madt();
486 return 0;
487 }
488 diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
489 index 0cc92ef..f5d7aec 100644
490 --- a/drivers/acpi/tables/tbutils.c
491 +++ b/drivers/acpi/tables/tbutils.c
492 @@ -512,10 +512,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)
493 if (ACPI_FAILURE(status)) {
494 ACPI_WARNING((AE_INFO,
495 "Truncating %u table entries!",
496 - (unsigned)
497 - (acpi_gbl_root_table_list.size -
498 - acpi_gbl_root_table_list.
499 - count)));
500 + (unsigned) (table_count -
501 + (acpi_gbl_root_table_list.
502 + count - 2))));
503 break;
504 }
505 }
506 diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
507 index 42e1e84..a953b5d 100644
508 --- a/drivers/acpi/video.c
509 +++ b/drivers/acpi/video.c
510 @@ -36,6 +36,7 @@
511 #include <linux/backlight.h>
512 #include <linux/thermal.h>
513 #include <linux/video_output.h>
514 +#include <linux/sort.h>
515 #include <asm/uaccess.h>
516
517 #include <acpi/acpi_bus.h>
518 @@ -632,6 +633,16 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
519 }
520
521 /*
522 + * Simple comparison function used to sort backlight levels.
523 + */
524 +
525 +static int
526 +acpi_video_cmp_level(const void *a, const void *b)
527 +{
528 + return *(int *)a - *(int *)b;
529 +}
530 +
531 +/*
532 * Arg:
533 * device : video output device (LCD, CRT, ..)
534 *
535 @@ -682,6 +693,10 @@ acpi_video_init_brightness(struct acpi_video_device *device)
536 count++;
537 }
538
539 + /* don't sort the first two brightness levels */
540 + sort(&br->levels[2], count - 2, sizeof(br->levels[2]),
541 + acpi_video_cmp_level, NULL);
542 +
543 if (count < 2)
544 goto out_free_levels;
545
546 @@ -997,7 +1012,7 @@ acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset)
547 }
548
549 seq_printf(seq, "levels: ");
550 - for (i = 0; i < dev->brightness->count; i++)
551 + for (i = 2; i < dev->brightness->count; i++)
552 seq_printf(seq, " %d", dev->brightness->levels[i]);
553 seq_printf(seq, "\ncurrent: %d\n", dev->brightness->curr);
554
555 @@ -1036,7 +1051,7 @@ acpi_video_device_write_brightness(struct file *file,
556 return -EFAULT;
557
558 /* validate through the list of available levels */
559 - for (i = 0; i < dev->brightness->count; i++)
560 + for (i = 2; i < dev->brightness->count; i++)
561 if (level == dev->brightness->levels[i]) {
562 if (ACPI_SUCCESS
563 (acpi_video_device_lcd_set_level(dev, level)))
564 @@ -1689,7 +1704,7 @@ acpi_video_get_next_level(struct acpi_video_device *device,
565 max = max_below = 0;
566 min = min_above = 255;
567 /* Find closest level to level_current */
568 - for (i = 0; i < device->brightness->count; i++) {
569 + for (i = 2; i < device->brightness->count; i++) {
570 l = device->brightness->levels[i];
571 if (abs(l - level_current) < abs(delta)) {
572 delta = l - level_current;
573 @@ -1699,7 +1714,7 @@ acpi_video_get_next_level(struct acpi_video_device *device,
574 }
575 /* Ajust level_current to closest available level */
576 level_current += delta;
577 - for (i = 0; i < device->brightness->count; i++) {
578 + for (i = 2; i < device->brightness->count; i++) {
579 l = device->brightness->levels[i];
580 if (l < min)
581 min = l;
582 @@ -1983,6 +1998,12 @@ static int acpi_video_bus_add(struct acpi_device *device)
583 device->pnp.bus_id[3] = '0' + instance;
584 instance ++;
585 }
586 + /* a hack to fix the duplicate name "VGA" problem on Pa 3553 */
587 + if (!strcmp(device->pnp.bus_id, "VGA")) {
588 + if (instance)
589 + device->pnp.bus_id[3] = '0' + instance;
590 + instance++;
591 + }
592
593 video->device = device;
594 strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
595 diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
596 index f1fe749..5eb23fa 100644
597 --- a/drivers/char/agp/intel-agp.c
598 +++ b/drivers/char/agp/intel-agp.c
599 @@ -40,6 +40,8 @@
600 #define PCI_DEVICE_ID_INTEL_Q45_IG 0x2E12
601 #define PCI_DEVICE_ID_INTEL_G45_HB 0x2E20
602 #define PCI_DEVICE_ID_INTEL_G45_IG 0x2E22
603 +#define PCI_DEVICE_ID_INTEL_G41_HB 0x2E30
604 +#define PCI_DEVICE_ID_INTEL_G41_IG 0x2E32
605
606 /* cover 915 and 945 variants */
607 #define IS_I915 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_E7221_HB || \
608 @@ -63,7 +65,8 @@
609 #define IS_G4X (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGD_E_HB || \
610 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q45_HB || \
611 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G45_HB || \
612 - agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB)
613 + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB || \
614 + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G41_HB)
615
616 extern int agp_memory_reserved;
617
618 @@ -214,8 +217,8 @@ static int intel_i810_configure(void)
619 if (agp_bridge->driver->needs_scratch_page) {
620 for (i = 0; i < current_size->num_entries; i++) {
621 writel(agp_bridge->scratch_page, intel_private.registers+I810_PTE_BASE+(i*4));
622 - readl(intel_private.registers+I810_PTE_BASE+(i*4)); /* PCI posting. */
623 }
624 + readl(intel_private.registers+I810_PTE_BASE+((i-1)*4)); /* PCI posting. */
625 }
626 global_cache_flush();
627 return 0;
628 @@ -775,8 +778,8 @@ static int intel_i830_configure(void)
629 if (agp_bridge->driver->needs_scratch_page) {
630 for (i = intel_private.gtt_entries; i < current_size->num_entries; i++) {
631 writel(agp_bridge->scratch_page, intel_private.registers+I810_PTE_BASE+(i*4));
632 - readl(intel_private.registers+I810_PTE_BASE+(i*4)); /* PCI Posting. */
633 }
634 + readl(intel_private.registers+I810_PTE_BASE+((i-1)*4)); /* PCI Posting. */
635 }
636
637 global_cache_flush();
638 @@ -991,8 +994,8 @@ static int intel_i915_configure(void)
639 if (agp_bridge->driver->needs_scratch_page) {
640 for (i = intel_private.gtt_entries; i < current_size->num_entries; i++) {
641 writel(agp_bridge->scratch_page, intel_private.gtt+i);
642 - readl(intel_private.gtt+i); /* PCI Posting. */
643 }
644 + readl(intel_private.gtt+i-1); /* PCI Posting. */
645 }
646
647 global_cache_flush();
648 @@ -1196,6 +1199,7 @@ static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size)
649 case PCI_DEVICE_ID_INTEL_IGD_E_HB:
650 case PCI_DEVICE_ID_INTEL_Q45_HB:
651 case PCI_DEVICE_ID_INTEL_G45_HB:
652 + case PCI_DEVICE_ID_INTEL_G41_HB:
653 *gtt_offset = *gtt_size = MB(2);
654 break;
655 default:
656 @@ -2128,13 +2132,15 @@ static const struct intel_driver_description {
657 { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, 0, "Q33",
658 NULL, &intel_g33_driver },
659 { PCI_DEVICE_ID_INTEL_GM45_HB, PCI_DEVICE_ID_INTEL_GM45_IG, 0,
660 - "Mobile Intel? GM45 Express", NULL, &intel_i965_driver },
661 + "Mobile Intel® GM45 Express", NULL, &intel_i965_driver },
662 { PCI_DEVICE_ID_INTEL_IGD_E_HB, PCI_DEVICE_ID_INTEL_IGD_E_IG, 0,
663 "Intel Integrated Graphics Device", NULL, &intel_i965_driver },
664 { PCI_DEVICE_ID_INTEL_Q45_HB, PCI_DEVICE_ID_INTEL_Q45_IG, 0,
665 "Q45/Q43", NULL, &intel_i965_driver },
666 { PCI_DEVICE_ID_INTEL_G45_HB, PCI_DEVICE_ID_INTEL_G45_IG, 0,
667 "G45/G43", NULL, &intel_i965_driver },
668 + { PCI_DEVICE_ID_INTEL_G41_HB, PCI_DEVICE_ID_INTEL_G41_IG, 0,
669 + "G41", NULL, &intel_i965_driver },
670 { 0, 0, 0, NULL, NULL, NULL }
671 };
672
673 @@ -2332,6 +2338,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
674 ID(PCI_DEVICE_ID_INTEL_IGD_E_HB),
675 ID(PCI_DEVICE_ID_INTEL_Q45_HB),
676 ID(PCI_DEVICE_ID_INTEL_G45_HB),
677 + ID(PCI_DEVICE_ID_INTEL_G41_HB),
678 { }
679 };
680
681 diff --git a/drivers/char/vt.c b/drivers/char/vt.c
682 index d429499..372267d 100644
683 --- a/drivers/char/vt.c
684 +++ b/drivers/char/vt.c
685 @@ -301,7 +301,7 @@ static void scrup(struct vc_data *vc, unsigned int t, unsigned int b, int nr)
686 d = (unsigned short *)(vc->vc_origin + vc->vc_size_row * t);
687 s = (unsigned short *)(vc->vc_origin + vc->vc_size_row * (t + nr));
688 scr_memmovew(d, s, (b - t - nr) * vc->vc_size_row);
689 - scr_memsetw(d + (b - t - nr) * vc->vc_cols, vc->vc_scrl_erase_char,
690 + scr_memsetw(d + (b - t - nr) * vc->vc_cols, vc->vc_video_erase_char,
691 vc->vc_size_row * nr);
692 }
693
694 @@ -319,7 +319,7 @@ static void scrdown(struct vc_data *vc, unsigned int t, unsigned int b, int nr)
695 s = (unsigned short *)(vc->vc_origin + vc->vc_size_row * t);
696 step = vc->vc_cols * nr;
697 scr_memmovew(s + step, s, (b - t - nr) * vc->vc_size_row);
698 - scr_memsetw(s, vc->vc_scrl_erase_char, 2 * step);
699 + scr_memsetw(s, vc->vc_video_erase_char, 2 * step);
700 }
701
702 static void do_update_region(struct vc_data *vc, unsigned long start, int count)
703 @@ -434,7 +434,6 @@ static void update_attr(struct vc_data *vc)
704 vc->vc_blink, vc->vc_underline,
705 vc->vc_reverse ^ vc->vc_decscnm, vc->vc_italic);
706 vc->vc_video_erase_char = (build_attr(vc, vc->vc_color, 1, vc->vc_blink, 0, vc->vc_decscnm, 0) << 8) | ' ';
707 - vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, vc->vc_decscnm, false) << 8) | ' ';
708 }
709
710 /* Note: inverting the screen twice should revert to the original state */
711 diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
712 index 595759c..cd589ca 100644
713 --- a/drivers/firewire/fw-ohci.c
714 +++ b/drivers/firewire/fw-ohci.c
715 @@ -226,7 +226,7 @@ static inline struct fw_ohci *fw_ohci(struct fw_card *card)
716 #define CONTEXT_DEAD 0x0800
717 #define CONTEXT_ACTIVE 0x0400
718
719 -#define OHCI1394_MAX_AT_REQ_RETRIES 0x2
720 +#define OHCI1394_MAX_AT_REQ_RETRIES 0xf
721 #define OHCI1394_MAX_AT_RESP_RETRIES 0x2
722 #define OHCI1394_MAX_PHYS_RESP_RETRIES 0x8
723
724 diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
725 index 64142c1..716370c 100644
726 --- a/drivers/firewire/fw-sbp2.c
727 +++ b/drivers/firewire/fw-sbp2.c
728 @@ -350,15 +350,17 @@ static const struct {
729 .model = ~0,
730 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
731 },
732 -
733 /*
734 - * There are iPods (2nd gen, 3rd gen) with model_id == 0, but
735 - * these iPods do not feature the read_capacity bug according
736 - * to one report. Read_capacity behaviour as well as model_id
737 - * could change due to Apple-supplied firmware updates though.
738 + * iPod 2nd generation: needs 128k max transfer size workaround
739 + * iPod 3rd generation: needs fix capacity workaround
740 */
741 -
742 - /* iPod 4th generation. */ {
743 + {
744 + .firmware_revision = 0x0a2700,
745 + .model = 0x000000,
746 + .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS |
747 + SBP2_WORKAROUND_FIX_CAPACITY,
748 + },
749 + /* iPod 4th generation */ {
750 .firmware_revision = 0x0a2700,
751 .model = 0x000021,
752 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY,
753 @@ -1293,6 +1295,19 @@ static struct fw_driver sbp2_driver = {
754 .id_table = sbp2_id_table,
755 };
756
757 +static void sbp2_unmap_scatterlist(struct device *card_device,
758 + struct sbp2_command_orb *orb)
759 +{
760 + if (scsi_sg_count(orb->cmd))
761 + dma_unmap_sg(card_device, scsi_sglist(orb->cmd),
762 + scsi_sg_count(orb->cmd),
763 + orb->cmd->sc_data_direction);
764 +
765 + if (orb->request.misc & cpu_to_be32(COMMAND_ORB_PAGE_TABLE_PRESENT))
766 + dma_unmap_single(card_device, orb->page_table_bus,
767 + sizeof(orb->page_table), DMA_TO_DEVICE);
768 +}
769 +
770 static unsigned int
771 sbp2_status_to_sense_data(u8 *sbp2_status, u8 *sense_data)
772 {
773 @@ -1372,15 +1387,7 @@ complete_command_orb(struct sbp2_orb *base_orb, struct sbp2_status *status)
774
775 dma_unmap_single(device->card->device, orb->base.request_bus,
776 sizeof(orb->request), DMA_TO_DEVICE);
777 -
778 - if (scsi_sg_count(orb->cmd) > 0)
779 - dma_unmap_sg(device->card->device, scsi_sglist(orb->cmd),
780 - scsi_sg_count(orb->cmd),
781 - orb->cmd->sc_data_direction);
782 -
783 - if (orb->page_table_bus != 0)
784 - dma_unmap_single(device->card->device, orb->page_table_bus,
785 - sizeof(orb->page_table), DMA_TO_DEVICE);
786 + sbp2_unmap_scatterlist(device->card->device, orb);
787
788 orb->cmd->result = result;
789 orb->done(orb->cmd);
790 @@ -1530,8 +1537,10 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
791 orb->base.request_bus =
792 dma_map_single(device->card->device, &orb->request,
793 sizeof(orb->request), DMA_TO_DEVICE);
794 - if (dma_mapping_error(device->card->device, orb->base.request_bus))
795 + if (dma_mapping_error(device->card->device, orb->base.request_bus)) {
796 + sbp2_unmap_scatterlist(device->card->device, orb);
797 goto out;
798 + }
799
800 sbp2_send_orb(&orb->base, lu, lu->tgt->node_id, lu->generation,
801 lu->command_block_agent_address + SBP2_ORB_POINTER);
802 diff --git a/drivers/ieee1394/ohci1394.h b/drivers/ieee1394/ohci1394.h
803 index 4320bf0..7fb8ab9 100644
804 --- a/drivers/ieee1394/ohci1394.h
805 +++ b/drivers/ieee1394/ohci1394.h
806 @@ -26,7 +26,7 @@
807
808 #define OHCI1394_DRIVER_NAME "ohci1394"
809
810 -#define OHCI1394_MAX_AT_REQ_RETRIES 0x2
811 +#define OHCI1394_MAX_AT_REQ_RETRIES 0xf
812 #define OHCI1394_MAX_AT_RESP_RETRIES 0x2
813 #define OHCI1394_MAX_PHYS_RESP_RETRIES 0x8
814 #define OHCI1394_MAX_SELF_ID_ERRORS 16
815 diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
816 index bad46ea..0c0fdbb 100644
817 --- a/drivers/ieee1394/sbp2.c
818 +++ b/drivers/ieee1394/sbp2.c
819 @@ -395,6 +395,16 @@ static const struct {
820 .model_id = SBP2_ROM_VALUE_WILDCARD,
821 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
822 },
823 + /*
824 + * iPod 2nd generation: needs 128k max transfer size workaround
825 + * iPod 3rd generation: needs fix capacity workaround
826 + */
827 + {
828 + .firmware_revision = 0x0a2700,
829 + .model_id = 0x000000,
830 + .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS |
831 + SBP2_WORKAROUND_FIX_CAPACITY,
832 + },
833 /* iPod 4th generation */ {
834 .firmware_revision = 0x0a2700,
835 .model_id = 0x000021,
836 diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
837 index c2fcf28..61f5753 100644
838 --- a/drivers/md/dm-mpath.c
839 +++ b/drivers/md/dm-mpath.c
840 @@ -427,13 +427,13 @@ static void process_queued_ios(struct work_struct *work)
841 __choose_pgpath(m);
842
843 pgpath = m->current_pgpath;
844 - m->pgpath_to_activate = m->current_pgpath;
845
846 if ((pgpath && !m->queue_io) ||
847 (!pgpath && !m->queue_if_no_path))
848 must_queue = 0;
849
850 - if (m->pg_init_required && !m->pg_init_in_progress) {
851 + if (m->pg_init_required && !m->pg_init_in_progress && pgpath) {
852 + m->pgpath_to_activate = pgpath;
853 m->pg_init_count++;
854 m->pg_init_required = 0;
855 m->pg_init_in_progress = 1;
856 diff --git a/drivers/md/md.c b/drivers/md/md.c
857 index fe6eccd..60f3e59 100644
858 --- a/drivers/md/md.c
859 +++ b/drivers/md/md.c
860 @@ -1454,6 +1454,11 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
861 if (find_rdev_nr(mddev, rdev->desc_nr))
862 return -EBUSY;
863 }
864 + if (mddev->max_disks && rdev->desc_nr >= mddev->max_disks) {
865 + printk(KERN_WARNING "md: %s: array is limited to %d devices\n",
866 + mdname(mddev), mddev->max_disks);
867 + return -EBUSY;
868 + }
869 bdevname(rdev->bdev,b);
870 while ( (s=strchr(b, '/')) != NULL)
871 *s = '!';
872 @@ -2362,6 +2367,15 @@ static void analyze_sbs(mddev_t * mddev)
873
874 i = 0;
875 rdev_for_each(rdev, tmp, mddev) {
876 + if (rdev->desc_nr >= mddev->max_disks ||
877 + i > mddev->max_disks) {
878 + printk(KERN_WARNING
879 + "md: %s: %s: only %d devices permitted\n",
880 + mdname(mddev), bdevname(rdev->bdev, b),
881 + mddev->max_disks);
882 + kick_rdev_from_array(rdev);
883 + continue;
884 + }
885 if (rdev != freshest)
886 if (super_types[mddev->major_version].
887 validate_super(mddev, rdev)) {
888 @@ -2728,9 +2742,9 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len)
889 break;
890 case read_auto:
891 if (mddev->pers) {
892 - if (mddev->ro != 1)
893 + if (mddev->ro == 0)
894 err = do_md_stop(mddev, 1, 0);
895 - else
896 + else if (mddev->ro == 1)
897 err = restart_array(mddev);
898 if (err == 0) {
899 mddev->ro = 2;
900 @@ -2946,7 +2960,13 @@ metadata_store(mddev_t *mddev, const char *buf, size_t len)
901 {
902 int major, minor;
903 char *e;
904 - if (!list_empty(&mddev->disks))
905 + /* Changing the details of 'external' metadata is
906 + * always permitted. Otherwise there must be
907 + * no devices attached to the array.
908 + */
909 + if (mddev->external && strncmp(buf, "external:", 9) == 0)
910 + ;
911 + else if (!list_empty(&mddev->disks))
912 return -EBUSY;
913
914 if (cmd_match(buf, "none")) {
915 @@ -4450,13 +4470,6 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev)
916 * noticed in interrupt contexts ...
917 */
918
919 - if (rdev->desc_nr == mddev->max_disks) {
920 - printk(KERN_WARNING "%s: can not hot-add to full array!\n",
921 - mdname(mddev));
922 - err = -EBUSY;
923 - goto abort_unbind_export;
924 - }
925 -
926 rdev->raid_disk = -1;
927
928 md_update_sb(mddev, 1);
929 @@ -4470,9 +4483,6 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev)
930 md_new_event(mddev);
931 return 0;
932
933 -abort_unbind_export:
934 - unbind_rdev_from_array(rdev);
935 -
936 abort_export:
937 export_rdev(rdev);
938 return err;
939 diff --git a/drivers/misc/eeepc-laptop.c b/drivers/misc/eeepc-laptop.c
940 index 616bcbd..13a8996 100644
941 --- a/drivers/misc/eeepc-laptop.c
942 +++ b/drivers/misc/eeepc-laptop.c
943 @@ -381,7 +381,8 @@ static void notify_wlan(u32 *event)
944 static void notify_brn(void)
945 {
946 struct backlight_device *bd = eeepc_backlight_device;
947 - bd->props.brightness = read_brightness(bd);
948 + if (bd)
949 + bd->props.brightness = read_brightness(bd);
950 }
951
952 static void eeepc_hotk_notify(acpi_handle handle, u32 event, void *data)
953 diff --git a/drivers/misc/sgi-xp/xpc.h b/drivers/misc/sgi-xp/xpc.h
954 index 619208d..bcf3782 100644
955 --- a/drivers/misc/sgi-xp/xpc.h
956 +++ b/drivers/misc/sgi-xp/xpc.h
957 @@ -3,7 +3,7 @@
958 * License. See the file "COPYING" in the main directory of this archive
959 * for more details.
960 *
961 - * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved.
962 + * Copyright (c) 2004-2009 Silicon Graphics, Inc. All Rights Reserved.
963 */
964
965 /*
966 @@ -502,7 +502,8 @@ struct xpc_channel_uv {
967 /* partition's notify mq */
968
969 struct xpc_send_msg_slot_uv *send_msg_slots;
970 - struct xpc_notify_mq_msg_uv *recv_msg_slots;
971 + void *recv_msg_slots; /* each slot will hold a xpc_notify_mq_msg_uv */
972 + /* structure plus the user's payload */
973
974 struct xpc_fifo_head_uv msg_slot_free_list;
975 struct xpc_fifo_head_uv recv_msg_list; /* deliverable payloads */
976 diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
977 index b8f8d50..1bb8bc5 100644
978 --- a/drivers/misc/sgi-xp/xpc_uv.c
979 +++ b/drivers/misc/sgi-xp/xpc_uv.c
980 @@ -3,7 +3,7 @@
981 * License. See the file "COPYING" in the main directory of this archive
982 * for more details.
983 *
984 - * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
985 + * Copyright (c) 2008-2009 Silicon Graphics, Inc. All Rights Reserved.
986 */
987
988 /*
989 @@ -825,8 +825,8 @@ xpc_allocate_recv_msg_slot_uv(struct xpc_channel *ch)
990 continue;
991
992 for (entry = 0; entry < nentries; entry++) {
993 - msg_slot = ch_uv->recv_msg_slots + entry *
994 - ch->entry_size;
995 + msg_slot = ch_uv->recv_msg_slots +
996 + entry * ch->entry_size;
997
998 msg_slot->hdr.msg_slot_number = entry;
999 }
1000 @@ -1123,9 +1123,8 @@ xpc_handle_notify_mq_msg_uv(struct xpc_partition *part,
1001 /* we're dealing with a normal message sent via the notify_mq */
1002 ch_uv = &ch->sn.uv;
1003
1004 - msg_slot = (struct xpc_notify_mq_msg_uv *)((u64)ch_uv->recv_msg_slots +
1005 - (msg->hdr.msg_slot_number % ch->remote_nentries) *
1006 - ch->entry_size);
1007 + msg_slot = ch_uv->recv_msg_slots +
1008 + (msg->hdr.msg_slot_number % ch->remote_nentries) * ch->entry_size;
1009
1010 BUG_ON(msg->hdr.msg_slot_number != msg_slot->hdr.msg_slot_number);
1011 BUG_ON(msg_slot->hdr.size != 0);
1012 diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
1013 index 872ea58..6b96357 100644
1014 --- a/drivers/net/e1000/e1000_main.c
1015 +++ b/drivers/net/e1000/e1000_main.c
1016 @@ -31,7 +31,7 @@
1017
1018 char e1000_driver_name[] = "e1000";
1019 static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
1020 -#define DRV_VERSION "7.3.20-k3-NAPI"
1021 +#define DRV_VERSION "7.3.21-k3-NAPI"
1022 const char e1000_driver_version[] = DRV_VERSION;
1023 static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
1024
1025 @@ -927,7 +927,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
1026 err = pci_enable_device(pdev);
1027 } else {
1028 bars = pci_select_bars(pdev, IORESOURCE_MEM);
1029 - err = pci_enable_device(pdev);
1030 + err = pci_enable_device_mem(pdev);
1031 }
1032 if (err)
1033 return err;
1034 @@ -3835,7 +3835,7 @@ static irqreturn_t e1000_intr(int irq, void *data)
1035 struct e1000_hw *hw = &adapter->hw;
1036 u32 rctl, icr = er32(ICR);
1037
1038 - if (unlikely(!icr))
1039 + if (unlikely((!icr) || test_bit(__E1000_RESETTING, &adapter->flags)))
1040 return IRQ_NONE; /* Not our interrupt */
1041
1042 /* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
1043 diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
1044 index 6e42b5a..5790194 100644
1045 --- a/drivers/net/usb/hso.c
1046 +++ b/drivers/net/usb/hso.c
1047 @@ -2047,7 +2047,7 @@ static void hso_create_rfkill(struct hso_device *hso_dev,
1048 char *rfkn;
1049
1050 hso_net->rfkill = rfkill_allocate(&interface_to_usbdev(interface)->dev,
1051 - RFKILL_TYPE_WLAN);
1052 + RFKILL_TYPE_WWAN);
1053 if (!hso_net->rfkill) {
1054 dev_err(dev, "%s - Out of memory", __func__);
1055 return;
1056 diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
1057 index dcce354..966c86c 100644
1058 --- a/drivers/net/wireless/ipw2200.c
1059 +++ b/drivers/net/wireless/ipw2200.c
1060 @@ -4346,7 +4346,8 @@ static void ipw_handle_missed_beacon(struct ipw_priv *priv,
1061 return;
1062 }
1063
1064 - if (priv->status & STATUS_SCANNING) {
1065 + if (priv->status & STATUS_SCANNING &&
1066 + missed_count > IPW_MB_SCAN_CANCEL_THRESHOLD) {
1067 /* Stop scan to keep fw from getting
1068 * stuck (only if we aren't roaming --
1069 * otherwise we'll never scan more than 2 or 3
1070 @@ -6276,6 +6277,20 @@ static void ipw_add_scan_channels(struct ipw_priv *priv,
1071 }
1072 }
1073
1074 +static int ipw_passive_dwell_time(struct ipw_priv *priv)
1075 +{
1076 + /* staying on passive channels longer than the DTIM interval during a
1077 + * scan, while associated, causes the firmware to cancel the scan
1078 + * without notification. Hence, don't stay on passive channels longer
1079 + * than the beacon interval.
1080 + */
1081 + if (priv->status & STATUS_ASSOCIATED
1082 + && priv->assoc_network->beacon_interval > 10)
1083 + return priv->assoc_network->beacon_interval - 10;
1084 + else
1085 + return 120;
1086 +}
1087 +
1088 static int ipw_request_scan_helper(struct ipw_priv *priv, int type, int direct)
1089 {
1090 struct ipw_scan_request_ext scan;
1091 @@ -6319,16 +6334,16 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type, int direct)
1092 scan.full_scan_index = cpu_to_le32(ieee80211_get_scans(priv->ieee));
1093
1094 if (type == IW_SCAN_TYPE_PASSIVE) {
1095 - IPW_DEBUG_WX("use passive scanning\n");
1096 - scan_type = IPW_SCAN_PASSIVE_FULL_DWELL_SCAN;
1097 + IPW_DEBUG_WX("use passive scanning\n");
1098 + scan_type = IPW_SCAN_PASSIVE_FULL_DWELL_SCAN;
1099 scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] =
1100 - cpu_to_le16(120);
1101 + cpu_to_le16(ipw_passive_dwell_time(priv));
1102 ipw_add_scan_channels(priv, &scan, scan_type);
1103 goto send_request;
1104 }
1105
1106 /* Use active scan by default. */
1107 - if (priv->config & CFG_SPEED_SCAN)
1108 + if (priv->config & CFG_SPEED_SCAN)
1109 scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_SCAN] =
1110 cpu_to_le16(30);
1111 else
1112 @@ -6338,7 +6353,8 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type, int direct)
1113 scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN] =
1114 cpu_to_le16(20);
1115
1116 - scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = cpu_to_le16(120);
1117 + scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] =
1118 + cpu_to_le16(ipw_passive_dwell_time(priv));
1119 scan.dwell_time[IPW_SCAN_ACTIVE_DIRECT_SCAN] = cpu_to_le16(20);
1120
1121 #ifdef CONFIG_IPW2200_MONITOR
1122 diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
1123 index d4ab28b..60b4e71 100644
1124 --- a/drivers/net/wireless/ipw2200.h
1125 +++ b/drivers/net/wireless/ipw2200.h
1126 @@ -244,6 +244,7 @@ enum connection_manager_assoc_states {
1127 #define HOST_NOTIFICATION_S36_MEASUREMENT_REFUSED 31
1128
1129 #define HOST_NOTIFICATION_STATUS_BEACON_MISSING 1
1130 +#define IPW_MB_SCAN_CANCEL_THRESHOLD 3
1131 #define IPW_MB_ROAMING_THRESHOLD_MIN 1
1132 #define IPW_MB_ROAMING_THRESHOLD_DEFAULT 8
1133 #define IPW_MB_ROAMING_THRESHOLD_MAX 30
1134 diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
1135 index 77baff0..3f2309f 100644
1136 --- a/drivers/pci/pci-sysfs.c
1137 +++ b/drivers/pci/pci-sysfs.c
1138 @@ -694,8 +694,8 @@ pci_read_rom(struct kobject *kobj, struct bin_attribute *bin_attr,
1139 return -EINVAL;
1140
1141 rom = pci_map_rom(pdev, &size); /* size starts out as PCI window size */
1142 - if (!rom)
1143 - return 0;
1144 + if (!rom || !size)
1145 + return -EIO;
1146
1147 if (off >= size)
1148 count = 0;
1149 diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
1150 index 8a82a62..e4df84b 100644
1151 --- a/drivers/pci/pcie/aspm.c
1152 +++ b/drivers/pci/pcie/aspm.c
1153 @@ -713,9 +713,9 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev)
1154
1155 /*
1156 * All PCIe functions are in one slot, remove one function will remove
1157 - * the the whole slot, so just wait
1158 + * the whole slot, so just wait until we are the last function left.
1159 */
1160 - if (!list_empty(&parent->subordinate->devices))
1161 + if (!list_is_last(&pdev->bus_list, &parent->subordinate->devices))
1162 goto out;
1163
1164 /* All functions are removed, so just disable ASPM for the link */
1165 diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
1166 index bd5c0e0..b2bac71 100644
1167 --- a/drivers/pci/rom.c
1168 +++ b/drivers/pci/rom.c
1169 @@ -63,7 +63,7 @@ static void pci_disable_rom(struct pci_dev *pdev)
1170 * The PCI window size could be much larger than the
1171 * actual image size.
1172 */
1173 -size_t pci_get_rom_size(void __iomem *rom, size_t size)
1174 +size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size)
1175 {
1176 void __iomem *image;
1177 int last_image;
1178 @@ -72,8 +72,10 @@ size_t pci_get_rom_size(void __iomem *rom, size_t size)
1179 do {
1180 void __iomem *pds;
1181 /* Standard PCI ROMs start out with these bytes 55 AA */
1182 - if (readb(image) != 0x55)
1183 + if (readb(image) != 0x55) {
1184 + dev_err(&pdev->dev, "Invalid ROM contents\n");
1185 break;
1186 + }
1187 if (readb(image + 1) != 0xAA)
1188 break;
1189 /* get the PCI data structure and check its signature */
1190 @@ -158,7 +160,7 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
1191 * size is much larger than the actual size of the ROM.
1192 * True size is important if the ROM is going to be copied.
1193 */
1194 - *size = pci_get_rom_size(rom, *size);
1195 + *size = pci_get_rom_size(pdev, rom, *size);
1196 return rom;
1197 }
1198
1199 diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
1200 index fd0695b..056071d 100644
1201 --- a/drivers/serial/8250_pci.c
1202 +++ b/drivers/serial/8250_pci.c
1203 @@ -599,6 +599,10 @@ static int pci_netmos_init(struct pci_dev *dev)
1204 /* subdevice 0x00PS means <P> parallel, <S> serial */
1205 unsigned int num_serial = dev->subsystem_device & 0xf;
1206
1207 + if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
1208 + dev->subsystem_device == 0x0299)
1209 + return 0;
1210 +
1211 if (num_serial == 0)
1212 return -ENODEV;
1213 return num_serial;
1214 @@ -766,6 +770,8 @@ pci_default_setup(struct serial_private *priv, struct pciserial_board *board,
1215 #define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
1216 #define PCI_SUBDEVICE_ID_POCTAL232 0x0308
1217 #define PCI_SUBDEVICE_ID_POCTAL422 0x0408
1218 +#define PCI_VENDOR_ID_ADVANTECH 0x13fe
1219 +#define PCI_DEVICE_ID_ADVANTECH_PCI3620 0x3620
1220
1221 /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
1222 #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
1223 @@ -2051,6 +2057,10 @@ static int pciserial_resume_one(struct pci_dev *dev)
1224 #endif
1225
1226 static struct pci_device_id serial_pci_tbl[] = {
1227 + /* Advantech use PCI_DEVICE_ID_ADVANTECH_PCI3620 (0x3620) as 'PCI_SUBVENDOR_ID' */
1228 + { PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCI3620,
1229 + PCI_DEVICE_ID_ADVANTECH_PCI3620, 0x0001, 0, 0,
1230 + pbn_b2_8_921600 },
1231 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
1232 PCI_SUBVENDOR_ID_CONNECT_TECH,
1233 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
1234 @@ -2294,6 +2304,9 @@ static struct pci_device_id serial_pci_tbl[] = {
1235 * For now just used the hex ID 0x950a.
1236 */
1237 { PCI_VENDOR_ID_OXSEMI, 0x950a,
1238 + PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_SERIAL, 0, 0,
1239 + pbn_b0_2_115200 },
1240 + { PCI_VENDOR_ID_OXSEMI, 0x950a,
1241 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1242 pbn_b0_2_1130000 },
1243 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
1244 @@ -2846,6 +2859,10 @@ static struct pci_device_id serial_pci_tbl[] = {
1245 0,
1246 pbn_b0_8_115200 },
1247
1248 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
1249 + PCI_VENDOR_ID_IBM, 0x0299,
1250 + 0, 0, pbn_b0_bt_2_115200 },
1251 +
1252 /*
1253 * These entries match devices with class COMMUNICATION_SERIAL,
1254 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
1255 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1256 index b205311..876bf36 100644
1257 --- a/drivers/usb/serial/option.c
1258 +++ b/drivers/usb/serial/option.c
1259 @@ -192,14 +192,15 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
1260 #define NOVATELWIRELESS_PRODUCT_MC950D 0x4400
1261
1262 /* FUTURE NOVATEL PRODUCTS */
1263 -#define NOVATELWIRELESS_PRODUCT_EVDO_1 0x6000
1264 -#define NOVATELWIRELESS_PRODUCT_HSPA_1 0x7000
1265 -#define NOVATELWIRELESS_PRODUCT_EMBEDDED_1 0x8000
1266 -#define NOVATELWIRELESS_PRODUCT_GLOBAL_1 0x9000
1267 -#define NOVATELWIRELESS_PRODUCT_EVDO_2 0x6001
1268 -#define NOVATELWIRELESS_PRODUCT_HSPA_2 0x7001
1269 -#define NOVATELWIRELESS_PRODUCT_EMBEDDED_2 0x8001
1270 -#define NOVATELWIRELESS_PRODUCT_GLOBAL_2 0x9001
1271 +#define NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED 0X6000
1272 +#define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001
1273 +#define NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED 0X7000
1274 +#define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED 0X7001
1275 +#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED 0X8000
1276 +#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0X8001
1277 +#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0X9000
1278 +#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0X9001
1279 +#define NOVATELWIRELESS_PRODUCT_GLOBAL 0XA001
1280
1281 /* AMOI PRODUCTS */
1282 #define AMOI_VENDOR_ID 0x1614
1283 @@ -209,6 +210,27 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
1284
1285 #define DELL_VENDOR_ID 0x413C
1286
1287 +/* Dell modems */
1288 +#define DELL_PRODUCT_5700_MINICARD 0x8114
1289 +#define DELL_PRODUCT_5500_MINICARD 0x8115
1290 +#define DELL_PRODUCT_5505_MINICARD 0x8116
1291 +#define DELL_PRODUCT_5700_EXPRESSCARD 0x8117
1292 +#define DELL_PRODUCT_5510_EXPRESSCARD 0x8118
1293 +
1294 +#define DELL_PRODUCT_5700_MINICARD_SPRINT 0x8128
1295 +#define DELL_PRODUCT_5700_MINICARD_TELUS 0x8129
1296 +
1297 +#define DELL_PRODUCT_5720_MINICARD_VZW 0x8133
1298 +#define DELL_PRODUCT_5720_MINICARD_SPRINT 0x8134
1299 +#define DELL_PRODUCT_5720_MINICARD_TELUS 0x8135
1300 +#define DELL_PRODUCT_5520_MINICARD_CINGULAR 0x8136
1301 +#define DELL_PRODUCT_5520_MINICARD_GENERIC_L 0x8137
1302 +#define DELL_PRODUCT_5520_MINICARD_GENERIC_I 0x8138
1303 +
1304 +#define DELL_PRODUCT_5730_MINICARD_SPRINT 0x8180
1305 +#define DELL_PRODUCT_5730_MINICARD_TELUS 0x8181
1306 +#define DELL_PRODUCT_5730_MINICARD_VZW 0x8182
1307 +
1308 #define KYOCERA_VENDOR_ID 0x0c88
1309 #define KYOCERA_PRODUCT_KPC650 0x17da
1310 #define KYOCERA_PRODUCT_KPC680 0x180a
1311 @@ -267,12 +289,6 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
1312 #define ERICSSON_VENDOR_ID 0x0bdb
1313 #define ERICSSON_PRODUCT_F3507G 0x1900
1314
1315 -/* Pantech products */
1316 -#define PANTECH_VENDOR_ID 0x106c
1317 -#define PANTECH_PRODUCT_PC5740 0x3701
1318 -#define PANTECH_PRODUCT_PC5750 0x3702 /* PX-500 */
1319 -#define PANTECH_PRODUCT_UM150 0x3711
1320 -
1321 static struct usb_device_id option_ids[] = {
1322 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
1323 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
1324 @@ -383,31 +399,37 @@ static struct usb_device_id option_ids[] = {
1325 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */
1326 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */
1327 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */
1328 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_1) }, /* Novatel EVDO product */
1329 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_1) }, /* Novatel HSPA product */
1330 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EMBEDDED_1) }, /* Novatel Embedded product */
1331 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL_1) }, /* Novatel Global product */
1332 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_2) }, /* Novatel EVDO product */
1333 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_2) }, /* Novatel HSPA product */
1334 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EMBEDDED_2) }, /* Novatel Embedded product */
1335 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL_2) }, /* Novatel Global product */
1336 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED) }, /* Novatel EVDO product */
1337 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */
1338 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */
1339 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */
1340 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) }, /* Novatel EVDO product */
1341 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED) }, /* Novatel HSPA product */
1342 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED) }, /* Novatel EVDO Embedded product */
1343 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED) }, /* Novatel HSPA Embedded product */
1344 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL) }, /* Novatel Global product */
1345
1346 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
1347 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
1348 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) },
1349
1350 - { USB_DEVICE(DELL_VENDOR_ID, 0x8114) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */
1351 - { USB_DEVICE(DELL_VENDOR_ID, 0x8115) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
1352 - { USB_DEVICE(DELL_VENDOR_ID, 0x8116) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
1353 - { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */
1354 - { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */
1355 - { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */
1356 - { USB_DEVICE(DELL_VENDOR_ID, 0x8129) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite ET620 CDMA/EV-DO */
1357 - { USB_DEVICE(DELL_VENDOR_ID, 0x8133) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
1358 - { USB_DEVICE(DELL_VENDOR_ID, 0x8136) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */
1359 - { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */
1360 - { USB_DEVICE(DELL_VENDOR_ID, 0x8138) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */
1361 - { USB_DEVICE(DELL_VENDOR_ID, 0x8147) }, /* Dell Wireless 5530 Mobile Broadband (3G HSPA) Mini-Card */
1362 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */
1363 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
1364 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5505_MINICARD) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
1365 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_EXPRESSCARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */
1366 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5510_EXPRESSCARD) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */
1367 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD_SPRINT) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */
1368 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD_TELUS) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite ET620 CDMA/EV-DO */
1369 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_VZW) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
1370 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_SPRINT) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
1371 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_TELUS) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
1372 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_CINGULAR) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */
1373 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_GENERIC_L) }, /* Dell Wireless HSDPA 5520 */
1374 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_GENERIC_I) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */
1375 + { USB_DEVICE(DELL_VENDOR_ID, 0x8147) }, /* Dell Wireless 5530 Mobile Broadband (3G HSPA) Mini-Card */
1376 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_SPRINT) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */
1377 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_TELUS) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */
1378 + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */
1379 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */
1380 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
1381 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
1382 @@ -476,9 +498,6 @@ static struct usb_device_id option_ids[] = {
1383 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) },
1384 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) },
1385 { USB_DEVICE(ERICSSON_VENDOR_ID, ERICSSON_PRODUCT_F3507G) },
1386 - { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_PC5740) },
1387 - { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_PC5750) },
1388 - { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_UM150) },
1389 { } /* Terminating entry */
1390 };
1391 MODULE_DEVICE_TABLE(usb, option_ids);
1392 diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
1393 index 9a3e495..d8c41ae 100644
1394 --- a/drivers/usb/serial/ti_usb_3410_5052.c
1395 +++ b/drivers/usb/serial/ti_usb_3410_5052.c
1396 @@ -227,25 +227,32 @@ static unsigned int product_5052_count;
1397 /* the array dimension is the number of default entries plus */
1398 /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */
1399 /* null entry */
1400 -static struct usb_device_id ti_id_table_3410[1+TI_EXTRA_VID_PID_COUNT+1] = {
1401 +static struct usb_device_id ti_id_table_3410[10+TI_EXTRA_VID_PID_COUNT+1] = {
1402 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
1403 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
1404 + { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
1405 + { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) },
1406 + { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) },
1407 };
1408
1409 -static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = {
1410 +static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = {
1411 { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) },
1412 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) },
1413 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) },
1414 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) },
1415 + { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
1416 };
1417
1418 -static struct usb_device_id ti_id_table_combined[] = {
1419 +static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] = {
1420 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
1421 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
1422 { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) },
1423 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) },
1424 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) },
1425 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) },
1426 + { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
1427 + { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) },
1428 + { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) },
1429 { }
1430 };
1431
1432 diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410_5052.h
1433 index b5541bf..d4e4d7e 100644
1434 --- a/drivers/usb/serial/ti_usb_3410_5052.h
1435 +++ b/drivers/usb/serial/ti_usb_3410_5052.h
1436 @@ -27,7 +27,11 @@
1437
1438 /* Vendor and product ids */
1439 #define TI_VENDOR_ID 0x0451
1440 +#define IBM_VENDOR_ID 0x04b3
1441 #define TI_3410_PRODUCT_ID 0x3410
1442 +#define IBM_4543_PRODUCT_ID 0x4543
1443 +#define IBM_454B_PRODUCT_ID 0x454b
1444 +#define IBM_454C_PRODUCT_ID 0x454c
1445 #define TI_3410_EZ430_ID 0xF430 /* TI ez430 development tool */
1446 #define TI_5052_BOOT_PRODUCT_ID 0x5052 /* no EEPROM, no firmware */
1447 #define TI_5152_BOOT_PRODUCT_ID 0x5152 /* no EEPROM, no firmware */
1448 diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
1449 index 620c2b5..8daaace 100644
1450 --- a/drivers/usb/storage/scsiglue.c
1451 +++ b/drivers/usb/storage/scsiglue.c
1452 @@ -64,6 +64,7 @@
1453 */
1454 #define VENDOR_ID_NOKIA 0x0421
1455 #define VENDOR_ID_NIKON 0x04b0
1456 +#define VENDOR_ID_PENTAX 0x0a17
1457 #define VENDOR_ID_MOTOROLA 0x22b8
1458
1459 /***********************************************************************
1460 @@ -150,6 +151,7 @@ static int slave_configure(struct scsi_device *sdev)
1461 switch (le16_to_cpu(us->pusb_dev->descriptor.idVendor)) {
1462 case VENDOR_ID_NOKIA:
1463 case VENDOR_ID_NIKON:
1464 + case VENDOR_ID_PENTAX:
1465 case VENDOR_ID_MOTOROLA:
1466 if (!(us->fflags & (US_FL_FIX_CAPACITY |
1467 US_FL_CAPACITY_OK)))
1468 diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
1469 index aae786c..d775cfe 100644
1470 --- a/drivers/usb/storage/unusual_devs.h
1471 +++ b/drivers/usb/storage/unusual_devs.h
1472 @@ -1381,21 +1381,6 @@ UNUSUAL_DEV( 0x0a17, 0x0004, 0x1000, 0x1000,
1473 US_SC_DEVICE, US_PR_DEVICE, NULL,
1474 US_FL_FIX_INQUIRY ),
1475
1476 -
1477 -/* Submitted by Per Winkvist <per.winkvist@uk.com> */
1478 -UNUSUAL_DEV( 0x0a17, 0x006, 0x0000, 0xffff,
1479 - "Pentax",
1480 - "Optio S/S4",
1481 - US_SC_DEVICE, US_PR_DEVICE, NULL,
1482 - US_FL_FIX_INQUIRY ),
1483 -
1484 -/* Reported by Jaak Ristioja <Ristioja@gmail.com> */
1485 -UNUSUAL_DEV( 0x0a17, 0x006e, 0x0100, 0x0100,
1486 - "Pentax",
1487 - "K10D",
1488 - US_SC_DEVICE, US_PR_DEVICE, NULL,
1489 - US_FL_FIX_CAPACITY ),
1490 -
1491 /* These are virtual windows driver CDs, which the zd1211rw driver
1492 * automatically converts into WLAN devices. */
1493 UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101,
1494 diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
1495 index 038ea62..93a080e 100644
1496 --- a/drivers/video/console/fbcon.c
1497 +++ b/drivers/video/console/fbcon.c
1498 @@ -1855,8 +1855,6 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
1499 struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
1500 struct display *p = &fb_display[vc->vc_num];
1501 int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK;
1502 - unsigned short saved_ec;
1503 - int ret;
1504
1505 if (fbcon_is_inactive(vc, info))
1506 return -EINVAL;
1507 @@ -1869,11 +1867,6 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
1508 * whole screen (prevents flicker).
1509 */
1510
1511 - saved_ec = vc->vc_video_erase_char;
1512 - vc->vc_video_erase_char = vc->vc_scrl_erase_char;
1513 -
1514 - ret = 0;
1515 -
1516 switch (dir) {
1517 case SM_UP:
1518 if (count > vc->vc_rows) /* Maximum realistic size */
1519 @@ -1890,9 +1883,9 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
1520 scr_memsetw((unsigned short *) (vc->vc_origin +
1521 vc->vc_size_row *
1522 (b - count)),
1523 - vc->vc_scrl_erase_char,
1524 + vc->vc_video_erase_char,
1525 vc->vc_size_row * count);
1526 - ret = 1;
1527 + return 1;
1528 break;
1529
1530 case SCROLL_WRAP_MOVE:
1531 @@ -1962,10 +1955,9 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
1532 scr_memsetw((unsigned short *) (vc->vc_origin +
1533 vc->vc_size_row *
1534 (b - count)),
1535 - vc->vc_scrl_erase_char,
1536 + vc->vc_video_erase_char,
1537 vc->vc_size_row * count);
1538 - ret = 1;
1539 - break;
1540 + return 1;
1541 }
1542 break;
1543
1544 @@ -1982,9 +1974,9 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
1545 scr_memsetw((unsigned short *) (vc->vc_origin +
1546 vc->vc_size_row *
1547 t),
1548 - vc->vc_scrl_erase_char,
1549 + vc->vc_video_erase_char,
1550 vc->vc_size_row * count);
1551 - ret = 1;
1552 + return 1;
1553 break;
1554
1555 case SCROLL_WRAP_MOVE:
1556 @@ -2052,15 +2044,12 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
1557 scr_memsetw((unsigned short *) (vc->vc_origin +
1558 vc->vc_size_row *
1559 t),
1560 - vc->vc_scrl_erase_char,
1561 + vc->vc_video_erase_char,
1562 vc->vc_size_row * count);
1563 - ret = 1;
1564 - break;
1565 + return 1;
1566 }
1567 - break;
1568 }
1569 - vc->vc_video_erase_char = saved_ec;
1570 - return ret;
1571 + return 0;
1572 }
1573
1574
1575 @@ -2522,9 +2511,6 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
1576 c = vc->vc_video_erase_char;
1577 vc->vc_video_erase_char =
1578 ((c & 0xfe00) >> 1) | (c & 0xff);
1579 - c = vc->vc_scrl_erase_char;
1580 - vc->vc_scrl_erase_char =
1581 - ((c & 0xFE00) >> 1) | (c & 0xFF);
1582 vc->vc_attr >>= 1;
1583 }
1584 } else if (!vc->vc_hi_font_mask && cnt == 512) {
1585 @@ -2555,14 +2541,9 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
1586 if (vc->vc_can_do_color) {
1587 vc->vc_video_erase_char =
1588 ((c & 0xff00) << 1) | (c & 0xff);
1589 - c = vc->vc_scrl_erase_char;
1590 - vc->vc_scrl_erase_char =
1591 - ((c & 0xFF00) << 1) | (c & 0xFF);
1592 vc->vc_attr <<= 1;
1593 - } else {
1594 + } else
1595 vc->vc_video_erase_char = c & ~0x100;
1596 - vc->vc_scrl_erase_char = c & ~0x100;
1597 - }
1598 }
1599
1600 }
1601 diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c
1602 index 9901064..dd3eaaa 100644
1603 --- a/drivers/video/console/mdacon.c
1604 +++ b/drivers/video/console/mdacon.c
1605 @@ -533,7 +533,7 @@ static void mdacon_cursor(struct vc_data *c, int mode)
1606
1607 static int mdacon_scroll(struct vc_data *c, int t, int b, int dir, int lines)
1608 {
1609 - u16 eattr = mda_convert_attr(c->vc_scrl_erase_char);
1610 + u16 eattr = mda_convert_attr(c->vc_video_erase_char);
1611
1612 if (!lines)
1613 return 0;
1614 diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c
1615 index 4055dbd..491c1c1 100644
1616 --- a/drivers/video/console/sticon.c
1617 +++ b/drivers/video/console/sticon.c
1618 @@ -170,12 +170,12 @@ static int sticon_scroll(struct vc_data *conp, int t, int b, int dir, int count)
1619 switch (dir) {
1620 case SM_UP:
1621 sti_bmove(sti, t + count, 0, t, 0, b - t - count, conp->vc_cols);
1622 - sti_clear(sti, b - count, 0, count, conp->vc_cols, conp->vc_scrl_erase_char);
1623 + sti_clear(sti, b - count, 0, count, conp->vc_cols, conp->vc_video_erase_char);
1624 break;
1625
1626 case SM_DOWN:
1627 sti_bmove(sti, t, 0, t + count, 0, b - t - count, conp->vc_cols);
1628 - sti_clear(sti, t, 0, count, conp->vc_cols, conp->vc_scrl_erase_char);
1629 + sti_clear(sti, t, 0, count, conp->vc_cols, conp->vc_video_erase_char);
1630 break;
1631 }
1632
1633 diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
1634 index bd1f57b..6df29a6 100644
1635 --- a/drivers/video/console/vgacon.c
1636 +++ b/drivers/video/console/vgacon.c
1637 @@ -1350,7 +1350,7 @@ static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
1638 } else
1639 c->vc_origin += delta;
1640 scr_memsetw((u16 *) (c->vc_origin + c->vc_screenbuf_size -
1641 - delta), c->vc_scrl_erase_char,
1642 + delta), c->vc_video_erase_char,
1643 delta);
1644 } else {
1645 if (oldo - delta < vga_vram_base) {
1646 @@ -1363,7 +1363,7 @@ static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
1647 } else
1648 c->vc_origin -= delta;
1649 c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size;
1650 - scr_memsetw((u16 *) (c->vc_origin), c->vc_scrl_erase_char,
1651 + scr_memsetw((u16 *) (c->vc_origin), c->vc_video_erase_char,
1652 delta);
1653 }
1654 c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size;
1655 diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
1656 index 655ed8d..e57df48 100644
1657 --- a/fs/binfmt_elf.c
1658 +++ b/fs/binfmt_elf.c
1659 @@ -1188,9 +1188,11 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
1660 * check for an ELF header. If we find one, dump the first page to
1661 * aid in determining what was mapped here.
1662 */
1663 - if (FILTER(ELF_HEADERS) && vma->vm_file != NULL && vma->vm_pgoff == 0) {
1664 + if (FILTER(ELF_HEADERS) &&
1665 + vma->vm_pgoff == 0 && (vma->vm_flags & VM_READ)) {
1666 u32 __user *header = (u32 __user *) vma->vm_start;
1667 u32 word;
1668 + mm_segment_t fs = get_fs();
1669 /*
1670 * Doing it this way gets the constant folded by GCC.
1671 */
1672 @@ -1203,7 +1205,15 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
1673 magic.elfmag[EI_MAG1] = ELFMAG1;
1674 magic.elfmag[EI_MAG2] = ELFMAG2;
1675 magic.elfmag[EI_MAG3] = ELFMAG3;
1676 - if (get_user(word, header) == 0 && word == magic.cmp)
1677 + /*
1678 + * Switch to the user "segment" for get_user(),
1679 + * then put back what elf_core_dump() had in place.
1680 + */
1681 + set_fs(USER_DS);
1682 + if (unlikely(get_user(word, header)))
1683 + word = 0;
1684 + set_fs(fs);
1685 + if (word == magic.cmp)
1686 return PAGE_SIZE;
1687 }
1688
1689 diff --git a/fs/seq_file.c b/fs/seq_file.c
1690 index bd20f7f..ef4d497 100644
1691 --- a/fs/seq_file.c
1692 +++ b/fs/seq_file.c
1693 @@ -54,6 +54,64 @@ int seq_open(struct file *file, const struct seq_operations *op)
1694 }
1695 EXPORT_SYMBOL(seq_open);
1696
1697 +static int traverse(struct seq_file *m, loff_t offset)
1698 +{
1699 + loff_t pos = 0, index;
1700 + int error = 0;
1701 + void *p;
1702 +
1703 + m->version = 0;
1704 + index = 0;
1705 + m->count = m->from = 0;
1706 + if (!offset) {
1707 + m->index = index;
1708 + return 0;
1709 + }
1710 + if (!m->buf) {
1711 + m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL);
1712 + if (!m->buf)
1713 + return -ENOMEM;
1714 + }
1715 + p = m->op->start(m, &index);
1716 + while (p) {
1717 + error = PTR_ERR(p);
1718 + if (IS_ERR(p))
1719 + break;
1720 + error = m->op->show(m, p);
1721 + if (error < 0)
1722 + break;
1723 + if (unlikely(error)) {
1724 + error = 0;
1725 + m->count = 0;
1726 + }
1727 + if (m->count == m->size)
1728 + goto Eoverflow;
1729 + if (pos + m->count > offset) {
1730 + m->from = offset - pos;
1731 + m->count -= m->from;
1732 + m->index = index;
1733 + break;
1734 + }
1735 + pos += m->count;
1736 + m->count = 0;
1737 + if (pos == offset) {
1738 + index++;
1739 + m->index = index;
1740 + break;
1741 + }
1742 + p = m->op->next(m, p, &index);
1743 + }
1744 + m->op->stop(m, p);
1745 + m->index = index;
1746 + return error;
1747 +
1748 +Eoverflow:
1749 + m->op->stop(m, p);
1750 + kfree(m->buf);
1751 + m->buf = kmalloc(m->size <<= 1, GFP_KERNEL);
1752 + return !m->buf ? -ENOMEM : -EAGAIN;
1753 +}
1754 +
1755 /**
1756 * seq_read - ->read() method for sequential files.
1757 * @file: the file to read from
1758 @@ -186,63 +244,6 @@ Efault:
1759 }
1760 EXPORT_SYMBOL(seq_read);
1761
1762 -static int traverse(struct seq_file *m, loff_t offset)
1763 -{
1764 - loff_t pos = 0, index;
1765 - int error = 0;
1766 - void *p;
1767 -
1768 - m->version = 0;
1769 - index = 0;
1770 - m->count = m->from = 0;
1771 - if (!offset) {
1772 - m->index = index;
1773 - return 0;
1774 - }
1775 - if (!m->buf) {
1776 - m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL);
1777 - if (!m->buf)
1778 - return -ENOMEM;
1779 - }
1780 - p = m->op->start(m, &index);
1781 - while (p) {
1782 - error = PTR_ERR(p);
1783 - if (IS_ERR(p))
1784 - break;
1785 - error = m->op->show(m, p);
1786 - if (error < 0)
1787 - break;
1788 - if (unlikely(error)) {
1789 - error = 0;
1790 - m->count = 0;
1791 - }
1792 - if (m->count == m->size)
1793 - goto Eoverflow;
1794 - if (pos + m->count > offset) {
1795 - m->from = offset - pos;
1796 - m->count -= m->from;
1797 - m->index = index;
1798 - break;
1799 - }
1800 - pos += m->count;
1801 - m->count = 0;
1802 - if (pos == offset) {
1803 - index++;
1804 - m->index = index;
1805 - break;
1806 - }
1807 - p = m->op->next(m, p, &index);
1808 - }
1809 - m->op->stop(m, p);
1810 - return error;
1811 -
1812 -Eoverflow:
1813 - m->op->stop(m, p);
1814 - kfree(m->buf);
1815 - m->buf = kmalloc(m->size <<= 1, GFP_KERNEL);
1816 - return !m->buf ? -ENOMEM : -EAGAIN;
1817 -}
1818 -
1819 /**
1820 * seq_lseek - ->llseek() method for sequential files.
1821 * @file: the file in question
1822 diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
1823 index 36d5fcd..8454dee 100644
1824 --- a/fs/xfs/linux-2.6/xfs_buf.c
1825 +++ b/fs/xfs/linux-2.6/xfs_buf.c
1826 @@ -1114,8 +1114,7 @@ xfs_buf_bio_end_io(
1827 unsigned int blocksize = bp->b_target->bt_bsize;
1828 struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
1829
1830 - if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
1831 - bp->b_error = EIO;
1832 + xfs_buf_ioerror(bp, -error);
1833
1834 do {
1835 struct page *page = bvec->bv_page;
1836 diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h
1837 index e72bfdd..552637b 100644
1838 --- a/include/acpi/pdc_intel.h
1839 +++ b/include/acpi/pdc_intel.h
1840 @@ -14,6 +14,7 @@
1841 #define ACPI_PDC_SMP_T_SWCOORD (0x0080)
1842 #define ACPI_PDC_C_C1_FFH (0x0100)
1843 #define ACPI_PDC_C_C2C3_FFH (0x0200)
1844 +#define ACPI_PDC_SMP_P_HWCOORD (0x0800)
1845
1846 #define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \
1847 ACPI_PDC_C_C1_HALT | \
1848 @@ -22,6 +23,7 @@
1849 #define ACPI_PDC_EST_CAPABILITY_SWSMP (ACPI_PDC_SMP_C1PT | \
1850 ACPI_PDC_C_C1_HALT | \
1851 ACPI_PDC_SMP_P_SWCOORD | \
1852 + ACPI_PDC_SMP_P_HWCOORD | \
1853 ACPI_PDC_P_FFH)
1854
1855 #define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \
1856 diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
1857 index b03f80a..d71f7c0 100644
1858 --- a/include/linux/console_struct.h
1859 +++ b/include/linux/console_struct.h
1860 @@ -53,7 +53,6 @@ struct vc_data {
1861 unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */
1862 struct console_font vc_font; /* Current VC font set */
1863 unsigned short vc_video_erase_char; /* Background erase character */
1864 - unsigned short vc_scrl_erase_char; /* Erase character for scroll */
1865 /* VT terminal data */
1866 unsigned int vc_state; /* Escape sequence parser state */
1867 unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */
1868 diff --git a/include/linux/module.h b/include/linux/module.h
1869 index 68e0955..760a41b 100644
1870 --- a/include/linux/module.h
1871 +++ b/include/linux/module.h
1872 @@ -387,7 +387,6 @@ void symbol_put_addr(void *addr);
1873 static inline void __module_get(struct module *module)
1874 {
1875 if (module) {
1876 - BUG_ON(module_refcount(module) == 0);
1877 local_inc(&module->ref[get_cpu()].count);
1878 put_cpu();
1879 }
1880 diff --git a/include/linux/pci.h b/include/linux/pci.h
1881 index 426e029..911b99d 100644
1882 --- a/include/linux/pci.h
1883 +++ b/include/linux/pci.h
1884 @@ -639,7 +639,7 @@ int pci_select_bars(struct pci_dev *dev, unsigned long flags);
1885 /* ROM control related routines */
1886 void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size);
1887 void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom);
1888 -size_t pci_get_rom_size(void __iomem *rom, size_t size);
1889 +size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size);
1890
1891 /* Power management related routines */
1892 int pci_save_state(struct pci_dev *dev);
1893 diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
1894 index 26b59cb..794e546 100644
1895 --- a/include/linux/pci_ids.h
1896 +++ b/include/linux/pci_ids.h
1897 @@ -1755,6 +1755,7 @@
1898 #define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081
1899 #define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082
1900 #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050
1901 +#define PCI_SUBDEVICE_ID_SIIG_DUAL_SERIAL 0x2530
1902
1903 #define PCI_VENDOR_ID_RADISYS 0x1331
1904
1905 diff --git a/include/linux/wait.h b/include/linux/wait.h
1906 index 0081147..3c2f411 100644
1907 --- a/include/linux/wait.h
1908 +++ b/include/linux/wait.h
1909 @@ -141,6 +141,8 @@ static inline void __remove_wait_queue(wait_queue_head_t *head,
1910 list_del(&old->task_list);
1911 }
1912
1913 +void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
1914 + int nr_exclusive, int sync, void *key);
1915 void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
1916 extern void __wake_up_locked(wait_queue_head_t *q, unsigned int mode);
1917 extern void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr);
1918 @@ -342,16 +344,19 @@ do { \
1919 for (;;) { \
1920 prepare_to_wait_exclusive(&wq, &__wait, \
1921 TASK_INTERRUPTIBLE); \
1922 - if (condition) \
1923 + if (condition) { \
1924 + finish_wait(&wq, &__wait); \
1925 break; \
1926 + } \
1927 if (!signal_pending(current)) { \
1928 schedule(); \
1929 continue; \
1930 } \
1931 ret = -ERESTARTSYS; \
1932 + abort_exclusive_wait(&wq, &__wait, \
1933 + TASK_INTERRUPTIBLE, NULL); \
1934 break; \
1935 } \
1936 - finish_wait(&wq, &__wait); \
1937 } while (0)
1938
1939 #define wait_event_interruptible_exclusive(wq, condition) \
1940 @@ -440,6 +445,8 @@ extern long interruptible_sleep_on_timeout(wait_queue_head_t *q,
1941 void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state);
1942 void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state);
1943 void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
1944 +void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait,
1945 + unsigned int mode, void *key);
1946 int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
1947 int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
1948
1949 diff --git a/ipc/shm.c b/ipc/shm.c
1950 index f00c897..35a65be 100644
1951 --- a/ipc/shm.c
1952 +++ b/ipc/shm.c
1953 @@ -565,11 +565,15 @@ static void shm_get_stat(struct ipc_namespace *ns, unsigned long *rss,
1954 struct hstate *h = hstate_file(shp->shm_file);
1955 *rss += pages_per_huge_page(h) * mapping->nrpages;
1956 } else {
1957 +#ifdef CONFIG_SHMEM
1958 struct shmem_inode_info *info = SHMEM_I(inode);
1959 spin_lock(&info->lock);
1960 *rss += inode->i_mapping->nrpages;
1961 *swp += info->swapped;
1962 spin_unlock(&info->lock);
1963 +#else
1964 + *rss += inode->i_mapping->nrpages;
1965 +#endif
1966 }
1967
1968 total++;
1969 diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
1970 index 3cd441e..48c58fe 100644
1971 --- a/kernel/irq/chip.c
1972 +++ b/kernel/irq/chip.c
1973 @@ -78,6 +78,7 @@ void dynamic_irq_cleanup(unsigned int irq)
1974 desc->chip_data = NULL;
1975 desc->handle_irq = handle_bad_irq;
1976 desc->chip = &no_irq_chip;
1977 + desc->name = NULL;
1978 spin_unlock_irqrestore(&desc->lock, flags);
1979 }
1980
1981 diff --git a/kernel/sched.c b/kernel/sched.c
1982 index 2a09e44..98c0cdc 100644
1983 --- a/kernel/sched.c
1984 +++ b/kernel/sched.c
1985 @@ -4556,8 +4556,8 @@ EXPORT_SYMBOL(default_wake_function);
1986 * started to run but is not in state TASK_RUNNING. try_to_wake_up() returns
1987 * zero in this (rare) case, and we handle it by continuing to scan the queue.
1988 */
1989 -static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
1990 - int nr_exclusive, int sync, void *key)
1991 +void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
1992 + int nr_exclusive, int sync, void *key)
1993 {
1994 wait_queue_t *curr, *next;
1995
1996 diff --git a/kernel/wait.c b/kernel/wait.c
1997 index c275c56..24688c7 100644
1998 --- a/kernel/wait.c
1999 +++ b/kernel/wait.c
2000 @@ -101,6 +101,15 @@ prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state)
2001 }
2002 EXPORT_SYMBOL(prepare_to_wait_exclusive);
2003
2004 +/*
2005 + * finish_wait - clean up after waiting in a queue
2006 + * @q: waitqueue waited on
2007 + * @wait: wait descriptor
2008 + *
2009 + * Sets current thread back to running state and removes
2010 + * the wait descriptor from the given waitqueue if still
2011 + * queued.
2012 + */
2013 void finish_wait(wait_queue_head_t *q, wait_queue_t *wait)
2014 {
2015 unsigned long flags;
2016 @@ -127,6 +136,39 @@ void finish_wait(wait_queue_head_t *q, wait_queue_t *wait)
2017 }
2018 EXPORT_SYMBOL(finish_wait);
2019
2020 +/*
2021 + * abort_exclusive_wait - abort exclusive waiting in a queue
2022 + * @q: waitqueue waited on
2023 + * @wait: wait descriptor
2024 + * @state: runstate of the waiter to be woken
2025 + * @key: key to identify a wait bit queue or %NULL
2026 + *
2027 + * Sets current thread back to running state and removes
2028 + * the wait descriptor from the given waitqueue if still
2029 + * queued.
2030 + *
2031 + * Wakes up the next waiter if the caller is concurrently
2032 + * woken up through the queue.
2033 + *
2034 + * This prevents waiter starvation where an exclusive waiter
2035 + * aborts and is woken up concurrently and noone wakes up
2036 + * the next waiter.
2037 + */
2038 +void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait,
2039 + unsigned int mode, void *key)
2040 +{
2041 + unsigned long flags;
2042 +
2043 + __set_current_state(TASK_RUNNING);
2044 + spin_lock_irqsave(&q->lock, flags);
2045 + if (!list_empty(&wait->task_list))
2046 + list_del_init(&wait->task_list);
2047 + else if (waitqueue_active(q))
2048 + __wake_up_common(q, mode, 1, 0, key);
2049 + spin_unlock_irqrestore(&q->lock, flags);
2050 +}
2051 +EXPORT_SYMBOL(abort_exclusive_wait);
2052 +
2053 int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key)
2054 {
2055 int ret = default_wake_function(wait, mode, sync, key);
2056 @@ -187,17 +229,20 @@ int __sched
2057 __wait_on_bit_lock(wait_queue_head_t *wq, struct wait_bit_queue *q,
2058 int (*action)(void *), unsigned mode)
2059 {
2060 - int ret = 0;
2061 -
2062 do {
2063 + int ret;
2064 +
2065 prepare_to_wait_exclusive(wq, &q->wait, mode);
2066 - if (test_bit(q->key.bit_nr, q->key.flags)) {
2067 - if ((ret = (*action)(q->key.flags)))
2068 - break;
2069 - }
2070 + if (!test_bit(q->key.bit_nr, q->key.flags))
2071 + continue;
2072 + ret = action(q->key.flags);
2073 + if (!ret)
2074 + continue;
2075 + abort_exclusive_wait(wq, &q->wait, mode, &q->key);
2076 + return ret;
2077 } while (test_and_set_bit(q->key.bit_nr, q->key.flags));
2078 finish_wait(wq, &q->wait);
2079 - return ret;
2080 + return 0;
2081 }
2082 EXPORT_SYMBOL(__wait_on_bit_lock);
2083
2084 diff --git a/mm/swap.c b/mm/swap.c
2085 index 9e0cb31..65e6825 100644
2086 --- a/mm/swap.c
2087 +++ b/mm/swap.c
2088 @@ -244,7 +244,6 @@ void lru_add_drain(void)
2089 put_cpu();
2090 }
2091
2092 -#ifdef CONFIG_NUMA
2093 static void lru_add_drain_per_cpu(struct work_struct *dummy)
2094 {
2095 lru_add_drain();
2096 @@ -258,18 +257,6 @@ int lru_add_drain_all(void)
2097 return schedule_on_each_cpu(lru_add_drain_per_cpu);
2098 }
2099
2100 -#else
2101 -
2102 -/*
2103 - * Returns 0 for success
2104 - */
2105 -int lru_add_drain_all(void)
2106 -{
2107 - lru_add_drain();
2108 - return 0;
2109 -}
2110 -#endif
2111 -
2112 /*
2113 * Batched page_cache_release(). Decrement the reference count on all the
2114 * passed pages. If it fell to zero then remove the page from the LRU and
2115 diff --git a/net/sctp/input.c b/net/sctp/input.c
2116 index a49fa80..be736af 100644
2117 --- a/net/sctp/input.c
2118 +++ b/net/sctp/input.c
2119 @@ -249,6 +249,19 @@ int sctp_rcv(struct sk_buff *skb)
2120 */
2121 sctp_bh_lock_sock(sk);
2122
2123 + if (sk != rcvr->sk) {
2124 + /* Our cached sk is different from the rcvr->sk. This is
2125 + * because migrate()/accept() may have moved the association
2126 + * to a new socket and released all the sockets. So now we
2127 + * are holding a lock on the old socket while the user may
2128 + * be doing something with the new socket. Switch our veiw
2129 + * of the current sk.
2130 + */
2131 + sctp_bh_unlock_sock(sk);
2132 + sk = rcvr->sk;
2133 + sctp_bh_lock_sock(sk);
2134 + }
2135 +
2136 if (sock_owned_by_user(sk)) {
2137 SCTP_INC_STATS_BH(SCTP_MIB_IN_PKT_BACKLOG);
2138 sctp_add_backlog(sk, skb);
2139 diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
2140 index 3e65719..e4c27c1 100644
2141 --- a/net/sunrpc/svcsock.c
2142 +++ b/net/sunrpc/svcsock.c
2143 @@ -1171,7 +1171,11 @@ int svc_addsock(struct svc_serv *serv,
2144 else if (so->state > SS_UNCONNECTED)
2145 err = -EISCONN;
2146 else {
2147 - svsk = svc_setup_socket(serv, so, &err, SVC_SOCK_DEFAULTS);
2148 + if (!try_module_get(THIS_MODULE))
2149 + err = -ENOENT;
2150 + else
2151 + svsk = svc_setup_socket(serv, so, &err,
2152 + SVC_SOCK_DEFAULTS);
2153 if (svsk) {
2154 struct sockaddr_storage addr;
2155 struct sockaddr *sin = (struct sockaddr *)&addr;
2156 @@ -1184,7 +1188,8 @@ int svc_addsock(struct svc_serv *serv,
2157 spin_unlock_bh(&serv->sv_lock);
2158 svc_xprt_received(&svsk->sk_xprt);
2159 err = 0;
2160 - }
2161 + } else
2162 + module_put(THIS_MODULE);
2163 }
2164 if (err) {
2165 sockfd_put(so);
2166 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
2167 index aa7dc03..db9c702 100644
2168 --- a/sound/pci/hda/patch_realtek.c
2169 +++ b/sound/pci/hda/patch_realtek.c
2170 @@ -920,6 +920,7 @@ do_sku:
2171 case 0x10ec0267:
2172 case 0x10ec0268:
2173 case 0x10ec0269:
2174 + case 0x10ec0272:
2175 case 0x10ec0660:
2176 case 0x10ec0662:
2177 case 0x10ec0663:
2178 @@ -948,6 +949,7 @@ do_sku:
2179 case 0x10ec0882:
2180 case 0x10ec0883:
2181 case 0x10ec0885:
2182 + case 0x10ec0887:
2183 case 0x10ec0889:
2184 snd_hda_codec_write(codec, 0x20, 0,
2185 AC_VERB_SET_COEF_INDEX, 7);
2186 @@ -8059,6 +8061,8 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
2187 SND_PCI_QUIRK(0x1558, 0, "Clevo laptop", ALC883_LAPTOP_EAPD),
2188 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch),
2189 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION),
2190 + SND_PCI_QUIRK(0x1734, 0x1107, "FSC AMILO Xi2550",
2191 + ALC883_FUJITSU_PI2515),
2192 SND_PCI_QUIRK(0x1734, 0x1108, "Fujitsu AMILO Pi2515", ALC883_FUJITSU_PI2515),
2193 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch),
2194 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763),
2195 diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
2196 index b8cfb7c..7a1a8c8 100644
2197 --- a/sound/usb/usbaudio.c
2198 +++ b/sound/usb/usbaudio.c
2199 @@ -2958,6 +2958,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
2200 return -EINVAL;
2201 }
2202 alts = &iface->altsetting[fp->altset_idx];
2203 + fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
2204 usb_set_interface(chip->dev, fp->iface, 0);
2205 init_usb_pitch(chip->dev, fp->iface, alts, fp);
2206 init_usb_sample_rate(chip->dev, fp->iface, alts, fp, fp->rate_max);