diff options
41 files changed, 328 insertions, 334 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 8309a7b2cd63..79577f0ace98 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -44,6 +44,9 @@ extern void __init clustered_apic_check(void); | |||
44 | extern int gsi_irq_sharing(int gsi); | 44 | extern int gsi_irq_sharing(int gsi); |
45 | #include <asm/proto.h> | 45 | #include <asm/proto.h> |
46 | 46 | ||
47 | static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return 0; } | ||
48 | |||
49 | |||
47 | #else /* X86 */ | 50 | #else /* X86 */ |
48 | 51 | ||
49 | #ifdef CONFIG_X86_LOCAL_APIC | 52 | #ifdef CONFIG_X86_LOCAL_APIC |
diff --git a/arch/mips/lib/iomap.c b/arch/mips/lib/iomap.c index 7e2ced715cfb..f4ac5bbcd81f 100644 --- a/arch/mips/lib/iomap.c +++ b/arch/mips/lib/iomap.c | |||
@@ -63,7 +63,7 @@ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | |||
63 | return ioport_map(start, len); | 63 | return ioport_map(start, len); |
64 | if (flags & IORESOURCE_MEM) { | 64 | if (flags & IORESOURCE_MEM) { |
65 | if (flags & IORESOURCE_CACHEABLE) | 65 | if (flags & IORESOURCE_CACHEABLE) |
66 | return ioremap_cacheable_cow(start, len); | 66 | return ioremap_cachable(start, len); |
67 | return ioremap_nocache(start, len); | 67 | return ioremap_nocache(start, len); |
68 | } | 68 | } |
69 | 69 | ||
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 1b71d91e8268..0668e9bfce41 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -235,7 +235,9 @@ static inline void r4k_blast_scache_page_setup(void) | |||
235 | { | 235 | { |
236 | unsigned long sc_lsize = cpu_scache_line_size(); | 236 | unsigned long sc_lsize = cpu_scache_line_size(); |
237 | 237 | ||
238 | if (sc_lsize == 16) | 238 | if (scache_size == 0) |
239 | r4k_blast_scache_page = (void *)no_sc_noop; | ||
240 | else if (sc_lsize == 16) | ||
239 | r4k_blast_scache_page = blast_scache16_page; | 241 | r4k_blast_scache_page = blast_scache16_page; |
240 | else if (sc_lsize == 32) | 242 | else if (sc_lsize == 32) |
241 | r4k_blast_scache_page = blast_scache32_page; | 243 | r4k_blast_scache_page = blast_scache32_page; |
@@ -251,7 +253,9 @@ static inline void r4k_blast_scache_page_indexed_setup(void) | |||
251 | { | 253 | { |
252 | unsigned long sc_lsize = cpu_scache_line_size(); | 254 | unsigned long sc_lsize = cpu_scache_line_size(); |
253 | 255 | ||
254 | if (sc_lsize == 16) | 256 | if (scache_size == 0) |
257 | r4k_blast_scache_page_indexed = (void *)no_sc_noop; | ||
258 | else if (sc_lsize == 16) | ||
255 | r4k_blast_scache_page_indexed = blast_scache16_page_indexed; | 259 | r4k_blast_scache_page_indexed = blast_scache16_page_indexed; |
256 | else if (sc_lsize == 32) | 260 | else if (sc_lsize == 32) |
257 | r4k_blast_scache_page_indexed = blast_scache32_page_indexed; | 261 | r4k_blast_scache_page_indexed = blast_scache32_page_indexed; |
@@ -267,7 +271,9 @@ static inline void r4k_blast_scache_setup(void) | |||
267 | { | 271 | { |
268 | unsigned long sc_lsize = cpu_scache_line_size(); | 272 | unsigned long sc_lsize = cpu_scache_line_size(); |
269 | 273 | ||
270 | if (sc_lsize == 16) | 274 | if (scache_size == 0) |
275 | r4k_blast_scache = (void *)no_sc_noop; | ||
276 | else if (sc_lsize == 16) | ||
271 | r4k_blast_scache = blast_scache16; | 277 | r4k_blast_scache = blast_scache16; |
272 | else if (sc_lsize == 32) | 278 | else if (sc_lsize == 32) |
273 | r4k_blast_scache = blast_scache32; | 279 | r4k_blast_scache = blast_scache32; |
@@ -482,7 +488,7 @@ static inline void local_r4k_flush_icache_range(void *args) | |||
482 | protected_blast_dcache_range(start, end); | 488 | protected_blast_dcache_range(start, end); |
483 | } | 489 | } |
484 | 490 | ||
485 | if (!cpu_icache_snoops_remote_store) { | 491 | if (!cpu_icache_snoops_remote_store && scache_size) { |
486 | if (end - start > scache_size) | 492 | if (end - start > scache_size) |
487 | r4k_blast_scache(); | 493 | r4k_blast_scache(); |
488 | else | 494 | else |
@@ -651,7 +657,7 @@ static void local_r4k_flush_cache_sigtramp(void * arg) | |||
651 | 657 | ||
652 | R4600_HIT_CACHEOP_WAR_IMPL; | 658 | R4600_HIT_CACHEOP_WAR_IMPL; |
653 | protected_writeback_dcache_line(addr & ~(dc_lsize - 1)); | 659 | protected_writeback_dcache_line(addr & ~(dc_lsize - 1)); |
654 | if (!cpu_icache_snoops_remote_store) | 660 | if (!cpu_icache_snoops_remote_store && scache_size) |
655 | protected_writeback_scache_line(addr & ~(sc_lsize - 1)); | 661 | protected_writeback_scache_line(addr & ~(sc_lsize - 1)); |
656 | protected_flush_icache_line(addr & ~(ic_lsize - 1)); | 662 | protected_flush_icache_line(addr & ~(ic_lsize - 1)); |
657 | if (MIPS4K_ICACHE_REFILL_WAR) { | 663 | if (MIPS4K_ICACHE_REFILL_WAR) { |
diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S index ccaeda5136d1..4ee871f1cadb 100644 --- a/arch/powerpc/kernel/vdso64/gettimeofday.S +++ b/arch/powerpc/kernel/vdso64/gettimeofday.S | |||
@@ -225,9 +225,9 @@ V_FUNCTION_BEGIN(__do_get_xsec) | |||
225 | .cfi_startproc | 225 | .cfi_startproc |
226 | /* check for update count & load values */ | 226 | /* check for update count & load values */ |
227 | 1: ld r8,CFG_TB_UPDATE_COUNT(r3) | 227 | 1: ld r8,CFG_TB_UPDATE_COUNT(r3) |
228 | andi. r0,r4,1 /* pending update ? loop */ | 228 | andi. r0,r8,1 /* pending update ? loop */ |
229 | bne- 1b | 229 | bne- 1b |
230 | xor r0,r4,r4 /* create dependency */ | 230 | xor r0,r8,r8 /* create dependency */ |
231 | add r3,r3,r0 | 231 | add r3,r3,r0 |
232 | 232 | ||
233 | /* Get TB & offset it */ | 233 | /* Get TB & offset it */ |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index b1f614c612dd..e9d589eefc14 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -169,7 +169,7 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
169 | #ifdef CONFIG_PPC_ISERIES | 169 | #ifdef CONFIG_PPC_ISERIES |
170 | if (_machine == PLATFORM_ISERIES_LPAR) | 170 | if (_machine == PLATFORM_ISERIES_LPAR) |
171 | ret = iSeries_hpte_insert(hpteg, va, | 171 | ret = iSeries_hpte_insert(hpteg, va, |
172 | virt_to_abs(paddr), | 172 | __pa(vaddr), |
173 | tmp_mode, | 173 | tmp_mode, |
174 | HPTE_V_BOLTED, | 174 | HPTE_V_BOLTED, |
175 | psize); | 175 | psize); |
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 83578313ee7e..2ab9dcdfb415 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -893,6 +893,20 @@ void eeh_add_device_tree_early(struct device_node *dn) | |||
893 | } | 893 | } |
894 | EXPORT_SYMBOL_GPL(eeh_add_device_tree_early); | 894 | EXPORT_SYMBOL_GPL(eeh_add_device_tree_early); |
895 | 895 | ||
896 | void eeh_add_device_tree_late(struct pci_bus *bus) | ||
897 | { | ||
898 | struct pci_dev *dev; | ||
899 | |||
900 | list_for_each_entry(dev, &bus->devices, bus_list) { | ||
901 | eeh_add_device_late(dev); | ||
902 | if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { | ||
903 | struct pci_bus *subbus = dev->subordinate; | ||
904 | if (subbus) | ||
905 | eeh_add_device_tree_late(subbus); | ||
906 | } | ||
907 | } | ||
908 | } | ||
909 | |||
896 | /** | 910 | /** |
897 | * eeh_add_device_late - perform EEH initialization for the indicated pci device | 911 | * eeh_add_device_late - perform EEH initialization for the indicated pci device |
898 | * @dev: pci device for which to set up EEH | 912 | * @dev: pci device for which to set up EEH |
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c index e3cbba49fd6e..b811d5ff92fe 100644 --- a/arch/powerpc/platforms/pseries/eeh_driver.c +++ b/arch/powerpc/platforms/pseries/eeh_driver.c | |||
@@ -37,7 +37,7 @@ | |||
37 | 37 | ||
38 | static inline const char * pcid_name (struct pci_dev *pdev) | 38 | static inline const char * pcid_name (struct pci_dev *pdev) |
39 | { | 39 | { |
40 | if (pdev->dev.driver) | 40 | if (pdev && pdev->dev.driver) |
41 | return pdev->dev.driver->name; | 41 | return pdev->dev.driver->name; |
42 | return ""; | 42 | return ""; |
43 | } | 43 | } |
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c index bdaa8aabdaa6..f3bad900bbcf 100644 --- a/arch/powerpc/platforms/pseries/pci_dlpar.c +++ b/arch/powerpc/platforms/pseries/pci_dlpar.c | |||
@@ -106,6 +106,8 @@ pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus) | |||
106 | } | 106 | } |
107 | } | 107 | } |
108 | } | 108 | } |
109 | |||
110 | eeh_add_device_tree_late(bus); | ||
109 | } | 111 | } |
110 | EXPORT_SYMBOL_GPL(pcibios_fixup_new_pci_devices); | 112 | EXPORT_SYMBOL_GPL(pcibios_fixup_new_pci_devices); |
111 | 113 | ||
@@ -114,7 +116,6 @@ pcibios_pci_config_bridge(struct pci_dev *dev) | |||
114 | { | 116 | { |
115 | u8 sec_busno; | 117 | u8 sec_busno; |
116 | struct pci_bus *child_bus; | 118 | struct pci_bus *child_bus; |
117 | struct pci_dev *child_dev; | ||
118 | 119 | ||
119 | /* Get busno of downstream bus */ | 120 | /* Get busno of downstream bus */ |
120 | pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno); | 121 | pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno); |
@@ -129,10 +130,6 @@ pcibios_pci_config_bridge(struct pci_dev *dev) | |||
129 | 130 | ||
130 | pci_scan_child_bus(child_bus); | 131 | pci_scan_child_bus(child_bus); |
131 | 132 | ||
132 | list_for_each_entry(child_dev, &child_bus->devices, bus_list) { | ||
133 | eeh_add_device_late(child_dev); | ||
134 | } | ||
135 | |||
136 | /* Fixup new pci devices without touching bus struct */ | 133 | /* Fixup new pci devices without touching bus struct */ |
137 | pcibios_fixup_new_pci_devices(child_bus, 0); | 134 | pcibios_fixup_new_pci_devices(child_bus, 0); |
138 | 135 | ||
@@ -160,18 +157,25 @@ pcibios_add_pci_devices(struct pci_bus * bus) | |||
160 | 157 | ||
161 | eeh_add_device_tree_early(dn); | 158 | eeh_add_device_tree_early(dn); |
162 | 159 | ||
163 | /* pci_scan_slot should find all children */ | 160 | if (_machine == PLATFORM_PSERIES_LPAR) { |
164 | slotno = PCI_SLOT(PCI_DN(dn->child)->devfn); | 161 | /* use ofdt-based probe */ |
165 | num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); | 162 | of_scan_bus(dn, bus); |
166 | if (num) { | 163 | if (!list_empty(&bus->devices)) { |
167 | pcibios_fixup_new_pci_devices(bus, 1); | 164 | pcibios_fixup_new_pci_devices(bus, 0); |
168 | pci_bus_add_devices(bus); | 165 | pci_bus_add_devices(bus); |
169 | } | 166 | } |
167 | } else { | ||
168 | /* use legacy probe */ | ||
169 | slotno = PCI_SLOT(PCI_DN(dn->child)->devfn); | ||
170 | num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); | ||
171 | if (num) { | ||
172 | pcibios_fixup_new_pci_devices(bus, 1); | ||
173 | pci_bus_add_devices(bus); | ||
174 | } | ||
170 | 175 | ||
171 | list_for_each_entry(dev, &bus->devices, bus_list) { | 176 | list_for_each_entry(dev, &bus->devices, bus_list) |
172 | eeh_add_device_late (dev); | 177 | if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) |
173 | if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) | 178 | pcibios_pci_config_bridge(dev); |
174 | pcibios_pci_config_bridge(dev); | ||
175 | } | 179 | } |
176 | } | 180 | } |
177 | EXPORT_SYMBOL_GPL(pcibios_add_pci_devices); | 181 | EXPORT_SYMBOL_GPL(pcibios_add_pci_devices); |
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c index d70605eda333..e5b14c57eaa0 100644 --- a/arch/x86_64/kernel/apic.c +++ b/arch/x86_64/kernel/apic.c | |||
@@ -962,14 +962,12 @@ void smp_apic_timer_interrupt(struct pt_regs *regs) | |||
962 | irq_exit(); | 962 | irq_exit(); |
963 | } | 963 | } |
964 | 964 | ||
965 | int __initdata unsync_tsc_on_multicluster; | ||
966 | |||
967 | /* | 965 | /* |
968 | * oem_force_hpet_timer -- force HPET mode for some boxes. | 966 | * oem_force_hpet_timer -- force HPET mode for some boxes. |
969 | * | 967 | * |
970 | * Thus far, the major user of this is IBM's Summit2 series: | 968 | * Thus far, the major user of this is IBM's Summit2 series: |
971 | * | 969 | * |
972 | * Some clustered boxes may have unsynced TSC problems if they are | 970 | * Clustered boxes may have unsynced TSC problems if they are |
973 | * multi-chassis. Use available data to take a good guess. | 971 | * multi-chassis. Use available data to take a good guess. |
974 | * If in doubt, go HPET. | 972 | * If in doubt, go HPET. |
975 | */ | 973 | */ |
@@ -979,11 +977,6 @@ __cpuinit int oem_force_hpet_timer(void) | |||
979 | unsigned id; | 977 | unsigned id; |
980 | DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS); | 978 | DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS); |
981 | 979 | ||
982 | /* Only do this check on IBM machines - big Unisys systems | ||
983 | use multiple clusters too, but have synchronized TSC */ | ||
984 | if (!unsync_tsc_on_multicluster) | ||
985 | return 0; | ||
986 | |||
987 | bitmap_zero(clustermap, NUM_APIC_CLUSTERS); | 980 | bitmap_zero(clustermap, NUM_APIC_CLUSTERS); |
988 | 981 | ||
989 | for (i = 0; i < NR_CPUS; i++) { | 982 | for (i = 0; i < NR_CPUS; i++) { |
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 74fae2daf87e..c8dbe38c81c8 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -239,7 +239,6 @@ enum cfqq_state_flags { | |||
239 | CFQ_CFQQ_FLAG_fifo_expire, | 239 | CFQ_CFQQ_FLAG_fifo_expire, |
240 | CFQ_CFQQ_FLAG_idle_window, | 240 | CFQ_CFQQ_FLAG_idle_window, |
241 | CFQ_CFQQ_FLAG_prio_changed, | 241 | CFQ_CFQQ_FLAG_prio_changed, |
242 | CFQ_CFQQ_FLAG_expired, | ||
243 | }; | 242 | }; |
244 | 243 | ||
245 | #define CFQ_CFQQ_FNS(name) \ | 244 | #define CFQ_CFQQ_FNS(name) \ |
@@ -264,7 +263,6 @@ CFQ_CFQQ_FNS(must_dispatch); | |||
264 | CFQ_CFQQ_FNS(fifo_expire); | 263 | CFQ_CFQQ_FNS(fifo_expire); |
265 | CFQ_CFQQ_FNS(idle_window); | 264 | CFQ_CFQQ_FNS(idle_window); |
266 | CFQ_CFQQ_FNS(prio_changed); | 265 | CFQ_CFQQ_FNS(prio_changed); |
267 | CFQ_CFQQ_FNS(expired); | ||
268 | #undef CFQ_CFQQ_FNS | 266 | #undef CFQ_CFQQ_FNS |
269 | 267 | ||
270 | enum cfq_rq_state_flags { | 268 | enum cfq_rq_state_flags { |
@@ -336,7 +334,7 @@ static struct request *cfq_find_rq_hash(struct cfq_data *cfqd, sector_t offset) | |||
336 | */ | 334 | */ |
337 | static inline void cfq_schedule_dispatch(struct cfq_data *cfqd) | 335 | static inline void cfq_schedule_dispatch(struct cfq_data *cfqd) |
338 | { | 336 | { |
339 | if (!cfqd->rq_in_driver && cfqd->busy_queues) | 337 | if (cfqd->busy_queues) |
340 | kblockd_schedule_work(&cfqd->unplug_work); | 338 | kblockd_schedule_work(&cfqd->unplug_work); |
341 | } | 339 | } |
342 | 340 | ||
@@ -736,13 +734,63 @@ __cfq_set_active_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) | |||
736 | cfqq->slice_left = 0; | 734 | cfqq->slice_left = 0; |
737 | cfq_clear_cfqq_must_alloc_slice(cfqq); | 735 | cfq_clear_cfqq_must_alloc_slice(cfqq); |
738 | cfq_clear_cfqq_fifo_expire(cfqq); | 736 | cfq_clear_cfqq_fifo_expire(cfqq); |
739 | cfq_clear_cfqq_expired(cfqq); | ||
740 | } | 737 | } |
741 | 738 | ||
742 | cfqd->active_queue = cfqq; | 739 | cfqd->active_queue = cfqq; |
743 | } | 740 | } |
744 | 741 | ||
745 | /* | 742 | /* |
743 | * current cfqq expired its slice (or was too idle), select new one | ||
744 | */ | ||
745 | static void | ||
746 | __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq, | ||
747 | int preempted) | ||
748 | { | ||
749 | unsigned long now = jiffies; | ||
750 | |||
751 | if (cfq_cfqq_wait_request(cfqq)) | ||
752 | del_timer(&cfqd->idle_slice_timer); | ||
753 | |||
754 | if (!preempted && !cfq_cfqq_dispatched(cfqq)) { | ||
755 | cfqq->service_last = now; | ||
756 | cfq_schedule_dispatch(cfqd); | ||
757 | } | ||
758 | |||
759 | cfq_clear_cfqq_must_dispatch(cfqq); | ||
760 | cfq_clear_cfqq_wait_request(cfqq); | ||
761 | |||
762 | /* | ||
763 | * store what was left of this slice, if the queue idled out | ||
764 | * or was preempted | ||
765 | */ | ||
766 | if (time_after(cfqq->slice_end, now)) | ||
767 | cfqq->slice_left = cfqq->slice_end - now; | ||
768 | else | ||
769 | cfqq->slice_left = 0; | ||
770 | |||
771 | if (cfq_cfqq_on_rr(cfqq)) | ||
772 | cfq_resort_rr_list(cfqq, preempted); | ||
773 | |||
774 | if (cfqq == cfqd->active_queue) | ||
775 | cfqd->active_queue = NULL; | ||
776 | |||
777 | if (cfqd->active_cic) { | ||
778 | put_io_context(cfqd->active_cic->ioc); | ||
779 | cfqd->active_cic = NULL; | ||
780 | } | ||
781 | |||
782 | cfqd->dispatch_slice = 0; | ||
783 | } | ||
784 | |||
785 | static inline void cfq_slice_expired(struct cfq_data *cfqd, int preempted) | ||
786 | { | ||
787 | struct cfq_queue *cfqq = cfqd->active_queue; | ||
788 | |||
789 | if (cfqq) | ||
790 | __cfq_slice_expired(cfqd, cfqq, preempted); | ||
791 | } | ||
792 | |||
793 | /* | ||
746 | * 0 | 794 | * 0 |
747 | * 0,1 | 795 | * 0,1 |
748 | * 0,1,2 | 796 | * 0,1,2 |
@@ -801,16 +849,7 @@ static int cfq_get_next_prio_level(struct cfq_data *cfqd) | |||
801 | 849 | ||
802 | static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd) | 850 | static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd) |
803 | { | 851 | { |
804 | struct cfq_queue *cfqq; | 852 | struct cfq_queue *cfqq = NULL; |
805 | |||
806 | /* | ||
807 | * if current queue is expired but not done with its requests yet, | ||
808 | * wait for that to happen | ||
809 | */ | ||
810 | if ((cfqq = cfqd->active_queue) != NULL) { | ||
811 | if (cfq_cfqq_expired(cfqq) && cfq_cfqq_dispatched(cfqq)) | ||
812 | return NULL; | ||
813 | } | ||
814 | 853 | ||
815 | /* | 854 | /* |
816 | * if current list is non-empty, grab first entry. if it is empty, | 855 | * if current list is non-empty, grab first entry. if it is empty, |
@@ -837,66 +876,11 @@ static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd) | |||
837 | return cfqq; | 876 | return cfqq; |
838 | } | 877 | } |
839 | 878 | ||
840 | /* | ||
841 | * current cfqq expired its slice (or was too idle), select new one | ||
842 | */ | ||
843 | static void | ||
844 | __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq, | ||
845 | int preempted) | ||
846 | { | ||
847 | unsigned long now = jiffies; | ||
848 | |||
849 | if (cfq_cfqq_wait_request(cfqq)) | ||
850 | del_timer(&cfqd->idle_slice_timer); | ||
851 | |||
852 | if (!preempted && !cfq_cfqq_dispatched(cfqq)) | ||
853 | cfqq->service_last = now; | ||
854 | |||
855 | cfq_clear_cfqq_must_dispatch(cfqq); | ||
856 | cfq_clear_cfqq_wait_request(cfqq); | ||
857 | |||
858 | /* | ||
859 | * store what was left of this slice, if the queue idled out | ||
860 | * or was preempted | ||
861 | */ | ||
862 | if (time_after(cfqq->slice_end, now)) | ||
863 | cfqq->slice_left = cfqq->slice_end - now; | ||
864 | else | ||
865 | cfqq->slice_left = 0; | ||
866 | |||
867 | if (cfq_cfqq_on_rr(cfqq)) | ||
868 | cfq_resort_rr_list(cfqq, preempted); | ||
869 | |||
870 | if (cfqq == cfqd->active_queue) | ||
871 | cfqd->active_queue = NULL; | ||
872 | |||
873 | if (cfqd->active_cic) { | ||
874 | put_io_context(cfqd->active_cic->ioc); | ||
875 | cfqd->active_cic = NULL; | ||
876 | } | ||
877 | |||
878 | cfqd->dispatch_slice = 0; | ||
879 | } | ||
880 | |||
881 | static inline void cfq_slice_expired(struct cfq_data *cfqd, int preempted) | ||
882 | { | ||
883 | struct cfq_queue *cfqq = cfqd->active_queue; | ||
884 | |||
885 | if (cfqq) { | ||
886 | /* | ||
887 | * use deferred expiry, if there are requests in progress as | ||
888 | * not to disturb the slice of the next queue | ||
889 | */ | ||
890 | if (cfq_cfqq_dispatched(cfqq)) | ||
891 | cfq_mark_cfqq_expired(cfqq); | ||
892 | else | ||
893 | __cfq_slice_expired(cfqd, cfqq, preempted); | ||
894 | } | ||
895 | } | ||
896 | |||
897 | static int cfq_arm_slice_timer(struct cfq_data *cfqd, struct cfq_queue *cfqq) | 879 | static int cfq_arm_slice_timer(struct cfq_data *cfqd, struct cfq_queue *cfqq) |
898 | 880 | ||
899 | { | 881 | { |
882 | unsigned long sl; | ||
883 | |||
900 | WARN_ON(!RB_EMPTY(&cfqq->sort_list)); | 884 | WARN_ON(!RB_EMPTY(&cfqq->sort_list)); |
901 | WARN_ON(cfqq != cfqd->active_queue); | 885 | WARN_ON(cfqq != cfqd->active_queue); |
902 | 886 | ||
@@ -916,13 +900,8 @@ static int cfq_arm_slice_timer(struct cfq_data *cfqd, struct cfq_queue *cfqq) | |||
916 | cfq_mark_cfqq_must_dispatch(cfqq); | 900 | cfq_mark_cfqq_must_dispatch(cfqq); |
917 | cfq_mark_cfqq_wait_request(cfqq); | 901 | cfq_mark_cfqq_wait_request(cfqq); |
918 | 902 | ||
919 | if (!timer_pending(&cfqd->idle_slice_timer)) { | 903 | sl = min(cfqq->slice_end - 1, (unsigned long) cfqd->cfq_slice_idle); |
920 | unsigned long slice_left = min(cfqq->slice_end - 1, (unsigned long) cfqd->cfq_slice_idle); | 904 | mod_timer(&cfqd->idle_slice_timer, jiffies + sl); |
921 | |||
922 | cfqd->idle_slice_timer.expires = jiffies + slice_left; | ||
923 | add_timer(&cfqd->idle_slice_timer); | ||
924 | } | ||
925 | |||
926 | return 1; | 905 | return 1; |
927 | } | 906 | } |
928 | 907 | ||
@@ -1006,9 +985,6 @@ static struct cfq_queue *cfq_select_queue(struct cfq_data *cfqd) | |||
1006 | if (!cfqq) | 985 | if (!cfqq) |
1007 | goto new_queue; | 986 | goto new_queue; |
1008 | 987 | ||
1009 | if (cfq_cfqq_expired(cfqq)) | ||
1010 | goto new_queue; | ||
1011 | |||
1012 | /* | 988 | /* |
1013 | * slice has expired | 989 | * slice has expired |
1014 | */ | 990 | */ |
@@ -1181,10 +1157,8 @@ static void cfq_put_queue(struct cfq_queue *cfqq) | |||
1181 | BUG_ON(cfqq->allocated[READ] + cfqq->allocated[WRITE]); | 1157 | BUG_ON(cfqq->allocated[READ] + cfqq->allocated[WRITE]); |
1182 | BUG_ON(cfq_cfqq_on_rr(cfqq)); | 1158 | BUG_ON(cfq_cfqq_on_rr(cfqq)); |
1183 | 1159 | ||
1184 | if (unlikely(cfqd->active_queue == cfqq)) { | 1160 | if (unlikely(cfqd->active_queue == cfqq)) |
1185 | __cfq_slice_expired(cfqd, cfqq, 0); | 1161 | __cfq_slice_expired(cfqd, cfqq, 0); |
1186 | cfq_schedule_dispatch(cfqd); | ||
1187 | } | ||
1188 | 1162 | ||
1189 | cfq_put_cfqd(cfqq->cfqd); | 1163 | cfq_put_cfqd(cfqq->cfqd); |
1190 | 1164 | ||
@@ -1245,10 +1219,8 @@ static void cfq_exit_single_io_context(struct cfq_io_context *cic) | |||
1245 | 1219 | ||
1246 | spin_lock(q->queue_lock); | 1220 | spin_lock(q->queue_lock); |
1247 | 1221 | ||
1248 | if (unlikely(cic->cfqq == cfqd->active_queue)) { | 1222 | if (unlikely(cic->cfqq == cfqd->active_queue)) |
1249 | __cfq_slice_expired(cfqd, cic->cfqq, 0); | 1223 | __cfq_slice_expired(cfqd, cic->cfqq, 0); |
1250 | cfq_schedule_dispatch(cfqd); | ||
1251 | } | ||
1252 | 1224 | ||
1253 | cfq_put_queue(cic->cfqq); | 1225 | cfq_put_queue(cic->cfqq); |
1254 | cic->cfqq = NULL; | 1226 | cic->cfqq = NULL; |
@@ -1715,10 +1687,7 @@ static void cfq_completed_request(request_queue_t *q, struct request *rq) | |||
1715 | cfqq->service_last = now; | 1687 | cfqq->service_last = now; |
1716 | cfq_resort_rr_list(cfqq, 0); | 1688 | cfq_resort_rr_list(cfqq, 0); |
1717 | } | 1689 | } |
1718 | if (cfq_cfqq_expired(cfqq)) { | 1690 | cfq_schedule_dispatch(cfqd); |
1719 | __cfq_slice_expired(cfqd, cfqq, 0); | ||
1720 | cfq_schedule_dispatch(cfqd); | ||
1721 | } | ||
1722 | } | 1691 | } |
1723 | 1692 | ||
1724 | if (cfq_crq_is_sync(crq)) | 1693 | if (cfq_crq_is_sync(crq)) |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e7dc653d5bd6..e8e92c853e89 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -9408,6 +9408,15 @@ static int __devinit tg3_is_sun_570X(struct tg3 *tp) | |||
9408 | return 0; | 9408 | return 0; |
9409 | if (venid == PCI_VENDOR_ID_SUN) | 9409 | if (venid == PCI_VENDOR_ID_SUN) |
9410 | return 1; | 9410 | return 1; |
9411 | |||
9412 | /* TG3 chips onboard the SunBlade-2500 don't have the | ||
9413 | * subsystem-vendor-id set to PCI_VENDOR_ID_SUN but they | ||
9414 | * are distinguishable from non-Sun variants by being | ||
9415 | * named "network" by the firmware. Non-Sun cards will | ||
9416 | * show up as being named "ethernet". | ||
9417 | */ | ||
9418 | if (!strcmp(pcp->prom_name, "network")) | ||
9419 | return 1; | ||
9411 | } | 9420 | } |
9412 | return 0; | 9421 | return 0; |
9413 | } | 9422 | } |
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 5f1d7580218d..4f91b0dc572b 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -82,6 +82,10 @@ int atapi_enabled = 0; | |||
82 | module_param(atapi_enabled, int, 0444); | 82 | module_param(atapi_enabled, int, 0444); |
83 | MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)"); | 83 | MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)"); |
84 | 84 | ||
85 | int libata_fua = 0; | ||
86 | module_param_named(fua, libata_fua, int, 0444); | ||
87 | MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)"); | ||
88 | |||
85 | MODULE_AUTHOR("Jeff Garzik"); | 89 | MODULE_AUTHOR("Jeff Garzik"); |
86 | MODULE_DESCRIPTION("Library module for ATA devices"); | 90 | MODULE_DESCRIPTION("Library module for ATA devices"); |
87 | MODULE_LICENSE("GPL"); | 91 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 07b1e7cc61df..59503c9ccac9 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -1708,6 +1708,8 @@ static int ata_dev_supports_fua(u16 *id) | |||
1708 | { | 1708 | { |
1709 | unsigned char model[41], fw[9]; | 1709 | unsigned char model[41], fw[9]; |
1710 | 1710 | ||
1711 | if (!libata_fua) | ||
1712 | return 0; | ||
1711 | if (!ata_id_has_fua(id)) | 1713 | if (!ata_id_has_fua(id)) |
1712 | return 0; | 1714 | return 0; |
1713 | 1715 | ||
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h index e03ce48b7b4b..fddaf479a544 100644 --- a/drivers/scsi/libata.h +++ b/drivers/scsi/libata.h | |||
@@ -41,6 +41,7 @@ struct ata_scsi_args { | |||
41 | 41 | ||
42 | /* libata-core.c */ | 42 | /* libata-core.c */ |
43 | extern int atapi_enabled; | 43 | extern int atapi_enabled; |
44 | extern int libata_fua; | ||
44 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, | 45 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, |
45 | struct ata_device *dev); | 46 | struct ata_device *dev); |
46 | extern int ata_rwcmd_protocol(struct ata_queued_cmd *qc); | 47 | extern int ata_rwcmd_protocol(struct ata_queued_cmd *qc); |
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 308704566948..4e453fa966ae 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c | |||
@@ -299,13 +299,10 @@ static void sunsu_start_tx(struct uart_port *port) | |||
299 | static void sunsu_stop_rx(struct uart_port *port) | 299 | static void sunsu_stop_rx(struct uart_port *port) |
300 | { | 300 | { |
301 | struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; | 301 | struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; |
302 | unsigned long flags; | ||
303 | 302 | ||
304 | spin_lock_irqsave(&up->port.lock, flags); | ||
305 | up->ier &= ~UART_IER_RLSI; | 303 | up->ier &= ~UART_IER_RLSI; |
306 | up->port.read_status_mask &= ~UART_LSR_DR; | 304 | up->port.read_status_mask &= ~UART_LSR_DR; |
307 | serial_out(up, UART_IER, up->ier); | 305 | serial_out(up, UART_IER, up->ier); |
308 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
309 | } | 306 | } |
310 | 307 | ||
311 | static void sunsu_enable_ms(struct uart_port *port) | 308 | static void sunsu_enable_ms(struct uart_port *port) |
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c index e02fea5a5433..1a362c5e7f3d 100644 --- a/drivers/usb/gadget/lh7a40x_udc.c +++ b/drivers/usb/gadget/lh7a40x_udc.c | |||
@@ -1062,11 +1062,11 @@ static int lh7a40x_ep_enable(struct usb_ep *_ep, | |||
1062 | ep->pio_irqs = 0; | 1062 | ep->pio_irqs = 0; |
1063 | ep->ep.maxpacket = le16_to_cpu(desc->wMaxPacketSize); | 1063 | ep->ep.maxpacket = le16_to_cpu(desc->wMaxPacketSize); |
1064 | 1064 | ||
1065 | spin_unlock_irqrestore(&ep->dev->lock, flags); | ||
1066 | |||
1065 | /* Reset halt state (does flush) */ | 1067 | /* Reset halt state (does flush) */ |
1066 | lh7a40x_set_halt(_ep, 0); | 1068 | lh7a40x_set_halt(_ep, 0); |
1067 | 1069 | ||
1068 | spin_unlock_irqrestore(&ep->dev->lock, flags); | ||
1069 | |||
1070 | DEBUG("%s: enabled %s\n", __FUNCTION__, _ep->name); | 1070 | DEBUG("%s: enabled %s\n", __FUNCTION__, _ep->name); |
1071 | return 0; | 1071 | return 0; |
1072 | } | 1072 | } |
@@ -1775,6 +1775,7 @@ static void lh7a40x_ep0_setup(struct lh7a40x_udc *dev, u32 csr) | |||
1775 | break; | 1775 | break; |
1776 | 1776 | ||
1777 | qep = &dev->ep[ep_num]; | 1777 | qep = &dev->ep[ep_num]; |
1778 | spin_unlock(&dev->lock); | ||
1778 | if (ctrl.bRequest == USB_REQ_SET_FEATURE) { | 1779 | if (ctrl.bRequest == USB_REQ_SET_FEATURE) { |
1779 | DEBUG_SETUP("SET_FEATURE (%d)\n", | 1780 | DEBUG_SETUP("SET_FEATURE (%d)\n", |
1780 | ep_num); | 1781 | ep_num); |
@@ -1784,6 +1785,7 @@ static void lh7a40x_ep0_setup(struct lh7a40x_udc *dev, u32 csr) | |||
1784 | ep_num); | 1785 | ep_num); |
1785 | lh7a40x_set_halt(&qep->ep, 0); | 1786 | lh7a40x_set_halt(&qep->ep, 0); |
1786 | } | 1787 | } |
1788 | spin_lock(&dev->lock); | ||
1787 | usb_set_index(0); | 1789 | usb_set_index(0); |
1788 | 1790 | ||
1789 | /* Reply with a ZLP on next IN token */ | 1791 | /* Reply with a ZLP on next IN token */ |
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index 9689efeb364c..6d6eaad73968 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c | |||
@@ -853,11 +853,14 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf) | |||
853 | // DEBUG("%s: OID = %08X\n", __FUNCTION__, cpu_to_le32(buf->OID)); | 853 | // DEBUG("%s: OID = %08X\n", __FUNCTION__, cpu_to_le32(buf->OID)); |
854 | if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP; | 854 | if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP; |
855 | 855 | ||
856 | /* | 856 | /* |
857 | * we need more memory: | 857 | * we need more memory: |
858 | * oid_supported_list is the largest answer | 858 | * gen_ndis_query_resp expects enough space for |
859 | * rndis_query_cmplt_type followed by data. | ||
860 | * oid_supported_list is the largest data reply | ||
859 | */ | 861 | */ |
860 | r = rndis_add_response (configNr, sizeof (oid_supported_list)); | 862 | r = rndis_add_response (configNr, |
863 | sizeof (oid_supported_list) + sizeof(rndis_query_cmplt_type)); | ||
861 | if (!r) | 864 | if (!r) |
862 | return -ENOMEM; | 865 | return -ENOMEM; |
863 | resp = (rndis_query_cmplt_type *) r->buf; | 866 | resp = (rndis_query_cmplt_type *) r->buf; |
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 118288d94423..9e81c26313f9 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c | |||
@@ -260,12 +260,13 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev) | |||
260 | offset + EHCI_USBLEGCTLSTS, | 260 | offset + EHCI_USBLEGCTLSTS, |
261 | val | EHCI_USBLEGCTLSTS_SOOE); | 261 | val | EHCI_USBLEGCTLSTS_SOOE); |
262 | #endif | 262 | #endif |
263 | } | ||
264 | 263 | ||
265 | /* always say Linux will own the hardware | 264 | /* some systems get upset if this semaphore is |
266 | * by setting EHCI_USBLEGSUP_OS. | 265 | * set for any other reason than forcing a BIOS |
267 | */ | 266 | * handoff.. |
268 | pci_write_config_byte(pdev, offset + 3, 1); | 267 | */ |
268 | pci_write_config_byte(pdev, offset + 3, 1); | ||
269 | } | ||
269 | 270 | ||
270 | /* if boot firmware now owns EHCI, spin till | 271 | /* if boot firmware now owns EHCI, spin till |
271 | * it hands it over. | 272 | * it hands it over. |
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 772478086bd3..07a012f88772 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -1407,6 +1407,7 @@ void hid_init_reports(struct hid_device *hid) | |||
1407 | #define USB_VENDOR_ID_WISEGROUP 0x0925 | 1407 | #define USB_VENDOR_ID_WISEGROUP 0x0925 |
1408 | #define USB_DEVICE_ID_1_PHIDGETSERVO_20 0x8101 | 1408 | #define USB_DEVICE_ID_1_PHIDGETSERVO_20 0x8101 |
1409 | #define USB_DEVICE_ID_4_PHIDGETSERVO_20 0x8104 | 1409 | #define USB_DEVICE_ID_4_PHIDGETSERVO_20 0x8104 |
1410 | #define USB_DEVICE_ID_DUAL_USB_JOYPAD 0x8866 | ||
1410 | 1411 | ||
1411 | #define USB_VENDOR_ID_CODEMERCS 0x07c0 | 1412 | #define USB_VENDOR_ID_CODEMERCS 0x07c0 |
1412 | #define USB_DEVICE_ID_CODEMERCS_IOW40 0x1500 | 1413 | #define USB_DEVICE_ID_CODEMERCS_IOW40 0x1500 |
@@ -1577,6 +1578,7 @@ static const struct hid_blacklist { | |||
1577 | { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET}, | 1578 | { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET}, |
1578 | { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET }, | 1579 | { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET }, |
1579 | { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET }, | 1580 | { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET }, |
1581 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, | ||
1580 | 1582 | ||
1581 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_POWERMOUSE, HID_QUIRK_2WHEEL_POWERMOUSE }, | 1583 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_POWERMOUSE, HID_QUIRK_2WHEEL_POWERMOUSE }, |
1582 | { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, | 1584 | { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index f2b4ca8692d8..c145e1ed8429 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -469,8 +469,14 @@ static struct usb_device_id id_table_combined [] = { | |||
469 | { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, | 469 | { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, |
470 | { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, | 470 | { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, |
471 | { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, | 471 | { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, |
472 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) }, | ||
473 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_YS_PID) }, | ||
472 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, | 474 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, |
473 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, | 475 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, |
476 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_IC_PID) }, | ||
477 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_DB9_PID) }, | ||
478 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_RS232_PID) }, | ||
479 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y9_PID) }, | ||
474 | { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, | 480 | { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, |
475 | { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, | 481 | { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, |
476 | { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, | 482 | { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index ca40f16370f1..bdef3b8c731f 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -333,10 +333,18 @@ | |||
333 | 333 | ||
334 | /* | 334 | /* |
335 | * microHAM product IDs (http://www.microham.com). | 335 | * microHAM product IDs (http://www.microham.com). |
336 | * Submitted by Justin Burket (KL1RL) <zorton@jtan.com>. | 336 | * Submitted by Justin Burket (KL1RL) <zorton@jtan.com> |
337 | * and Mike Studer (K6EEP) <k6eep@hamsoftware.org>. | ||
338 | * Ian Abbott <abbotti@mev.co.uk> added a few more from the driver INF file. | ||
337 | */ | 339 | */ |
340 | #define FTDI_MHAM_KW_PID 0xEEE8 /* USB-KW interface */ | ||
341 | #define FTDI_MHAM_YS_PID 0xEEE9 /* USB-YS interface */ | ||
338 | #define FTDI_MHAM_Y6_PID 0xEEEA /* USB-Y6 interface */ | 342 | #define FTDI_MHAM_Y6_PID 0xEEEA /* USB-Y6 interface */ |
339 | #define FTDI_MHAM_Y8_PID 0xEEEB /* USB-Y8 interface */ | 343 | #define FTDI_MHAM_Y8_PID 0xEEEB /* USB-Y8 interface */ |
344 | #define FTDI_MHAM_IC_PID 0xEEEC /* USB-IC interface */ | ||
345 | #define FTDI_MHAM_DB9_PID 0xEEED /* USB-DB9 interface */ | ||
346 | #define FTDI_MHAM_RS232_PID 0xEEEE /* USB-RS232 interface */ | ||
347 | #define FTDI_MHAM_Y9_PID 0xEEEF /* USB-Y9 interface */ | ||
340 | 348 | ||
341 | /* | 349 | /* |
342 | * Active Robots product ids. | 350 | * Active Robots product ids. |
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index bce3d55affd8..11a48d874752 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
@@ -69,6 +69,8 @@ static struct usb_device_id id_table [] = { | |||
69 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, | 69 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, |
70 | { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID), | 70 | { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID), |
71 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, | 71 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, |
72 | { USB_DEVICE(GSPDA_VENDOR_ID, GSPDA_XPLORE_M68_ID), | ||
73 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, | ||
72 | { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID), | 74 | { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID), |
73 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, | 75 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, |
74 | { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID), | 76 | { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID), |
@@ -139,6 +141,7 @@ static struct usb_device_id id_table_combined [] = { | |||
139 | { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_VISOR_ID) }, | 141 | { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_VISOR_ID) }, |
140 | { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO_ID) }, | 142 | { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO_ID) }, |
141 | { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID) }, | 143 | { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID) }, |
144 | { USB_DEVICE(GSPDA_VENDOR_ID, GSPDA_XPLORE_M68_ID) }, | ||
142 | { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID) }, | 145 | { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID) }, |
143 | { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID) }, | 146 | { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID) }, |
144 | { USB_DEVICE(PALM_VENDOR_ID, PALM_M515_ID) }, | 147 | { USB_DEVICE(PALM_VENDOR_ID, PALM_M515_ID) }, |
diff --git a/drivers/usb/serial/visor.h b/drivers/usb/serial/visor.h index b84d1cb4c693..765118d83fb6 100644 --- a/drivers/usb/serial/visor.h +++ b/drivers/usb/serial/visor.h | |||
@@ -36,6 +36,9 @@ | |||
36 | #define PALM_ZIRE_ID 0x0070 | 36 | #define PALM_ZIRE_ID 0x0070 |
37 | #define PALM_M100_ID 0x0080 | 37 | #define PALM_M100_ID 0x0080 |
38 | 38 | ||
39 | #define GSPDA_VENDOR_ID 0x115e | ||
40 | #define GSPDA_XPLORE_M68_ID 0xf100 | ||
41 | |||
39 | #define SONY_VENDOR_ID 0x054C | 42 | #define SONY_VENDOR_ID 0x054C |
40 | #define SONY_CLIE_3_5_ID 0x0038 | 43 | #define SONY_CLIE_3_5_ID 0x0038 |
41 | #define SONY_CLIE_4_0_ID 0x0066 | 44 | #define SONY_CLIE_4_0_ID 0x0066 |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index e71c5ca1a07b..31ca92056c27 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -753,6 +753,13 @@ UNUSUAL_DEV( 0x0693, 0x0005, 0x0100, 0x0100, | |||
753 | "Flashgate", | 753 | "Flashgate", |
754 | US_SC_SCSI, US_PR_BULK, NULL, 0 ), | 754 | US_SC_SCSI, US_PR_BULK, NULL, 0 ), |
755 | 755 | ||
756 | /* Reported by David Hamilton <niftimusmaximus@lycos.com> */ | ||
757 | UNUSUAL_DEV( 0x069b, 0x3004, 0x0001, 0x0001, | ||
758 | "Thomson Multimedia Inc.", | ||
759 | "RCA RD1080 MP3 Player", | ||
760 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
761 | US_FL_FIX_CAPACITY ), | ||
762 | |||
756 | UNUSUAL_DEV( 0x0781, 0x0001, 0x0200, 0x0200, | 763 | UNUSUAL_DEV( 0x0781, 0x0001, 0x0200, 0x0200, |
757 | "Sandisk", | 764 | "Sandisk", |
758 | "ImageMate SDDR-05a", | 765 | "ImageMate SDDR-05a", |
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 8f2beec526cf..74d8be87f983 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -540,7 +540,7 @@ xfs_probe_cluster( | |||
540 | 540 | ||
541 | /* First sum forwards in this page */ | 541 | /* First sum forwards in this page */ |
542 | do { | 542 | do { |
543 | if (mapped != buffer_mapped(bh)) | 543 | if (!buffer_uptodate(bh) || (mapped != buffer_mapped(bh))) |
544 | return total; | 544 | return total; |
545 | total += bh->b_size; | 545 | total += bh->b_size; |
546 | } while ((bh = bh->b_this_page) != head); | 546 | } while ((bh = bh->b_this_page) != head); |
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index 53a00fb217fa..7c0e39dc6189 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -68,6 +68,9 @@ kmem_zone_t *qm_dqzone; | |||
68 | kmem_zone_t *qm_dqtrxzone; | 68 | kmem_zone_t *qm_dqtrxzone; |
69 | STATIC kmem_shaker_t xfs_qm_shaker; | 69 | STATIC kmem_shaker_t xfs_qm_shaker; |
70 | 70 | ||
71 | STATIC cred_t xfs_zerocr; | ||
72 | STATIC xfs_inode_t xfs_zeroino; | ||
73 | |||
71 | STATIC void xfs_qm_list_init(xfs_dqlist_t *, char *, int); | 74 | STATIC void xfs_qm_list_init(xfs_dqlist_t *, char *, int); |
72 | STATIC void xfs_qm_list_destroy(xfs_dqlist_t *); | 75 | STATIC void xfs_qm_list_destroy(xfs_dqlist_t *); |
73 | 76 | ||
@@ -1393,8 +1396,6 @@ xfs_qm_qino_alloc( | |||
1393 | xfs_trans_t *tp; | 1396 | xfs_trans_t *tp; |
1394 | int error; | 1397 | int error; |
1395 | unsigned long s; | 1398 | unsigned long s; |
1396 | cred_t zerocr; | ||
1397 | xfs_inode_t zeroino; | ||
1398 | int committed; | 1399 | int committed; |
1399 | 1400 | ||
1400 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QINOCREATE); | 1401 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QINOCREATE); |
@@ -1406,11 +1407,9 @@ xfs_qm_qino_alloc( | |||
1406 | xfs_trans_cancel(tp, 0); | 1407 | xfs_trans_cancel(tp, 0); |
1407 | return error; | 1408 | return error; |
1408 | } | 1409 | } |
1409 | memset(&zerocr, 0, sizeof(zerocr)); | ||
1410 | memset(&zeroino, 0, sizeof(zeroino)); | ||
1411 | 1410 | ||
1412 | if ((error = xfs_dir_ialloc(&tp, &zeroino, S_IFREG, 1, 0, | 1411 | if ((error = xfs_dir_ialloc(&tp, &xfs_zeroino, S_IFREG, 1, 0, |
1413 | &zerocr, 0, 1, ip, &committed))) { | 1412 | &xfs_zerocr, 0, 1, ip, &committed))) { |
1414 | xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | | 1413 | xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | |
1415 | XFS_TRANS_ABORT); | 1414 | XFS_TRANS_ABORT); |
1416 | return error; | 1415 | return error; |
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 06fc061c50fc..5b413946b1c5 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c | |||
@@ -130,7 +130,8 @@ xfs_growfs_rt_alloc( | |||
130 | /* | 130 | /* |
131 | * Lock the inode. | 131 | * Lock the inode. |
132 | */ | 132 | */ |
133 | if ((error = xfs_trans_iget(mp, tp, ino, 0, XFS_ILOCK_EXCL, &ip))) | 133 | if ((error = xfs_trans_iget(mp, tp, ino, 0, |
134 | XFS_ILOCK_EXCL, &ip))) | ||
134 | goto error_exit; | 135 | goto error_exit; |
135 | XFS_BMAP_INIT(&flist, &firstblock); | 136 | XFS_BMAP_INIT(&flist, &firstblock); |
136 | /* | 137 | /* |
@@ -170,8 +171,8 @@ xfs_growfs_rt_alloc( | |||
170 | /* | 171 | /* |
171 | * Lock the bitmap inode. | 172 | * Lock the bitmap inode. |
172 | */ | 173 | */ |
173 | if ((error = xfs_trans_iget(mp, tp, ino, 0, XFS_ILOCK_EXCL, | 174 | if ((error = xfs_trans_iget(mp, tp, ino, 0, |
174 | &ip))) | 175 | XFS_ILOCK_EXCL, &ip))) |
175 | goto error_exit; | 176 | goto error_exit; |
176 | /* | 177 | /* |
177 | * Get a buffer for the block. | 178 | * Get a buffer for the block. |
@@ -2023,8 +2024,8 @@ xfs_growfs_rt( | |||
2023 | /* | 2024 | /* |
2024 | * Lock out other callers by grabbing the bitmap inode lock. | 2025 | * Lock out other callers by grabbing the bitmap inode lock. |
2025 | */ | 2026 | */ |
2026 | if ((error = xfs_trans_iget(mp, tp, 0, mp->m_sb.sb_rbmino, | 2027 | if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, |
2027 | XFS_ILOCK_EXCL, &ip))) | 2028 | XFS_ILOCK_EXCL, &ip))) |
2028 | goto error_exit; | 2029 | goto error_exit; |
2029 | ASSERT(ip == mp->m_rbmip); | 2030 | ASSERT(ip == mp->m_rbmip); |
2030 | /* | 2031 | /* |
@@ -2037,8 +2038,8 @@ xfs_growfs_rt( | |||
2037 | /* | 2038 | /* |
2038 | * Get the summary inode into the transaction. | 2039 | * Get the summary inode into the transaction. |
2039 | */ | 2040 | */ |
2040 | if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, | 2041 | if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0, |
2041 | 0, XFS_ILOCK_EXCL, &ip))) | 2042 | XFS_ILOCK_EXCL, &ip))) |
2042 | goto error_exit; | 2043 | goto error_exit; |
2043 | ASSERT(ip == mp->m_rsumip); | 2044 | ASSERT(ip == mp->m_rsumip); |
2044 | /* | 2045 | /* |
@@ -2158,10 +2159,9 @@ xfs_rtallocate_extent( | |||
2158 | /* | 2159 | /* |
2159 | * Lock out other callers by grabbing the bitmap inode lock. | 2160 | * Lock out other callers by grabbing the bitmap inode lock. |
2160 | */ | 2161 | */ |
2161 | error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, &ip); | 2162 | if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, |
2162 | if (error) { | 2163 | XFS_ILOCK_EXCL, &ip))) |
2163 | return error; | 2164 | return error; |
2164 | } | ||
2165 | sumbp = NULL; | 2165 | sumbp = NULL; |
2166 | /* | 2166 | /* |
2167 | * Allocate by size, or near another block, or exactly at some block. | 2167 | * Allocate by size, or near another block, or exactly at some block. |
@@ -2221,10 +2221,9 @@ xfs_rtfree_extent( | |||
2221 | /* | 2221 | /* |
2222 | * Synchronize by locking the bitmap inode. | 2222 | * Synchronize by locking the bitmap inode. |
2223 | */ | 2223 | */ |
2224 | error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, &ip); | 2224 | if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, |
2225 | if (error) { | 2225 | XFS_ILOCK_EXCL, &ip))) |
2226 | return error; | 2226 | return error; |
2227 | } | ||
2228 | #if defined(__KERNEL__) && defined(DEBUG) | 2227 | #if defined(__KERNEL__) && defined(DEBUG) |
2229 | /* | 2228 | /* |
2230 | * Check to see that this whole range is currently allocated. | 2229 | * Check to see that this whole range is currently allocated. |
@@ -2365,8 +2364,8 @@ xfs_rtpick_extent( | |||
2365 | __uint64_t seq; /* sequence number of file creation */ | 2364 | __uint64_t seq; /* sequence number of file creation */ |
2366 | __uint64_t *seqp; /* pointer to seqno in inode */ | 2365 | __uint64_t *seqp; /* pointer to seqno in inode */ |
2367 | 2366 | ||
2368 | error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, &ip); | 2367 | if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, |
2369 | if (error) | 2368 | XFS_ILOCK_EXCL, &ip))) |
2370 | return error; | 2369 | return error; |
2371 | ASSERT(ip == mp->m_rbmip); | 2370 | ASSERT(ip == mp->m_rbmip); |
2372 | seqp = (__uint64_t *)&ip->i_d.di_atime; | 2371 | seqp = (__uint64_t *)&ip->i_d.di_atime; |
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index 5a4c8a54b8f4..8c011aa61afa 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h | |||
@@ -283,6 +283,24 @@ static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, | |||
283 | __ioremap_mode((offset), (size), _CACHE_UNCACHED) | 283 | __ioremap_mode((offset), (size), _CACHE_UNCACHED) |
284 | 284 | ||
285 | /* | 285 | /* |
286 | * ioremap_cachable - map bus memory into CPU space | ||
287 | * @offset: bus address of the memory | ||
288 | * @size: size of the resource to map | ||
289 | * | ||
290 | * ioremap_nocache performs a platform specific sequence of operations to | ||
291 | * make bus memory CPU accessible via the readb/readw/readl/writeb/ | ||
292 | * writew/writel functions and the other mmio helpers. The returned | ||
293 | * address is not guaranteed to be usable directly as a virtual | ||
294 | * address. | ||
295 | * | ||
296 | * This version of ioremap ensures that the memory is marked cachable by | ||
297 | * the CPU. Also enables full write-combining. Useful for some | ||
298 | * memory-like regions on I/O busses. | ||
299 | */ | ||
300 | #define ioremap_cachable(offset, size) \ | ||
301 | __ioremap_mode((offset), (size), PAGE_CACHABLE_DEFAULT) | ||
302 | |||
303 | /* | ||
286 | * These two are MIPS specific ioremap variant. ioremap_cacheable_cow | 304 | * These two are MIPS specific ioremap variant. ioremap_cacheable_cow |
287 | * requests a cachable mapping, ioremap_uncached_accelerated requests a | 305 | * requests a cachable mapping, ioremap_uncached_accelerated requests a |
288 | * mapping using the uncached accelerated mode which isn't supported on | 306 | * mapping using the uncached accelerated mode which isn't supported on |
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h index b263fb2fa6e4..7dfb408fe2ca 100644 --- a/include/asm-powerpc/eeh.h +++ b/include/asm-powerpc/eeh.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/string.h> | 27 | #include <linux/string.h> |
28 | 28 | ||
29 | struct pci_dev; | 29 | struct pci_dev; |
30 | struct pci_bus; | ||
30 | struct device_node; | 31 | struct device_node; |
31 | 32 | ||
32 | #ifdef CONFIG_EEH | 33 | #ifdef CONFIG_EEH |
@@ -61,7 +62,7 @@ void __init pci_addr_cache_build(void); | |||
61 | */ | 62 | */ |
62 | void eeh_add_device_early(struct device_node *); | 63 | void eeh_add_device_early(struct device_node *); |
63 | void eeh_add_device_tree_early(struct device_node *); | 64 | void eeh_add_device_tree_early(struct device_node *); |
64 | void eeh_add_device_late(struct pci_dev *); | 65 | void eeh_add_device_tree_late(struct pci_bus *); |
65 | 66 | ||
66 | /** | 67 | /** |
67 | * eeh_remove_device - undo EEH setup for the indicated pci device | 68 | * eeh_remove_device - undo EEH setup for the indicated pci device |
@@ -116,12 +117,12 @@ static inline void pci_addr_cache_build(void) { } | |||
116 | 117 | ||
117 | static inline void eeh_add_device_early(struct device_node *dn) { } | 118 | static inline void eeh_add_device_early(struct device_node *dn) { } |
118 | 119 | ||
119 | static inline void eeh_add_device_late(struct pci_dev *dev) { } | ||
120 | |||
121 | static inline void eeh_remove_device(struct pci_dev *dev) { } | 120 | static inline void eeh_remove_device(struct pci_dev *dev) { } |
122 | 121 | ||
123 | static inline void eeh_add_device_tree_early(struct device_node *dn) { } | 122 | static inline void eeh_add_device_tree_early(struct device_node *dn) { } |
124 | 123 | ||
124 | static inline void eeh_add_device_tree_late(struct pci_bus *bus) { } | ||
125 | |||
125 | static inline void eeh_remove_bus_device(struct pci_dev *dev) { } | 126 | static inline void eeh_remove_bus_device(struct pci_dev *dev) { } |
126 | #define EEH_POSSIBLE_ERROR(val, type) (0) | 127 | #define EEH_POSSIBLE_ERROR(val, type) (0) |
127 | #define EEH_IO_ERROR_VALUE(size) (-1UL) | 128 | #define EEH_IO_ERROR_VALUE(size) (-1UL) |
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h index e2b9923189a0..aa1c7b2e438c 100644 --- a/include/asm-x86_64/acpi.h +++ b/include/asm-x86_64/acpi.h | |||
@@ -164,20 +164,6 @@ extern u8 x86_acpiid_to_apicid[]; | |||
164 | 164 | ||
165 | extern int acpi_skip_timer_override; | 165 | extern int acpi_skip_timer_override; |
166 | 166 | ||
167 | extern int unsync_tsc_on_multicluster; | ||
168 | |||
169 | static inline int acpi_madt_oem_check(char *oem, char *productid) | ||
170 | { | ||
171 | /* Copied from i386. Probably has too many entries. */ | ||
172 | if (!strncmp(oem, "IBM ENSW", 8) && | ||
173 | (!strncmp(productid, "VIGIL SMP", 9) | ||
174 | || !strncmp(productid, "EXA", 3) | ||
175 | || !strncmp(productid, "RUTHLESS SMP", 12))) { | ||
176 | unsync_tsc_on_multicluster = 1; | ||
177 | } | ||
178 | return 0; | ||
179 | } | ||
180 | |||
181 | #endif /*__KERNEL__*/ | 167 | #endif /*__KERNEL__*/ |
182 | 168 | ||
183 | #endif /*_ASM_ACPI_H*/ | 169 | #endif /*_ASM_ACPI_H*/ |
diff --git a/include/linux/netfilter_bridge/ebt_log.h b/include/linux/netfilter_bridge/ebt_log.h index 358fbc84fb59..96e231ae7554 100644 --- a/include/linux/netfilter_bridge/ebt_log.h +++ b/include/linux/netfilter_bridge/ebt_log.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */ | 4 | #define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */ |
5 | #define EBT_LOG_ARP 0x02 | 5 | #define EBT_LOG_ARP 0x02 |
6 | #define EBT_LOG_NFLOG 0x04 | ||
6 | #define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP) | 7 | #define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP) |
7 | #define EBT_LOG_PREFIX_SIZE 30 | 8 | #define EBT_LOG_PREFIX_SIZE 30 |
8 | #define EBT_LOG_WATCHER "log" | 9 | #define EBT_LOG_WATCHER "log" |
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h index 22d16177319b..892f9a33fea8 100644 --- a/include/linux/netfilter_ipv4/ipt_LOG.h +++ b/include/linux/netfilter_ipv4/ipt_LOG.h | |||
@@ -6,7 +6,8 @@ | |||
6 | #define IPT_LOG_TCPOPT 0x02 /* Log TCP options */ | 6 | #define IPT_LOG_TCPOPT 0x02 /* Log TCP options */ |
7 | #define IPT_LOG_IPOPT 0x04 /* Log IP options */ | 7 | #define IPT_LOG_IPOPT 0x04 /* Log IP options */ |
8 | #define IPT_LOG_UID 0x08 /* Log UID owning local socket */ | 8 | #define IPT_LOG_UID 0x08 /* Log UID owning local socket */ |
9 | #define IPT_LOG_MASK 0x0f | 9 | #define IPT_LOG_NFLOG 0x10 /* Log using nf_log backend */ |
10 | #define IPT_LOG_MASK 0x1f | ||
10 | 11 | ||
11 | struct ipt_log_info { | 12 | struct ipt_log_info { |
12 | unsigned char level; | 13 | unsigned char level; |
diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/linux/netfilter_ipv6/ip6t_LOG.h index 9008ff5c40ae..060c1a1c6c60 100644 --- a/include/linux/netfilter_ipv6/ip6t_LOG.h +++ b/include/linux/netfilter_ipv6/ip6t_LOG.h | |||
@@ -6,7 +6,8 @@ | |||
6 | #define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */ | 6 | #define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */ |
7 | #define IP6T_LOG_IPOPT 0x04 /* Log IP options */ | 7 | #define IP6T_LOG_IPOPT 0x04 /* Log IP options */ |
8 | #define IP6T_LOG_UID 0x08 /* Log UID owning local socket */ | 8 | #define IP6T_LOG_UID 0x08 /* Log UID owning local socket */ |
9 | #define IP6T_LOG_MASK 0x0f | 9 | #define IP6T_LOG_NFLOG 0x10 /* Log using nf_log backend */ |
10 | #define IP6T_LOG_MASK 0x1f | ||
10 | 11 | ||
11 | struct ip6t_log_info { | 12 | struct ip6t_log_info { |
12 | unsigned char level; | 13 | unsigned char level; |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 004e645f3e18..8d362c49b8a9 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -233,7 +233,6 @@ struct xfrm_type | |||
233 | int (*init_state)(struct xfrm_state *x); | 233 | int (*init_state)(struct xfrm_state *x); |
234 | void (*destructor)(struct xfrm_state *); | 234 | void (*destructor)(struct xfrm_state *); |
235 | int (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); | 235 | int (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); |
236 | int (*post_input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); | ||
237 | int (*output)(struct xfrm_state *, struct sk_buff *pskb); | 236 | int (*output)(struct xfrm_state *, struct sk_buff *pskb); |
238 | /* Estimate maximal size of result of transformation of a dgram */ | 237 | /* Estimate maximal size of result of transformation of a dgram */ |
239 | u32 (*get_max_size)(struct xfrm_state *, int size); | 238 | u32 (*get_max_size)(struct xfrm_state *, int size); |
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c index 0128fbbe2328..288ff1d4ccc4 100644 --- a/net/bridge/netfilter/ebt_log.c +++ b/net/bridge/netfilter/ebt_log.c | |||
@@ -166,7 +166,12 @@ static void ebt_log(const struct sk_buff *skb, unsigned int hooknr, | |||
166 | li.u.log.level = info->loglevel; | 166 | li.u.log.level = info->loglevel; |
167 | li.u.log.logflags = info->bitmask; | 167 | li.u.log.logflags = info->bitmask; |
168 | 168 | ||
169 | nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, info->prefix); | 169 | if (info->bitmask & EBT_LOG_NFLOG) |
170 | nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, | ||
171 | info->prefix); | ||
172 | else | ||
173 | ebt_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, | ||
174 | info->prefix); | ||
170 | } | 175 | } |
171 | 176 | ||
172 | static struct ebt_watcher log = | 177 | static struct ebt_watcher log = |
diff --git a/net/core/request_sock.c b/net/core/request_sock.c index b8203de5ff07..98f0fc923f91 100644 --- a/net/core/request_sock.c +++ b/net/core/request_sock.c | |||
@@ -52,7 +52,6 @@ int reqsk_queue_alloc(struct request_sock_queue *queue, | |||
52 | get_random_bytes(&lopt->hash_rnd, sizeof(lopt->hash_rnd)); | 52 | get_random_bytes(&lopt->hash_rnd, sizeof(lopt->hash_rnd)); |
53 | rwlock_init(&queue->syn_wait_lock); | 53 | rwlock_init(&queue->syn_wait_lock); |
54 | queue->rskq_accept_head = queue->rskq_accept_head = NULL; | 54 | queue->rskq_accept_head = queue->rskq_accept_head = NULL; |
55 | queue->rskq_defer_accept = 0; | ||
56 | lopt->nr_table_entries = nr_table_entries; | 55 | lopt->nr_table_entries = nr_table_entries; |
57 | 56 | ||
58 | write_lock_bh(&queue->syn_wait_lock); | 57 | write_lock_bh(&queue->syn_wait_lock); |
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 73bfcae8af9c..09590f356086 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
@@ -12,13 +12,6 @@ | |||
12 | #include <net/protocol.h> | 12 | #include <net/protocol.h> |
13 | #include <net/udp.h> | 13 | #include <net/udp.h> |
14 | 14 | ||
15 | /* decapsulation data for use when post-processing */ | ||
16 | struct esp_decap_data { | ||
17 | xfrm_address_t saddr; | ||
18 | __u16 sport; | ||
19 | __u8 proto; | ||
20 | }; | ||
21 | |||
22 | static int esp_output(struct xfrm_state *x, struct sk_buff *skb) | 15 | static int esp_output(struct xfrm_state *x, struct sk_buff *skb) |
23 | { | 16 | { |
24 | int err; | 17 | int err; |
@@ -150,6 +143,10 @@ static int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struc | |||
150 | int elen = skb->len - sizeof(struct ip_esp_hdr) - esp->conf.ivlen - alen; | 143 | int elen = skb->len - sizeof(struct ip_esp_hdr) - esp->conf.ivlen - alen; |
151 | int nfrags; | 144 | int nfrags; |
152 | int encap_len = 0; | 145 | int encap_len = 0; |
146 | u8 nexthdr[2]; | ||
147 | struct scatterlist *sg; | ||
148 | u8 workbuf[60]; | ||
149 | int padlen; | ||
153 | 150 | ||
154 | if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr))) | 151 | if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr))) |
155 | goto out; | 152 | goto out; |
@@ -185,122 +182,82 @@ static int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struc | |||
185 | if (esp->conf.ivlen) | 182 | if (esp->conf.ivlen) |
186 | crypto_cipher_set_iv(esp->conf.tfm, esph->enc_data, crypto_tfm_alg_ivsize(esp->conf.tfm)); | 183 | crypto_cipher_set_iv(esp->conf.tfm, esph->enc_data, crypto_tfm_alg_ivsize(esp->conf.tfm)); |
187 | 184 | ||
188 | { | 185 | sg = &esp->sgbuf[0]; |
189 | u8 nexthdr[2]; | ||
190 | struct scatterlist *sg = &esp->sgbuf[0]; | ||
191 | u8 workbuf[60]; | ||
192 | int padlen; | ||
193 | |||
194 | if (unlikely(nfrags > ESP_NUM_FAST_SG)) { | ||
195 | sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC); | ||
196 | if (!sg) | ||
197 | goto out; | ||
198 | } | ||
199 | skb_to_sgvec(skb, sg, sizeof(struct ip_esp_hdr) + esp->conf.ivlen, elen); | ||
200 | crypto_cipher_decrypt(esp->conf.tfm, sg, sg, elen); | ||
201 | if (unlikely(sg != &esp->sgbuf[0])) | ||
202 | kfree(sg); | ||
203 | |||
204 | if (skb_copy_bits(skb, skb->len-alen-2, nexthdr, 2)) | ||
205 | BUG(); | ||
206 | 186 | ||
207 | padlen = nexthdr[0]; | 187 | if (unlikely(nfrags > ESP_NUM_FAST_SG)) { |
208 | if (padlen+2 >= elen) | 188 | sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC); |
189 | if (!sg) | ||
209 | goto out; | 190 | goto out; |
210 | |||
211 | /* ... check padding bits here. Silly. :-) */ | ||
212 | |||
213 | if (x->encap && decap && decap->decap_type) { | ||
214 | struct esp_decap_data *encap_data; | ||
215 | struct udphdr *uh = (struct udphdr *) (iph+1); | ||
216 | |||
217 | encap_data = (struct esp_decap_data *) (decap->decap_data); | ||
218 | encap_data->proto = 0; | ||
219 | |||
220 | switch (decap->decap_type) { | ||
221 | case UDP_ENCAP_ESPINUDP: | ||
222 | case UDP_ENCAP_ESPINUDP_NON_IKE: | ||
223 | encap_data->proto = AF_INET; | ||
224 | encap_data->saddr.a4 = iph->saddr; | ||
225 | encap_data->sport = uh->source; | ||
226 | encap_len = (void*)esph - (void*)uh; | ||
227 | break; | ||
228 | |||
229 | default: | ||
230 | goto out; | ||
231 | } | ||
232 | } | ||
233 | |||
234 | iph->protocol = nexthdr[1]; | ||
235 | pskb_trim(skb, skb->len - alen - padlen - 2); | ||
236 | memcpy(workbuf, skb->nh.raw, iph->ihl*4); | ||
237 | skb->h.raw = skb_pull(skb, sizeof(struct ip_esp_hdr) + esp->conf.ivlen); | ||
238 | skb->nh.raw += encap_len + sizeof(struct ip_esp_hdr) + esp->conf.ivlen; | ||
239 | memcpy(skb->nh.raw, workbuf, iph->ihl*4); | ||
240 | skb->nh.iph->tot_len = htons(skb->len); | ||
241 | } | 191 | } |
192 | skb_to_sgvec(skb, sg, sizeof(struct ip_esp_hdr) + esp->conf.ivlen, elen); | ||
193 | crypto_cipher_decrypt(esp->conf.tfm, sg, sg, elen); | ||
194 | if (unlikely(sg != &esp->sgbuf[0])) | ||
195 | kfree(sg); | ||
242 | 196 | ||
243 | return 0; | 197 | if (skb_copy_bits(skb, skb->len-alen-2, nexthdr, 2)) |
198 | BUG(); | ||
244 | 199 | ||
245 | out: | 200 | padlen = nexthdr[0]; |
246 | return -EINVAL; | 201 | if (padlen+2 >= elen) |
247 | } | 202 | goto out; |
248 | 203 | ||
249 | static int esp_post_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb) | 204 | /* ... check padding bits here. Silly. :-) */ |
250 | { | ||
251 | |||
252 | if (x->encap) { | ||
253 | struct xfrm_encap_tmpl *encap; | ||
254 | struct esp_decap_data *decap_data; | ||
255 | 205 | ||
256 | encap = x->encap; | 206 | if (x->encap) { |
257 | decap_data = (struct esp_decap_data *)(decap->decap_data); | 207 | struct xfrm_encap_tmpl *encap = x->encap; |
208 | struct udphdr *uh; | ||
258 | 209 | ||
259 | /* first, make sure that the decap type == the encap type */ | ||
260 | if (encap->encap_type != decap->decap_type) | 210 | if (encap->encap_type != decap->decap_type) |
261 | return -EINVAL; | 211 | goto out; |
262 | 212 | ||
263 | switch (encap->encap_type) { | 213 | uh = (struct udphdr *)(iph + 1); |
264 | default: | 214 | encap_len = (void*)esph - (void*)uh; |
265 | case UDP_ENCAP_ESPINUDP: | 215 | |
266 | case UDP_ENCAP_ESPINUDP_NON_IKE: | 216 | /* |
267 | /* | 217 | * 1) if the NAT-T peer's IP or port changed then |
268 | * 1) if the NAT-T peer's IP or port changed then | 218 | * advertize the change to the keying daemon. |
269 | * advertize the change to the keying daemon. | 219 | * This is an inbound SA, so just compare |
270 | * This is an inbound SA, so just compare | 220 | * SRC ports. |
271 | * SRC ports. | 221 | */ |
272 | */ | 222 | if (iph->saddr != x->props.saddr.a4 || |
273 | if (decap_data->proto == AF_INET && | 223 | uh->source != encap->encap_sport) { |
274 | (decap_data->saddr.a4 != x->props.saddr.a4 || | 224 | xfrm_address_t ipaddr; |
275 | decap_data->sport != encap->encap_sport)) { | 225 | |
276 | xfrm_address_t ipaddr; | 226 | ipaddr.a4 = iph->saddr; |
277 | 227 | km_new_mapping(x, &ipaddr, uh->source); | |
278 | ipaddr.a4 = decap_data->saddr.a4; | 228 | |
279 | km_new_mapping(x, &ipaddr, decap_data->sport); | 229 | /* XXX: perhaps add an extra |
280 | 230 | * policy check here, to see | |
281 | /* XXX: perhaps add an extra | 231 | * if we should allow or |
282 | * policy check here, to see | 232 | * reject a packet from a |
283 | * if we should allow or | 233 | * different source |
284 | * reject a packet from a | 234 | * address/port. |
285 | * different source | ||
286 | * address/port. | ||
287 | */ | ||
288 | } | ||
289 | |||
290 | /* | ||
291 | * 2) ignore UDP/TCP checksums in case | ||
292 | * of NAT-T in Transport Mode, or | ||
293 | * perform other post-processing fixes | ||
294 | * as per * draft-ietf-ipsec-udp-encaps-06, | ||
295 | * section 3.1.2 | ||
296 | */ | 235 | */ |
297 | if (!x->props.mode) | ||
298 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
299 | |||
300 | break; | ||
301 | } | 236 | } |
237 | |||
238 | /* | ||
239 | * 2) ignore UDP/TCP checksums in case | ||
240 | * of NAT-T in Transport Mode, or | ||
241 | * perform other post-processing fixes | ||
242 | * as per draft-ietf-ipsec-udp-encaps-06, | ||
243 | * section 3.1.2 | ||
244 | */ | ||
245 | if (!x->props.mode) | ||
246 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
302 | } | 247 | } |
248 | |||
249 | iph->protocol = nexthdr[1]; | ||
250 | pskb_trim(skb, skb->len - alen - padlen - 2); | ||
251 | memcpy(workbuf, skb->nh.raw, iph->ihl*4); | ||
252 | skb->h.raw = skb_pull(skb, sizeof(struct ip_esp_hdr) + esp->conf.ivlen); | ||
253 | skb->nh.raw += encap_len + sizeof(struct ip_esp_hdr) + esp->conf.ivlen; | ||
254 | memcpy(skb->nh.raw, workbuf, iph->ihl*4); | ||
255 | skb->nh.iph->tot_len = htons(skb->len); | ||
256 | |||
303 | return 0; | 257 | return 0; |
258 | |||
259 | out: | ||
260 | return -EINVAL; | ||
304 | } | 261 | } |
305 | 262 | ||
306 | static u32 esp4_get_max_size(struct xfrm_state *x, int mtu) | 263 | static u32 esp4_get_max_size(struct xfrm_state *x, int mtu) |
@@ -458,7 +415,6 @@ static struct xfrm_type esp_type = | |||
458 | .destructor = esp_destroy, | 415 | .destructor = esp_destroy, |
459 | .get_max_size = esp4_get_max_size, | 416 | .get_max_size = esp4_get_max_size, |
460 | .input = esp_input, | 417 | .input = esp_input, |
461 | .post_input = esp_post_input, | ||
462 | .output = esp_output | 418 | .output = esp_output |
463 | }; | 419 | }; |
464 | 420 | ||
@@ -470,15 +426,6 @@ static struct net_protocol esp4_protocol = { | |||
470 | 426 | ||
471 | static int __init esp4_init(void) | 427 | static int __init esp4_init(void) |
472 | { | 428 | { |
473 | struct xfrm_decap_state decap; | ||
474 | |||
475 | if (sizeof(struct esp_decap_data) > | ||
476 | sizeof(decap.decap_data)) { | ||
477 | extern void decap_data_too_small(void); | ||
478 | |||
479 | decap_data_too_small(); | ||
480 | } | ||
481 | |||
482 | if (xfrm_register_type(&esp_type, AF_INET) < 0) { | 429 | if (xfrm_register_type(&esp_type, AF_INET) < 0) { |
483 | printk(KERN_INFO "ip esp init: can't add xfrm type\n"); | 430 | printk(KERN_INFO "ip esp init: can't add xfrm type\n"); |
484 | return -EAGAIN; | 431 | return -EAGAIN; |
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c index 6606ddb66a29..cc27545ff97f 100644 --- a/net/ipv4/netfilter/ipt_LOG.c +++ b/net/ipv4/netfilter/ipt_LOG.c | |||
@@ -425,7 +425,12 @@ ipt_log_target(struct sk_buff **pskb, | |||
425 | li.u.log.level = loginfo->level; | 425 | li.u.log.level = loginfo->level; |
426 | li.u.log.logflags = loginfo->logflags; | 426 | li.u.log.logflags = loginfo->logflags; |
427 | 427 | ||
428 | nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li, loginfo->prefix); | 428 | if (loginfo->logflags & IPT_LOG_NFLOG) |
429 | nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li, | ||
430 | loginfo->prefix); | ||
431 | else | ||
432 | ipt_log_packet(PF_INET, hooknum, *pskb, in, out, &li, | ||
433 | loginfo->prefix); | ||
429 | 434 | ||
430 | return IPT_CONTINUE; | 435 | return IPT_CONTINUE; |
431 | } | 436 | } |
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c index 77c725832dec..6b930efa9fb9 100644 --- a/net/ipv6/netfilter/ip6t_LOG.c +++ b/net/ipv6/netfilter/ip6t_LOG.c | |||
@@ -436,7 +436,12 @@ ip6t_log_target(struct sk_buff **pskb, | |||
436 | li.u.log.level = loginfo->level; | 436 | li.u.log.level = loginfo->level; |
437 | li.u.log.logflags = loginfo->logflags; | 437 | li.u.log.logflags = loginfo->logflags; |
438 | 438 | ||
439 | nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, loginfo->prefix); | 439 | if (loginfo->logflags & IP6T_LOG_NFLOG) |
440 | nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, | ||
441 | loginfo->prefix); | ||
442 | else | ||
443 | ip6t_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, | ||
444 | loginfo->prefix); | ||
440 | 445 | ||
441 | return IP6T_CONTINUE; | 446 | return IP6T_CONTINUE; |
442 | } | 447 | } |
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c index d3a4f30a7f22..d9f0d7ef103b 100644 --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/skbuff.h> | 6 | #include <linux/skbuff.h> |
7 | #include <linux/netfilter.h> | 7 | #include <linux/netfilter.h> |
8 | #include <linux/seq_file.h> | 8 | #include <linux/seq_file.h> |
9 | #include <linux/rcupdate.h> | ||
9 | #include <net/protocol.h> | 10 | #include <net/protocol.h> |
10 | 11 | ||
11 | #include "nf_internals.h" | 12 | #include "nf_internals.h" |
@@ -16,7 +17,7 @@ | |||
16 | * for queueing and must reinject all packets it receives, no matter what. | 17 | * for queueing and must reinject all packets it receives, no matter what. |
17 | */ | 18 | */ |
18 | static struct nf_queue_handler *queue_handler[NPROTO]; | 19 | static struct nf_queue_handler *queue_handler[NPROTO]; |
19 | static struct nf_queue_rerouter *queue_rerouter; | 20 | static struct nf_queue_rerouter *queue_rerouter[NPROTO]; |
20 | 21 | ||
21 | static DEFINE_RWLOCK(queue_handler_lock); | 22 | static DEFINE_RWLOCK(queue_handler_lock); |
22 | 23 | ||
@@ -64,7 +65,7 @@ int nf_register_queue_rerouter(int pf, struct nf_queue_rerouter *rer) | |||
64 | return -EINVAL; | 65 | return -EINVAL; |
65 | 66 | ||
66 | write_lock_bh(&queue_handler_lock); | 67 | write_lock_bh(&queue_handler_lock); |
67 | memcpy(&queue_rerouter[pf], rer, sizeof(queue_rerouter[pf])); | 68 | rcu_assign_pointer(queue_rerouter[pf], rer); |
68 | write_unlock_bh(&queue_handler_lock); | 69 | write_unlock_bh(&queue_handler_lock); |
69 | 70 | ||
70 | return 0; | 71 | return 0; |
@@ -77,8 +78,9 @@ int nf_unregister_queue_rerouter(int pf) | |||
77 | return -EINVAL; | 78 | return -EINVAL; |
78 | 79 | ||
79 | write_lock_bh(&queue_handler_lock); | 80 | write_lock_bh(&queue_handler_lock); |
80 | memset(&queue_rerouter[pf], 0, sizeof(queue_rerouter[pf])); | 81 | rcu_assign_pointer(queue_rerouter[pf], NULL); |
81 | write_unlock_bh(&queue_handler_lock); | 82 | write_unlock_bh(&queue_handler_lock); |
83 | synchronize_rcu(); | ||
82 | return 0; | 84 | return 0; |
83 | } | 85 | } |
84 | EXPORT_SYMBOL_GPL(nf_unregister_queue_rerouter); | 86 | EXPORT_SYMBOL_GPL(nf_unregister_queue_rerouter); |
@@ -114,16 +116,17 @@ int nf_queue(struct sk_buff **skb, | |||
114 | struct net_device *physindev = NULL; | 116 | struct net_device *physindev = NULL; |
115 | struct net_device *physoutdev = NULL; | 117 | struct net_device *physoutdev = NULL; |
116 | #endif | 118 | #endif |
119 | struct nf_queue_rerouter *rerouter; | ||
117 | 120 | ||
118 | /* QUEUE == DROP if noone is waiting, to be safe. */ | 121 | /* QUEUE == DROP if noone is waiting, to be safe. */ |
119 | read_lock(&queue_handler_lock); | 122 | read_lock(&queue_handler_lock); |
120 | if (!queue_handler[pf] || !queue_handler[pf]->outfn) { | 123 | if (!queue_handler[pf]) { |
121 | read_unlock(&queue_handler_lock); | 124 | read_unlock(&queue_handler_lock); |
122 | kfree_skb(*skb); | 125 | kfree_skb(*skb); |
123 | return 1; | 126 | return 1; |
124 | } | 127 | } |
125 | 128 | ||
126 | info = kmalloc(sizeof(*info)+queue_rerouter[pf].rer_size, GFP_ATOMIC); | 129 | info = kmalloc(sizeof(*info)+queue_rerouter[pf]->rer_size, GFP_ATOMIC); |
127 | if (!info) { | 130 | if (!info) { |
128 | if (net_ratelimit()) | 131 | if (net_ratelimit()) |
129 | printk(KERN_ERR "OOM queueing packet %p\n", | 132 | printk(KERN_ERR "OOM queueing packet %p\n", |
@@ -155,15 +158,13 @@ int nf_queue(struct sk_buff **skb, | |||
155 | if (physoutdev) dev_hold(physoutdev); | 158 | if (physoutdev) dev_hold(physoutdev); |
156 | } | 159 | } |
157 | #endif | 160 | #endif |
158 | if (queue_rerouter[pf].save) | 161 | rerouter = rcu_dereference(queue_rerouter[pf]); |
159 | queue_rerouter[pf].save(*skb, info); | 162 | if (rerouter) |
163 | rerouter->save(*skb, info); | ||
160 | 164 | ||
161 | status = queue_handler[pf]->outfn(*skb, info, queuenum, | 165 | status = queue_handler[pf]->outfn(*skb, info, queuenum, |
162 | queue_handler[pf]->data); | 166 | queue_handler[pf]->data); |
163 | 167 | ||
164 | if (status >= 0 && queue_rerouter[pf].reroute) | ||
165 | status = queue_rerouter[pf].reroute(skb, info); | ||
166 | |||
167 | read_unlock(&queue_handler_lock); | 168 | read_unlock(&queue_handler_lock); |
168 | 169 | ||
169 | if (status < 0) { | 170 | if (status < 0) { |
@@ -189,6 +190,7 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info, | |||
189 | { | 190 | { |
190 | struct list_head *elem = &info->elem->list; | 191 | struct list_head *elem = &info->elem->list; |
191 | struct list_head *i; | 192 | struct list_head *i; |
193 | struct nf_queue_rerouter *rerouter; | ||
192 | 194 | ||
193 | rcu_read_lock(); | 195 | rcu_read_lock(); |
194 | 196 | ||
@@ -212,7 +214,7 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info, | |||
212 | break; | 214 | break; |
213 | } | 215 | } |
214 | 216 | ||
215 | if (elem == &nf_hooks[info->pf][info->hook]) { | 217 | if (i == &nf_hooks[info->pf][info->hook]) { |
216 | /* The module which sent it to userspace is gone. */ | 218 | /* The module which sent it to userspace is gone. */ |
217 | NFDEBUG("%s: module disappeared, dropping packet.\n", | 219 | NFDEBUG("%s: module disappeared, dropping packet.\n", |
218 | __FUNCTION__); | 220 | __FUNCTION__); |
@@ -226,6 +228,12 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info, | |||
226 | } | 228 | } |
227 | 229 | ||
228 | if (verdict == NF_ACCEPT) { | 230 | if (verdict == NF_ACCEPT) { |
231 | rerouter = rcu_dereference(queue_rerouter[info->pf]); | ||
232 | if (rerouter && rerouter->reroute(&skb, info) < 0) | ||
233 | verdict = NF_DROP; | ||
234 | } | ||
235 | |||
236 | if (verdict == NF_ACCEPT) { | ||
229 | next_hook: | 237 | next_hook: |
230 | verdict = nf_iterate(&nf_hooks[info->pf][info->hook], | 238 | verdict = nf_iterate(&nf_hooks[info->pf][info->hook], |
231 | &skb, info->hook, | 239 | &skb, info->hook, |
@@ -322,22 +330,12 @@ int __init netfilter_queue_init(void) | |||
322 | { | 330 | { |
323 | #ifdef CONFIG_PROC_FS | 331 | #ifdef CONFIG_PROC_FS |
324 | struct proc_dir_entry *pde; | 332 | struct proc_dir_entry *pde; |
325 | #endif | ||
326 | queue_rerouter = kmalloc(NPROTO * sizeof(struct nf_queue_rerouter), | ||
327 | GFP_KERNEL); | ||
328 | if (!queue_rerouter) | ||
329 | return -ENOMEM; | ||
330 | 333 | ||
331 | #ifdef CONFIG_PROC_FS | ||
332 | pde = create_proc_entry("nf_queue", S_IRUGO, proc_net_netfilter); | 334 | pde = create_proc_entry("nf_queue", S_IRUGO, proc_net_netfilter); |
333 | if (!pde) { | 335 | if (!pde) |
334 | kfree(queue_rerouter); | ||
335 | return -1; | 336 | return -1; |
336 | } | ||
337 | pde->proc_fops = &nfqueue_file_ops; | 337 | pde->proc_fops = &nfqueue_file_ops; |
338 | #endif | 338 | #endif |
339 | memset(queue_rerouter, 0, NPROTO * sizeof(struct nf_queue_rerouter)); | ||
340 | |||
341 | return 0; | 339 | return 0; |
342 | } | 340 | } |
343 | 341 | ||
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 8206025d8e46..ae62054a9fc4 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -996,13 +996,6 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, | |||
996 | struct sec_decap_state *xvec = &(skb->sp->x[i]); | 996 | struct sec_decap_state *xvec = &(skb->sp->x[i]); |
997 | if (!xfrm_selector_match(&xvec->xvec->sel, &fl, family)) | 997 | if (!xfrm_selector_match(&xvec->xvec->sel, &fl, family)) |
998 | return 0; | 998 | return 0; |
999 | |||
1000 | /* If there is a post_input processor, try running it */ | ||
1001 | if (xvec->xvec->type->post_input && | ||
1002 | (xvec->xvec->type->post_input)(xvec->xvec, | ||
1003 | &(xvec->decap), | ||
1004 | skb) != 0) | ||
1005 | return 0; | ||
1006 | } | 999 | } |
1007 | } | 1000 | } |
1008 | 1001 | ||