Contents of /trunk/kernel26-alx/patches-2.6.20-r6/0114-2.6.20.14-all-fixes.patch
Parent Directory | Revision Log
Revision 1175 -
(show annotations)
(download)
Thu Oct 14 12:15:46 2010 UTC (13 years, 11 months ago) by niro
File size: 46641 byte(s)
Thu Oct 14 12:15:46 2010 UTC (13 years, 11 months ago) by niro
File size: 46641 byte(s)
-2.6.20-alx-r6 new magellan 0.5.2 kernel
1 | diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c |
2 | index 89ec70e..d907a2a 100644 |
3 | --- a/arch/arm/mach-iop13xx/pci.c |
4 | +++ b/arch/arm/mach-iop13xx/pci.c |
5 | @@ -1023,7 +1023,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys) |
6 | << IOP13XX_ATUX_PCIXSR_FUNC_NUM; |
7 | __raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR); |
8 | |
9 | - res[0].start = IOP13XX_PCIX_LOWER_IO_PA; |
10 | + res[0].start = IOP13XX_PCIX_LOWER_IO_PA + IOP13XX_PCIX_IO_BUS_OFFSET; |
11 | res[0].end = IOP13XX_PCIX_UPPER_IO_PA; |
12 | res[0].name = "IQ81340 ATUX PCI I/O Space"; |
13 | res[0].flags = IORESOURCE_IO; |
14 | @@ -1033,7 +1033,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys) |
15 | res[1].name = "IQ81340 ATUX PCI Memory Space"; |
16 | res[1].flags = IORESOURCE_MEM; |
17 | sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET; |
18 | - sys->io_offset = IOP13XX_PCIX_IO_OFFSET; |
19 | + sys->io_offset = IOP13XX_PCIX_LOWER_IO_PA; |
20 | break; |
21 | case IOP13XX_INIT_ATU_ATUE: |
22 | /* Note: the function number field in the PCSR is ro */ |
23 | @@ -1044,7 +1044,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys) |
24 | |
25 | __raw_writel(pcsr, IOP13XX_ATUE_PCSR); |
26 | |
27 | - res[0].start = IOP13XX_PCIE_LOWER_IO_PA; |
28 | + res[0].start = IOP13XX_PCIE_LOWER_IO_PA + IOP13XX_PCIE_IO_BUS_OFFSET; |
29 | res[0].end = IOP13XX_PCIE_UPPER_IO_PA; |
30 | res[0].name = "IQ81340 ATUE PCI I/O Space"; |
31 | res[0].flags = IORESOURCE_IO; |
32 | @@ -1054,7 +1054,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys) |
33 | res[1].name = "IQ81340 ATUE PCI Memory Space"; |
34 | res[1].flags = IORESOURCE_MEM; |
35 | sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET; |
36 | - sys->io_offset = IOP13XX_PCIE_IO_OFFSET; |
37 | + sys->io_offset = IOP13XX_PCIE_LOWER_IO_PA; |
38 | sys->map_irq = iop13xx_pcie_map_irq; |
39 | break; |
40 | default: |
41 | diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S |
42 | index baea10a..06459ae 100644 |
43 | --- a/arch/sparc64/kernel/head.S |
44 | +++ b/arch/sparc64/kernel/head.S |
45 | @@ -653,33 +653,54 @@ setup_tba: |
46 | restore |
47 | sparc64_boot_end: |
48 | |
49 | -#include "ktlb.S" |
50 | -#include "tsb.S" |
51 | #include "etrap.S" |
52 | #include "rtrap.S" |
53 | #include "winfixup.S" |
54 | #include "entry.S" |
55 | #include "sun4v_tlb_miss.S" |
56 | #include "sun4v_ivec.S" |
57 | +#include "ktlb.S" |
58 | +#include "tsb.S" |
59 | |
60 | /* |
61 | * The following skip makes sure the trap table in ttable.S is aligned |
62 | * on a 32K boundary as required by the v9 specs for TBA register. |
63 | * |
64 | * We align to a 32K boundary, then we have the 32K kernel TSB, |
65 | - * then the 32K aligned trap table. |
66 | + * the 64K kernel 4MB TSB, and then the 32K aligned trap table. |
67 | */ |
68 | 1: |
69 | .skip 0x4000 + _start - 1b |
70 | |
71 | +! 0x0000000000408000 |
72 | + |
73 | .globl swapper_tsb |
74 | swapper_tsb: |
75 | .skip (32 * 1024) |
76 | |
77 | -! 0x0000000000408000 |
78 | + .globl swapper_4m_tsb |
79 | +swapper_4m_tsb: |
80 | + .skip (64 * 1024) |
81 | + |
82 | +! 0x0000000000420000 |
83 | |
84 | + /* Some care needs to be exercised if you try to move the |
85 | + * location of the trap table relative to other things. For |
86 | + * one thing there are br* instructions in some of the |
87 | + * trap table entires which branch back to code in ktlb.S |
88 | + * Those instructions can only handle a signed 16-bit |
89 | + * displacement. |
90 | + * |
91 | + * There is a binutils bug (bugzilla #4558) which causes |
92 | + * the relocation overflow checks for such instructions to |
93 | + * not be done correctly. So bintuils will not notice the |
94 | + * error and will instead write junk into the relocation and |
95 | + * you'll have an unbootable kernel. |
96 | + */ |
97 | #include "ttable.S" |
98 | |
99 | +! 0x0000000000428000 |
100 | + |
101 | #include "systbls.S" |
102 | |
103 | .data |
104 | diff --git a/arch/sparc64/kernel/itlb_miss.S b/arch/sparc64/kernel/itlb_miss.S |
105 | index ad46e20..5a8377b 100644 |
106 | --- a/arch/sparc64/kernel/itlb_miss.S |
107 | +++ b/arch/sparc64/kernel/itlb_miss.S |
108 | @@ -11,12 +11,12 @@ |
109 | /* ITLB ** ICACHE line 2: TSB compare and TLB load */ |
110 | bne,pn %xcc, tsb_miss_itlb ! Miss |
111 | mov FAULT_CODE_ITLB, %g3 |
112 | - andcc %g5, _PAGE_EXEC_4U, %g0 ! Executable? |
113 | + sethi %hi(_PAGE_EXEC_4U), %g4 |
114 | + andcc %g5, %g4, %g0 ! Executable? |
115 | be,pn %xcc, tsb_do_fault |
116 | nop ! Delay slot, fill me |
117 | stxa %g5, [%g0] ASI_ITLB_DATA_IN ! Load TLB |
118 | retry ! Trap done |
119 | - nop |
120 | |
121 | /* ITLB ** ICACHE line 3: */ |
122 | nop |
123 | diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c |
124 | index 6b04794..1153f68 100644 |
125 | --- a/arch/sparc64/kernel/pci_sun4v.c |
126 | +++ b/arch/sparc64/kernel/pci_sun4v.c |
127 | @@ -10,6 +10,7 @@ |
128 | #include <linux/slab.h> |
129 | #include <linux/interrupt.h> |
130 | #include <linux/percpu.h> |
131 | +#include <linux/log2.h> |
132 | |
133 | #include <asm/pbm.h> |
134 | #include <asm/iommu.h> |
135 | @@ -994,9 +995,8 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm) |
136 | { |
137 | struct pci_iommu *iommu = pbm->iommu; |
138 | struct property *prop; |
139 | - unsigned long num_tsb_entries, sz; |
140 | + unsigned long num_tsb_entries, sz, tsbsize; |
141 | u32 vdma[2], dma_mask, dma_offset; |
142 | - int tsbsize; |
143 | |
144 | prop = of_find_property(pbm->prom_node, "virtual-dma", NULL); |
145 | if (prop) { |
146 | @@ -1010,31 +1010,15 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm) |
147 | vdma[1] = 0x80000000; |
148 | } |
149 | |
150 | - dma_mask = vdma[0]; |
151 | - switch (vdma[1]) { |
152 | - case 0x20000000: |
153 | - dma_mask |= 0x1fffffff; |
154 | - tsbsize = 64; |
155 | - break; |
156 | - |
157 | - case 0x40000000: |
158 | - dma_mask |= 0x3fffffff; |
159 | - tsbsize = 128; |
160 | - break; |
161 | - |
162 | - case 0x80000000: |
163 | - dma_mask |= 0x7fffffff; |
164 | - tsbsize = 256; |
165 | - break; |
166 | - |
167 | - default: |
168 | - prom_printf("PCI-SUN4V: strange virtual-dma size.\n"); |
169 | - prom_halt(); |
170 | + if ((vdma[0] | vdma[1]) & ~IO_PAGE_MASK) { |
171 | + prom_printf("PCI-SUN4V: strange virtual-dma[%08x:%08x].\n", |
172 | + vdma[0], vdma[1]); |
173 | + prom_halt(); |
174 | }; |
175 | |
176 | - tsbsize *= (8 * 1024); |
177 | - |
178 | - num_tsb_entries = tsbsize / sizeof(iopte_t); |
179 | + dma_mask = (roundup_pow_of_two(vdma[1]) - 1UL); |
180 | + num_tsb_entries = vdma[1] / IO_PAGE_SIZE; |
181 | + tsbsize = num_tsb_entries * sizeof(iopte_t); |
182 | |
183 | dma_offset = vdma[0]; |
184 | |
185 | @@ -1045,7 +1029,7 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm) |
186 | iommu->dma_addr_mask = dma_mask; |
187 | |
188 | /* Allocate and initialize the free area map. */ |
189 | - sz = num_tsb_entries / 8; |
190 | + sz = (num_tsb_entries + 7) / 8; |
191 | sz = (sz + 7UL) & ~7UL; |
192 | iommu->arena.map = kzalloc(sz, GFP_KERNEL); |
193 | if (!iommu->arena.map) { |
194 | diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c |
195 | index 5391cd5..88f5ff0 100644 |
196 | --- a/arch/sparc64/mm/init.c |
197 | +++ b/arch/sparc64/mm/init.c |
198 | @@ -60,8 +60,11 @@ unsigned long kern_linear_pte_xor[2] __read_mostly; |
199 | unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)]; |
200 | |
201 | #ifndef CONFIG_DEBUG_PAGEALLOC |
202 | -/* A special kernel TSB for 4MB and 256MB linear mappings. */ |
203 | -struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES]; |
204 | +/* A special kernel TSB for 4MB and 256MB linear mappings. |
205 | + * Space is allocated for this right after the trap table |
206 | + * in arch/sparc64/kernel/head.S |
207 | + */ |
208 | +extern struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES]; |
209 | #endif |
210 | |
211 | #define MAX_BANKS 32 |
212 | diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c |
213 | index ccb91dd..4df4bb5 100644 |
214 | --- a/arch/x86_64/mm/pageattr.c |
215 | +++ b/arch/x86_64/mm/pageattr.c |
216 | @@ -81,8 +81,8 @@ static void flush_kernel_map(void *arg) |
217 | void *adr = page_address(pg); |
218 | if (cpu_has_clflush) |
219 | cache_flush_page(adr); |
220 | - __flush_tlb_one(adr); |
221 | } |
222 | + __flush_tlb_all(); |
223 | } |
224 | |
225 | static inline void flush_map(struct list_head *l) |
226 | diff --git a/crypto/api.c b/crypto/api.c |
227 | index 8c44687..005d874 100644 |
228 | --- a/crypto/api.c |
229 | +++ b/crypto/api.c |
230 | @@ -48,8 +48,10 @@ EXPORT_SYMBOL_GPL(crypto_mod_get); |
231 | |
232 | void crypto_mod_put(struct crypto_alg *alg) |
233 | { |
234 | + struct module *module = alg->cra_module; |
235 | + |
236 | crypto_alg_put(alg); |
237 | - module_put(alg->cra_module); |
238 | + module_put(module); |
239 | } |
240 | EXPORT_SYMBOL_GPL(crypto_mod_put); |
241 | |
242 | diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c |
243 | index 40ddb4d..324a1cb 100644 |
244 | --- a/drivers/acpi/thermal.c |
245 | +++ b/drivers/acpi/thermal.c |
246 | @@ -758,7 +758,8 @@ static void acpi_thermal_check(void *data) |
247 | del_timer(&(tz->timer)); |
248 | } else { |
249 | if (timer_pending(&(tz->timer))) |
250 | - mod_timer(&(tz->timer), (HZ * sleep_time) / 1000); |
251 | + mod_timer(&(tz->timer), |
252 | + jiffies + (HZ * sleep_time) / 1000); |
253 | else { |
254 | tz->timer.data = (unsigned long)tz; |
255 | tz->timer.function = acpi_thermal_run; |
256 | diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c |
257 | index d3d5c0d..f6ac2da 100644 |
258 | --- a/drivers/ata/sata_via.c |
259 | +++ b/drivers/ata/sata_via.c |
260 | @@ -90,6 +90,10 @@ static struct pci_driver svia_pci_driver = { |
261 | .name = DRV_NAME, |
262 | .id_table = svia_pci_tbl, |
263 | .probe = svia_init_one, |
264 | +#ifdef CONFIG_PM |
265 | + .suspend = ata_pci_device_suspend, |
266 | + .resume = ata_pci_device_resume, |
267 | +#endif |
268 | .remove = ata_pci_remove_one, |
269 | }; |
270 | |
271 | @@ -109,6 +113,10 @@ static struct scsi_host_template svia_sht = { |
272 | .slave_configure = ata_scsi_slave_config, |
273 | .slave_destroy = ata_scsi_slave_destroy, |
274 | .bios_param = ata_std_bios_param, |
275 | +#ifdef CONFIG_PM |
276 | + .suspend = ata_scsi_device_suspend, |
277 | + .resume = ata_scsi_device_resume, |
278 | +#endif |
279 | }; |
280 | |
281 | static const struct ata_port_operations vt6420_sata_ops = { |
282 | diff --git a/drivers/base/core.c b/drivers/base/core.c |
283 | index 67b79a7..7d10d67 100644 |
284 | --- a/drivers/base/core.c |
285 | +++ b/drivers/base/core.c |
286 | @@ -93,6 +93,9 @@ static void device_release(struct kobject * kobj) |
287 | { |
288 | struct device * dev = to_dev(kobj); |
289 | |
290 | + kfree(dev->devt_attr); |
291 | + dev->devt_attr = NULL; |
292 | + |
293 | if (dev->release) |
294 | dev->release(dev); |
295 | else if (dev->class && dev->class->dev_release) |
296 | @@ -650,10 +653,8 @@ void device_del(struct device * dev) |
297 | |
298 | if (parent) |
299 | klist_del(&dev->knode_parent); |
300 | - if (dev->devt_attr) { |
301 | + if (dev->devt_attr) |
302 | device_remove_file(dev, dev->devt_attr); |
303 | - kfree(dev->devt_attr); |
304 | - } |
305 | if (dev->class) { |
306 | sysfs_remove_link(&dev->kobj, "subsystem"); |
307 | /* If this is not a "fake" compatible device, remove the |
308 | diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c |
309 | index 3b12996..879b010 100644 |
310 | --- a/drivers/input/serio/i8042.c |
311 | +++ b/drivers/input/serio/i8042.c |
312 | @@ -533,6 +533,33 @@ static irqreturn_t __devinit i8042_aux_test_irq(int irq, void *dev_id) |
313 | return IRQ_HANDLED; |
314 | } |
315 | |
316 | +/* |
317 | + * i8042_toggle_aux - enables or disables AUX port on i8042 via command and |
318 | + * verifies success by readinng CTR. Used when testing for presence of AUX |
319 | + * port. |
320 | + */ |
321 | +static int __devinit i8042_toggle_aux(int on) |
322 | +{ |
323 | + unsigned char param; |
324 | + int i; |
325 | + |
326 | + if (i8042_command(¶m, |
327 | + on ? I8042_CMD_AUX_ENABLE : I8042_CMD_AUX_DISABLE)) |
328 | + return -1; |
329 | + |
330 | + /* some chips need some time to set the I8042_CTR_AUXDIS bit */ |
331 | + for (i = 0; i < 100; i++) { |
332 | + udelay(50); |
333 | + |
334 | + if (i8042_command(¶m, I8042_CMD_CTL_RCTR)) |
335 | + return -1; |
336 | + |
337 | + if (!(param & I8042_CTR_AUXDIS) == on) |
338 | + return 0; |
339 | + } |
340 | + |
341 | + return -1; |
342 | +} |
343 | |
344 | /* |
345 | * i8042_check_aux() applies as much paranoia as it can at detecting |
346 | @@ -587,16 +614,12 @@ static int __devinit i8042_check_aux(void) |
347 | * Bit assignment test - filters out PS/2 i8042's in AT mode |
348 | */ |
349 | |
350 | - if (i8042_command(¶m, I8042_CMD_AUX_DISABLE)) |
351 | - return -1; |
352 | - if (i8042_command(¶m, I8042_CMD_CTL_RCTR) || (~param & I8042_CTR_AUXDIS)) { |
353 | + if (i8042_toggle_aux(0)) { |
354 | printk(KERN_WARNING "Failed to disable AUX port, but continuing anyway... Is this a SiS?\n"); |
355 | printk(KERN_WARNING "If AUX port is really absent please use the 'i8042.noaux' option.\n"); |
356 | } |
357 | |
358 | - if (i8042_command(¶m, I8042_CMD_AUX_ENABLE)) |
359 | - return -1; |
360 | - if (i8042_command(¶m, I8042_CMD_CTL_RCTR) || (param & I8042_CTR_AUXDIS)) |
361 | + if (i8042_toggle_aux(1)) |
362 | return -1; |
363 | |
364 | /* |
365 | diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c |
366 | index f2066b4..ac0ca22 100644 |
367 | --- a/drivers/media/dvb/ttpci/budget-ci.c |
368 | +++ b/drivers/media/dvb/ttpci/budget-ci.c |
369 | @@ -892,7 +892,7 @@ static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struc |
370 | band = 1; |
371 | } else if (tuner_frequency < 200000000) { |
372 | cp = 6; |
373 | - band = 2; |
374 | + band = 1; |
375 | } else if (tuner_frequency < 290000000) { |
376 | cp = 3; |
377 | band = 2; |
378 | diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c |
379 | index 43af614..5f1cdb2 100644 |
380 | --- a/drivers/net/smc911x.c |
381 | +++ b/drivers/net/smc911x.c |
382 | @@ -499,7 +499,7 @@ static inline void smc911x_rcv(struct net_device *dev) |
383 | SMC_SET_RX_CFG(RX_CFG_RX_END_ALGN4_ | ((2<<8) & RX_CFG_RXDOFF_)); |
384 | SMC_PULL_DATA(data, pkt_len+2+3); |
385 | |
386 | - DBG(SMC_DEBUG_PKTS, "%s: Received packet\n", dev->name,); |
387 | + DBG(SMC_DEBUG_PKTS, "%s: Received packet\n", dev->name); |
388 | PRINT_PKT(data, ((pkt_len - 4) <= 64) ? pkt_len - 4 : 64); |
389 | dev->last_rx = jiffies; |
390 | skb->dev = dev; |
391 | diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c |
392 | index e35d9ab..b45ba53 100644 |
393 | --- a/drivers/serial/suncore.c |
394 | +++ b/drivers/serial/suncore.c |
395 | @@ -30,9 +30,9 @@ void |
396 | sunserial_console_termios(struct console *con) |
397 | { |
398 | char mode[16], buf[16], *s; |
399 | - char *mode_prop = "ttyX-mode"; |
400 | - char *cd_prop = "ttyX-ignore-cd"; |
401 | - char *dtr_prop = "ttyX-rts-dtr-off"; |
402 | + char mode_prop[] = "ttyX-mode"; |
403 | + char cd_prop[] = "ttyX-ignore-cd"; |
404 | + char dtr_prop[] = "ttyX-rts-dtr-off"; |
405 | char *ssp_console_modes_prop = "ssp-console-modes"; |
406 | int baud, bits, stop, cflag; |
407 | char parity; |
408 | diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c |
409 | index 4008047..942069b 100644 |
410 | --- a/fs/fuse/dir.c |
411 | +++ b/fs/fuse/dir.c |
412 | @@ -484,7 +484,7 @@ static int fuse_mknod(struct inode *dir, struct dentry *entry, int mode, |
413 | static int fuse_create(struct inode *dir, struct dentry *entry, int mode, |
414 | struct nameidata *nd) |
415 | { |
416 | - if (nd && (nd->flags & LOOKUP_CREATE)) { |
417 | + if (nd && (nd->flags & LOOKUP_OPEN)) { |
418 | int err = fuse_create_open(dir, entry, mode, nd); |
419 | if (err != -ENOSYS) |
420 | return err; |
421 | diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c |
422 | index 5065baa..3760d02 100644 |
423 | --- a/fs/jfs/jfs_logmgr.c |
424 | +++ b/fs/jfs/jfs_logmgr.c |
425 | @@ -2354,12 +2354,13 @@ int jfsIOWait(void *arg) |
426 | lbmStartIO(bp); |
427 | spin_lock_irq(&log_redrive_lock); |
428 | } |
429 | - spin_unlock_irq(&log_redrive_lock); |
430 | |
431 | if (freezing(current)) { |
432 | + spin_unlock_irq(&log_redrive_lock); |
433 | refrigerator(); |
434 | } else { |
435 | set_current_state(TASK_INTERRUPTIBLE); |
436 | + spin_unlock_irq(&log_redrive_lock); |
437 | schedule(); |
438 | current->state = TASK_RUNNING; |
439 | } |
440 | diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c |
441 | index f8bf8da..461460d 100644 |
442 | --- a/fs/ntfs/inode.c |
443 | +++ b/fs/ntfs/inode.c |
444 | @@ -141,7 +141,7 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na) |
445 | if (!ni->name) |
446 | return -ENOMEM; |
447 | memcpy(ni->name, na->name, i); |
448 | - ni->name[i] = 0; |
449 | + ni->name[na->name_len] = 0; |
450 | } |
451 | return 0; |
452 | } |
453 | diff --git a/include/asm-arm/arch-iop13xx/iop13xx.h b/include/asm-arm/arch-iop13xx/iop13xx.h |
454 | index a88522a..9a52479 100644 |
455 | --- a/include/asm-arm/arch-iop13xx/iop13xx.h |
456 | +++ b/include/asm-arm/arch-iop13xx/iop13xx.h |
457 | @@ -55,19 +55,24 @@ static inline int iop13xx_cpu_id(void) |
458 | #define IOP13XX_PCI_OFFSET IOP13XX_MAX_RAM_SIZE |
459 | |
460 | /* PCI MAP |
461 | - * 0x0000.0000 - 0x8000.0000 1:1 mapping with Physical RAM |
462 | - * 0x8000.0000 - 0x8800.0000 PCIX/PCIE memory window (128MB) |
463 | -*/ |
464 | + * bus range cpu phys cpu virt note |
465 | + * 0x0000.0000 + 2GB (n/a) (n/a) inbound, 1:1 mapping with Physical RAM |
466 | + * 0x8000.0000 + 928M 0x1.8000.0000 (ioremap) PCIX outbound memory window |
467 | + * 0x8000.0000 + 928M 0x2.8000.0000 (ioremap) PCIE outbound memory window |
468 | + * |
469 | + * IO MAP |
470 | + * 0x1000 + 64K 0x0.fffb.1000 0xfec6.1000 PCIX outbound i/o window |
471 | + * 0x1000 + 64K 0x0.fffd.1000 0xfed7.1000 PCIE outbound i/o window |
472 | + */ |
473 | #define IOP13XX_PCIX_IO_WINDOW_SIZE 0x10000UL |
474 | #define IOP13XX_PCIX_LOWER_IO_PA 0xfffb0000UL |
475 | #define IOP13XX_PCIX_LOWER_IO_VA 0xfec60000UL |
476 | -#define IOP13XX_PCIX_LOWER_IO_BA 0x0fff0000UL |
477 | +#define IOP13XX_PCIX_LOWER_IO_BA 0x0UL /* OIOTVR */ |
478 | +#define IOP13XX_PCIX_IO_BUS_OFFSET 0x1000UL |
479 | #define IOP13XX_PCIX_UPPER_IO_PA (IOP13XX_PCIX_LOWER_IO_PA +\ |
480 | IOP13XX_PCIX_IO_WINDOW_SIZE - 1) |
481 | #define IOP13XX_PCIX_UPPER_IO_VA (IOP13XX_PCIX_LOWER_IO_VA +\ |
482 | IOP13XX_PCIX_IO_WINDOW_SIZE - 1) |
483 | -#define IOP13XX_PCIX_IO_OFFSET (IOP13XX_PCIX_LOWER_IO_VA -\ |
484 | - IOP13XX_PCIX_LOWER_IO_BA) |
485 | #define IOP13XX_PCIX_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\ |
486 | (IOP13XX_PCIX_LOWER_IO_PA\ |
487 | - IOP13XX_PCIX_LOWER_IO_VA)) |
488 | @@ -93,15 +98,14 @@ static inline int iop13xx_cpu_id(void) |
489 | #define IOP13XX_PCIE_IO_WINDOW_SIZE 0x10000UL |
490 | #define IOP13XX_PCIE_LOWER_IO_PA 0xfffd0000UL |
491 | #define IOP13XX_PCIE_LOWER_IO_VA 0xfed70000UL |
492 | -#define IOP13XX_PCIE_LOWER_IO_BA 0x0fff0000UL |
493 | +#define IOP13XX_PCIE_LOWER_IO_BA 0x0UL /* OIOTVR */ |
494 | +#define IOP13XX_PCIE_IO_BUS_OFFSET 0x1000UL |
495 | #define IOP13XX_PCIE_UPPER_IO_PA (IOP13XX_PCIE_LOWER_IO_PA +\ |
496 | IOP13XX_PCIE_IO_WINDOW_SIZE - 1) |
497 | #define IOP13XX_PCIE_UPPER_IO_VA (IOP13XX_PCIE_LOWER_IO_VA +\ |
498 | IOP13XX_PCIE_IO_WINDOW_SIZE - 1) |
499 | #define IOP13XX_PCIE_UPPER_IO_BA (IOP13XX_PCIE_LOWER_IO_BA +\ |
500 | IOP13XX_PCIE_IO_WINDOW_SIZE - 1) |
501 | -#define IOP13XX_PCIE_IO_OFFSET (IOP13XX_PCIE_LOWER_IO_VA -\ |
502 | - IOP13XX_PCIE_LOWER_IO_BA) |
503 | #define IOP13XX_PCIE_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\ |
504 | (IOP13XX_PCIE_LOWER_IO_PA\ |
505 | - IOP13XX_PCIE_LOWER_IO_VA)) |
506 | diff --git a/include/asm-s390/checksum.h b/include/asm-s390/checksum.h |
507 | index 0a3cd7e..d5a8e7c 100644 |
508 | --- a/include/asm-s390/checksum.h |
509 | +++ b/include/asm-s390/checksum.h |
510 | @@ -121,50 +121,21 @@ csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
511 | unsigned short len, unsigned short proto, |
512 | __wsum sum) |
513 | { |
514 | -#ifndef __s390x__ |
515 | - asm volatile( |
516 | - " alr %0,%1\n" /* sum += saddr */ |
517 | - " brc 12,0f\n" |
518 | - " ahi %0,1\n" /* add carry */ |
519 | - "0:" |
520 | - : "+&d" (sum) : "d" (saddr) : "cc"); |
521 | - asm volatile( |
522 | - " alr %0,%1\n" /* sum += daddr */ |
523 | - " brc 12,1f\n" |
524 | - " ahi %0,1\n" /* add carry */ |
525 | - "1:" |
526 | - : "+&d" (sum) : "d" (daddr) : "cc"); |
527 | - asm volatile( |
528 | - " alr %0,%1\n" /* sum += len + proto */ |
529 | - " brc 12,2f\n" |
530 | - " ahi %0,1\n" /* add carry */ |
531 | - "2:" |
532 | - : "+&d" (sum) |
533 | - : "d" (len + proto) |
534 | - : "cc"); |
535 | -#else /* __s390x__ */ |
536 | - asm volatile( |
537 | - " lgfr %0,%0\n" |
538 | - " algr %0,%1\n" /* sum += saddr */ |
539 | - " brc 12,0f\n" |
540 | - " aghi %0,1\n" /* add carry */ |
541 | - "0: algr %0,%2\n" /* sum += daddr */ |
542 | - " brc 12,1f\n" |
543 | - " aghi %0,1\n" /* add carry */ |
544 | - "1: algfr %0,%3\n" /* sum += len + proto */ |
545 | - " brc 12,2f\n" |
546 | - " aghi %0,1\n" /* add carry */ |
547 | - "2: srlg 0,%0,32\n" |
548 | - " alr %0,0\n" /* fold to 32 bits */ |
549 | - " brc 12,3f\n" |
550 | - " ahi %0,1\n" /* add carry */ |
551 | - "3: llgfr %0,%0" |
552 | - : "+&d" (sum) |
553 | - : "d" (saddr), "d" (daddr), |
554 | - "d" (len + proto) |
555 | - : "cc", "0"); |
556 | -#endif /* __s390x__ */ |
557 | - return sum; |
558 | + __u32 csum = (__force __u32)sum; |
559 | + |
560 | + csum += (__force __u32)saddr; |
561 | + if (csum < (__force __u32)saddr) |
562 | + csum++; |
563 | + |
564 | + csum += (__force __u32)daddr; |
565 | + if (csum < (__force __u32)daddr) |
566 | + csum++; |
567 | + |
568 | + csum += len + proto; |
569 | + if (csum < len + proto) |
570 | + csum++; |
571 | + |
572 | + return (__force __wsum)csum; |
573 | } |
574 | |
575 | /* |
576 | diff --git a/include/asm-sparc64/tsb.h b/include/asm-sparc64/tsb.h |
577 | index ab55ffc..76e4299 100644 |
578 | --- a/include/asm-sparc64/tsb.h |
579 | +++ b/include/asm-sparc64/tsb.h |
580 | @@ -271,7 +271,7 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end; |
581 | #define KERN_TSB4M_LOOKUP_TL1(TAG, REG1, REG2, REG3, REG4, OK_LABEL) \ |
582 | sethi %hi(swapper_4m_tsb), REG1; \ |
583 | or REG1, %lo(swapper_4m_tsb), REG1; \ |
584 | - and TAG, (KERNEL_TSB_NENTRIES - 1), REG2; \ |
585 | + and TAG, (KERNEL_TSB4M_NENTRIES - 1), REG2; \ |
586 | sllx REG2, 4, REG2; \ |
587 | add REG1, REG2, REG2; \ |
588 | KTSB_LOAD_QUAD(REG2, REG3); \ |
589 | diff --git a/include/linux/mii.h b/include/linux/mii.h |
590 | index beddc6d..151b7e0 100644 |
591 | --- a/include/linux/mii.h |
592 | +++ b/include/linux/mii.h |
593 | @@ -56,8 +56,8 @@ |
594 | #define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */ |
595 | #define BMSR_RESV 0x00c0 /* Unused... */ |
596 | #define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */ |
597 | -#define BMSR_100FULL2 0x0200 /* Can do 100BASE-T2 HDX */ |
598 | -#define BMSR_100HALF2 0x0400 /* Can do 100BASE-T2 FDX */ |
599 | +#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */ |
600 | +#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */ |
601 | #define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */ |
602 | #define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */ |
603 | #define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */ |
604 | diff --git a/include/linux/netfilter/nf_conntrack_proto_gre.h b/include/linux/netfilter/nf_conntrack_proto_gre.h |
605 | index 4e6bbce..535e421 100644 |
606 | --- a/include/linux/netfilter/nf_conntrack_proto_gre.h |
607 | +++ b/include/linux/netfilter/nf_conntrack_proto_gre.h |
608 | @@ -87,24 +87,6 @@ int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, |
609 | /* delete keymap entries */ |
610 | void nf_ct_gre_keymap_destroy(struct nf_conn *ct); |
611 | |
612 | -/* get pointer to gre key, if present */ |
613 | -static inline __be32 *gre_key(struct gre_hdr *greh) |
614 | -{ |
615 | - if (!greh->key) |
616 | - return NULL; |
617 | - if (greh->csum || greh->routing) |
618 | - return (__be32 *)(greh+sizeof(*greh)+4); |
619 | - return (__be32 *)(greh+sizeof(*greh)); |
620 | -} |
621 | - |
622 | -/* get pointer ot gre csum, if present */ |
623 | -static inline __sum16 *gre_csum(struct gre_hdr *greh) |
624 | -{ |
625 | - if (!greh->csum) |
626 | - return NULL; |
627 | - return (__sum16 *)(greh+sizeof(*greh)); |
628 | -} |
629 | - |
630 | extern void nf_ct_gre_keymap_flush(void); |
631 | extern void nf_nat_need_gre(void); |
632 | |
633 | diff --git a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h |
634 | index e371e0f..d0f36f5 100644 |
635 | --- a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h |
636 | +++ b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h |
637 | @@ -90,25 +90,6 @@ int ip_ct_gre_keymap_add(struct ip_conntrack *ct, |
638 | /* delete keymap entries */ |
639 | void ip_ct_gre_keymap_destroy(struct ip_conntrack *ct); |
640 | |
641 | - |
642 | -/* get pointer to gre key, if present */ |
643 | -static inline __be32 *gre_key(struct gre_hdr *greh) |
644 | -{ |
645 | - if (!greh->key) |
646 | - return NULL; |
647 | - if (greh->csum || greh->routing) |
648 | - return (__be32 *) (greh+sizeof(*greh)+4); |
649 | - return (__be32 *) (greh+sizeof(*greh)); |
650 | -} |
651 | - |
652 | -/* get pointer ot gre csum, if present */ |
653 | -static inline __sum16 *gre_csum(struct gre_hdr *greh) |
654 | -{ |
655 | - if (!greh->csum) |
656 | - return NULL; |
657 | - return (__sum16 *) (greh+sizeof(*greh)); |
658 | -} |
659 | - |
660 | #endif /* __KERNEL__ */ |
661 | |
662 | #endif /* _CONNTRACK_PROTO_GRE_H */ |
663 | diff --git a/include/net/af_unix.h b/include/net/af_unix.h |
664 | index c0398f5..65f49fd 100644 |
665 | --- a/include/net/af_unix.h |
666 | +++ b/include/net/af_unix.h |
667 | @@ -62,13 +62,11 @@ struct unix_skb_parms { |
668 | #define UNIXCREDS(skb) (&UNIXCB((skb)).creds) |
669 | #define UNIXSID(skb) (&UNIXCB((skb)).secid) |
670 | |
671 | -#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) |
672 | -#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) |
673 | -#define unix_state_wlock(s) spin_lock(&unix_sk(s)->lock) |
674 | -#define unix_state_wlock_nested(s) \ |
675 | +#define unix_state_lock(s) spin_lock(&unix_sk(s)->lock) |
676 | +#define unix_state_unlock(s) spin_unlock(&unix_sk(s)->lock) |
677 | +#define unix_state_lock_nested(s) \ |
678 | spin_lock_nested(&unix_sk(s)->lock, \ |
679 | SINGLE_DEPTH_NESTING) |
680 | -#define unix_state_wunlock(s) spin_unlock(&unix_sk(s)->lock) |
681 | |
682 | #ifdef __KERNEL__ |
683 | /* The AF_UNIX socket */ |
684 | diff --git a/mm/oom_kill.c b/mm/oom_kill.c |
685 | index 223add3..3791edf 100644 |
686 | --- a/mm/oom_kill.c |
687 | +++ b/mm/oom_kill.c |
688 | @@ -335,7 +335,7 @@ static int oom_kill_task(struct task_struct *p) |
689 | */ |
690 | do_each_thread(g, q) { |
691 | if (q->mm == mm && q->tgid != p->tgid) |
692 | - force_sig(SIGKILL, p); |
693 | + force_sig(SIGKILL, q); |
694 | } while_each_thread(g, q); |
695 | |
696 | return 0; |
697 | diff --git a/mm/rmap.c b/mm/rmap.c |
698 | index 669acb2..7ce69c1 100644 |
699 | --- a/mm/rmap.c |
700 | +++ b/mm/rmap.c |
701 | @@ -490,9 +490,9 @@ int page_mkclean(struct page *page) |
702 | struct address_space *mapping = page_mapping(page); |
703 | if (mapping) |
704 | ret = page_mkclean_file(mapping, page); |
705 | + if (page_test_and_clear_dirty(page)) |
706 | + ret = 1; |
707 | } |
708 | - if (page_test_and_clear_dirty(page)) |
709 | - ret = 1; |
710 | |
711 | return ret; |
712 | } |
713 | diff --git a/net/core/dev.c b/net/core/dev.c |
714 | index 2a587b8..3c3d383 100644 |
715 | --- a/net/core/dev.c |
716 | +++ b/net/core/dev.c |
717 | @@ -3138,7 +3138,6 @@ void netdev_run_todo(void) |
718 | continue; |
719 | } |
720 | |
721 | - netdev_unregister_sysfs(dev); |
722 | dev->reg_state = NETREG_UNREGISTERED; |
723 | |
724 | netdev_wait_allrefs(dev); |
725 | @@ -3149,11 +3148,11 @@ void netdev_run_todo(void) |
726 | BUG_TRAP(!dev->ip6_ptr); |
727 | BUG_TRAP(!dev->dn_ptr); |
728 | |
729 | - /* It must be the very last action, |
730 | - * after this 'dev' may point to freed up memory. |
731 | - */ |
732 | if (dev->destructor) |
733 | dev->destructor(dev); |
734 | + |
735 | + /* Free network device */ |
736 | + kobject_put(&dev->class_dev.kobj); |
737 | } |
738 | |
739 | out: |
740 | @@ -3310,6 +3309,9 @@ int unregister_netdevice(struct net_device *dev) |
741 | /* Notifier chain MUST detach us from master device. */ |
742 | BUG_TRAP(!dev->master); |
743 | |
744 | + /* Remove entries from sysfs */ |
745 | + netdev_unregister_sysfs(dev); |
746 | + |
747 | /* Finish processing unregister after unlock */ |
748 | net_set_todo(dev); |
749 | |
750 | diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c |
751 | index f47f319..c60fe3b 100644 |
752 | --- a/net/core/net-sysfs.c |
753 | +++ b/net/core/net-sysfs.c |
754 | @@ -440,9 +440,15 @@ static struct class net_class = { |
755 | #endif |
756 | }; |
757 | |
758 | +/* Delete sysfs entries but hold kobject reference until after all |
759 | + * netdev references are gone. |
760 | + */ |
761 | void netdev_unregister_sysfs(struct net_device * net) |
762 | { |
763 | - class_device_del(&(net->class_dev)); |
764 | + struct class_device *dev = &(net->class_dev); |
765 | + |
766 | + kobject_get(&dev->kobj); |
767 | + class_device_del(dev); |
768 | } |
769 | |
770 | /* Create sysfs entries for network device. */ |
771 | diff --git a/net/core/sock.c b/net/core/sock.c |
772 | index b69192b..c7d2de0 100644 |
773 | --- a/net/core/sock.c |
774 | +++ b/net/core/sock.c |
775 | @@ -204,7 +204,19 @@ static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen) |
776 | return -EINVAL; |
777 | if (copy_from_user(&tv, optval, sizeof(tv))) |
778 | return -EFAULT; |
779 | - |
780 | + if (tv.tv_usec < 0 || tv.tv_usec >= USEC_PER_SEC) |
781 | + return -EDOM; |
782 | + |
783 | + if (tv.tv_sec < 0) { |
784 | + static int warned = 0; |
785 | + *timeo_p = 0; |
786 | + if (warned < 10 && net_ratelimit()) |
787 | + warned++; |
788 | + printk(KERN_INFO "sock_set_timeout: `%s' (pid %d) " |
789 | + "tries to set negative timeout\n", |
790 | + current->comm, current->pid); |
791 | + return 0; |
792 | + } |
793 | *timeo_p = MAX_SCHEDULE_TIMEOUT; |
794 | if (tv.tv_sec == 0 && tv.tv_usec == 0) |
795 | return 0; |
796 | diff --git a/net/core/utils.c b/net/core/utils.c |
797 | index 6155606..a724b3b 100644 |
798 | --- a/net/core/utils.c |
799 | +++ b/net/core/utils.c |
800 | @@ -137,16 +137,16 @@ int in4_pton(const char *src, int srclen, |
801 | while(1) { |
802 | int c; |
803 | c = xdigit2bin(srclen > 0 ? *s : '\0', delim); |
804 | - if (!(c & (IN6PTON_DIGIT | IN6PTON_DOT | IN6PTON_DELIM))) { |
805 | + if (!(c & (IN6PTON_DIGIT | IN6PTON_DOT | IN6PTON_DELIM | IN6PTON_COLON_MASK))) { |
806 | goto out; |
807 | } |
808 | - if (c & (IN6PTON_DOT | IN6PTON_DELIM)) { |
809 | + if (c & (IN6PTON_DOT | IN6PTON_DELIM | IN6PTON_COLON_MASK)) { |
810 | if (w == 0) |
811 | goto out; |
812 | *d++ = w & 0xff; |
813 | w = 0; |
814 | i++; |
815 | - if (c & IN6PTON_DELIM) { |
816 | + if (c & (IN6PTON_DELIM | IN6PTON_COLON_MASK)) { |
817 | if (i != 4) |
818 | goto out; |
819 | break; |
820 | diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig |
821 | index 503e705..75ad01a 100644 |
822 | --- a/net/ipv4/Kconfig |
823 | +++ b/net/ipv4/Kconfig |
824 | @@ -43,11 +43,11 @@ config IP_ADVANCED_ROUTER |
825 | asymmetric routing (packets from you to a host take a different path |
826 | than packets from that host to you) or if you operate a non-routing |
827 | host which has several IP addresses on different interfaces. To turn |
828 | - rp_filter off use: |
829 | + rp_filter on use: |
830 | |
831 | - echo 0 > /proc/sys/net/ipv4/conf/<device>/rp_filter |
832 | + echo 1 > /proc/sys/net/ipv4/conf/<device>/rp_filter |
833 | or |
834 | - echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter |
835 | + echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter |
836 | |
837 | If unsure, say N here. |
838 | |
839 | diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c |
840 | index 40cf0d0..e523fcc 100644 |
841 | --- a/net/ipv4/icmp.c |
842 | +++ b/net/ipv4/icmp.c |
843 | @@ -513,9 +513,15 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) |
844 | |
845 | saddr = iph->daddr; |
846 | if (!(rt->rt_flags & RTCF_LOCAL)) { |
847 | - if (sysctl_icmp_errors_use_inbound_ifaddr) |
848 | - saddr = inet_select_addr(skb_in->dev, 0, RT_SCOPE_LINK); |
849 | - else |
850 | + struct net_device *dev = NULL; |
851 | + |
852 | + if (rt->fl.iif && sysctl_icmp_errors_use_inbound_ifaddr) |
853 | + dev = dev_get_by_index(rt->fl.iif); |
854 | + |
855 | + if (dev) { |
856 | + saddr = inet_select_addr(dev, 0, RT_SCOPE_LINK); |
857 | + dev_put(dev); |
858 | + } else |
859 | saddr = 0; |
860 | } |
861 | |
862 | diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c |
863 | index 9d68837..3b42ddb 100644 |
864 | --- a/net/ipv4/inet_connection_sock.c |
865 | +++ b/net/ipv4/inet_connection_sock.c |
866 | @@ -31,10 +31,8 @@ EXPORT_SYMBOL(inet_csk_timer_bug_msg); |
867 | |
868 | /* |
869 | * This array holds the first and last local port number. |
870 | - * For high-usage systems, use sysctl to change this to |
871 | - * 32768-61000 |
872 | */ |
873 | -int sysctl_local_port_range[2] = { 1024, 4999 }; |
874 | +int sysctl_local_port_range[2] = { 32768, 61000 }; |
875 | |
876 | int inet_csk_bind_conflict(const struct sock *sk, |
877 | const struct inet_bind_bucket *tb) |
878 | diff --git a/net/ipv4/netfilter/ip_nat_proto_gre.c b/net/ipv4/netfilter/ip_nat_proto_gre.c |
879 | index 9581020..e3146a3 100644 |
880 | --- a/net/ipv4/netfilter/ip_nat_proto_gre.c |
881 | +++ b/net/ipv4/netfilter/ip_nat_proto_gre.c |
882 | @@ -70,6 +70,11 @@ gre_unique_tuple(struct ip_conntrack_tuple *tuple, |
883 | __be16 *keyptr; |
884 | unsigned int min, i, range_size; |
885 | |
886 | + /* If there is no master conntrack we are not PPTP, |
887 | + do not change tuples */ |
888 | + if (!conntrack->master) |
889 | + return 0; |
890 | + |
891 | if (maniptype == IP_NAT_MANIP_SRC) |
892 | keyptr = &tuple->src.u.gre.key; |
893 | else |
894 | @@ -122,18 +127,9 @@ gre_manip_pkt(struct sk_buff **pskb, |
895 | if (maniptype == IP_NAT_MANIP_DST) { |
896 | /* key manipulation is always dest */ |
897 | switch (greh->version) { |
898 | - case 0: |
899 | - if (!greh->key) { |
900 | - DEBUGP("can't nat GRE w/o key\n"); |
901 | - break; |
902 | - } |
903 | - if (greh->csum) { |
904 | - /* FIXME: Never tested this code... */ |
905 | - nf_proto_csum_replace4(gre_csum(greh), *pskb, |
906 | - *(gre_key(greh)), |
907 | - tuple->dst.u.gre.key, 0); |
908 | - } |
909 | - *(gre_key(greh)) = tuple->dst.u.gre.key; |
910 | + case GRE_VERSION_1701: |
911 | + /* We do not currently NAT any GREv0 packets. |
912 | + * Try to behave like "ip_nat_proto_unknown" */ |
913 | break; |
914 | case GRE_VERSION_PPTP: |
915 | DEBUGP("call_id -> 0x%04x\n", |
916 | diff --git a/net/ipv4/netfilter/nf_nat_proto_gre.c b/net/ipv4/netfilter/nf_nat_proto_gre.c |
917 | index e5a34c1..ca3ff84 100644 |
918 | --- a/net/ipv4/netfilter/nf_nat_proto_gre.c |
919 | +++ b/net/ipv4/netfilter/nf_nat_proto_gre.c |
920 | @@ -72,6 +72,11 @@ gre_unique_tuple(struct nf_conntrack_tuple *tuple, |
921 | __be16 *keyptr; |
922 | unsigned int min, i, range_size; |
923 | |
924 | + /* If there is no master conntrack we are not PPTP, |
925 | + do not change tuples */ |
926 | + if (!conntrack->master) |
927 | + return 0; |
928 | + |
929 | if (maniptype == IP_NAT_MANIP_SRC) |
930 | keyptr = &tuple->src.u.gre.key; |
931 | else |
932 | @@ -122,18 +127,9 @@ gre_manip_pkt(struct sk_buff **pskb, unsigned int iphdroff, |
933 | if (maniptype != IP_NAT_MANIP_DST) |
934 | return 1; |
935 | switch (greh->version) { |
936 | - case 0: |
937 | - if (!greh->key) { |
938 | - DEBUGP("can't nat GRE w/o key\n"); |
939 | - break; |
940 | - } |
941 | - if (greh->csum) { |
942 | - /* FIXME: Never tested this code... */ |
943 | - nf_proto_csum_replace4(gre_csum(greh), *pskb, |
944 | - *(gre_key(greh)), |
945 | - tuple->dst.u.gre.key, 0); |
946 | - } |
947 | - *(gre_key(greh)) = tuple->dst.u.gre.key; |
948 | + case GRE_VERSION_1701: |
949 | + /* We do not currently NAT any GREv0 packets. |
950 | + * Try to behave like "nf_nat_proto_unknown" */ |
951 | break; |
952 | case GRE_VERSION_PPTP: |
953 | DEBUGP("call_id -> 0x%04x\n", ntohs(tuple->dst.u.gre.key)); |
954 | diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
955 | index 4a71b31..6842474 100644 |
956 | --- a/net/ipv4/tcp.c |
957 | +++ b/net/ipv4/tcp.c |
958 | @@ -2445,13 +2445,10 @@ void __init tcp_init(void) |
959 | order++) |
960 | ; |
961 | if (order >= 4) { |
962 | - sysctl_local_port_range[0] = 32768; |
963 | - sysctl_local_port_range[1] = 61000; |
964 | tcp_death_row.sysctl_max_tw_buckets = 180000; |
965 | sysctl_tcp_max_orphans = 4096 << (order - 4); |
966 | sysctl_max_syn_backlog = 1024; |
967 | } else if (order < 3) { |
968 | - sysctl_local_port_range[0] = 1024 * (3 - order); |
969 | tcp_death_row.sysctl_max_tw_buckets >>= (3 - order); |
970 | sysctl_tcp_max_orphans >>= (3 - order); |
971 | sysctl_max_syn_backlog = 128; |
972 | diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c |
973 | index 8655d03..ce69187 100644 |
974 | --- a/net/ipv4/xfrm4_input.c |
975 | +++ b/net/ipv4/xfrm4_input.c |
976 | @@ -136,10 +136,8 @@ int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type) |
977 | nf_reset(skb); |
978 | |
979 | if (decaps) { |
980 | - if (!(skb->dev->flags&IFF_LOOPBACK)) { |
981 | - dst_release(skb->dst); |
982 | - skb->dst = NULL; |
983 | - } |
984 | + dst_release(skb->dst); |
985 | + skb->dst = NULL; |
986 | netif_rx(skb); |
987 | return 0; |
988 | } else { |
989 | diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c |
990 | index 21ed667..f020d06 100644 |
991 | --- a/net/ipv4/xfrm4_mode_tunnel.c |
992 | +++ b/net/ipv4/xfrm4_mode_tunnel.c |
993 | @@ -66,6 +66,8 @@ static int xfrm4_tunnel_output(struct xfrm_state *x, struct sk_buff *skb) |
994 | top_iph->daddr = x->id.daddr.a4; |
995 | top_iph->protocol = IPPROTO_IPIP; |
996 | |
997 | + skb->protocol = htons(ETH_P_IP); |
998 | + |
999 | memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); |
1000 | return 0; |
1001 | } |
1002 | diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c |
1003 | index f5af4ca..e383ac8 100644 |
1004 | --- a/net/ipv6/addrconf.c |
1005 | +++ b/net/ipv6/addrconf.c |
1006 | @@ -2338,8 +2338,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, |
1007 | break; |
1008 | |
1009 | case NETDEV_CHANGENAME: |
1010 | -#ifdef CONFIG_SYSCTL |
1011 | if (idev) { |
1012 | + snmp6_unregister_dev(idev); |
1013 | +#ifdef CONFIG_SYSCTL |
1014 | addrconf_sysctl_unregister(&idev->cnf); |
1015 | neigh_sysctl_unregister(idev->nd_parms); |
1016 | neigh_sysctl_register(dev, idev->nd_parms, |
1017 | @@ -2347,8 +2348,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, |
1018 | &ndisc_ifinfo_sysctl_change, |
1019 | NULL); |
1020 | addrconf_sysctl_register(idev, &idev->cnf); |
1021 | - } |
1022 | #endif |
1023 | + snmp6_register_dev(idev); |
1024 | + } |
1025 | break; |
1026 | }; |
1027 | |
1028 | diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c |
1029 | index 2d9c425..0c4aaac 100644 |
1030 | --- a/net/ipv6/ip6_fib.c |
1031 | +++ b/net/ipv6/ip6_fib.c |
1032 | @@ -620,14 +620,6 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt, |
1033 | |
1034 | ins = &fn->leaf; |
1035 | |
1036 | - if (fn->fn_flags&RTN_TL_ROOT && |
1037 | - fn->leaf == &ip6_null_entry && |
1038 | - !(rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) ){ |
1039 | - fn->leaf = rt; |
1040 | - rt->u.next = NULL; |
1041 | - goto out; |
1042 | - } |
1043 | - |
1044 | for (iter = fn->leaf; iter; iter=iter->u.next) { |
1045 | /* |
1046 | * Search for duplicates |
1047 | diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c |
1048 | index 35249d8..a239e91 100644 |
1049 | --- a/net/ipv6/proc.c |
1050 | +++ b/net/ipv6/proc.c |
1051 | @@ -237,6 +237,7 @@ int snmp6_unregister_dev(struct inet6_dev *idev) |
1052 | return -EINVAL; |
1053 | remove_proc_entry(idev->stats.proc_dir_entry->name, |
1054 | proc_net_devsnmp6); |
1055 | + idev->stats.proc_dir_entry = NULL; |
1056 | return 0; |
1057 | } |
1058 | |
1059 | diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c |
1060 | index 5c8b7a5..8174dae 100644 |
1061 | --- a/net/ipv6/xfrm6_input.c |
1062 | +++ b/net/ipv6/xfrm6_input.c |
1063 | @@ -103,10 +103,8 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi) |
1064 | nf_reset(skb); |
1065 | |
1066 | if (decaps) { |
1067 | - if (!(skb->dev->flags&IFF_LOOPBACK)) { |
1068 | - dst_release(skb->dst); |
1069 | - skb->dst = NULL; |
1070 | - } |
1071 | + dst_release(skb->dst); |
1072 | + skb->dst = NULL; |
1073 | netif_rx(skb); |
1074 | return -1; |
1075 | } else { |
1076 | diff --git a/net/ipv6/xfrm6_mode_tunnel.c b/net/ipv6/xfrm6_mode_tunnel.c |
1077 | index 5e7d8a7..a5a96da 100644 |
1078 | --- a/net/ipv6/xfrm6_mode_tunnel.c |
1079 | +++ b/net/ipv6/xfrm6_mode_tunnel.c |
1080 | @@ -65,6 +65,7 @@ static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb) |
1081 | top_iph->hop_limit = dst_metric(dst->child, RTAX_HOPLIMIT); |
1082 | ipv6_addr_copy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr); |
1083 | ipv6_addr_copy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr); |
1084 | + skb->protocol = htons(ETH_P_IPV6); |
1085 | return 0; |
1086 | } |
1087 | |
1088 | diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c |
1089 | index 2f208c7..20deb87 100644 |
1090 | --- a/net/unix/af_unix.c |
1091 | +++ b/net/unix/af_unix.c |
1092 | @@ -175,11 +175,11 @@ static struct sock *unix_peer_get(struct sock *s) |
1093 | { |
1094 | struct sock *peer; |
1095 | |
1096 | - unix_state_rlock(s); |
1097 | + unix_state_lock(s); |
1098 | peer = unix_peer(s); |
1099 | if (peer) |
1100 | sock_hold(peer); |
1101 | - unix_state_runlock(s); |
1102 | + unix_state_unlock(s); |
1103 | return peer; |
1104 | } |
1105 | |
1106 | @@ -370,7 +370,7 @@ static int unix_release_sock (struct sock *sk, int embrion) |
1107 | unix_remove_socket(sk); |
1108 | |
1109 | /* Clear state */ |
1110 | - unix_state_wlock(sk); |
1111 | + unix_state_lock(sk); |
1112 | sock_orphan(sk); |
1113 | sk->sk_shutdown = SHUTDOWN_MASK; |
1114 | dentry = u->dentry; |
1115 | @@ -379,7 +379,7 @@ static int unix_release_sock (struct sock *sk, int embrion) |
1116 | u->mnt = NULL; |
1117 | state = sk->sk_state; |
1118 | sk->sk_state = TCP_CLOSE; |
1119 | - unix_state_wunlock(sk); |
1120 | + unix_state_unlock(sk); |
1121 | |
1122 | wake_up_interruptible_all(&u->peer_wait); |
1123 | |
1124 | @@ -387,12 +387,12 @@ static int unix_release_sock (struct sock *sk, int embrion) |
1125 | |
1126 | if (skpair!=NULL) { |
1127 | if (sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) { |
1128 | - unix_state_wlock(skpair); |
1129 | + unix_state_lock(skpair); |
1130 | /* No more writes */ |
1131 | skpair->sk_shutdown = SHUTDOWN_MASK; |
1132 | if (!skb_queue_empty(&sk->sk_receive_queue) || embrion) |
1133 | skpair->sk_err = ECONNRESET; |
1134 | - unix_state_wunlock(skpair); |
1135 | + unix_state_unlock(skpair); |
1136 | skpair->sk_state_change(skpair); |
1137 | read_lock(&skpair->sk_callback_lock); |
1138 | sk_wake_async(skpair,1,POLL_HUP); |
1139 | @@ -449,7 +449,7 @@ static int unix_listen(struct socket *sock, int backlog) |
1140 | err = -EINVAL; |
1141 | if (!u->addr) |
1142 | goto out; /* No listens on an unbound socket */ |
1143 | - unix_state_wlock(sk); |
1144 | + unix_state_lock(sk); |
1145 | if (sk->sk_state != TCP_CLOSE && sk->sk_state != TCP_LISTEN) |
1146 | goto out_unlock; |
1147 | if (backlog > sk->sk_max_ack_backlog) |
1148 | @@ -463,7 +463,7 @@ static int unix_listen(struct socket *sock, int backlog) |
1149 | err = 0; |
1150 | |
1151 | out_unlock: |
1152 | - unix_state_wunlock(sk); |
1153 | + unix_state_unlock(sk); |
1154 | out: |
1155 | return err; |
1156 | } |
1157 | @@ -859,6 +859,31 @@ out_mknod_parent: |
1158 | goto out_up; |
1159 | } |
1160 | |
1161 | +static void unix_state_double_lock(struct sock *sk1, struct sock *sk2) |
1162 | +{ |
1163 | + if (unlikely(sk1 == sk2) || !sk2) { |
1164 | + unix_state_lock(sk1); |
1165 | + return; |
1166 | + } |
1167 | + if (sk1 < sk2) { |
1168 | + unix_state_lock(sk1); |
1169 | + unix_state_lock_nested(sk2); |
1170 | + } else { |
1171 | + unix_state_lock(sk2); |
1172 | + unix_state_lock_nested(sk1); |
1173 | + } |
1174 | +} |
1175 | + |
1176 | +static void unix_state_double_unlock(struct sock *sk1, struct sock *sk2) |
1177 | +{ |
1178 | + if (unlikely(sk1 == sk2) || !sk2) { |
1179 | + unix_state_unlock(sk1); |
1180 | + return; |
1181 | + } |
1182 | + unix_state_unlock(sk1); |
1183 | + unix_state_unlock(sk2); |
1184 | +} |
1185 | + |
1186 | static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr, |
1187 | int alen, int flags) |
1188 | { |
1189 | @@ -878,11 +903,19 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr, |
1190 | !unix_sk(sk)->addr && (err = unix_autobind(sock)) != 0) |
1191 | goto out; |
1192 | |
1193 | +restart: |
1194 | other=unix_find_other(sunaddr, alen, sock->type, hash, &err); |
1195 | if (!other) |
1196 | goto out; |
1197 | |
1198 | - unix_state_wlock(sk); |
1199 | + unix_state_double_lock(sk, other); |
1200 | + |
1201 | + /* Apparently VFS overslept socket death. Retry. */ |
1202 | + if (sock_flag(other, SOCK_DEAD)) { |
1203 | + unix_state_double_unlock(sk, other); |
1204 | + sock_put(other); |
1205 | + goto restart; |
1206 | + } |
1207 | |
1208 | err = -EPERM; |
1209 | if (!unix_may_send(sk, other)) |
1210 | @@ -897,7 +930,7 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr, |
1211 | * 1003.1g breaking connected state with AF_UNSPEC |
1212 | */ |
1213 | other = NULL; |
1214 | - unix_state_wlock(sk); |
1215 | + unix_state_double_lock(sk, other); |
1216 | } |
1217 | |
1218 | /* |
1219 | @@ -906,19 +939,19 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr, |
1220 | if (unix_peer(sk)) { |
1221 | struct sock *old_peer = unix_peer(sk); |
1222 | unix_peer(sk)=other; |
1223 | - unix_state_wunlock(sk); |
1224 | + unix_state_double_unlock(sk, other); |
1225 | |
1226 | if (other != old_peer) |
1227 | unix_dgram_disconnected(sk, old_peer); |
1228 | sock_put(old_peer); |
1229 | } else { |
1230 | unix_peer(sk)=other; |
1231 | - unix_state_wunlock(sk); |
1232 | + unix_state_double_unlock(sk, other); |
1233 | } |
1234 | return 0; |
1235 | |
1236 | out_unlock: |
1237 | - unix_state_wunlock(sk); |
1238 | + unix_state_double_unlock(sk, other); |
1239 | sock_put(other); |
1240 | out: |
1241 | return err; |
1242 | @@ -937,7 +970,7 @@ static long unix_wait_for_peer(struct sock *other, long timeo) |
1243 | (skb_queue_len(&other->sk_receive_queue) > |
1244 | other->sk_max_ack_backlog); |
1245 | |
1246 | - unix_state_runlock(other); |
1247 | + unix_state_unlock(other); |
1248 | |
1249 | if (sched) |
1250 | timeo = schedule_timeout(timeo); |
1251 | @@ -995,11 +1028,11 @@ restart: |
1252 | goto out; |
1253 | |
1254 | /* Latch state of peer */ |
1255 | - unix_state_rlock(other); |
1256 | + unix_state_lock(other); |
1257 | |
1258 | /* Apparently VFS overslept socket death. Retry. */ |
1259 | if (sock_flag(other, SOCK_DEAD)) { |
1260 | - unix_state_runlock(other); |
1261 | + unix_state_unlock(other); |
1262 | sock_put(other); |
1263 | goto restart; |
1264 | } |
1265 | @@ -1049,18 +1082,18 @@ restart: |
1266 | goto out_unlock; |
1267 | } |
1268 | |
1269 | - unix_state_wlock_nested(sk); |
1270 | + unix_state_lock_nested(sk); |
1271 | |
1272 | if (sk->sk_state != st) { |
1273 | - unix_state_wunlock(sk); |
1274 | - unix_state_runlock(other); |
1275 | + unix_state_unlock(sk); |
1276 | + unix_state_unlock(other); |
1277 | sock_put(other); |
1278 | goto restart; |
1279 | } |
1280 | |
1281 | err = security_unix_stream_connect(sock, other->sk_socket, newsk); |
1282 | if (err) { |
1283 | - unix_state_wunlock(sk); |
1284 | + unix_state_unlock(sk); |
1285 | goto out_unlock; |
1286 | } |
1287 | |
1288 | @@ -1097,7 +1130,7 @@ restart: |
1289 | smp_mb__after_atomic_inc(); /* sock_hold() does an atomic_inc() */ |
1290 | unix_peer(sk) = newsk; |
1291 | |
1292 | - unix_state_wunlock(sk); |
1293 | + unix_state_unlock(sk); |
1294 | |
1295 | /* take ten and and send info to listening sock */ |
1296 | spin_lock(&other->sk_receive_queue.lock); |
1297 | @@ -1106,14 +1139,14 @@ restart: |
1298 | * is installed to listening socket. */ |
1299 | atomic_inc(&newu->inflight); |
1300 | spin_unlock(&other->sk_receive_queue.lock); |
1301 | - unix_state_runlock(other); |
1302 | + unix_state_unlock(other); |
1303 | other->sk_data_ready(other, 0); |
1304 | sock_put(other); |
1305 | return 0; |
1306 | |
1307 | out_unlock: |
1308 | if (other) |
1309 | - unix_state_runlock(other); |
1310 | + unix_state_unlock(other); |
1311 | |
1312 | out: |
1313 | if (skb) |
1314 | @@ -1179,10 +1212,10 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags) |
1315 | wake_up_interruptible(&unix_sk(sk)->peer_wait); |
1316 | |
1317 | /* attach accepted sock to socket */ |
1318 | - unix_state_wlock(tsk); |
1319 | + unix_state_lock(tsk); |
1320 | newsock->state = SS_CONNECTED; |
1321 | sock_graft(tsk, newsock); |
1322 | - unix_state_wunlock(tsk); |
1323 | + unix_state_unlock(tsk); |
1324 | return 0; |
1325 | |
1326 | out: |
1327 | @@ -1209,7 +1242,7 @@ static int unix_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_ |
1328 | } |
1329 | |
1330 | u = unix_sk(sk); |
1331 | - unix_state_rlock(sk); |
1332 | + unix_state_lock(sk); |
1333 | if (!u->addr) { |
1334 | sunaddr->sun_family = AF_UNIX; |
1335 | sunaddr->sun_path[0] = 0; |
1336 | @@ -1220,7 +1253,7 @@ static int unix_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_ |
1337 | *uaddr_len = addr->len; |
1338 | memcpy(sunaddr, addr->name, *uaddr_len); |
1339 | } |
1340 | - unix_state_runlock(sk); |
1341 | + unix_state_unlock(sk); |
1342 | sock_put(sk); |
1343 | out: |
1344 | return err; |
1345 | @@ -1338,7 +1371,7 @@ restart: |
1346 | goto out_free; |
1347 | } |
1348 | |
1349 | - unix_state_rlock(other); |
1350 | + unix_state_lock(other); |
1351 | err = -EPERM; |
1352 | if (!unix_may_send(sk, other)) |
1353 | goto out_unlock; |
1354 | @@ -1348,20 +1381,20 @@ restart: |
1355 | * Check with 1003.1g - what should |
1356 | * datagram error |
1357 | */ |
1358 | - unix_state_runlock(other); |
1359 | + unix_state_unlock(other); |
1360 | sock_put(other); |
1361 | |
1362 | err = 0; |
1363 | - unix_state_wlock(sk); |
1364 | + unix_state_lock(sk); |
1365 | if (unix_peer(sk) == other) { |
1366 | unix_peer(sk)=NULL; |
1367 | - unix_state_wunlock(sk); |
1368 | + unix_state_unlock(sk); |
1369 | |
1370 | unix_dgram_disconnected(sk, other); |
1371 | sock_put(other); |
1372 | err = -ECONNREFUSED; |
1373 | } else { |
1374 | - unix_state_wunlock(sk); |
1375 | + unix_state_unlock(sk); |
1376 | } |
1377 | |
1378 | other = NULL; |
1379 | @@ -1398,14 +1431,14 @@ restart: |
1380 | } |
1381 | |
1382 | skb_queue_tail(&other->sk_receive_queue, skb); |
1383 | - unix_state_runlock(other); |
1384 | + unix_state_unlock(other); |
1385 | other->sk_data_ready(other, len); |
1386 | sock_put(other); |
1387 | scm_destroy(siocb->scm); |
1388 | return len; |
1389 | |
1390 | out_unlock: |
1391 | - unix_state_runlock(other); |
1392 | + unix_state_unlock(other); |
1393 | out_free: |
1394 | kfree_skb(skb); |
1395 | out: |
1396 | @@ -1495,14 +1528,14 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, |
1397 | goto out_err; |
1398 | } |
1399 | |
1400 | - unix_state_rlock(other); |
1401 | + unix_state_lock(other); |
1402 | |
1403 | if (sock_flag(other, SOCK_DEAD) || |
1404 | (other->sk_shutdown & RCV_SHUTDOWN)) |
1405 | goto pipe_err_free; |
1406 | |
1407 | skb_queue_tail(&other->sk_receive_queue, skb); |
1408 | - unix_state_runlock(other); |
1409 | + unix_state_unlock(other); |
1410 | other->sk_data_ready(other, size); |
1411 | sent+=size; |
1412 | } |
1413 | @@ -1513,7 +1546,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, |
1414 | return sent; |
1415 | |
1416 | pipe_err_free: |
1417 | - unix_state_runlock(other); |
1418 | + unix_state_unlock(other); |
1419 | kfree_skb(skb); |
1420 | pipe_err: |
1421 | if (sent==0 && !(msg->msg_flags&MSG_NOSIGNAL)) |
1422 | @@ -1642,7 +1675,7 @@ static long unix_stream_data_wait(struct sock * sk, long timeo) |
1423 | { |
1424 | DEFINE_WAIT(wait); |
1425 | |
1426 | - unix_state_rlock(sk); |
1427 | + unix_state_lock(sk); |
1428 | |
1429 | for (;;) { |
1430 | prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); |
1431 | @@ -1655,14 +1688,14 @@ static long unix_stream_data_wait(struct sock * sk, long timeo) |
1432 | break; |
1433 | |
1434 | set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); |
1435 | - unix_state_runlock(sk); |
1436 | + unix_state_unlock(sk); |
1437 | timeo = schedule_timeout(timeo); |
1438 | - unix_state_rlock(sk); |
1439 | + unix_state_lock(sk); |
1440 | clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); |
1441 | } |
1442 | |
1443 | finish_wait(sk->sk_sleep, &wait); |
1444 | - unix_state_runlock(sk); |
1445 | + unix_state_unlock(sk); |
1446 | return timeo; |
1447 | } |
1448 | |
1449 | @@ -1817,12 +1850,12 @@ static int unix_shutdown(struct socket *sock, int mode) |
1450 | mode = (mode+1)&(RCV_SHUTDOWN|SEND_SHUTDOWN); |
1451 | |
1452 | if (mode) { |
1453 | - unix_state_wlock(sk); |
1454 | + unix_state_lock(sk); |
1455 | sk->sk_shutdown |= mode; |
1456 | other=unix_peer(sk); |
1457 | if (other) |
1458 | sock_hold(other); |
1459 | - unix_state_wunlock(sk); |
1460 | + unix_state_unlock(sk); |
1461 | sk->sk_state_change(sk); |
1462 | |
1463 | if (other && |
1464 | @@ -1834,9 +1867,9 @@ static int unix_shutdown(struct socket *sock, int mode) |
1465 | peer_mode |= SEND_SHUTDOWN; |
1466 | if (mode&SEND_SHUTDOWN) |
1467 | peer_mode |= RCV_SHUTDOWN; |
1468 | - unix_state_wlock(other); |
1469 | + unix_state_lock(other); |
1470 | other->sk_shutdown |= peer_mode; |
1471 | - unix_state_wunlock(other); |
1472 | + unix_state_unlock(other); |
1473 | other->sk_state_change(other); |
1474 | read_lock(&other->sk_callback_lock); |
1475 | if (peer_mode == SHUTDOWN_MASK) |
1476 | @@ -1974,7 +2007,7 @@ static int unix_seq_show(struct seq_file *seq, void *v) |
1477 | else { |
1478 | struct sock *s = v; |
1479 | struct unix_sock *u = unix_sk(s); |
1480 | - unix_state_rlock(s); |
1481 | + unix_state_lock(s); |
1482 | |
1483 | seq_printf(seq, "%p: %08X %08X %08X %04X %02X %5lu", |
1484 | s, |
1485 | @@ -2002,7 +2035,7 @@ static int unix_seq_show(struct seq_file *seq, void *v) |
1486 | for ( ; i < len; i++) |
1487 | seq_putc(seq, u->addr->name->sun_path[i]); |
1488 | } |
1489 | - unix_state_runlock(s); |
1490 | + unix_state_unlock(s); |
1491 | seq_putc(seq, '\n'); |
1492 | } |
1493 | |
1494 | diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c |
1495 | index 6bc7e7c..8912c0f 100644 |
1496 | --- a/scripts/basic/fixdep.c |
1497 | +++ b/scripts/basic/fixdep.c |
1498 | @@ -249,6 +249,8 @@ void parse_config_file(char *map, size_t len) |
1499 | found: |
1500 | if (!memcmp(q - 7, "_MODULE", 7)) |
1501 | q -= 7; |
1502 | + if( (q-p-7) < 0 ) |
1503 | + continue; |
1504 | use_config(p+7, q-p-7); |
1505 | } |
1506 | } |
1507 | diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h |
1508 | index a7e9563..9461d6e 100644 |
1509 | --- a/sound/usb/usbquirks.h |
1510 | +++ b/sound/usb/usbquirks.h |
1511 | @@ -40,6 +40,29 @@ |
1512 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC |
1513 | |
1514 | /* |
1515 | + * Logitech QuickCam: bDeviceClass is vendor-specific, so generic interface |
1516 | + * class matches do not take effect without an explicit ID match. |
1517 | + */ |
1518 | +{ |
1519 | + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | |
1520 | + USB_DEVICE_ID_MATCH_INT_CLASS | |
1521 | + USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
1522 | + .idVendor = 0x046d, |
1523 | + .idProduct = 0x08f0, |
1524 | + .bInterfaceClass = USB_CLASS_AUDIO, |
1525 | + .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL |
1526 | +}, |
1527 | +{ |
1528 | + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | |
1529 | + USB_DEVICE_ID_MATCH_INT_CLASS | |
1530 | + USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
1531 | + .idVendor = 0x046d, |
1532 | + .idProduct = 0x08f6, |
1533 | + .bInterfaceClass = USB_CLASS_AUDIO, |
1534 | + .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL |
1535 | +}, |
1536 | + |
1537 | +/* |
1538 | * Yamaha devices |
1539 | */ |
1540 |