diff options
53 files changed, 593 insertions, 301 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index f3d7256bc74e..9507b4207512 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -88,7 +88,6 @@ S: Status, one of the following: | |||
88 | P: Mike Phillips | 88 | P: Mike Phillips |
89 | M: mikep@linuxtr.net | 89 | M: mikep@linuxtr.net |
90 | L: netdev@vger.kernel.org | 90 | L: netdev@vger.kernel.org |
91 | L: linux-tr@linuxtr.net | ||
92 | W: http://www.linuxtr.net | 91 | W: http://www.linuxtr.net |
93 | S: Maintained | 92 | S: Maintained |
94 | 93 | ||
@@ -167,7 +166,6 @@ S: Maintained | |||
167 | 166 | ||
168 | A2232 SERIAL BOARD DRIVER | 167 | A2232 SERIAL BOARD DRIVER |
169 | P: Enver Haase | 168 | P: Enver Haase |
170 | M: ehaase@inf.fu-berlin.de | ||
171 | M: A2232@gmx.net | 169 | M: A2232@gmx.net |
172 | L: linux-m68k@lists.linux-m68k.org | 170 | L: linux-m68k@lists.linux-m68k.org |
173 | S: Maintained | 171 | S: Maintained |
@@ -439,7 +437,7 @@ S: Maintained | |||
439 | 437 | ||
440 | ARM/ATMEL AT91RM9200 ARM ARCHITECTURE | 438 | ARM/ATMEL AT91RM9200 ARM ARCHITECTURE |
441 | P: Andrew Victor | 439 | P: Andrew Victor |
442 | M: linux@maxim.org.za | 440 | M: andrew@sanpeople.com |
443 | L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) | 441 | L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) |
444 | W: http://maxim.org.za/at91_26.html | 442 | W: http://maxim.org.za/at91_26.html |
445 | S: Maintained | 443 | S: Maintained |
@@ -2064,7 +2062,7 @@ S: Maintained | |||
2064 | IOC3 SERIAL DRIVER | 2062 | IOC3 SERIAL DRIVER |
2065 | P: Pat Gefre | 2063 | P: Pat Gefre |
2066 | M: pfg@sgi.com | 2064 | M: pfg@sgi.com |
2067 | L: linux-kernel@linux-mips.org | 2065 | L: linux-mips@linux-mips.org |
2068 | S: Maintained | 2066 | S: Maintained |
2069 | 2067 | ||
2070 | IP MASQUERADING: | 2068 | IP MASQUERADING: |
@@ -2815,7 +2813,6 @@ M: p2@ace.ulyssis.student.kuleuven.ac.be | |||
2815 | P: Mike Phillips | 2813 | P: Mike Phillips |
2816 | M: mikep@linuxtr.net | 2814 | M: mikep@linuxtr.net |
2817 | L: netdev@vger.kernel.org | 2815 | L: netdev@vger.kernel.org |
2818 | L: linux-tr@linuxtr.net | ||
2819 | W: http://www.linuxtr.net | 2816 | W: http://www.linuxtr.net |
2820 | S: Maintained | 2817 | S: Maintained |
2821 | 2818 | ||
@@ -2953,7 +2950,7 @@ S: Supported | |||
2953 | PCMCIA SUBSYSTEM | 2950 | PCMCIA SUBSYSTEM |
2954 | P: Linux PCMCIA Team | 2951 | P: Linux PCMCIA Team |
2955 | L: linux-pcmcia@lists.infradead.org | 2952 | L: linux-pcmcia@lists.infradead.org |
2956 | L: http://lists.infradead.org/mailman/listinfo/linux-pcmcia | 2953 | W: http://lists.infradead.org/mailman/listinfo/linux-pcmcia |
2957 | T: git kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git | 2954 | T: git kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git |
2958 | S: Maintained | 2955 | S: Maintained |
2959 | 2956 | ||
@@ -3731,7 +3728,6 @@ TOKEN-RING NETWORK DRIVER | |||
3731 | P: Mike Phillips | 3728 | P: Mike Phillips |
3732 | M: mikep@linuxtr.net | 3729 | M: mikep@linuxtr.net |
3733 | L: netdev@vger.kernel.org | 3730 | L: netdev@vger.kernel.org |
3734 | L: linux-tr@linuxtr.net | ||
3735 | W: http://www.linuxtr.net | 3731 | W: http://www.linuxtr.net |
3736 | S: Maintained | 3732 | S: Maintained |
3737 | 3733 | ||
@@ -4049,7 +4045,7 @@ S: Maintained | |||
4049 | 4045 | ||
4050 | USER-MODE LINUX | 4046 | USER-MODE LINUX |
4051 | P: Jeff Dike | 4047 | P: Jeff Dike |
4052 | M: jdike@karaya.com | 4048 | M: jdike@addtoit.com |
4053 | L: user-mode-linux-devel@lists.sourceforge.net | 4049 | L: user-mode-linux-devel@lists.sourceforge.net |
4054 | L: user-mode-linux-user@lists.sourceforge.net | 4050 | L: user-mode-linux-user@lists.sourceforge.net |
4055 | W: http://user-mode-linux.sourceforge.net | 4051 | W: http://user-mode-linux.sourceforge.net |
@@ -4280,13 +4276,6 @@ L: mjpeg-users@lists.sourceforge.net | |||
4280 | W: http://mjpeg.sourceforge.net/driver-zoran/ | 4276 | W: http://mjpeg.sourceforge.net/driver-zoran/ |
4281 | S: Maintained | 4277 | S: Maintained |
4282 | 4278 | ||
4283 | ZR36120 VIDEO FOR LINUX DRIVER | ||
4284 | P: Pauline Middelink | ||
4285 | M: middelin@polyware.nl | ||
4286 | W: http://www.polyware.nl/~middelin/En/hobbies.html | ||
4287 | W: http://www.polyware.nl/~middelin/hobbies.html | ||
4288 | S: Maintained | ||
4289 | |||
4290 | ZS DECSTATION Z85C30 SERIAL DRIVER | 4279 | ZS DECSTATION Z85C30 SERIAL DRIVER |
4291 | P: Maciej W. Rozycki | 4280 | P: Maciej W. Rozycki |
4292 | M: macro@linux-mips.org | 4281 | M: macro@linux-mips.org |
@@ -108,6 +108,9 @@ endif | |||
108 | PHONY := _all | 108 | PHONY := _all |
109 | _all: | 109 | _all: |
110 | 110 | ||
111 | # Cancel implicit rules on top Makefile | ||
112 | $(CURDIR)/Makefile Makefile: ; | ||
113 | |||
111 | ifneq ($(KBUILD_OUTPUT),) | 114 | ifneq ($(KBUILD_OUTPUT),) |
112 | # Invoke a second make in the output directory, passing relevant variables | 115 | # Invoke a second make in the output directory, passing relevant variables |
113 | # check that the output directory actually exists | 116 | # check that the output directory actually exists |
@@ -115,13 +118,10 @@ saved-output := $(KBUILD_OUTPUT) | |||
115 | KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) | 118 | KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) |
116 | $(if $(KBUILD_OUTPUT),, \ | 119 | $(if $(KBUILD_OUTPUT),, \ |
117 | $(error output directory "$(saved-output)" does not exist)) | 120 | $(error output directory "$(saved-output)" does not exist)) |
118 | # Check that OUTPUT directory is not the same as where we have kernel src | ||
119 | $(if $(filter-out $(KBUILD_OUTPUT),$(shell /bin/pwd)),, \ | ||
120 | $(error Output directory (O=...) specifies kernel src dir)) | ||
121 | 121 | ||
122 | PHONY += $(MAKECMDGOALS) sub-make | 122 | PHONY += $(MAKECMDGOALS) sub-make |
123 | 123 | ||
124 | $(filter-out _all sub-make,$(MAKECMDGOALS)) _all: sub-make | 124 | $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make |
125 | $(Q)@: | 125 | $(Q)@: |
126 | 126 | ||
127 | sub-make: FORCE | 127 | sub-make: FORCE |
@@ -291,7 +291,8 @@ export quiet Q KBUILD_VERBOSE | |||
291 | # Look for make include files relative to root of kernel src | 291 | # Look for make include files relative to root of kernel src |
292 | MAKEFLAGS += --include-dir=$(srctree) | 292 | MAKEFLAGS += --include-dir=$(srctree) |
293 | 293 | ||
294 | # We need some generic definitions. | 294 | # We need some generic definitions (do not try to remake the file). |
295 | $(srctree)/scripts/Kbuild.include: ; | ||
295 | include $(srctree)/scripts/Kbuild.include | 296 | include $(srctree)/scripts/Kbuild.include |
296 | 297 | ||
297 | # Make variables (CC, etc...) | 298 | # Make variables (CC, etc...) |
@@ -1560,9 +1561,6 @@ endif # skip-makefile | |||
1560 | PHONY += FORCE | 1561 | PHONY += FORCE |
1561 | FORCE: | 1562 | FORCE: |
1562 | 1563 | ||
1563 | # Cancel implicit rules on top Makefile, `-rR' will apply to sub-makes. | ||
1564 | Makefile: ; | ||
1565 | |||
1566 | # Declare the contents of the .PHONY variable as phony. We keep that | 1564 | # Declare the contents of the .PHONY variable as phony. We keep that |
1567 | # information in a variable se we can use it in if_changed and friends. | 1565 | # information in a variable se we can use it in if_changed and friends. |
1568 | .PHONY: $(PHONY) | 1566 | .PHONY: $(PHONY) |
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index 34951aa2370b..b916ccfdef84 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile | |||
@@ -77,7 +77,7 @@ vmlinux.gz: vmlinux | |||
77 | $(Q)$(MAKE) $(build)=$(boot) $@ | 77 | $(Q)$(MAKE) $(build)=$(boot) $@ |
78 | 78 | ||
79 | unwcheck: vmlinux | 79 | unwcheck: vmlinux |
80 | -$(Q)READELF=$(READELF) $(srctree)/arch/ia64/scripts/unwcheck.py $< | 80 | -$(Q)READELF=$(READELF) python $(srctree)/arch/ia64/scripts/unwcheck.py $< |
81 | 81 | ||
82 | archclean: | 82 | archclean: |
83 | $(Q)$(MAKE) $(clean)=$(boot) | 83 | $(Q)$(MAKE) $(clean)=$(boot) |
diff --git a/arch/ia64/hp/sim/boot/Makefile b/arch/ia64/hp/sim/boot/Makefile index df6e9968c845..2e805e0cc560 100644 --- a/arch/ia64/hp/sim/boot/Makefile +++ b/arch/ia64/hp/sim/boot/Makefile | |||
@@ -33,5 +33,5 @@ $(obj)/vmlinux.bin: vmlinux FORCE | |||
33 | LDFLAGS_bootloader = -static -T | 33 | LDFLAGS_bootloader = -static -T |
34 | 34 | ||
35 | $(obj)/bootloader: $(src)/bootloader.lds $(obj)/bootloader.o $(obj)/boot_head.o $(obj)/fw-emu.o \ | 35 | $(obj)/bootloader: $(src)/bootloader.lds $(obj)/bootloader.o $(obj)/boot_head.o $(obj)/fw-emu.o \ |
36 | lib/lib.a arch/ia64/lib/lib.a FORCE | 36 | lib/lib.a arch/ia64/lib/built-in.o arch/ia64/lib/lib.a FORCE |
37 | $(call if_changed,ld) | 37 | $(call if_changed,ld) |
diff --git a/arch/ia64/hp/sim/boot/bootloader.lds b/arch/ia64/hp/sim/boot/bootloader.lds index 69ae58531033..3977f25a1265 100644 --- a/arch/ia64/hp/sim/boot/bootloader.lds +++ b/arch/ia64/hp/sim/boot/bootloader.lds | |||
@@ -22,10 +22,11 @@ SECTIONS | |||
22 | .sdata : { *(.sdata) } | 22 | .sdata : { *(.sdata) } |
23 | _edata = .; | 23 | _edata = .; |
24 | 24 | ||
25 | _bss = .; | 25 | __bss_start = .; |
26 | .sbss : { *(.sbss) *(.scommon) } | 26 | .sbss : { *(.sbss) *(.scommon) } |
27 | .bss : { *(.bss) *(COMMON) } | 27 | .bss : { *(.bss) *(COMMON) } |
28 | . = ALIGN(64 / 8); | 28 | . = ALIGN(64 / 8); |
29 | __bss_stop = .; | ||
29 | _end = . ; | 30 | _end = . ; |
30 | 31 | ||
31 | /* Stabs debugging sections. */ | 32 | /* Stabs debugging sections. */ |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 897e2083a3b1..00b5d08f6da8 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -860,7 +860,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) | |||
860 | lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer; | 860 | lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer; |
861 | 861 | ||
862 | if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) || | 862 | if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) || |
863 | (!lsapic->lapic_flags & ACPI_MADT_ENABLED)) { | 863 | (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))) { |
864 | kfree(buffer.pointer); | 864 | kfree(buffer.pointer); |
865 | return -EINVAL; | 865 | return -EINVAL; |
866 | } | 866 | } |
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 8e8f8b6193ee..242d79341120 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c | |||
@@ -370,7 +370,7 @@ efi_get_pal_addr (void) | |||
370 | continue; | 370 | continue; |
371 | } | 371 | } |
372 | 372 | ||
373 | if (md->num_pages << EFI_PAGE_SHIFT > IA64_GRANULE_SIZE) | 373 | if (efi_md_size(md) > IA64_GRANULE_SIZE) |
374 | panic("Woah! PAL code size bigger than a granule!"); | 374 | panic("Woah! PAL code size bigger than a granule!"); |
375 | 375 | ||
376 | #if EFI_DEBUG | 376 | #if EFI_DEBUG |
@@ -378,7 +378,7 @@ efi_get_pal_addr (void) | |||
378 | 378 | ||
379 | printk(KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n", | 379 | printk(KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n", |
380 | smp_processor_id(), md->phys_addr, | 380 | smp_processor_id(), md->phys_addr, |
381 | md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), | 381 | md->phys_addr + efi_md_size(md), |
382 | vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE); | 382 | vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE); |
383 | #endif | 383 | #endif |
384 | return __va(md->phys_addr); | 384 | return __va(md->phys_addr); |
@@ -523,7 +523,7 @@ efi_init (void) | |||
523 | md = p; | 523 | md = p; |
524 | printk("mem%02u: type=%u, attr=0x%lx, range=[0x%016lx-0x%016lx) (%luMB)\n", | 524 | printk("mem%02u: type=%u, attr=0x%lx, range=[0x%016lx-0x%016lx) (%luMB)\n", |
525 | i, md->type, md->attribute, md->phys_addr, | 525 | i, md->type, md->attribute, md->phys_addr, |
526 | md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), | 526 | md->phys_addr + efi_md_size(md), |
527 | md->num_pages >> (20 - EFI_PAGE_SHIFT)); | 527 | md->num_pages >> (20 - EFI_PAGE_SHIFT)); |
528 | } | 528 | } |
529 | } | 529 | } |
@@ -656,7 +656,7 @@ efi_memory_descriptor (unsigned long phys_addr) | |||
656 | for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { | 656 | for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { |
657 | md = p; | 657 | md = p; |
658 | 658 | ||
659 | if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT)) | 659 | if (phys_addr - md->phys_addr < efi_md_size(md)) |
660 | return md; | 660 | return md; |
661 | } | 661 | } |
662 | return NULL; | 662 | return NULL; |
@@ -1158,7 +1158,7 @@ efi_initialize_iomem_resources(struct resource *code_resource, | |||
1158 | 1158 | ||
1159 | res->name = name; | 1159 | res->name = name; |
1160 | res->start = md->phys_addr; | 1160 | res->start = md->phys_addr; |
1161 | res->end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1; | 1161 | res->end = md->phys_addr + efi_md_size(md) - 1; |
1162 | res->flags = flags; | 1162 | res->flags = flags; |
1163 | 1163 | ||
1164 | if (insert_resource(&iomem_resource, res) < 0) | 1164 | if (insert_resource(&iomem_resource, res) < 0) |
diff --git a/arch/ia64/kernel/gate.lds.S b/arch/ia64/kernel/gate.lds.S index 454d7a7dfa9d..3cb1abc00e24 100644 --- a/arch/ia64/kernel/gate.lds.S +++ b/arch/ia64/kernel/gate.lds.S | |||
@@ -30,7 +30,7 @@ SECTIONS | |||
30 | * the dynamic symbol table et al. If this amount is insufficient, | 30 | * the dynamic symbol table et al. If this amount is insufficient, |
31 | * ld -shared will barf. Just increase it here. | 31 | * ld -shared will barf. Just increase it here. |
32 | */ | 32 | */ |
33 | . = GATE_ADDR + 0x500; | 33 | . = GATE_ADDR + 0x600; |
34 | 34 | ||
35 | .data.patch : { | 35 | .data.patch : { |
36 | __start_gate_mckinley_e9_patchlist = .; | 36 | __start_gate_mckinley_e9_patchlist = .; |
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c index bd17190bebb6..c3b4412ccc67 100644 --- a/arch/ia64/kernel/ia64_ksyms.c +++ b/arch/ia64/kernel/ia64_ksyms.c | |||
@@ -63,6 +63,9 @@ EXPORT_SYMBOL(__udivdi3); | |||
63 | EXPORT_SYMBOL(__moddi3); | 63 | EXPORT_SYMBOL(__moddi3); |
64 | EXPORT_SYMBOL(__umoddi3); | 64 | EXPORT_SYMBOL(__umoddi3); |
65 | 65 | ||
66 | #include <asm/page.h> | ||
67 | EXPORT_SYMBOL(copy_page); | ||
68 | |||
66 | #if defined(CONFIG_MD_RAID456) || defined(CONFIG_MD_RAID456_MODULE) | 69 | #if defined(CONFIG_MD_RAID456) || defined(CONFIG_MD_RAID456_MODULE) |
67 | extern void xor_ia64_2(void); | 70 | extern void xor_ia64_2(void); |
68 | extern void xor_ia64_3(void); | 71 | extern void xor_ia64_3(void); |
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index 274a59383043..398e2fd1cd25 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c | |||
@@ -199,19 +199,6 @@ static inline int __gsi_to_irq(unsigned int gsi) | |||
199 | return -1; | 199 | return -1; |
200 | } | 200 | } |
201 | 201 | ||
202 | /* | ||
203 | * Translate GSI number to the corresponding IA-64 interrupt vector. If no | ||
204 | * entry exists, return -1. | ||
205 | */ | ||
206 | inline int | ||
207 | gsi_to_vector (unsigned int gsi) | ||
208 | { | ||
209 | int irq = __gsi_to_irq(gsi); | ||
210 | if (check_irq_used(irq) < 0) | ||
211 | return -1; | ||
212 | return irq_to_vector(irq); | ||
213 | } | ||
214 | |||
215 | int | 202 | int |
216 | gsi_to_irq (unsigned int gsi) | 203 | gsi_to_irq (unsigned int gsi) |
217 | { | 204 | { |
@@ -429,7 +416,7 @@ iosapic_end_level_irq (unsigned int irq) | |||
429 | #define iosapic_disable_level_irq mask_irq | 416 | #define iosapic_disable_level_irq mask_irq |
430 | #define iosapic_ack_level_irq nop | 417 | #define iosapic_ack_level_irq nop |
431 | 418 | ||
432 | struct irq_chip irq_type_iosapic_level = { | 419 | static struct irq_chip irq_type_iosapic_level = { |
433 | .name = "IO-SAPIC-level", | 420 | .name = "IO-SAPIC-level", |
434 | .startup = iosapic_startup_level_irq, | 421 | .startup = iosapic_startup_level_irq, |
435 | .shutdown = iosapic_shutdown_level_irq, | 422 | .shutdown = iosapic_shutdown_level_irq, |
@@ -478,7 +465,7 @@ iosapic_ack_edge_irq (unsigned int irq) | |||
478 | #define iosapic_disable_edge_irq nop | 465 | #define iosapic_disable_edge_irq nop |
479 | #define iosapic_end_edge_irq nop | 466 | #define iosapic_end_edge_irq nop |
480 | 467 | ||
481 | struct irq_chip irq_type_iosapic_edge = { | 468 | static struct irq_chip irq_type_iosapic_edge = { |
482 | .name = "IO-SAPIC-edge", | 469 | .name = "IO-SAPIC-edge", |
483 | .startup = iosapic_startup_edge_irq, | 470 | .startup = iosapic_startup_edge_irq, |
484 | .shutdown = iosapic_disable_edge_irq, | 471 | .shutdown = iosapic_disable_edge_irq, |
@@ -491,7 +478,7 @@ struct irq_chip irq_type_iosapic_edge = { | |||
491 | .set_affinity = iosapic_set_affinity | 478 | .set_affinity = iosapic_set_affinity |
492 | }; | 479 | }; |
493 | 480 | ||
494 | unsigned int | 481 | static unsigned int |
495 | iosapic_version (char __iomem *addr) | 482 | iosapic_version (char __iomem *addr) |
496 | { | 483 | { |
497 | /* | 484 | /* |
@@ -938,7 +925,7 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi, | |||
938 | case ACPI_INTERRUPT_CPEI: | 925 | case ACPI_INTERRUPT_CPEI: |
939 | irq = vector = IA64_CPE_VECTOR; | 926 | irq = vector = IA64_CPE_VECTOR; |
940 | BUG_ON(bind_irq_vector(irq, vector, CPU_MASK_ALL)); | 927 | BUG_ON(bind_irq_vector(irq, vector, CPU_MASK_ALL)); |
941 | delivery = IOSAPIC_LOWEST_PRIORITY; | 928 | delivery = IOSAPIC_FIXED; |
942 | mask = 1; | 929 | mask = 1; |
943 | break; | 930 | break; |
944 | default: | 931 | default: |
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index 5fd65d8302c8..fc4d2676264f 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c | |||
@@ -182,8 +182,8 @@ static int __kprobes unsupported_inst(uint template, uint slot, | |||
182 | qp = kprobe_inst & 0x3f; | 182 | qp = kprobe_inst & 0x3f; |
183 | if (is_cmp_ctype_unc_inst(template, slot, major_opcode, kprobe_inst)) { | 183 | if (is_cmp_ctype_unc_inst(template, slot, major_opcode, kprobe_inst)) { |
184 | if (slot == 1 && qp) { | 184 | if (slot == 1 && qp) { |
185 | printk(KERN_WARNING "Kprobes on cmp unc" | 185 | printk(KERN_WARNING "Kprobes on cmp unc " |
186 | "instruction on slot 1 at <0x%lx>" | 186 | "instruction on slot 1 at <0x%lx> " |
187 | "is not supported\n", addr); | 187 | "is not supported\n", addr); |
188 | return -EINVAL; | 188 | return -EINVAL; |
189 | 189 | ||
@@ -221,8 +221,8 @@ static int __kprobes unsupported_inst(uint template, uint slot, | |||
221 | * bit 12 to be equal to 1 | 221 | * bit 12 to be equal to 1 |
222 | */ | 222 | */ |
223 | if (slot == 1 && qp) { | 223 | if (slot == 1 && qp) { |
224 | printk(KERN_WARNING "Kprobes on test bit" | 224 | printk(KERN_WARNING "Kprobes on test bit " |
225 | "instruction on slot at <0x%lx>" | 225 | "instruction on slot at <0x%lx> " |
226 | "is not supported\n", addr); | 226 | "is not supported\n", addr); |
227 | return -EINVAL; | 227 | return -EINVAL; |
228 | } | 228 | } |
@@ -242,7 +242,7 @@ static int __kprobes unsupported_inst(uint template, uint slot, | |||
242 | */ | 242 | */ |
243 | int x6=(kprobe_inst >> 27) & 0x3F; | 243 | int x6=(kprobe_inst >> 27) & 0x3F; |
244 | if ((x6 == 0x10) || (x6 == 0x11)) { | 244 | if ((x6 == 0x10) || (x6 == 0x11)) { |
245 | printk(KERN_WARNING "Kprobes on" | 245 | printk(KERN_WARNING "Kprobes on " |
246 | "Indirect Predict is not supported\n"); | 246 | "Indirect Predict is not supported\n"); |
247 | return -EINVAL; | 247 | return -EINVAL; |
248 | } | 248 | } |
@@ -435,6 +435,23 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) | |||
435 | /* another task is sharing our hash bucket */ | 435 | /* another task is sharing our hash bucket */ |
436 | continue; | 436 | continue; |
437 | 437 | ||
438 | orig_ret_address = (unsigned long)ri->ret_addr; | ||
439 | if (orig_ret_address != trampoline_address) | ||
440 | /* | ||
441 | * This is the real return address. Any other | ||
442 | * instances associated with this task are for | ||
443 | * other calls deeper on the call stack | ||
444 | */ | ||
445 | break; | ||
446 | } | ||
447 | |||
448 | regs->cr_iip = orig_ret_address; | ||
449 | |||
450 | hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { | ||
451 | if (ri->task != current) | ||
452 | /* another task is sharing our hash bucket */ | ||
453 | continue; | ||
454 | |||
438 | if (ri->rp && ri->rp->handler) | 455 | if (ri->rp && ri->rp->handler) |
439 | ri->rp->handler(ri, regs); | 456 | ri->rp->handler(ri, regs); |
440 | 457 | ||
@@ -452,8 +469,6 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) | |||
452 | 469 | ||
453 | kretprobe_assert(ri, orig_ret_address, trampoline_address); | 470 | kretprobe_assert(ri, orig_ret_address, trampoline_address); |
454 | 471 | ||
455 | regs->cr_iip = orig_ret_address; | ||
456 | |||
457 | reset_current_kprobe(); | 472 | reset_current_kprobe(); |
458 | spin_unlock_irqrestore(&kretprobe_lock, flags); | 473 | spin_unlock_irqrestore(&kretprobe_lock, flags); |
459 | preempt_enable_no_resched(); | 474 | preempt_enable_no_resched(); |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 2b3751eef5ce..4ac2b1f1bd3b 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -95,7 +95,6 @@ static struct resource bss_resource = { | |||
95 | .name = "Kernel bss", | 95 | .name = "Kernel bss", |
96 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | 96 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM |
97 | }; | 97 | }; |
98 | extern char _text[], _end[], _etext[], _edata[], _bss[]; | ||
99 | 98 | ||
100 | unsigned long ia64_max_cacheline_size; | 99 | unsigned long ia64_max_cacheline_size; |
101 | 100 | ||
@@ -206,7 +205,7 @@ static int __init register_memory(void) | |||
206 | code_resource.end = ia64_tpa(_etext) - 1; | 205 | code_resource.end = ia64_tpa(_etext) - 1; |
207 | data_resource.start = ia64_tpa(_etext); | 206 | data_resource.start = ia64_tpa(_etext); |
208 | data_resource.end = ia64_tpa(_edata) - 1; | 207 | data_resource.end = ia64_tpa(_edata) - 1; |
209 | bss_resource.start = ia64_tpa(_bss); | 208 | bss_resource.start = ia64_tpa(__bss_start); |
210 | bss_resource.end = ia64_tpa(_end) - 1; | 209 | bss_resource.end = ia64_tpa(_end) - 1; |
211 | efi_initialize_iomem_resources(&code_resource, &data_resource, | 210 | efi_initialize_iomem_resources(&code_resource, &data_resource, |
212 | &bss_resource); | 211 | &bss_resource); |
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c index cdb64cc4d9c8..4c730099d58f 100644 --- a/arch/ia64/kernel/signal.c +++ b/arch/ia64/kernel/signal.c | |||
@@ -98,7 +98,7 @@ restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr) | |||
98 | if ((flags & IA64_SC_FLAG_FPH_VALID) != 0) { | 98 | if ((flags & IA64_SC_FLAG_FPH_VALID) != 0) { |
99 | struct ia64_psr *psr = ia64_psr(&scr->pt); | 99 | struct ia64_psr *psr = ia64_psr(&scr->pt); |
100 | 100 | ||
101 | __copy_from_user(current->thread.fph, &sc->sc_fr[32], 96*16); | 101 | err |= __copy_from_user(current->thread.fph, &sc->sc_fr[32], 96*16); |
102 | psr->mfh = 0; /* drop signal handler's fph contents... */ | 102 | psr->mfh = 0; /* drop signal handler's fph contents... */ |
103 | preempt_disable(); | 103 | preempt_disable(); |
104 | if (psr->dfh) | 104 | if (psr->dfh) |
@@ -244,7 +244,7 @@ static long | |||
244 | setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratch *scr) | 244 | setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratch *scr) |
245 | { | 245 | { |
246 | unsigned long flags = 0, ifs, cfm, nat; | 246 | unsigned long flags = 0, ifs, cfm, nat; |
247 | long err; | 247 | long err = 0; |
248 | 248 | ||
249 | ifs = scr->pt.cr_ifs; | 249 | ifs = scr->pt.cr_ifs; |
250 | 250 | ||
@@ -257,12 +257,12 @@ setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratc | |||
257 | ia64_flush_fph(current); | 257 | ia64_flush_fph(current); |
258 | if ((current->thread.flags & IA64_THREAD_FPH_VALID)) { | 258 | if ((current->thread.flags & IA64_THREAD_FPH_VALID)) { |
259 | flags |= IA64_SC_FLAG_FPH_VALID; | 259 | flags |= IA64_SC_FLAG_FPH_VALID; |
260 | __copy_to_user(&sc->sc_fr[32], current->thread.fph, 96*16); | 260 | err = __copy_to_user(&sc->sc_fr[32], current->thread.fph, 96*16); |
261 | } | 261 | } |
262 | 262 | ||
263 | nat = ia64_get_scratch_nat_bits(&scr->pt, scr->scratch_unat); | 263 | nat = ia64_get_scratch_nat_bits(&scr->pt, scr->scratch_unat); |
264 | 264 | ||
265 | err = __put_user(flags, &sc->sc_flags); | 265 | err |= __put_user(flags, &sc->sc_flags); |
266 | err |= __put_user(nat, &sc->sc_nat); | 266 | err |= __put_user(nat, &sc->sc_nat); |
267 | err |= PUT_SIGSET(mask, &sc->sc_mask); | 267 | err |= PUT_SIGSET(mask, &sc->sc_mask); |
268 | err |= __put_user(cfm, &sc->sc_cfm); | 268 | err |= __put_user(cfm, &sc->sc_cfm); |
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index 00232b4357ba..757e419ebcf8 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S | |||
@@ -240,11 +240,12 @@ SECTIONS | |||
240 | .sdata : AT(ADDR(.sdata) - LOAD_OFFSET) | 240 | .sdata : AT(ADDR(.sdata) - LOAD_OFFSET) |
241 | { *(.sdata) *(.sdata1) *(.srdata) } | 241 | { *(.sdata) *(.sdata1) *(.srdata) } |
242 | _edata = .; | 242 | _edata = .; |
243 | _bss = .; | 243 | __bss_start = .; |
244 | .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) | 244 | .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) |
245 | { *(.sbss) *(.scommon) } | 245 | { *(.sbss) *(.scommon) } |
246 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) | 246 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) |
247 | { *(.bss) *(COMMON) } | 247 | { *(.bss) *(COMMON) } |
248 | __bss_stop = .; | ||
248 | 249 | ||
249 | _end = .; | 250 | _end = .; |
250 | 251 | ||
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile index 46edf8444c7e..98771e2a78af 100644 --- a/arch/ia64/lib/Makefile +++ b/arch/ia64/lib/Makefile | |||
@@ -11,8 +11,8 @@ lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ | |||
11 | flush.o ip_fast_csum.o do_csum.o \ | 11 | flush.o ip_fast_csum.o do_csum.o \ |
12 | memset.o strlen.o xor.o | 12 | memset.o strlen.o xor.o |
13 | 13 | ||
14 | lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o | 14 | obj-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o |
15 | lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o | 15 | obj-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o |
16 | lib-$(CONFIG_PERFMON) += carta_random.o | 16 | lib-$(CONFIG_PERFMON) += carta_random.o |
17 | 17 | ||
18 | AFLAGS___divdi3.o = | 18 | AFLAGS___divdi3.o = |
diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c index 1682fc639038..cef164729db7 100644 --- a/arch/ia64/mm/tlb.c +++ b/arch/ia64/mm/tlb.c | |||
@@ -180,7 +180,7 @@ ia64_tlb_init (void) | |||
180 | long status; | 180 | long status; |
181 | 181 | ||
182 | if ((status = ia64_pal_vm_page_size(&tr_pgbits, &purge.mask)) != 0) { | 182 | if ((status = ia64_pal_vm_page_size(&tr_pgbits, &purge.mask)) != 0) { |
183 | printk(KERN_ERR "PAL_VM_PAGE_SIZE failed with status=%ld;" | 183 | printk(KERN_ERR "PAL_VM_PAGE_SIZE failed with status=%ld; " |
184 | "defaulting to architected purge page-sizes.\n", status); | 184 | "defaulting to architected purge page-sizes.\n", status); |
185 | purge.mask = 0x115557000UL; | 185 | purge.mask = 0x115557000UL; |
186 | } | 186 | } |
diff --git a/arch/ia64/scripts/unwcheck.py b/arch/ia64/scripts/unwcheck.py index c27849889e19..c27849889e19 100755..100644 --- a/arch/ia64/scripts/unwcheck.py +++ b/arch/ia64/scripts/unwcheck.py | |||
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c index 4594770e685a..c4eb84f9e781 100644 --- a/arch/ia64/sn/kernel/io_common.c +++ b/arch/ia64/sn/kernel/io_common.c | |||
@@ -347,7 +347,7 @@ sn_common_bus_fixup(struct pci_bus *bus, | |||
347 | if (controller->node >= num_online_nodes()) { | 347 | if (controller->node >= num_online_nodes()) { |
348 | struct pcibus_bussoft *b = SN_PCIBUS_BUSSOFT(bus); | 348 | struct pcibus_bussoft *b = SN_PCIBUS_BUSSOFT(bus); |
349 | 349 | ||
350 | printk(KERN_WARNING "Device ASIC=%u XID=%u PBUSNUM=%u" | 350 | printk(KERN_WARNING "Device ASIC=%u XID=%u PBUSNUM=%u " |
351 | "L_IO=%lx L_MEM=%lx BASE=%lx\n", | 351 | "L_IO=%lx L_MEM=%lx BASE=%lx\n", |
352 | b->bs_asic_type, b->bs_xid, b->bs_persist_busnum, | 352 | b->bs_asic_type, b->bs_xid, b->bs_persist_busnum, |
353 | b->bs_legacy_io, b->bs_legacy_mem, b->bs_base); | 353 | b->bs_legacy_io, b->bs_legacy_mem, b->bs_base); |
@@ -545,19 +545,18 @@ sn_io_late_init(void) | |||
545 | nasid = NASID_GET(bussoft->bs_base); | 545 | nasid = NASID_GET(bussoft->bs_base); |
546 | cnode = nasid_to_cnodeid(nasid); | 546 | cnode = nasid_to_cnodeid(nasid); |
547 | if ((bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP) || | 547 | if ((bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP) || |
548 | (bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCE)) { | 548 | (bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCE) || |
549 | /* TIO PCI Bridge: find nearest node with CPUs */ | 549 | (bussoft->bs_asic_type == PCIIO_ASIC_TYPE_PIC)) { |
550 | /* PCI Bridge: find nearest node with CPUs */ | ||
550 | int e = sn_hwperf_get_nearest_node(cnode, NULL, | 551 | int e = sn_hwperf_get_nearest_node(cnode, NULL, |
551 | &near_cnode); | 552 | &near_cnode); |
552 | if (e < 0) { | 553 | if (e < 0) { |
553 | near_cnode = (cnodeid_t)-1; /* use any node */ | 554 | near_cnode = (cnodeid_t)-1; /* use any node */ |
554 | printk(KERN_WARNING "pcibr_bus_fixup: failed " | 555 | printk(KERN_WARNING "sn_io_late_init: failed " |
555 | "to find near node with CPUs to TIO " | 556 | "to find near node with CPUs for " |
556 | "node %d, err=%d\n", cnode, e); | 557 | "node %d, err=%d\n", cnode, e); |
557 | } | 558 | } |
558 | PCI_CONTROLLER(bus)->node = near_cnode; | 559 | PCI_CONTROLLER(bus)->node = near_cnode; |
559 | } else if (bussoft->bs_asic_type == PCIIO_ASIC_TYPE_PIC) { | ||
560 | PCI_CONTROLLER(bus)->node = cnode; | ||
561 | } | 560 | } |
562 | } | 561 | } |
563 | 562 | ||
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c index e43465d34d29..0340a342f772 100644 --- a/arch/powerpc/platforms/chrp/pci.c +++ b/arch/powerpc/platforms/chrp/pci.c | |||
@@ -317,8 +317,12 @@ chrp_find_bridges(void) | |||
317 | /* SL82C105 IDE Control/Status Register */ | 317 | /* SL82C105 IDE Control/Status Register */ |
318 | #define SL82C105_IDECSR 0x40 | 318 | #define SL82C105_IDECSR 0x40 |
319 | 319 | ||
320 | /* Fixup for Winbond ATA quirk, required for briq */ | 320 | /* Fixup for Winbond ATA quirk, required for briq mostly because the |
321 | void chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105) | 321 | * 8259 is configured for level sensitive IRQ 14 and so wants the |
322 | * ATA controller to be set to fully native mode or bad things | ||
323 | * will happen. | ||
324 | */ | ||
325 | static void __devinit chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105) | ||
322 | { | 326 | { |
323 | u8 progif; | 327 | u8 progif; |
324 | 328 | ||
@@ -334,10 +338,15 @@ void chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105) | |||
334 | sl82c105->class |= 0x05; | 338 | sl82c105->class |= 0x05; |
335 | /* Disable SL82C105 second port */ | 339 | /* Disable SL82C105 second port */ |
336 | pci_write_config_word(sl82c105, SL82C105_IDECSR, 0x0003); | 340 | pci_write_config_word(sl82c105, SL82C105_IDECSR, 0x0003); |
341 | /* Clear IO BARs, they will be reassigned */ | ||
342 | pci_write_config_dword(sl82c105, PCI_BASE_ADDRESS_0, 0); | ||
343 | pci_write_config_dword(sl82c105, PCI_BASE_ADDRESS_1, 0); | ||
344 | pci_write_config_dword(sl82c105, PCI_BASE_ADDRESS_2, 0); | ||
345 | pci_write_config_dword(sl82c105, PCI_BASE_ADDRESS_3, 0); | ||
337 | } | 346 | } |
338 | } | 347 | } |
339 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, | 348 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, |
340 | chrp_pci_fixup_winbond_ata); | 349 | chrp_pci_fixup_winbond_ata); |
341 | 350 | ||
342 | /* Pegasos2 firmware version 20040810 configures the built-in IDE controller | 351 | /* Pegasos2 firmware version 20040810 configures the built-in IDE controller |
343 | * in legacy mode, but sets the PCI registers to PCI native mode. | 352 | * in legacy mode, but sets the PCI registers to PCI native mode. |
@@ -345,7 +354,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, | |||
345 | * mode as well. The same fixup must be done to the class-code property in | 354 | * mode as well. The same fixup must be done to the class-code property in |
346 | * the IDE node /pci@80000000/ide@C,1 | 355 | * the IDE node /pci@80000000/ide@C,1 |
347 | */ | 356 | */ |
348 | static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide) | 357 | static void __devinit chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide) |
349 | { | 358 | { |
350 | u8 progif; | 359 | u8 progif; |
351 | struct pci_dev *viaisa; | 360 | struct pci_dev *viaisa; |
@@ -366,4 +375,4 @@ static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide) | |||
366 | 375 | ||
367 | pci_dev_put(viaisa); | 376 | pci_dev_put(viaisa); |
368 | } | 377 | } |
369 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, chrp_pci_fixup_vt8231_ata); | 378 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, chrp_pci_fixup_vt8231_ata); |
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index ec49099830d5..f852ae3e0ee4 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -1243,15 +1243,22 @@ void pmac_pci_fixup_pciata(struct pci_dev* dev) | |||
1243 | good: | 1243 | good: |
1244 | pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); | 1244 | pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); |
1245 | if ((progif & 5) != 5) { | 1245 | if ((progif & 5) != 5) { |
1246 | printk(KERN_INFO "Forcing PCI IDE into native mode: %s\n", | 1246 | printk(KERN_INFO "PCI: %s Forcing PCI IDE into native mode\n", |
1247 | pci_name(dev)); | 1247 | pci_name(dev)); |
1248 | (void) pci_write_config_byte(dev, PCI_CLASS_PROG, progif|5); | 1248 | (void) pci_write_config_byte(dev, PCI_CLASS_PROG, progif|5); |
1249 | if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) || | 1249 | if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) || |
1250 | (progif & 5) != 5) | 1250 | (progif & 5) != 5) |
1251 | printk(KERN_ERR "Rewrite of PROGIF failed !\n"); | 1251 | printk(KERN_ERR "Rewrite of PROGIF failed !\n"); |
1252 | else { | ||
1253 | /* Clear IO BARs, they will be reassigned */ | ||
1254 | pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, 0); | ||
1255 | pci_write_config_dword(dev, PCI_BASE_ADDRESS_1, 0); | ||
1256 | pci_write_config_dword(dev, PCI_BASE_ADDRESS_2, 0); | ||
1257 | pci_write_config_dword(dev, PCI_BASE_ADDRESS_3, 0); | ||
1258 | } | ||
1252 | } | 1259 | } |
1253 | } | 1260 | } |
1254 | DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata); | 1261 | DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata); |
1255 | #endif | 1262 | #endif |
1256 | 1263 | ||
1257 | /* | 1264 | /* |
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index b1d00ef6659c..ad00b3d94711 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | #include <linux/hdreg.h> | 7 | #include <linux/hdreg.h> |
8 | #include <linux/blkdev.h> | 8 | #include <linux/blkdev.h> |
9 | #include <linux/backing-dev.h> | ||
9 | #include <linux/fs.h> | 10 | #include <linux/fs.h> |
10 | #include <linux/ioctl.h> | 11 | #include <linux/ioctl.h> |
11 | #include <linux/genhd.h> | 12 | #include <linux/genhd.h> |
@@ -210,25 +211,20 @@ aoeblk_gdalloc(void *vp) | |||
210 | if (gd == NULL) { | 211 | if (gd == NULL) { |
211 | printk(KERN_ERR "aoe: cannot allocate disk structure for %ld.%ld\n", | 212 | printk(KERN_ERR "aoe: cannot allocate disk structure for %ld.%ld\n", |
212 | d->aoemajor, d->aoeminor); | 213 | d->aoemajor, d->aoeminor); |
213 | spin_lock_irqsave(&d->lock, flags); | 214 | goto err; |
214 | d->flags &= ~DEVFL_GDALLOC; | ||
215 | spin_unlock_irqrestore(&d->lock, flags); | ||
216 | return; | ||
217 | } | 215 | } |
218 | 216 | ||
219 | d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache); | 217 | d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache); |
220 | if (d->bufpool == NULL) { | 218 | if (d->bufpool == NULL) { |
221 | printk(KERN_ERR "aoe: cannot allocate bufpool for %ld.%ld\n", | 219 | printk(KERN_ERR "aoe: cannot allocate bufpool for %ld.%ld\n", |
222 | d->aoemajor, d->aoeminor); | 220 | d->aoemajor, d->aoeminor); |
223 | put_disk(gd); | 221 | goto err_disk; |
224 | spin_lock_irqsave(&d->lock, flags); | ||
225 | d->flags &= ~DEVFL_GDALLOC; | ||
226 | spin_unlock_irqrestore(&d->lock, flags); | ||
227 | return; | ||
228 | } | 222 | } |
229 | 223 | ||
230 | spin_lock_irqsave(&d->lock, flags); | ||
231 | blk_queue_make_request(&d->blkq, aoeblk_make_request); | 224 | blk_queue_make_request(&d->blkq, aoeblk_make_request); |
225 | if (bdi_init(&d->blkq.backing_dev_info)) | ||
226 | goto err_mempool; | ||
227 | spin_lock_irqsave(&d->lock, flags); | ||
232 | gd->major = AOE_MAJOR; | 228 | gd->major = AOE_MAJOR; |
233 | gd->first_minor = d->sysminor * AOE_PARTITIONS; | 229 | gd->first_minor = d->sysminor * AOE_PARTITIONS; |
234 | gd->fops = &aoe_bdops; | 230 | gd->fops = &aoe_bdops; |
@@ -246,6 +242,16 @@ aoeblk_gdalloc(void *vp) | |||
246 | 242 | ||
247 | add_disk(gd); | 243 | add_disk(gd); |
248 | aoedisk_add_sysfs(d); | 244 | aoedisk_add_sysfs(d); |
245 | return; | ||
246 | |||
247 | err_mempool: | ||
248 | mempool_destroy(d->bufpool); | ||
249 | err_disk: | ||
250 | put_disk(gd); | ||
251 | err: | ||
252 | spin_lock_irqsave(&d->lock, flags); | ||
253 | d->flags &= ~DEVFL_GDALLOC; | ||
254 | spin_unlock_irqrestore(&d->lock, flags); | ||
249 | } | 255 | } |
250 | 256 | ||
251 | void | 257 | void |
diff --git a/drivers/block/umem.c b/drivers/block/umem.c index 99806f9ee4ce..5f5095afb06b 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c | |||
@@ -484,7 +484,8 @@ static void process_page(unsigned long data) | |||
484 | page->idx++; | 484 | page->idx++; |
485 | if (page->idx >= bio->bi_vcnt) { | 485 | if (page->idx >= bio->bi_vcnt) { |
486 | page->bio = bio->bi_next; | 486 | page->bio = bio->bi_next; |
487 | page->idx = page->bio->bi_idx; | 487 | if (page->bio) |
488 | page->idx = page->bio->bi_idx; | ||
488 | } | 489 | } |
489 | 490 | ||
490 | pci_unmap_page(card->dev, desc->data_dma_handle, | 491 | pci_unmap_page(card->dev, desc->data_dma_handle, |
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c index c9b9081831da..436a855a4c60 100644 --- a/drivers/firewire/fw-ohci.c +++ b/drivers/firewire/fw-ohci.c | |||
@@ -437,6 +437,21 @@ static void ar_context_run(struct ar_context *ctx) | |||
437 | flush_writes(ctx->ohci); | 437 | flush_writes(ctx->ohci); |
438 | } | 438 | } |
439 | 439 | ||
440 | static struct descriptor * | ||
441 | find_branch_descriptor(struct descriptor *d, int z) | ||
442 | { | ||
443 | int b, key; | ||
444 | |||
445 | b = (le16_to_cpu(d->control) & DESCRIPTOR_BRANCH_ALWAYS) >> 2; | ||
446 | key = (le16_to_cpu(d->control) & DESCRIPTOR_KEY_IMMEDIATE) >> 8; | ||
447 | |||
448 | /* figure out which descriptor the branch address goes in */ | ||
449 | if (z == 2 && (b == 3 || key == 2)) | ||
450 | return d; | ||
451 | else | ||
452 | return d + z - 1; | ||
453 | } | ||
454 | |||
440 | static void context_tasklet(unsigned long data) | 455 | static void context_tasklet(unsigned long data) |
441 | { | 456 | { |
442 | struct context *ctx = (struct context *) data; | 457 | struct context *ctx = (struct context *) data; |
@@ -455,7 +470,7 @@ static void context_tasklet(unsigned long data) | |||
455 | address = le32_to_cpu(last->branch_address); | 470 | address = le32_to_cpu(last->branch_address); |
456 | z = address & 0xf; | 471 | z = address & 0xf; |
457 | d = ctx->buffer + (address - ctx->buffer_bus) / sizeof(*d); | 472 | d = ctx->buffer + (address - ctx->buffer_bus) / sizeof(*d); |
458 | last = (z == 2) ? d : d + z - 1; | 473 | last = find_branch_descriptor(d, z); |
459 | 474 | ||
460 | if (!ctx->callback(ctx, d, last)) | 475 | if (!ctx->callback(ctx, d, last)) |
461 | break; | 476 | break; |
@@ -566,7 +581,7 @@ static void context_append(struct context *ctx, | |||
566 | 581 | ||
567 | ctx->head_descriptor = d + z + extra; | 582 | ctx->head_descriptor = d + z + extra; |
568 | ctx->prev_descriptor->branch_address = cpu_to_le32(d_bus | z); | 583 | ctx->prev_descriptor->branch_address = cpu_to_le32(d_bus | z); |
569 | ctx->prev_descriptor = z == 2 ? d : d + z - 1; | 584 | ctx->prev_descriptor = find_branch_descriptor(d, z); |
570 | 585 | ||
571 | dma_sync_single_for_device(ctx->ohci->card.device, ctx->buffer_bus, | 586 | dma_sync_single_for_device(ctx->ohci->card.device, ctx->buffer_bus, |
572 | ctx->buffer_size, DMA_TO_DEVICE); | 587 | ctx->buffer_size, DMA_TO_DEVICE); |
@@ -655,7 +670,7 @@ at_context_queue_packet(struct context *ctx, struct fw_packet *packet) | |||
655 | driver_data = (struct driver_data *) &d[3]; | 670 | driver_data = (struct driver_data *) &d[3]; |
656 | driver_data->packet = packet; | 671 | driver_data->packet = packet; |
657 | packet->driver_data = driver_data; | 672 | packet->driver_data = driver_data; |
658 | 673 | ||
659 | if (packet->payload_length > 0) { | 674 | if (packet->payload_length > 0) { |
660 | payload_bus = | 675 | payload_bus = |
661 | dma_map_single(ohci->card.device, packet->payload, | 676 | dma_map_single(ohci->card.device, packet->payload, |
@@ -903,7 +918,7 @@ at_context_transmit(struct context *ctx, struct fw_packet *packet) | |||
903 | 918 | ||
904 | if (retval < 0) | 919 | if (retval < 0) |
905 | packet->callback(packet, &ctx->ohci->card, packet->ack); | 920 | packet->callback(packet, &ctx->ohci->card, packet->ack); |
906 | 921 | ||
907 | } | 922 | } |
908 | 923 | ||
909 | static void bus_reset_tasklet(unsigned long data) | 924 | static void bus_reset_tasklet(unsigned long data) |
@@ -1431,6 +1446,57 @@ static int handle_ir_dualbuffer_packet(struct context *context, | |||
1431 | return 1; | 1446 | return 1; |
1432 | } | 1447 | } |
1433 | 1448 | ||
1449 | static int handle_ir_packet_per_buffer(struct context *context, | ||
1450 | struct descriptor *d, | ||
1451 | struct descriptor *last) | ||
1452 | { | ||
1453 | struct iso_context *ctx = | ||
1454 | container_of(context, struct iso_context, context); | ||
1455 | struct descriptor *pd = d + 1; | ||
1456 | __le32 *ir_header; | ||
1457 | size_t header_length; | ||
1458 | void *p, *end; | ||
1459 | int i, z; | ||
1460 | |||
1461 | if (pd->res_count == pd->req_count) | ||
1462 | /* Descriptor(s) not done yet, stop iteration */ | ||
1463 | return 0; | ||
1464 | |||
1465 | header_length = le16_to_cpu(d->req_count); | ||
1466 | |||
1467 | i = ctx->header_length; | ||
1468 | z = le32_to_cpu(pd->branch_address) & 0xf; | ||
1469 | p = d + z; | ||
1470 | end = p + header_length; | ||
1471 | |||
1472 | while (p < end && i + ctx->base.header_size <= PAGE_SIZE) { | ||
1473 | /* | ||
1474 | * The iso header is byteswapped to little endian by | ||
1475 | * the controller, but the remaining header quadlets | ||
1476 | * are big endian. We want to present all the headers | ||
1477 | * as big endian, so we have to swap the first quadlet. | ||
1478 | */ | ||
1479 | *(u32 *) (ctx->header + i) = __swab32(*(u32 *) (p + 4)); | ||
1480 | memcpy(ctx->header + i + 4, p + 8, ctx->base.header_size - 4); | ||
1481 | i += ctx->base.header_size; | ||
1482 | p += ctx->base.header_size + 4; | ||
1483 | } | ||
1484 | |||
1485 | ctx->header_length = i; | ||
1486 | |||
1487 | if (le16_to_cpu(pd->control) & DESCRIPTOR_IRQ_ALWAYS) { | ||
1488 | ir_header = (__le32 *) (d + z); | ||
1489 | ctx->base.callback(&ctx->base, | ||
1490 | le32_to_cpu(ir_header[0]) & 0xffff, | ||
1491 | ctx->header_length, ctx->header, | ||
1492 | ctx->base.callback_data); | ||
1493 | ctx->header_length = 0; | ||
1494 | } | ||
1495 | |||
1496 | |||
1497 | return 1; | ||
1498 | } | ||
1499 | |||
1434 | static int handle_it_packet(struct context *context, | 1500 | static int handle_it_packet(struct context *context, |
1435 | struct descriptor *d, | 1501 | struct descriptor *d, |
1436 | struct descriptor *last) | 1502 | struct descriptor *last) |
@@ -1466,14 +1532,12 @@ ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size) | |||
1466 | } else { | 1532 | } else { |
1467 | mask = &ohci->ir_context_mask; | 1533 | mask = &ohci->ir_context_mask; |
1468 | list = ohci->ir_context_list; | 1534 | list = ohci->ir_context_list; |
1469 | callback = handle_ir_dualbuffer_packet; | 1535 | if (ohci->version >= OHCI_VERSION_1_1) |
1536 | callback = handle_ir_dualbuffer_packet; | ||
1537 | else | ||
1538 | callback = handle_ir_packet_per_buffer; | ||
1470 | } | 1539 | } |
1471 | 1540 | ||
1472 | /* FIXME: We need a fallback for pre 1.1 OHCI. */ | ||
1473 | if (callback == handle_ir_dualbuffer_packet && | ||
1474 | ohci->version < OHCI_VERSION_1_1) | ||
1475 | return ERR_PTR(-ENOSYS); | ||
1476 | |||
1477 | spin_lock_irqsave(&ohci->lock, flags); | 1541 | spin_lock_irqsave(&ohci->lock, flags); |
1478 | index = ffs(*mask) - 1; | 1542 | index = ffs(*mask) - 1; |
1479 | if (index >= 0) | 1543 | if (index >= 0) |
@@ -1532,7 +1596,9 @@ static int ohci_start_iso(struct fw_iso_context *base, | |||
1532 | context_run(&ctx->context, match); | 1596 | context_run(&ctx->context, match); |
1533 | } else { | 1597 | } else { |
1534 | index = ctx - ohci->ir_context_list; | 1598 | index = ctx - ohci->ir_context_list; |
1535 | control = IR_CONTEXT_DUAL_BUFFER_MODE | IR_CONTEXT_ISOCH_HEADER; | 1599 | control = IR_CONTEXT_ISOCH_HEADER; |
1600 | if (ohci->version >= OHCI_VERSION_1_1) | ||
1601 | control |= IR_CONTEXT_DUAL_BUFFER_MODE; | ||
1536 | match = (tags << 28) | (sync << 8) | ctx->base.channel; | 1602 | match = (tags << 28) | (sync << 8) | ctx->base.channel; |
1537 | if (cycle >= 0) { | 1603 | if (cycle >= 0) { |
1538 | match |= (cycle & 0x07fff) << 12; | 1604 | match |= (cycle & 0x07fff) << 12; |
@@ -1738,7 +1804,6 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base, | |||
1738 | offset = payload & ~PAGE_MASK; | 1804 | offset = payload & ~PAGE_MASK; |
1739 | rest = p->payload_length; | 1805 | rest = p->payload_length; |
1740 | 1806 | ||
1741 | /* FIXME: OHCI 1.0 doesn't support dual buffer receive */ | ||
1742 | /* FIXME: make packet-per-buffer/dual-buffer a context option */ | 1807 | /* FIXME: make packet-per-buffer/dual-buffer a context option */ |
1743 | while (rest > 0) { | 1808 | while (rest > 0) { |
1744 | d = context_get_descriptors(&ctx->context, | 1809 | d = context_get_descriptors(&ctx->context, |
@@ -1777,6 +1842,81 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base, | |||
1777 | } | 1842 | } |
1778 | 1843 | ||
1779 | static int | 1844 | static int |
1845 | ohci_queue_iso_receive_packet_per_buffer(struct fw_iso_context *base, | ||
1846 | struct fw_iso_packet *packet, | ||
1847 | struct fw_iso_buffer *buffer, | ||
1848 | unsigned long payload) | ||
1849 | { | ||
1850 | struct iso_context *ctx = container_of(base, struct iso_context, base); | ||
1851 | struct descriptor *d = NULL, *pd = NULL; | ||
1852 | struct fw_iso_packet *p; | ||
1853 | dma_addr_t d_bus, page_bus; | ||
1854 | u32 z, header_z, rest; | ||
1855 | int i, page, offset, packet_count, header_size; | ||
1856 | |||
1857 | if (packet->skip) { | ||
1858 | d = context_get_descriptors(&ctx->context, 1, &d_bus); | ||
1859 | if (d == NULL) | ||
1860 | return -ENOMEM; | ||
1861 | |||
1862 | d->control = cpu_to_le16(DESCRIPTOR_STATUS | | ||
1863 | DESCRIPTOR_INPUT_LAST | | ||
1864 | DESCRIPTOR_BRANCH_ALWAYS | | ||
1865 | DESCRIPTOR_WAIT); | ||
1866 | context_append(&ctx->context, d, 1, 0); | ||
1867 | } | ||
1868 | |||
1869 | /* one descriptor for header, one for payload */ | ||
1870 | /* FIXME: handle cases where we need multiple desc. for payload */ | ||
1871 | z = 2; | ||
1872 | p = packet; | ||
1873 | |||
1874 | /* | ||
1875 | * The OHCI controller puts the status word in the | ||
1876 | * buffer too, so we need 4 extra bytes per packet. | ||
1877 | */ | ||
1878 | packet_count = p->header_length / ctx->base.header_size; | ||
1879 | header_size = packet_count * (ctx->base.header_size + 4); | ||
1880 | |||
1881 | /* Get header size in number of descriptors. */ | ||
1882 | header_z = DIV_ROUND_UP(header_size, sizeof(*d)); | ||
1883 | page = payload >> PAGE_SHIFT; | ||
1884 | offset = payload & ~PAGE_MASK; | ||
1885 | rest = p->payload_length; | ||
1886 | |||
1887 | for (i = 0; i < packet_count; i++) { | ||
1888 | /* d points to the header descriptor */ | ||
1889 | d = context_get_descriptors(&ctx->context, | ||
1890 | z + header_z, &d_bus); | ||
1891 | if (d == NULL) | ||
1892 | return -ENOMEM; | ||
1893 | |||
1894 | d->control = cpu_to_le16(DESCRIPTOR_INPUT_MORE); | ||
1895 | d->req_count = cpu_to_le16(header_size); | ||
1896 | d->res_count = d->req_count; | ||
1897 | d->data_address = cpu_to_le32(d_bus + (z * sizeof(*d))); | ||
1898 | |||
1899 | /* pd points to the payload descriptor */ | ||
1900 | pd = d + 1; | ||
1901 | pd->control = cpu_to_le16(DESCRIPTOR_STATUS | | ||
1902 | DESCRIPTOR_INPUT_LAST | | ||
1903 | DESCRIPTOR_BRANCH_ALWAYS); | ||
1904 | if (p->interrupt) | ||
1905 | pd->control |= cpu_to_le16(DESCRIPTOR_IRQ_ALWAYS); | ||
1906 | |||
1907 | pd->req_count = cpu_to_le16(rest); | ||
1908 | pd->res_count = pd->req_count; | ||
1909 | |||
1910 | page_bus = page_private(buffer->pages[page]); | ||
1911 | pd->data_address = cpu_to_le32(page_bus + offset); | ||
1912 | |||
1913 | context_append(&ctx->context, d, z, header_z); | ||
1914 | } | ||
1915 | |||
1916 | return 0; | ||
1917 | } | ||
1918 | |||
1919 | static int | ||
1780 | ohci_queue_iso(struct fw_iso_context *base, | 1920 | ohci_queue_iso(struct fw_iso_context *base, |
1781 | struct fw_iso_packet *packet, | 1921 | struct fw_iso_packet *packet, |
1782 | struct fw_iso_buffer *buffer, | 1922 | struct fw_iso_buffer *buffer, |
@@ -1790,8 +1930,9 @@ ohci_queue_iso(struct fw_iso_context *base, | |||
1790 | return ohci_queue_iso_receive_dualbuffer(base, packet, | 1930 | return ohci_queue_iso_receive_dualbuffer(base, packet, |
1791 | buffer, payload); | 1931 | buffer, payload); |
1792 | else | 1932 | else |
1793 | /* FIXME: Implement fallback for OHCI 1.0 controllers. */ | 1933 | return ohci_queue_iso_receive_packet_per_buffer(base, packet, |
1794 | return -ENOSYS; | 1934 | buffer, |
1935 | payload); | ||
1795 | } | 1936 | } |
1796 | 1937 | ||
1797 | static const struct fw_card_driver ohci_driver = { | 1938 | static const struct fw_card_driver ohci_driver = { |
@@ -1911,12 +2052,6 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) | |||
1911 | ohci->version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff; | 2052 | ohci->version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff; |
1912 | fw_notify("Added fw-ohci device %s, OHCI version %x.%x\n", | 2053 | fw_notify("Added fw-ohci device %s, OHCI version %x.%x\n", |
1913 | dev->dev.bus_id, ohci->version >> 16, ohci->version & 0xff); | 2054 | dev->dev.bus_id, ohci->version >> 16, ohci->version & 0xff); |
1914 | if (ohci->version < OHCI_VERSION_1_1) { | ||
1915 | fw_notify(" Isochronous I/O is not yet implemented for " | ||
1916 | "OHCI 1.0 chips.\n"); | ||
1917 | fw_notify(" Cameras, audio devices etc. won't work on " | ||
1918 | "this controller with this driver version.\n"); | ||
1919 | } | ||
1920 | return 0; | 2055 | return 0; |
1921 | 2056 | ||
1922 | fail_self_id: | 2057 | fail_self_id: |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 463a5a9d583d..c2f8a78c894c 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -743,46 +743,22 @@ static int pci_setup_device(struct pci_dev * dev) | |||
743 | */ | 743 | */ |
744 | if (class == PCI_CLASS_STORAGE_IDE) { | 744 | if (class == PCI_CLASS_STORAGE_IDE) { |
745 | u8 progif; | 745 | u8 progif; |
746 | struct pci_bus_region region; | ||
747 | |||
748 | pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); | 746 | pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); |
749 | if ((progif & 1) == 0) { | 747 | if ((progif & 1) == 0) { |
750 | struct resource resource = { | 748 | dev->resource[0].start = 0x1F0; |
751 | .start = 0x1F0, | 749 | dev->resource[0].end = 0x1F7; |
752 | .end = 0x1F7, | 750 | dev->resource[0].flags = LEGACY_IO_RESOURCE; |
753 | .flags = LEGACY_IO_RESOURCE, | 751 | dev->resource[1].start = 0x3F6; |
754 | }; | 752 | dev->resource[1].end = 0x3F6; |
755 | 753 | dev->resource[1].flags = LEGACY_IO_RESOURCE; | |
756 | pcibios_resource_to_bus(dev, ®ion, &resource); | ||
757 | dev->resource[0].start = region.start; | ||
758 | dev->resource[0].end = region.end; | ||
759 | dev->resource[0].flags = resource.flags; | ||
760 | resource.start = 0x3F6; | ||
761 | resource.end = 0x3F6; | ||
762 | resource.flags = LEGACY_IO_RESOURCE; | ||
763 | pcibios_resource_to_bus(dev, ®ion, &resource); | ||
764 | dev->resource[1].start = region.start; | ||
765 | dev->resource[1].end = region.end; | ||
766 | dev->resource[1].flags = resource.flags; | ||
767 | } | 754 | } |
768 | if ((progif & 4) == 0) { | 755 | if ((progif & 4) == 0) { |
769 | struct resource resource = { | 756 | dev->resource[2].start = 0x170; |
770 | .start = 0x170, | 757 | dev->resource[2].end = 0x177; |
771 | .end = 0x177, | 758 | dev->resource[2].flags = LEGACY_IO_RESOURCE; |
772 | .flags = LEGACY_IO_RESOURCE, | 759 | dev->resource[3].start = 0x376; |
773 | }; | 760 | dev->resource[3].end = 0x376; |
774 | 761 | dev->resource[3].flags = LEGACY_IO_RESOURCE; | |
775 | pcibios_resource_to_bus(dev, ®ion, &resource); | ||
776 | dev->resource[2].start = region.start; | ||
777 | dev->resource[2].end = region.end; | ||
778 | dev->resource[2].flags = resource.flags; | ||
779 | resource.start = 0x376; | ||
780 | resource.end = 0x376; | ||
781 | resource.flags = LEGACY_IO_RESOURCE; | ||
782 | pcibios_resource_to_bus(dev, ®ion, &resource); | ||
783 | dev->resource[3].start = region.start; | ||
784 | dev->resource[3].end = region.end; | ||
785 | dev->resource[3].flags = resource.flags; | ||
786 | } | 762 | } |
787 | } | 763 | } |
788 | break; | 764 | break; |
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index a0aca46ce877..56230dbd347a 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c | |||
@@ -89,7 +89,7 @@ DECLARE_RWSEM(pcmcia_socket_list_rwsem); | |||
89 | EXPORT_SYMBOL(pcmcia_socket_list_rwsem); | 89 | EXPORT_SYMBOL(pcmcia_socket_list_rwsem); |
90 | 90 | ||
91 | 91 | ||
92 | /** | 92 | /* |
93 | * Low-level PCMCIA socket drivers need to register with the PCCard | 93 | * Low-level PCMCIA socket drivers need to register with the PCCard |
94 | * core using pcmcia_register_socket. | 94 | * core using pcmcia_register_socket. |
95 | * | 95 | * |
@@ -174,6 +174,7 @@ static int pccardd(void *__skt); | |||
174 | 174 | ||
175 | /** | 175 | /** |
176 | * pcmcia_register_socket - add a new pcmcia socket device | 176 | * pcmcia_register_socket - add a new pcmcia socket device |
177 | * @socket: the &socket to register | ||
177 | */ | 178 | */ |
178 | int pcmcia_register_socket(struct pcmcia_socket *socket) | 179 | int pcmcia_register_socket(struct pcmcia_socket *socket) |
179 | { | 180 | { |
@@ -268,6 +269,7 @@ EXPORT_SYMBOL(pcmcia_register_socket); | |||
268 | 269 | ||
269 | /** | 270 | /** |
270 | * pcmcia_unregister_socket - remove a pcmcia socket device | 271 | * pcmcia_unregister_socket - remove a pcmcia socket device |
272 | * @socket: the &socket to unregister | ||
271 | */ | 273 | */ |
272 | void pcmcia_unregister_socket(struct pcmcia_socket *socket) | 274 | void pcmcia_unregister_socket(struct pcmcia_socket *socket) |
273 | { | 275 | { |
@@ -311,7 +313,7 @@ struct pcmcia_socket * pcmcia_get_socket_by_nr(unsigned int nr) | |||
311 | } | 313 | } |
312 | EXPORT_SYMBOL(pcmcia_get_socket_by_nr); | 314 | EXPORT_SYMBOL(pcmcia_get_socket_by_nr); |
313 | 315 | ||
314 | /** | 316 | /* |
315 | * The central event handler. Send_event() sends an event to the | 317 | * The central event handler. Send_event() sends an event to the |
316 | * 16-bit subsystem, which then calls the relevant device drivers. | 318 | * 16-bit subsystem, which then calls the relevant device drivers. |
317 | * Parse_events() interprets the event bits from | 319 | * Parse_events() interprets the event bits from |
@@ -380,7 +382,7 @@ static int socket_reset(struct pcmcia_socket *skt) | |||
380 | return CS_GENERAL_FAILURE; | 382 | return CS_GENERAL_FAILURE; |
381 | } | 383 | } |
382 | 384 | ||
383 | /** | 385 | /* |
384 | * socket_setup() and socket_shutdown() are called by the main event handler | 386 | * socket_setup() and socket_shutdown() are called by the main event handler |
385 | * when card insertion and removal events are received. | 387 | * when card insertion and removal events are received. |
386 | * socket_setup() turns on socket power and resets the socket, in two stages. | 388 | * socket_setup() turns on socket power and resets the socket, in two stages. |
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 7bf78c127898..5cf89a91da1e 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -320,6 +320,7 @@ pcmcia_create_newid_file(struct pcmcia_driver *drv) | |||
320 | 320 | ||
321 | /** | 321 | /** |
322 | * pcmcia_register_driver - register a PCMCIA driver with the bus core | 322 | * pcmcia_register_driver - register a PCMCIA driver with the bus core |
323 | * @driver: the &driver being registered | ||
323 | * | 324 | * |
324 | * Registers a PCMCIA driver with the PCMCIA bus core. | 325 | * Registers a PCMCIA driver with the PCMCIA bus core. |
325 | */ | 326 | */ |
@@ -354,6 +355,7 @@ EXPORT_SYMBOL(pcmcia_register_driver); | |||
354 | 355 | ||
355 | /** | 356 | /** |
356 | * pcmcia_unregister_driver - unregister a PCMCIA driver with the bus core | 357 | * pcmcia_unregister_driver - unregister a PCMCIA driver with the bus core |
358 | * @driver: the &driver being unregistered | ||
357 | */ | 359 | */ |
358 | void pcmcia_unregister_driver(struct pcmcia_driver *driver) | 360 | void pcmcia_unregister_driver(struct pcmcia_driver *driver) |
359 | { | 361 | { |
@@ -840,8 +842,8 @@ static void pcmcia_bus_rescan(struct pcmcia_socket *skt, int new_cis) | |||
840 | 842 | ||
841 | /** | 843 | /** |
842 | * pcmcia_load_firmware - load CIS from userspace if device-provided is broken | 844 | * pcmcia_load_firmware - load CIS from userspace if device-provided is broken |
843 | * @dev - the pcmcia device which needs a CIS override | 845 | * @dev: the pcmcia device which needs a CIS override |
844 | * @filename - requested filename in /lib/firmware/ | 846 | * @filename: requested filename in /lib/firmware/ |
845 | * | 847 | * |
846 | * This uses the in-kernel firmware loading mechanism to use a "fake CIS" if | 848 | * This uses the in-kernel firmware loading mechanism to use a "fake CIS" if |
847 | * the one provided by the card is broken. The firmware files reside in | 849 | * the one provided by the card is broken. The firmware files reside in |
diff --git a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h index 62e9ebf967f9..d29657bf1b40 100644 --- a/drivers/pcmcia/ti113x.h +++ b/drivers/pcmcia/ti113x.h | |||
@@ -874,7 +874,7 @@ static int ti1250_override(struct yenta_socket *socket) | |||
874 | */ | 874 | */ |
875 | 875 | ||
876 | #ifdef CONFIG_YENTA_ENE_TUNE | 876 | #ifdef CONFIG_YENTA_ENE_TUNE |
877 | /** | 877 | /* |
878 | * set/clear various test bits: | 878 | * set/clear various test bits: |
879 | * Defaults to clear the bit. | 879 | * Defaults to clear the bit. |
880 | * - mask (u8) defines what bits to change | 880 | * - mask (u8) defines what bits to change |
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 20853a03202d..0ab1fb65cdc3 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -48,7 +48,7 @@ MODULE_PARM_DESC(pwr_irqs_off, "Force IRQs off during power-on of slot. Use only | |||
48 | #define to_cycles(ns) ((ns)/120) | 48 | #define to_cycles(ns) ((ns)/120) |
49 | #define to_ns(cycles) ((cycles)*120) | 49 | #define to_ns(cycles) ((cycles)*120) |
50 | 50 | ||
51 | /** | 51 | /* |
52 | * yenta PCI irq probing. | 52 | * yenta PCI irq probing. |
53 | * currently only used in the TI/EnE initialization code | 53 | * currently only used in the TI/EnE initialization code |
54 | */ | 54 | */ |
@@ -888,7 +888,7 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas | |||
888 | } | 888 | } |
889 | 889 | ||
890 | 890 | ||
891 | /** | 891 | /* |
892 | * yenta PCI irq probing. | 892 | * yenta PCI irq probing. |
893 | * currently only used in the TI/EnE initialization code | 893 | * currently only used in the TI/EnE initialization code |
894 | */ | 894 | */ |
@@ -1012,7 +1012,7 @@ static void yenta_config_init(struct yenta_socket *socket) | |||
1012 | * invisible during PCI scans because of a misconfigured subordinate number | 1012 | * invisible during PCI scans because of a misconfigured subordinate number |
1013 | * of the parent brige - some BIOSes seem to be too lazy to set it right. | 1013 | * of the parent brige - some BIOSes seem to be too lazy to set it right. |
1014 | * Does the fixup carefully by checking how far it can go without conflicts. | 1014 | * Does the fixup carefully by checking how far it can go without conflicts. |
1015 | * See http://bugzilla.kernel.org/show_bug.cgi?id=2944 for more information. | 1015 | * See http\://bugzilla.kernel.org/show_bug.cgi?id=2944 for more information. |
1016 | */ | 1016 | */ |
1017 | static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) | 1017 | static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) |
1018 | { | 1018 | { |
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 8258506ba7d7..70f48a1a6d58 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -173,20 +173,20 @@ static struct pci_device_id dptids[] = { | |||
173 | }; | 173 | }; |
174 | MODULE_DEVICE_TABLE(pci,dptids); | 174 | MODULE_DEVICE_TABLE(pci,dptids); |
175 | 175 | ||
176 | static void adpt_exit(void); | 176 | static int adpt_detect(struct scsi_host_template* sht) |
177 | |||
178 | static int adpt_detect(void) | ||
179 | { | 177 | { |
180 | struct pci_dev *pDev = NULL; | 178 | struct pci_dev *pDev = NULL; |
181 | adpt_hba* pHba; | 179 | adpt_hba* pHba; |
182 | 180 | ||
181 | adpt_init(); | ||
182 | |||
183 | PINFO("Detecting Adaptec I2O RAID controllers...\n"); | 183 | PINFO("Detecting Adaptec I2O RAID controllers...\n"); |
184 | 184 | ||
185 | /* search for all Adatpec I2O RAID cards */ | 185 | /* search for all Adatpec I2O RAID cards */ |
186 | while ((pDev = pci_get_device( PCI_DPT_VENDOR_ID, PCI_ANY_ID, pDev))) { | 186 | while ((pDev = pci_get_device( PCI_DPT_VENDOR_ID, PCI_ANY_ID, pDev))) { |
187 | if(pDev->device == PCI_DPT_DEVICE_ID || | 187 | if(pDev->device == PCI_DPT_DEVICE_ID || |
188 | pDev->device == PCI_DPT_RAPTOR_DEVICE_ID){ | 188 | pDev->device == PCI_DPT_RAPTOR_DEVICE_ID){ |
189 | if(adpt_install_hba(pDev) ){ | 189 | if(adpt_install_hba(sht, pDev) ){ |
190 | PERROR("Could not Init an I2O RAID device\n"); | 190 | PERROR("Could not Init an I2O RAID device\n"); |
191 | PERROR("Will not try to detect others.\n"); | 191 | PERROR("Will not try to detect others.\n"); |
192 | return hba_count-1; | 192 | return hba_count-1; |
@@ -248,33 +248,34 @@ rebuild_sys_tab: | |||
248 | } | 248 | } |
249 | 249 | ||
250 | for (pHba = hba_chain; pHba; pHba = pHba->next) { | 250 | for (pHba = hba_chain; pHba; pHba = pHba->next) { |
251 | if (adpt_scsi_register(pHba) < 0) { | 251 | if( adpt_scsi_register(pHba,sht) < 0){ |
252 | adpt_i2o_delete_hba(pHba); | 252 | adpt_i2o_delete_hba(pHba); |
253 | continue; | 253 | continue; |
254 | } | 254 | } |
255 | pHba->initialized = TRUE; | 255 | pHba->initialized = TRUE; |
256 | pHba->state &= ~DPTI_STATE_RESET; | 256 | pHba->state &= ~DPTI_STATE_RESET; |
257 | scsi_scan_host(pHba->host); | ||
258 | } | 257 | } |
259 | 258 | ||
260 | // Register our control device node | 259 | // Register our control device node |
261 | // nodes will need to be created in /dev to access this | 260 | // nodes will need to be created in /dev to access this |
262 | // the nodes can not be created from within the driver | 261 | // the nodes can not be created from within the driver |
263 | if (hba_count && register_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER, &adpt_fops)) { | 262 | if (hba_count && register_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER, &adpt_fops)) { |
264 | adpt_exit(); | 263 | adpt_i2o_sys_shutdown(); |
265 | return 0; | 264 | return 0; |
266 | } | 265 | } |
267 | return hba_count; | 266 | return hba_count; |
268 | } | 267 | } |
269 | 268 | ||
270 | 269 | ||
271 | static int adpt_release(adpt_hba *pHba) | 270 | /* |
271 | * scsi_unregister will be called AFTER we return. | ||
272 | */ | ||
273 | static int adpt_release(struct Scsi_Host *host) | ||
272 | { | 274 | { |
273 | struct Scsi_Host *shost = pHba->host; | 275 | adpt_hba* pHba = (adpt_hba*) host->hostdata[0]; |
274 | scsi_remove_host(shost); | ||
275 | // adpt_i2o_quiesce_hba(pHba); | 276 | // adpt_i2o_quiesce_hba(pHba); |
276 | adpt_i2o_delete_hba(pHba); | 277 | adpt_i2o_delete_hba(pHba); |
277 | scsi_host_put(shost); | 278 | scsi_unregister(host); |
278 | return 0; | 279 | return 0; |
279 | } | 280 | } |
280 | 281 | ||
@@ -881,7 +882,7 @@ static int adpt_reboot_event(struct notifier_block *n, ulong code, void *p) | |||
881 | #endif | 882 | #endif |
882 | 883 | ||
883 | 884 | ||
884 | static int adpt_install_hba(struct pci_dev* pDev) | 885 | static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev) |
885 | { | 886 | { |
886 | 887 | ||
887 | adpt_hba* pHba = NULL; | 888 | adpt_hba* pHba = NULL; |
@@ -1028,6 +1029,8 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba) | |||
1028 | 1029 | ||
1029 | 1030 | ||
1030 | mutex_lock(&adpt_configuration_lock); | 1031 | mutex_lock(&adpt_configuration_lock); |
1032 | // scsi_unregister calls our adpt_release which | ||
1033 | // does a quiese | ||
1031 | if(pHba->host){ | 1034 | if(pHba->host){ |
1032 | free_irq(pHba->host->irq, pHba); | 1035 | free_irq(pHba->host->irq, pHba); |
1033 | } | 1036 | } |
@@ -1079,6 +1082,17 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba) | |||
1079 | } | 1082 | } |
1080 | 1083 | ||
1081 | 1084 | ||
1085 | static int adpt_init(void) | ||
1086 | { | ||
1087 | printk("Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n"); | ||
1088 | #ifdef REBOOT_NOTIFIER | ||
1089 | register_reboot_notifier(&adpt_reboot_notifier); | ||
1090 | #endif | ||
1091 | |||
1092 | return 0; | ||
1093 | } | ||
1094 | |||
1095 | |||
1082 | static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun) | 1096 | static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun) |
1083 | { | 1097 | { |
1084 | struct adpt_device* d; | 1098 | struct adpt_device* d; |
@@ -2164,6 +2178,37 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d | |||
2164 | } | 2178 | } |
2165 | 2179 | ||
2166 | 2180 | ||
2181 | static s32 adpt_scsi_register(adpt_hba* pHba,struct scsi_host_template * sht) | ||
2182 | { | ||
2183 | struct Scsi_Host *host = NULL; | ||
2184 | |||
2185 | host = scsi_register(sht, sizeof(adpt_hba*)); | ||
2186 | if (host == NULL) { | ||
2187 | printk ("%s: scsi_register returned NULL\n",pHba->name); | ||
2188 | return -1; | ||
2189 | } | ||
2190 | host->hostdata[0] = (unsigned long)pHba; | ||
2191 | pHba->host = host; | ||
2192 | |||
2193 | host->irq = pHba->pDev->irq; | ||
2194 | /* no IO ports, so don't have to set host->io_port and | ||
2195 | * host->n_io_port | ||
2196 | */ | ||
2197 | host->io_port = 0; | ||
2198 | host->n_io_port = 0; | ||
2199 | /* see comments in scsi_host.h */ | ||
2200 | host->max_id = 16; | ||
2201 | host->max_lun = 256; | ||
2202 | host->max_channel = pHba->top_scsi_channel + 1; | ||
2203 | host->cmd_per_lun = 1; | ||
2204 | host->unique_id = (uint) pHba; | ||
2205 | host->sg_tablesize = pHba->sg_tablesize; | ||
2206 | host->can_queue = pHba->post_fifo_size; | ||
2207 | |||
2208 | return 0; | ||
2209 | } | ||
2210 | |||
2211 | |||
2167 | static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd) | 2212 | static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd) |
2168 | { | 2213 | { |
2169 | adpt_hba* pHba; | 2214 | adpt_hba* pHba; |
@@ -3279,10 +3324,12 @@ static static void adpt_delay(int millisec) | |||
3279 | 3324 | ||
3280 | #endif | 3325 | #endif |
3281 | 3326 | ||
3282 | static struct scsi_host_template adpt_template = { | 3327 | static struct scsi_host_template driver_template = { |
3283 | .name = "dpt_i2o", | 3328 | .name = "dpt_i2o", |
3284 | .proc_name = "dpt_i2o", | 3329 | .proc_name = "dpt_i2o", |
3285 | .proc_info = adpt_proc_info, | 3330 | .proc_info = adpt_proc_info, |
3331 | .detect = adpt_detect, | ||
3332 | .release = adpt_release, | ||
3286 | .info = adpt_info, | 3333 | .info = adpt_info, |
3287 | .queuecommand = adpt_queue, | 3334 | .queuecommand = adpt_queue, |
3288 | .eh_abort_handler = adpt_abort, | 3335 | .eh_abort_handler = adpt_abort, |
@@ -3297,62 +3344,5 @@ static struct scsi_host_template adpt_template = { | |||
3297 | .use_clustering = ENABLE_CLUSTERING, | 3344 | .use_clustering = ENABLE_CLUSTERING, |
3298 | .use_sg_chaining = ENABLE_SG_CHAINING, | 3345 | .use_sg_chaining = ENABLE_SG_CHAINING, |
3299 | }; | 3346 | }; |
3300 | 3347 | #include "scsi_module.c" | |
3301 | static s32 adpt_scsi_register(adpt_hba* pHba) | ||
3302 | { | ||
3303 | struct Scsi_Host *host; | ||
3304 | |||
3305 | host = scsi_host_alloc(&adpt_template, sizeof(adpt_hba*)); | ||
3306 | if (host == NULL) { | ||
3307 | printk ("%s: scsi_host_alloc returned NULL\n",pHba->name); | ||
3308 | return -1; | ||
3309 | } | ||
3310 | host->hostdata[0] = (unsigned long)pHba; | ||
3311 | pHba->host = host; | ||
3312 | |||
3313 | host->irq = pHba->pDev->irq; | ||
3314 | /* no IO ports, so don't have to set host->io_port and | ||
3315 | * host->n_io_port | ||
3316 | */ | ||
3317 | host->io_port = 0; | ||
3318 | host->n_io_port = 0; | ||
3319 | /* see comments in scsi_host.h */ | ||
3320 | host->max_id = 16; | ||
3321 | host->max_lun = 256; | ||
3322 | host->max_channel = pHba->top_scsi_channel + 1; | ||
3323 | host->cmd_per_lun = 1; | ||
3324 | host->unique_id = (uint) pHba; | ||
3325 | host->sg_tablesize = pHba->sg_tablesize; | ||
3326 | host->can_queue = pHba->post_fifo_size; | ||
3327 | |||
3328 | if (scsi_add_host(host, &pHba->pDev->dev)) { | ||
3329 | scsi_host_put(host); | ||
3330 | return -1; | ||
3331 | } | ||
3332 | |||
3333 | return 0; | ||
3334 | } | ||
3335 | |||
3336 | static int __init adpt_init(void) | ||
3337 | { | ||
3338 | int count; | ||
3339 | |||
3340 | printk("Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n"); | ||
3341 | #ifdef REBOOT_NOTIFIER | ||
3342 | register_reboot_notifier(&adpt_reboot_notifier); | ||
3343 | #endif | ||
3344 | |||
3345 | count = adpt_detect(); | ||
3346 | |||
3347 | return count > 0 ? 0 : -ENODEV; | ||
3348 | } | ||
3349 | |||
3350 | static void adpt_exit(void) | ||
3351 | { | ||
3352 | while (hba_chain) | ||
3353 | adpt_release(hba_chain); | ||
3354 | } | ||
3355 | |||
3356 | module_init(adpt_init); | ||
3357 | module_exit(adpt_exit); | ||
3358 | MODULE_LICENSE("GPL"); | 3348 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h index 0892f6c70319..fd79068c5869 100644 --- a/drivers/scsi/dpti.h +++ b/drivers/scsi/dpti.h | |||
@@ -28,9 +28,11 @@ | |||
28 | * SCSI interface function Prototypes | 28 | * SCSI interface function Prototypes |
29 | */ | 29 | */ |
30 | 30 | ||
31 | static int adpt_detect(struct scsi_host_template * sht); | ||
31 | static int adpt_queue(struct scsi_cmnd * cmd, void (*cmdcomplete) (struct scsi_cmnd *)); | 32 | static int adpt_queue(struct scsi_cmnd * cmd, void (*cmdcomplete) (struct scsi_cmnd *)); |
32 | static int adpt_abort(struct scsi_cmnd * cmd); | 33 | static int adpt_abort(struct scsi_cmnd * cmd); |
33 | static int adpt_reset(struct scsi_cmnd* cmd); | 34 | static int adpt_reset(struct scsi_cmnd* cmd); |
35 | static int adpt_release(struct Scsi_Host *host); | ||
34 | static int adpt_slave_configure(struct scsi_device *); | 36 | static int adpt_slave_configure(struct scsi_device *); |
35 | 37 | ||
36 | static const char *adpt_info(struct Scsi_Host *pSHost); | 38 | static const char *adpt_info(struct Scsi_Host *pSHost); |
@@ -47,6 +49,8 @@ static int adpt_device_reset(struct scsi_cmnd* cmd); | |||
47 | 49 | ||
48 | #define DPT_DRIVER_NAME "Adaptec I2O RAID" | 50 | #define DPT_DRIVER_NAME "Adaptec I2O RAID" |
49 | 51 | ||
52 | #ifndef HOSTS_C | ||
53 | |||
50 | #include "dpt/sys_info.h" | 54 | #include "dpt/sys_info.h" |
51 | #include <linux/wait.h> | 55 | #include <linux/wait.h> |
52 | #include "dpt/dpti_i2o.h" | 56 | #include "dpt/dpti_i2o.h" |
@@ -285,7 +289,7 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba); | |||
285 | static s32 adpt_i2o_hrt_get(adpt_hba* pHba); | 289 | static s32 adpt_i2o_hrt_get(adpt_hba* pHba); |
286 | static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_device* dptdevice); | 290 | static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_device* dptdevice); |
287 | static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd); | 291 | static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd); |
288 | static s32 adpt_scsi_register(adpt_hba* pHba); | 292 | static s32 adpt_scsi_register(adpt_hba* pHba,struct scsi_host_template * sht); |
289 | static s32 adpt_hba_reset(adpt_hba* pHba); | 293 | static s32 adpt_hba_reset(adpt_hba* pHba); |
290 | static s32 adpt_i2o_reset_hba(adpt_hba* pHba); | 294 | static s32 adpt_i2o_reset_hba(adpt_hba* pHba); |
291 | static s32 adpt_rescan(adpt_hba* pHba); | 295 | static s32 adpt_rescan(adpt_hba* pHba); |
@@ -295,7 +299,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba); | |||
295 | static void adpt_inquiry(adpt_hba* pHba); | 299 | static void adpt_inquiry(adpt_hba* pHba); |
296 | static void adpt_fail_posted_scbs(adpt_hba* pHba); | 300 | static void adpt_fail_posted_scbs(adpt_hba* pHba); |
297 | static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun); | 301 | static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun); |
298 | static int adpt_install_hba(struct pci_dev* pDev) ; | 302 | static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev) ; |
299 | static int adpt_i2o_online_hba(adpt_hba* pHba); | 303 | static int adpt_i2o_online_hba(adpt_hba* pHba); |
300 | static void adpt_i2o_post_wait_complete(u32, int); | 304 | static void adpt_i2o_post_wait_complete(u32, int); |
301 | static int adpt_i2o_systab_send(adpt_hba* pHba); | 305 | static int adpt_i2o_systab_send(adpt_hba* pHba); |
@@ -339,4 +343,5 @@ static void adpt_i386_info(sysInfo_S* si); | |||
339 | #define FW_DEBUG_BLED_OFFSET 8 | 343 | #define FW_DEBUG_BLED_OFFSET 8 |
340 | 344 | ||
341 | #define FW_DEBUG_FLAGS_NO_HEADERS_B 0x01 | 345 | #define FW_DEBUG_FLAGS_NO_HEADERS_B 0x01 |
346 | #endif /* !HOSTS_C */ | ||
342 | #endif /* _DPT_H */ | 347 | #endif /* _DPT_H */ |
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index 4ed3a5297066..bfdee5968892 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c | |||
@@ -2026,8 +2026,8 @@ static void esp_reset_cleanup(struct esp *esp) | |||
2026 | tp->flags |= ESP_TGT_CHECK_NEGO; | 2026 | tp->flags |= ESP_TGT_CHECK_NEGO; |
2027 | 2027 | ||
2028 | if (tp->starget) | 2028 | if (tp->starget) |
2029 | starget_for_each_device(tp->starget, NULL, | 2029 | __starget_for_each_device(tp->starget, NULL, |
2030 | esp_clear_hold); | 2030 | esp_clear_hold); |
2031 | } | 2031 | } |
2032 | esp->flags &= ~ESP_FLAG_RESETTING; | 2032 | esp->flags &= ~ESP_FLAG_RESETTING; |
2033 | } | 2033 | } |
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 192948822455..0fb1709ce5e3 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
@@ -896,11 +896,11 @@ EXPORT_SYMBOL(__scsi_iterate_devices); | |||
896 | * starget_for_each_device - helper to walk all devices of a target | 896 | * starget_for_each_device - helper to walk all devices of a target |
897 | * @starget: target whose devices we want to iterate over. | 897 | * @starget: target whose devices we want to iterate over. |
898 | * | 898 | * |
899 | * This traverses over each devices of @shost. The devices have | 899 | * This traverses over each device of @starget. The devices have |
900 | * a reference that must be released by scsi_host_put when breaking | 900 | * a reference that must be released by scsi_host_put when breaking |
901 | * out of the loop. | 901 | * out of the loop. |
902 | */ | 902 | */ |
903 | void starget_for_each_device(struct scsi_target *starget, void * data, | 903 | void starget_for_each_device(struct scsi_target *starget, void *data, |
904 | void (*fn)(struct scsi_device *, void *)) | 904 | void (*fn)(struct scsi_device *, void *)) |
905 | { | 905 | { |
906 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | 906 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); |
@@ -915,6 +915,33 @@ void starget_for_each_device(struct scsi_target *starget, void * data, | |||
915 | EXPORT_SYMBOL(starget_for_each_device); | 915 | EXPORT_SYMBOL(starget_for_each_device); |
916 | 916 | ||
917 | /** | 917 | /** |
918 | * __starget_for_each_device - helper to walk all devices of a target | ||
919 | * (UNLOCKED) | ||
920 | * @starget: target whose devices we want to iterate over. | ||
921 | * | ||
922 | * This traverses over each device of @starget. It does _not_ | ||
923 | * take a reference on the scsi_device, so the whole loop must be | ||
924 | * protected by shost->host_lock. | ||
925 | * | ||
926 | * Note: The only reason why drivers would want to use this is because | ||
927 | * they need to access the device list in irq context. Otherwise you | ||
928 | * really want to use starget_for_each_device instead. | ||
929 | **/ | ||
930 | void __starget_for_each_device(struct scsi_target *starget, void *data, | ||
931 | void (*fn)(struct scsi_device *, void *)) | ||
932 | { | ||
933 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | ||
934 | struct scsi_device *sdev; | ||
935 | |||
936 | __shost_for_each_device(sdev, shost) { | ||
937 | if ((sdev->channel == starget->channel) && | ||
938 | (sdev->id == starget->id)) | ||
939 | fn(sdev, data); | ||
940 | } | ||
941 | } | ||
942 | EXPORT_SYMBOL(__starget_for_each_device); | ||
943 | |||
944 | /** | ||
918 | * __scsi_device_lookup_by_target - find a device given the target (UNLOCKED) | 945 | * __scsi_device_lookup_by_target - find a device given the target (UNLOCKED) |
919 | * @starget: SCSI target pointer | 946 | * @starget: SCSI target pointer |
920 | * @lun: SCSI Logical Unit Number | 947 | * @lun: SCSI Logical Unit Number |
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index a85f2d31a686..3f593247c41e 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c | |||
@@ -393,6 +393,7 @@ static inline void __init ulite_console_of_find_device(int id) | |||
393 | continue; | 393 | continue; |
394 | 394 | ||
395 | ulite_ports[id].mapbase = res.start; | 395 | ulite_ports[id].mapbase = res.start; |
396 | of_node_put(np); | ||
396 | return; | 397 | return; |
397 | } | 398 | } |
398 | } | 399 | } |
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index ff6a14bf1280..ff10808183a3 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c | |||
@@ -195,8 +195,8 @@ static void atmel_spi_next_xfer(struct spi_master *master, | |||
195 | xfer, xfer->len, xfer->tx_buf, xfer->tx_dma, | 195 | xfer, xfer->len, xfer->tx_buf, xfer->tx_dma, |
196 | xfer->rx_buf, xfer->rx_dma, spi_readl(as, IMR)); | 196 | xfer->rx_buf, xfer->rx_dma, spi_readl(as, IMR)); |
197 | 197 | ||
198 | spi_writel(as, TCR, len); | ||
199 | spi_writel(as, RCR, len); | 198 | spi_writel(as, RCR, len); |
199 | spi_writel(as, TCR, len); | ||
200 | spi_writel(as, PTCR, SPI_BIT(TXTEN) | SPI_BIT(RXTEN)); | 200 | spi_writel(as, PTCR, SPI_BIT(TXTEN) | SPI_BIT(RXTEN)); |
201 | } | 201 | } |
202 | 202 | ||
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index 5f3d808cbc29..1c2ab541d37d 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <asm/arch/pxa2xx_spi.h> | 39 | #include <asm/arch/pxa2xx_spi.h> |
40 | 40 | ||
41 | MODULE_AUTHOR("Stephen Street"); | 41 | MODULE_AUTHOR("Stephen Street"); |
42 | MODULE_DESCRIPTION("PXA2xx SSP SPI Contoller"); | 42 | MODULE_DESCRIPTION("PXA2xx SSP SPI Controller"); |
43 | MODULE_LICENSE("GPL"); | 43 | MODULE_LICENSE("GPL"); |
44 | 44 | ||
45 | #define MAX_BUSES 3 | 45 | #define MAX_BUSES 3 |
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index 22697b812205..7ef39a6e8c06 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c | |||
@@ -54,7 +54,7 @@ | |||
54 | 54 | ||
55 | #define DRV_NAME "bfin-spi" | 55 | #define DRV_NAME "bfin-spi" |
56 | #define DRV_AUTHOR "Bryan Wu, Luke Yang" | 56 | #define DRV_AUTHOR "Bryan Wu, Luke Yang" |
57 | #define DRV_DESC "Blackfin BF5xx on-chip SPI Contoller Driver" | 57 | #define DRV_DESC "Blackfin BF5xx on-chip SPI Controller Driver" |
58 | #define DRV_VERSION "1.0" | 58 | #define DRV_VERSION "1.0" |
59 | 59 | ||
60 | MODULE_AUTHOR(DRV_AUTHOR); | 60 | MODULE_AUTHOR(DRV_AUTHOR); |
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c index 7686ba34430f..2cd8573fb09c 100644 --- a/drivers/spi/spi_imx.c +++ b/drivers/spi/spi_imx.c | |||
@@ -1758,5 +1758,5 @@ static void __exit spi_imx_exit(void) | |||
1758 | module_exit(spi_imx_exit); | 1758 | module_exit(spi_imx_exit); |
1759 | 1759 | ||
1760 | MODULE_AUTHOR("Andrea Paterniani, <a.paterniani@swapp-eng.it>"); | 1760 | MODULE_AUTHOR("Andrea Paterniani, <a.paterniani@swapp-eng.it>"); |
1761 | MODULE_DESCRIPTION("iMX SPI Contoller Driver"); | 1761 | MODULE_DESCRIPTION("iMX SPI Controller Driver"); |
1762 | MODULE_LICENSE("GPL"); | 1762 | MODULE_LICENSE("GPL"); |
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 8d49838e5554..6a2fe5187b62 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -374,16 +374,9 @@ static int proc_delete_dentry(struct dentry * dentry) | |||
374 | return 1; | 374 | return 1; |
375 | } | 375 | } |
376 | 376 | ||
377 | static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata *nd) | ||
378 | { | ||
379 | d_drop(dentry); | ||
380 | return 0; | ||
381 | } | ||
382 | |||
383 | static struct dentry_operations proc_dentry_operations = | 377 | static struct dentry_operations proc_dentry_operations = |
384 | { | 378 | { |
385 | .d_delete = proc_delete_dentry, | 379 | .d_delete = proc_delete_dentry, |
386 | .d_revalidate = proc_revalidate_dentry, | ||
387 | }; | 380 | }; |
388 | 381 | ||
389 | /* | 382 | /* |
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index b9c8589e05c2..a49dd8d4b069 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -725,15 +725,15 @@ xfs_buf_associate_memory( | |||
725 | { | 725 | { |
726 | int rval; | 726 | int rval; |
727 | int i = 0; | 727 | int i = 0; |
728 | size_t ptr; | 728 | unsigned long pageaddr; |
729 | size_t end, end_cur; | 729 | unsigned long offset; |
730 | off_t offset; | 730 | size_t buflen; |
731 | int page_count; | 731 | int page_count; |
732 | 732 | ||
733 | page_count = PAGE_CACHE_ALIGN(len) >> PAGE_CACHE_SHIFT; | 733 | pageaddr = (unsigned long)mem & PAGE_CACHE_MASK; |
734 | offset = (off_t) mem - ((off_t)mem & PAGE_CACHE_MASK); | 734 | offset = (unsigned long)mem - pageaddr; |
735 | if (offset && (len > PAGE_CACHE_SIZE)) | 735 | buflen = PAGE_CACHE_ALIGN(len + offset); |
736 | page_count++; | 736 | page_count = buflen >> PAGE_CACHE_SHIFT; |
737 | 737 | ||
738 | /* Free any previous set of page pointers */ | 738 | /* Free any previous set of page pointers */ |
739 | if (bp->b_pages) | 739 | if (bp->b_pages) |
@@ -747,22 +747,15 @@ xfs_buf_associate_memory( | |||
747 | return rval; | 747 | return rval; |
748 | 748 | ||
749 | bp->b_offset = offset; | 749 | bp->b_offset = offset; |
750 | ptr = (size_t) mem & PAGE_CACHE_MASK; | 750 | |
751 | end = PAGE_CACHE_ALIGN((size_t) mem + len); | 751 | for (i = 0; i < bp->b_page_count; i++) { |
752 | end_cur = end; | 752 | bp->b_pages[i] = mem_to_page((void *)pageaddr); |
753 | /* set up first page */ | 753 | pageaddr += PAGE_CACHE_SIZE; |
754 | bp->b_pages[0] = mem_to_page(mem); | ||
755 | |||
756 | ptr += PAGE_CACHE_SIZE; | ||
757 | bp->b_page_count = ++i; | ||
758 | while (ptr < end) { | ||
759 | bp->b_pages[i] = mem_to_page((void *)ptr); | ||
760 | bp->b_page_count = ++i; | ||
761 | ptr += PAGE_CACHE_SIZE; | ||
762 | } | 754 | } |
763 | bp->b_locked = 0; | 755 | bp->b_locked = 0; |
764 | 756 | ||
765 | bp->b_count_desired = bp->b_buffer_length = len; | 757 | bp->b_count_desired = len; |
758 | bp->b_buffer_length = buflen; | ||
766 | bp->b_flags |= XBF_MAPPED; | 759 | bp->b_flags |= XBF_MAPPED; |
767 | 760 | ||
768 | return 0; | 761 | return 0; |
@@ -1032,7 +1025,7 @@ xfs_buf_ioend( | |||
1032 | xfs_buf_t *bp, | 1025 | xfs_buf_t *bp, |
1033 | int schedule) | 1026 | int schedule) |
1034 | { | 1027 | { |
1035 | bp->b_flags &= ~(XBF_READ | XBF_WRITE); | 1028 | bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_READ_AHEAD); |
1036 | if (bp->b_error == 0) | 1029 | if (bp->b_error == 0) |
1037 | bp->b_flags |= XBF_DONE; | 1030 | bp->b_flags |= XBF_DONE; |
1038 | 1031 | ||
@@ -1750,6 +1743,8 @@ xfsbufd( | |||
1750 | 1743 | ||
1751 | current->flags |= PF_MEMALLOC; | 1744 | current->flags |= PF_MEMALLOC; |
1752 | 1745 | ||
1746 | set_freezable(); | ||
1747 | |||
1753 | do { | 1748 | do { |
1754 | if (unlikely(freezing(current))) { | 1749 | if (unlikely(freezing(current))) { |
1755 | set_bit(XBT_FORCE_SLEEP, &target->bt_flags); | 1750 | set_bit(XBT_FORCE_SLEEP, &target->bt_flags); |
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index fb8dd34041eb..54c564693d93 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c | |||
@@ -218,6 +218,15 @@ xfs_vm_fault( | |||
218 | } | 218 | } |
219 | #endif /* CONFIG_XFS_DMAPI */ | 219 | #endif /* CONFIG_XFS_DMAPI */ |
220 | 220 | ||
221 | /* | ||
222 | * Unfortunately we can't just use the clean and simple readdir implementation | ||
223 | * below, because nfs might call back into ->lookup from the filldir callback | ||
224 | * and that will deadlock the low-level btree code. | ||
225 | * | ||
226 | * Hopefully we'll find a better workaround that allows to use the optimal | ||
227 | * version at least for local readdirs for 2.6.25. | ||
228 | */ | ||
229 | #if 0 | ||
221 | STATIC int | 230 | STATIC int |
222 | xfs_file_readdir( | 231 | xfs_file_readdir( |
223 | struct file *filp, | 232 | struct file *filp, |
@@ -249,6 +258,121 @@ xfs_file_readdir( | |||
249 | return -error; | 258 | return -error; |
250 | return 0; | 259 | return 0; |
251 | } | 260 | } |
261 | #else | ||
262 | |||
263 | struct hack_dirent { | ||
264 | int namlen; | ||
265 | loff_t offset; | ||
266 | u64 ino; | ||
267 | unsigned int d_type; | ||
268 | char name[]; | ||
269 | }; | ||
270 | |||
271 | struct hack_callback { | ||
272 | char *dirent; | ||
273 | size_t len; | ||
274 | size_t used; | ||
275 | }; | ||
276 | |||
277 | STATIC int | ||
278 | xfs_hack_filldir( | ||
279 | void *__buf, | ||
280 | const char *name, | ||
281 | int namlen, | ||
282 | loff_t offset, | ||
283 | u64 ino, | ||
284 | unsigned int d_type) | ||
285 | { | ||
286 | struct hack_callback *buf = __buf; | ||
287 | struct hack_dirent *de = (struct hack_dirent *)(buf->dirent + buf->used); | ||
288 | |||
289 | if (buf->used + sizeof(struct hack_dirent) + namlen > buf->len) | ||
290 | return -EINVAL; | ||
291 | |||
292 | de->namlen = namlen; | ||
293 | de->offset = offset; | ||
294 | de->ino = ino; | ||
295 | de->d_type = d_type; | ||
296 | memcpy(de->name, name, namlen); | ||
297 | buf->used += sizeof(struct hack_dirent) + namlen; | ||
298 | return 0; | ||
299 | } | ||
300 | |||
301 | STATIC int | ||
302 | xfs_file_readdir( | ||
303 | struct file *filp, | ||
304 | void *dirent, | ||
305 | filldir_t filldir) | ||
306 | { | ||
307 | struct inode *inode = filp->f_path.dentry->d_inode; | ||
308 | xfs_inode_t *ip = XFS_I(inode); | ||
309 | struct hack_callback buf; | ||
310 | struct hack_dirent *de; | ||
311 | int error; | ||
312 | loff_t size; | ||
313 | int eof = 0; | ||
314 | xfs_off_t start_offset, curr_offset, offset; | ||
315 | |||
316 | /* | ||
317 | * Try fairly hard to get memory | ||
318 | */ | ||
319 | buf.len = PAGE_CACHE_SIZE; | ||
320 | do { | ||
321 | buf.dirent = kmalloc(buf.len, GFP_KERNEL); | ||
322 | if (buf.dirent) | ||
323 | break; | ||
324 | buf.len >>= 1; | ||
325 | } while (buf.len >= 1024); | ||
326 | |||
327 | if (!buf.dirent) | ||
328 | return -ENOMEM; | ||
329 | |||
330 | curr_offset = filp->f_pos; | ||
331 | if (curr_offset == 0x7fffffff) | ||
332 | offset = 0xffffffff; | ||
333 | else | ||
334 | offset = filp->f_pos; | ||
335 | |||
336 | while (!eof) { | ||
337 | int reclen; | ||
338 | start_offset = offset; | ||
339 | |||
340 | buf.used = 0; | ||
341 | error = -xfs_readdir(ip, &buf, buf.len, &offset, | ||
342 | xfs_hack_filldir); | ||
343 | if (error || offset == start_offset) { | ||
344 | size = 0; | ||
345 | break; | ||
346 | } | ||
347 | |||
348 | size = buf.used; | ||
349 | de = (struct hack_dirent *)buf.dirent; | ||
350 | while (size > 0) { | ||
351 | if (filldir(dirent, de->name, de->namlen, | ||
352 | curr_offset & 0x7fffffff, | ||
353 | de->ino, de->d_type)) { | ||
354 | goto done; | ||
355 | } | ||
356 | |||
357 | reclen = sizeof(struct hack_dirent) + de->namlen; | ||
358 | size -= reclen; | ||
359 | curr_offset = de->offset /* & 0x7fffffff */; | ||
360 | de = (struct hack_dirent *)((char *)de + reclen); | ||
361 | } | ||
362 | } | ||
363 | |||
364 | done: | ||
365 | if (!error) { | ||
366 | if (size == 0) | ||
367 | filp->f_pos = offset & 0x7fffffff; | ||
368 | else if (de) | ||
369 | filp->f_pos = curr_offset; | ||
370 | } | ||
371 | |||
372 | kfree(buf.dirent); | ||
373 | return error; | ||
374 | } | ||
375 | #endif | ||
252 | 376 | ||
253 | STATIC int | 377 | STATIC int |
254 | xfs_file_mmap( | 378 | xfs_file_mmap( |
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index 2b34bad48b07..98a56568bb24 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c | |||
@@ -1047,24 +1047,20 @@ xfs_ioc_bulkstat( | |||
1047 | if ((count = bulkreq.icount) <= 0) | 1047 | if ((count = bulkreq.icount) <= 0) |
1048 | return -XFS_ERROR(EINVAL); | 1048 | return -XFS_ERROR(EINVAL); |
1049 | 1049 | ||
1050 | if (bulkreq.ubuffer == NULL) | ||
1051 | return -XFS_ERROR(EINVAL); | ||
1052 | |||
1050 | if (cmd == XFS_IOC_FSINUMBERS) | 1053 | if (cmd == XFS_IOC_FSINUMBERS) |
1051 | error = xfs_inumbers(mp, &inlast, &count, | 1054 | error = xfs_inumbers(mp, &inlast, &count, |
1052 | bulkreq.ubuffer, xfs_inumbers_fmt); | 1055 | bulkreq.ubuffer, xfs_inumbers_fmt); |
1053 | else if (cmd == XFS_IOC_FSBULKSTAT_SINGLE) | 1056 | else if (cmd == XFS_IOC_FSBULKSTAT_SINGLE) |
1054 | error = xfs_bulkstat_single(mp, &inlast, | 1057 | error = xfs_bulkstat_single(mp, &inlast, |
1055 | bulkreq.ubuffer, &done); | 1058 | bulkreq.ubuffer, &done); |
1056 | else { /* XFS_IOC_FSBULKSTAT */ | 1059 | else /* XFS_IOC_FSBULKSTAT */ |
1057 | if (count == 1 && inlast != 0) { | 1060 | error = xfs_bulkstat(mp, &inlast, &count, |
1058 | inlast++; | 1061 | (bulkstat_one_pf)xfs_bulkstat_one, NULL, |
1059 | error = xfs_bulkstat_single(mp, &inlast, | 1062 | sizeof(xfs_bstat_t), bulkreq.ubuffer, |
1060 | bulkreq.ubuffer, &done); | 1063 | BULKSTAT_FG_QUICK, &done); |
1061 | } else { | ||
1062 | error = xfs_bulkstat(mp, &inlast, &count, | ||
1063 | (bulkstat_one_pf)xfs_bulkstat_one, NULL, | ||
1064 | sizeof(xfs_bstat_t), bulkreq.ubuffer, | ||
1065 | BULKSTAT_FG_QUICK, &done); | ||
1066 | } | ||
1067 | } | ||
1068 | 1064 | ||
1069 | if (error) | 1065 | if (error) |
1070 | return -error; | 1066 | return -error; |
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c index 0046bdd5b7f1..bf2a956b63c2 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.c +++ b/fs/xfs/linux-2.6/xfs_ioctl32.c | |||
@@ -291,6 +291,9 @@ xfs_ioc_bulkstat_compat( | |||
291 | if ((count = bulkreq.icount) <= 0) | 291 | if ((count = bulkreq.icount) <= 0) |
292 | return -XFS_ERROR(EINVAL); | 292 | return -XFS_ERROR(EINVAL); |
293 | 293 | ||
294 | if (bulkreq.ubuffer == NULL) | ||
295 | return -XFS_ERROR(EINVAL); | ||
296 | |||
294 | if (cmd == XFS_IOC_FSINUMBERS) | 297 | if (cmd == XFS_IOC_FSINUMBERS) |
295 | error = xfs_inumbers(mp, &inlast, &count, | 298 | error = xfs_inumbers(mp, &inlast, &count, |
296 | bulkreq.ubuffer, xfs_inumbers_fmt_compat); | 299 | bulkreq.ubuffer, xfs_inumbers_fmt_compat); |
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index ac50f8a37582..37e116779eb1 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -117,7 +117,7 @@ xfs_ichgtime( | |||
117 | */ | 117 | */ |
118 | SYNCHRONIZE(); | 118 | SYNCHRONIZE(); |
119 | ip->i_update_core = 1; | 119 | ip->i_update_core = 1; |
120 | if (!(inode->i_state & I_SYNC)) | 120 | if (!(inode->i_state & I_NEW)) |
121 | mark_inode_dirty_sync(inode); | 121 | mark_inode_dirty_sync(inode); |
122 | } | 122 | } |
123 | 123 | ||
@@ -169,7 +169,7 @@ xfs_ichgtime_fast( | |||
169 | */ | 169 | */ |
170 | SYNCHRONIZE(); | 170 | SYNCHRONIZE(); |
171 | ip->i_update_core = 1; | 171 | ip->i_update_core = 1; |
172 | if (!(inode->i_state & I_SYNC)) | 172 | if (!(inode->i_state & I_NEW)) |
173 | mark_inode_dirty_sync(inode); | 173 | mark_inode_dirty_sync(inode); |
174 | } | 174 | } |
175 | 175 | ||
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index b5f91281b707..d488645f833d 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -1008,6 +1008,9 @@ xfs_qm_sync( | |||
1008 | boolean_t nowait; | 1008 | boolean_t nowait; |
1009 | int error; | 1009 | int error; |
1010 | 1010 | ||
1011 | if (! XFS_IS_QUOTA_ON(mp)) | ||
1012 | return 0; | ||
1013 | |||
1011 | restarts = 0; | 1014 | restarts = 0; |
1012 | /* | 1015 | /* |
1013 | * We won't block unless we are asked to. | 1016 | * We won't block unless we are asked to. |
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index 488836e204a3..fb69ef180b27 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c | |||
@@ -267,7 +267,7 @@ finish_inode: | |||
267 | icl = NULL; | 267 | icl = NULL; |
268 | if (radix_tree_gang_lookup(&pag->pag_ici_root, (void**)&iq, | 268 | if (radix_tree_gang_lookup(&pag->pag_ici_root, (void**)&iq, |
269 | first_index, 1)) { | 269 | first_index, 1)) { |
270 | if ((iq->i_ino & mask) == first_index) | 270 | if ((XFS_INO_TO_AGINO(mp, iq->i_ino) & mask) == first_index) |
271 | icl = iq->i_cluster; | 271 | icl = iq->i_cluster; |
272 | } | 272 | } |
273 | 273 | ||
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 9972992fd3c3..9fc4c2886529 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -316,6 +316,8 @@ xfs_bulkstat_use_dinode( | |||
316 | return 1; | 316 | return 1; |
317 | } | 317 | } |
318 | 318 | ||
319 | #define XFS_BULKSTAT_UBLEFT(ubleft) ((ubleft) >= statstruct_size) | ||
320 | |||
319 | /* | 321 | /* |
320 | * Return stat information in bulk (by-inode) for the filesystem. | 322 | * Return stat information in bulk (by-inode) for the filesystem. |
321 | */ | 323 | */ |
@@ -353,7 +355,7 @@ xfs_bulkstat( | |||
353 | xfs_inobt_rec_incore_t *irbp; /* current irec buffer pointer */ | 355 | xfs_inobt_rec_incore_t *irbp; /* current irec buffer pointer */ |
354 | xfs_inobt_rec_incore_t *irbuf; /* start of irec buffer */ | 356 | xfs_inobt_rec_incore_t *irbuf; /* start of irec buffer */ |
355 | xfs_inobt_rec_incore_t *irbufend; /* end of good irec buffer entries */ | 357 | xfs_inobt_rec_incore_t *irbufend; /* end of good irec buffer entries */ |
356 | xfs_ino_t lastino=0; /* last inode number returned */ | 358 | xfs_ino_t lastino; /* last inode number returned */ |
357 | int nbcluster; /* # of blocks in a cluster */ | 359 | int nbcluster; /* # of blocks in a cluster */ |
358 | int nicluster; /* # of inodes in a cluster */ | 360 | int nicluster; /* # of inodes in a cluster */ |
359 | int nimask; /* mask for inode clusters */ | 361 | int nimask; /* mask for inode clusters */ |
@@ -373,6 +375,7 @@ xfs_bulkstat( | |||
373 | * Get the last inode value, see if there's nothing to do. | 375 | * Get the last inode value, see if there's nothing to do. |
374 | */ | 376 | */ |
375 | ino = (xfs_ino_t)*lastinop; | 377 | ino = (xfs_ino_t)*lastinop; |
378 | lastino = ino; | ||
376 | dip = NULL; | 379 | dip = NULL; |
377 | agno = XFS_INO_TO_AGNO(mp, ino); | 380 | agno = XFS_INO_TO_AGNO(mp, ino); |
378 | agino = XFS_INO_TO_AGINO(mp, ino); | 381 | agino = XFS_INO_TO_AGINO(mp, ino); |
@@ -382,6 +385,9 @@ xfs_bulkstat( | |||
382 | *ubcountp = 0; | 385 | *ubcountp = 0; |
383 | return 0; | 386 | return 0; |
384 | } | 387 | } |
388 | if (!ubcountp || *ubcountp <= 0) { | ||
389 | return EINVAL; | ||
390 | } | ||
385 | ubcount = *ubcountp; /* statstruct's */ | 391 | ubcount = *ubcountp; /* statstruct's */ |
386 | ubleft = ubcount * statstruct_size; /* bytes */ | 392 | ubleft = ubcount * statstruct_size; /* bytes */ |
387 | *ubcountp = ubelem = 0; | 393 | *ubcountp = ubelem = 0; |
@@ -402,7 +408,8 @@ xfs_bulkstat( | |||
402 | * inode returned; 0 means start of the allocation group. | 408 | * inode returned; 0 means start of the allocation group. |
403 | */ | 409 | */ |
404 | rval = 0; | 410 | rval = 0; |
405 | while (ubleft >= statstruct_size && agno < mp->m_sb.sb_agcount) { | 411 | while (XFS_BULKSTAT_UBLEFT(ubleft) && agno < mp->m_sb.sb_agcount) { |
412 | cond_resched(); | ||
406 | bp = NULL; | 413 | bp = NULL; |
407 | down_read(&mp->m_peraglock); | 414 | down_read(&mp->m_peraglock); |
408 | error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp); | 415 | error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp); |
@@ -499,6 +506,7 @@ xfs_bulkstat( | |||
499 | break; | 506 | break; |
500 | error = xfs_inobt_lookup_ge(cur, agino, 0, 0, | 507 | error = xfs_inobt_lookup_ge(cur, agino, 0, 0, |
501 | &tmp); | 508 | &tmp); |
509 | cond_resched(); | ||
502 | } | 510 | } |
503 | /* | 511 | /* |
504 | * If ran off the end of the ag either with an error, | 512 | * If ran off the end of the ag either with an error, |
@@ -542,6 +550,7 @@ xfs_bulkstat( | |||
542 | */ | 550 | */ |
543 | agino = gino + XFS_INODES_PER_CHUNK; | 551 | agino = gino + XFS_INODES_PER_CHUNK; |
544 | error = xfs_inobt_increment(cur, 0, &tmp); | 552 | error = xfs_inobt_increment(cur, 0, &tmp); |
553 | cond_resched(); | ||
545 | } | 554 | } |
546 | /* | 555 | /* |
547 | * Drop the btree buffers and the agi buffer. | 556 | * Drop the btree buffers and the agi buffer. |
@@ -555,12 +564,12 @@ xfs_bulkstat( | |||
555 | */ | 564 | */ |
556 | irbufend = irbp; | 565 | irbufend = irbp; |
557 | for (irbp = irbuf; | 566 | for (irbp = irbuf; |
558 | irbp < irbufend && ubleft >= statstruct_size; irbp++) { | 567 | irbp < irbufend && XFS_BULKSTAT_UBLEFT(ubleft); irbp++) { |
559 | /* | 568 | /* |
560 | * Now process this chunk of inodes. | 569 | * Now process this chunk of inodes. |
561 | */ | 570 | */ |
562 | for (agino = irbp->ir_startino, chunkidx = clustidx = 0; | 571 | for (agino = irbp->ir_startino, chunkidx = clustidx = 0; |
563 | ubleft > 0 && | 572 | XFS_BULKSTAT_UBLEFT(ubleft) && |
564 | irbp->ir_freecount < XFS_INODES_PER_CHUNK; | 573 | irbp->ir_freecount < XFS_INODES_PER_CHUNK; |
565 | chunkidx++, clustidx++, agino++) { | 574 | chunkidx++, clustidx++, agino++) { |
566 | ASSERT(chunkidx < XFS_INODES_PER_CHUNK); | 575 | ASSERT(chunkidx < XFS_INODES_PER_CHUNK); |
@@ -663,15 +672,13 @@ xfs_bulkstat( | |||
663 | ubleft, private_data, | 672 | ubleft, private_data, |
664 | bno, &ubused, dip, &fmterror); | 673 | bno, &ubused, dip, &fmterror); |
665 | if (fmterror == BULKSTAT_RV_NOTHING) { | 674 | if (fmterror == BULKSTAT_RV_NOTHING) { |
666 | if (error == EFAULT) { | 675 | if (error && error != ENOENT && |
667 | ubleft = 0; | 676 | error != EINVAL) { |
668 | rval = error; | ||
669 | break; | ||
670 | } | ||
671 | else if (error == ENOMEM) | ||
672 | ubleft = 0; | 677 | ubleft = 0; |
673 | else | 678 | rval = error; |
674 | lastino = ino; | 679 | break; |
680 | } | ||
681 | lastino = ino; | ||
675 | continue; | 682 | continue; |
676 | } | 683 | } |
677 | if (fmterror == BULKSTAT_RV_GIVEUP) { | 684 | if (fmterror == BULKSTAT_RV_GIVEUP) { |
@@ -686,6 +693,8 @@ xfs_bulkstat( | |||
686 | ubelem++; | 693 | ubelem++; |
687 | lastino = ino; | 694 | lastino = ino; |
688 | } | 695 | } |
696 | |||
697 | cond_resched(); | ||
689 | } | 698 | } |
690 | 699 | ||
691 | if (bp) | 700 | if (bp) |
@@ -694,11 +703,12 @@ xfs_bulkstat( | |||
694 | /* | 703 | /* |
695 | * Set up for the next loop iteration. | 704 | * Set up for the next loop iteration. |
696 | */ | 705 | */ |
697 | if (ubleft > 0) { | 706 | if (XFS_BULKSTAT_UBLEFT(ubleft)) { |
698 | if (end_of_ag) { | 707 | if (end_of_ag) { |
699 | agno++; | 708 | agno++; |
700 | agino = 0; | 709 | agino = 0; |
701 | } | 710 | } else |
711 | agino = XFS_INO_TO_AGINO(mp, lastino); | ||
702 | } else | 712 | } else |
703 | break; | 713 | break; |
704 | } | 714 | } |
@@ -707,6 +717,11 @@ xfs_bulkstat( | |||
707 | */ | 717 | */ |
708 | kmem_free(irbuf, irbsize); | 718 | kmem_free(irbuf, irbsize); |
709 | *ubcountp = ubelem; | 719 | *ubcountp = ubelem; |
720 | /* | ||
721 | * Found some inodes, return them now and return the error next time. | ||
722 | */ | ||
723 | if (ubelem) | ||
724 | rval = 0; | ||
710 | if (agno >= mp->m_sb.sb_agcount) { | 725 | if (agno >= mp->m_sb.sb_agcount) { |
711 | /* | 726 | /* |
712 | * If we ran out of filesystem, mark lastino as off | 727 | * If we ran out of filesystem, mark lastino as off |
diff --git a/include/asm-h8300/timex.h b/include/asm-h8300/timex.h index 20413145fabb..23e67013439f 100644 --- a/include/asm-h8300/timex.h +++ b/include/asm-h8300/timex.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #ifndef _ASM_H8300_TIMEX_H | 6 | #ifndef _ASM_H8300_TIMEX_H |
7 | #define _ASM_H8300_TIMEX_H | 7 | #define _ASM_H8300_TIMEX_H |
8 | 8 | ||
9 | #define CLOCK_TICK_RATE CONFIG_CPU_CLOCK*1000/8192 /* Timer input freq. */ | 9 | #define CLOCK_TICK_RATE (CONFIG_CPU_CLOCK*1000/8192) /* Timer input freq. */ |
10 | 10 | ||
11 | typedef unsigned long cycles_t; | 11 | typedef unsigned long cycles_t; |
12 | extern short h8300_timer_count; | 12 | extern short h8300_timer_count; |
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h index b8f712859140..a3a4288daae8 100644 --- a/include/asm-ia64/iosapic.h +++ b/include/asm-ia64/iosapic.h | |||
@@ -80,7 +80,6 @@ extern int iosapic_remove (unsigned int gsi_base); | |||
80 | #else | 80 | #else |
81 | #define iosapic_remove(gsi_base) (-EINVAL) | 81 | #define iosapic_remove(gsi_base) (-EINVAL) |
82 | #endif /* CONFIG_HOTPLUG */ | 82 | #endif /* CONFIG_HOTPLUG */ |
83 | extern int gsi_to_vector (unsigned int gsi); | ||
84 | extern int gsi_to_irq (unsigned int gsi); | 83 | extern int gsi_to_irq (unsigned int gsi); |
85 | extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity, | 84 | extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity, |
86 | unsigned long trigger); | 85 | unsigned long trigger); |
@@ -94,7 +93,6 @@ extern int __init iosapic_register_platform_intr (u32 int_type, | |||
94 | u16 eid, u16 id, | 93 | u16 eid, u16 id, |
95 | unsigned long polarity, | 94 | unsigned long polarity, |
96 | unsigned long trigger); | 95 | unsigned long trigger); |
97 | extern unsigned int iosapic_version (char __iomem *addr); | ||
98 | 96 | ||
99 | #ifdef CONFIG_NUMA | 97 | #ifdef CONFIG_NUMA |
100 | extern void __devinit map_iosapic_to_node (unsigned int, int); | 98 | extern void __devinit map_iosapic_to_node (unsigned int, int); |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 66e9058357e0..6c2d80b36aa1 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -242,6 +242,9 @@ extern struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *, | |||
242 | uint); | 242 | uint); |
243 | extern void starget_for_each_device(struct scsi_target *, void *, | 243 | extern void starget_for_each_device(struct scsi_target *, void *, |
244 | void (*fn)(struct scsi_device *, void *)); | 244 | void (*fn)(struct scsi_device *, void *)); |
245 | extern void __starget_for_each_device(struct scsi_target *, void *, | ||
246 | void (*fn)(struct scsi_device *, | ||
247 | void *)); | ||
245 | 248 | ||
246 | /* only exposed to implement shost_for_each_device */ | 249 | /* only exposed to implement shost_for_each_device */ |
247 | extern struct scsi_device *__scsi_iterate_devices(struct Scsi_Host *, | 250 | extern struct scsi_device *__scsi_iterate_devices(struct Scsi_Host *, |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 6121b57bbe96..6f978218c2c8 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -907,7 +907,7 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
907 | */ | 907 | */ |
908 | pte = huge_pte_offset(mm, vaddr & HPAGE_MASK); | 908 | pte = huge_pte_offset(mm, vaddr & HPAGE_MASK); |
909 | 909 | ||
910 | if (!pte || pte_none(*pte)) { | 910 | if (!pte || pte_none(*pte) || (write && !pte_write(*pte))) { |
911 | int ret; | 911 | int ret; |
912 | 912 | ||
913 | spin_unlock(&mm->page_table_lock); | 913 | spin_unlock(&mm->page_table_lock); |
@@ -330,7 +330,7 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node) | |||
330 | 330 | ||
331 | /* Not enough space: must allocate a new page */ | 331 | /* Not enough space: must allocate a new page */ |
332 | if (!b) { | 332 | if (!b) { |
333 | b = slob_new_page(gfp, 0, node); | 333 | b = slob_new_page(gfp & ~__GFP_ZERO, 0, node); |
334 | if (!b) | 334 | if (!b) |
335 | return 0; | 335 | return 0; |
336 | sp = (struct slob_page *)virt_to_page(b); | 336 | sp = (struct slob_page *)virt_to_page(b); |
@@ -1468,6 +1468,9 @@ static void *__slab_alloc(struct kmem_cache *s, | |||
1468 | void **object; | 1468 | void **object; |
1469 | struct page *new; | 1469 | struct page *new; |
1470 | 1470 | ||
1471 | /* We handle __GFP_ZERO in the caller */ | ||
1472 | gfpflags &= ~__GFP_ZERO; | ||
1473 | |||
1471 | if (!c->page) | 1474 | if (!c->page) |
1472 | goto new_slab; | 1475 | goto new_slab; |
1473 | 1476 | ||
diff --git a/scripts/mkmakefile b/scripts/mkmakefile index ee39facee152..9ad1bd793252 100644 --- a/scripts/mkmakefile +++ b/scripts/mkmakefile | |||
@@ -11,6 +11,12 @@ | |||
11 | 11 | ||
12 | 12 | ||
13 | test ! -r $2/Makefile -o -O $2/Makefile || exit 0 | 13 | test ! -r $2/Makefile -o -O $2/Makefile || exit 0 |
14 | # Only overwrite automatically generated Makefiles | ||
15 | # (so we do not overwrite kernel Makefile) | ||
16 | if ! grep -q Automatically $2/Makefile | ||
17 | then | ||
18 | exit 0 | ||
19 | fi | ||
14 | echo " GEN $2/Makefile" | 20 | echo " GEN $2/Makefile" |
15 | 21 | ||
16 | cat << EOF > $2/Makefile | 22 | cat << EOF > $2/Makefile |