Magellan Linux

Contents of /trunk/kernel26-alx/patches-2.6.17-r5/0100-2.6.17-patch-2.6.17.7.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 199 - (show annotations) (download)
Fri May 18 11:04:36 2007 UTC (16 years, 11 months ago) by niro
File size: 73211 byte(s)
-import

1 diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
2 index 8dfa305..6ad5144 100644
3 --- a/arch/i386/Kconfig
4 +++ b/arch/i386/Kconfig
5 @@ -765,6 +765,9 @@ config HOTPLUG_CPU
6
7 endmenu
8
9 +config ARCH_ENABLE_MEMORY_HOTPLUG
10 + def_bool y
11 + depends on HIGHMEM
12
13 menu "Power management options (ACPI, APM)"
14 depends on !X86_VOYAGER
15 diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
16 index 2bf4237..a748409 100644
17 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
18 +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
19 @@ -581,10 +581,7 @@ static int __init powernow_cpu_init (str
20
21 rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val);
22
23 - /* recalibrate cpu_khz */
24 - result = recalibrate_cpu_khz();
25 - if (result)
26 - return result;
27 + recalibrate_cpu_khz();
28
29 fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.CFID];
30 if (!fsb) {
31 diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
32 index 71fffa1..2ea3c6c 100644
33 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
34 +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
35 @@ -1008,7 +1008,7 @@ static int __cpuinit powernowk8_cpu_init
36 * an UP version, and is deprecated by AMD.
37 */
38
39 - if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
40 + if (num_online_cpus() != 1) {
41 printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
42 kfree(data);
43 return -ENODEV;
44 diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
45 index 0f3076a..0c0cd0a 100644
46 --- a/arch/ia64/Kconfig
47 +++ b/arch/ia64/Kconfig
48 @@ -270,6 +270,9 @@ config HOTPLUG_CPU
49 can be controlled through /sys/devices/system/cpu/cpu#.
50 Say N if you want to disable CPU hotplug.
51
52 +config ARCH_ENABLE_MEMORY_HOTPLUG
53 + def_bool y
54 +
55 config SCHED_SMT
56 bool "SMT scheduler support"
57 depends on SMP
58 diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
59 index 6729c98..fbc2b7f 100644
60 --- a/arch/powerpc/Kconfig
61 +++ b/arch/powerpc/Kconfig
62 @@ -599,6 +599,9 @@ config HOTPLUG_CPU
63
64 Say N if you are unsure.
65
66 +config ARCH_ENABLE_MEMORY_HOTPLUG
67 + def_bool y
68 +
69 config KEXEC
70 bool "kexec system call (EXPERIMENTAL)"
71 depends on PPC_MULTIPLATFORM && EXPERIMENTAL
72 diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c
73 index 77840c8..7215849 100644
74 --- a/arch/sparc/mm/iommu.c
75 +++ b/arch/sparc/mm/iommu.c
76 @@ -144,8 +144,9 @@ static void iommu_flush_iotlb(iopte_t *i
77 unsigned long start;
78 unsigned long end;
79
80 - start = (unsigned long)iopte & PAGE_MASK;
81 + start = (unsigned long)iopte;
82 end = PAGE_ALIGN(start + niopte*sizeof(iopte_t));
83 + start &= PAGE_MASK;
84 if (viking_mxcc_present) {
85 while(start < end) {
86 viking_mxcc_flush_page(start);
87 diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c
88 index 86f51d0..87cdbc5 100644
89 --- a/arch/um/kernel/time_kern.c
90 +++ b/arch/um/kernel/time_kern.c
91 @@ -87,7 +87,7 @@ #endif
92
93 void time_init_kern(void)
94 {
95 - unsigned long long nsecs;
96 + long long nsecs;
97
98 nsecs = os_nsecs();
99 set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION,
100 diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
101 index 408d44a..ce0c797 100644
102 --- a/arch/x86_64/Kconfig
103 +++ b/arch/x86_64/Kconfig
104 @@ -369,6 +369,8 @@ config HOTPLUG_CPU
105 can be controlled through /sys/devices/system/cpu/cpu#.
106 Say N if you want to disable CPU hotplug.
107
108 +config ARCH_ENABLE_MEMORY_HOTPLUG
109 + def_bool y
110
111 config HPET_TIMER
112 bool
113 diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
114 index 655b919..e8d5f84 100644
115 --- a/arch/x86_64/kernel/setup.c
116 +++ b/arch/x86_64/kernel/setup.c
117 @@ -1440,7 +1440,7 @@ struct seq_operations cpuinfo_op = {
118 .show = show_cpuinfo,
119 };
120
121 -#ifdef CONFIG_INPUT_PCSPKR
122 +#if defined(CONFIG_INPUT_PCSPKR) || defined(CONFIG_INPUT_PCSPKR_MODULE)
123 #include <linux/platform_device.h>
124 static __init int add_pcspkr(void)
125 {
126 diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
127 index 7eb36c5..4293143 100644
128 --- a/block/ll_rw_blk.c
129 +++ b/block/ll_rw_blk.c
130 @@ -638,7 +638,7 @@ #if BITS_PER_LONG == 64
131 /* Assume anything <= 4GB can be handled by IOMMU.
132 Actually some IOMMUs can handle everything, but I don't
133 know of a way to test this here. */
134 - if (bounce_pfn < (0xffffffff>>PAGE_SHIFT))
135 + if (bounce_pfn < (min_t(u64,0xffffffff,BLK_BOUNCE_HIGH) >> PAGE_SHIFT))
136 dma = 1;
137 q->bounce_pfn = max_low_pfn;
138 #else
139 diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
140 index a95f636..d7791fb 100644
141 --- a/drivers/acpi/namespace/nsxfeval.c
142 +++ b/drivers/acpi/namespace/nsxfeval.c
143 @@ -238,8 +238,9 @@ acpi_evaluate_object(acpi_handle handle,
144 ACPI_ERROR((AE_INFO,
145 "Both Handle and Pathname are NULL"));
146 } else {
147 - ACPI_ERROR((AE_INFO,
148 - "Handle is NULL and Pathname is relative"));
149 + ACPI_DEBUG_PRINT((ACPI_DB_INFO,
150 + "Null Handle with relative pathname [%s]",
151 + pathname));
152 }
153
154 status = AE_BAD_PARAMETER;
155 diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
156 index 3170eaa..fdd37e4 100644
157 --- a/drivers/cdrom/cdrom.c
158 +++ b/drivers/cdrom/cdrom.c
159 @@ -1838,7 +1838,7 @@ static int dvd_read_bca(struct cdrom_dev
160 init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ);
161 cgc.cmd[0] = GPCMD_READ_DVD_STRUCTURE;
162 cgc.cmd[7] = s->type;
163 - cgc.cmd[9] = cgc.buflen = 0xff;
164 + cgc.cmd[9] = cgc.buflen & 0xff;
165
166 if ((ret = cdo->generic_packet(cdi, &cgc)))
167 return ret;
168 diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
169 index c01615d..5748554 100644
170 --- a/drivers/ide/ide-io.c
171 +++ b/drivers/ide/ide-io.c
172 @@ -932,7 +932,7 @@ #endif
173 printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name);
174 SELECT_DRIVE(drive);
175 HWIF(drive)->OUTB(8, HWIF(drive)->io_ports[IDE_CONTROL_OFFSET]);
176 - rc = ide_wait_not_busy(HWIF(drive), 10000);
177 + rc = ide_wait_not_busy(HWIF(drive), 100000);
178 if (rc)
179 printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
180 }
181 diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
182 index 11f1377..8f1292c 100644
183 --- a/drivers/ieee1394/ohci1394.c
184 +++ b/drivers/ieee1394/ohci1394.c
185 @@ -3539,6 +3539,7 @@ #ifdef CONFIG_PPC_PMAC
186 }
187 #endif /* CONFIG_PPC_PMAC */
188
189 + pci_restore_state(pdev);
190 pci_enable_device(pdev);
191
192 return 0;
193 @@ -3558,6 +3559,8 @@ #ifdef CONFIG_PPC_PMAC
194 }
195 #endif
196
197 + pci_save_state(pdev);
198 +
199 return 0;
200 }
201
202 diff --git a/drivers/infiniband/hw/mthca/mthca_reset.c b/drivers/infiniband/hw/mthca/mthca_reset.c
203 index df5e494..f4fddd5 100644
204 --- a/drivers/infiniband/hw/mthca/mthca_reset.c
205 +++ b/drivers/infiniband/hw/mthca/mthca_reset.c
206 @@ -49,6 +49,12 @@ int mthca_reset(struct mthca_dev *mdev)
207 u32 *hca_header = NULL;
208 u32 *bridge_header = NULL;
209 struct pci_dev *bridge = NULL;
210 + int bridge_pcix_cap = 0;
211 + int hca_pcie_cap = 0;
212 + int hca_pcix_cap = 0;
213 +
214 + u16 devctl;
215 + u16 linkctl;
216
217 #define MTHCA_RESET_OFFSET 0xf0010
218 #define MTHCA_RESET_VALUE swab32(1)
219 @@ -110,6 +116,9 @@ #define MTHCA_RESET_VALUE swab32(1)
220 }
221 }
222
223 + hca_pcix_cap = pci_find_capability(mdev->pdev, PCI_CAP_ID_PCIX);
224 + hca_pcie_cap = pci_find_capability(mdev->pdev, PCI_CAP_ID_EXP);
225 +
226 if (bridge) {
227 bridge_header = kmalloc(256, GFP_KERNEL);
228 if (!bridge_header) {
229 @@ -129,6 +138,13 @@ #define MTHCA_RESET_VALUE swab32(1)
230 goto out;
231 }
232 }
233 + bridge_pcix_cap = pci_find_capability(bridge, PCI_CAP_ID_PCIX);
234 + if (!bridge_pcix_cap) {
235 + err = -ENODEV;
236 + mthca_err(mdev, "Couldn't locate HCA bridge "
237 + "PCI-X capability, aborting.\n");
238 + goto out;
239 + }
240 }
241
242 /* actually hit reset */
243 @@ -178,6 +194,20 @@ #define MTHCA_RESET_VALUE swab32(1)
244 good:
245 /* Now restore the PCI headers */
246 if (bridge) {
247 + if (pci_write_config_dword(bridge, bridge_pcix_cap + 0x8,
248 + bridge_header[(bridge_pcix_cap + 0x8) / 4])) {
249 + err = -ENODEV;
250 + mthca_err(mdev, "Couldn't restore HCA bridge Upstream "
251 + "split transaction control, aborting.\n");
252 + goto out;
253 + }
254 + if (pci_write_config_dword(bridge, bridge_pcix_cap + 0xc,
255 + bridge_header[(bridge_pcix_cap + 0xc) / 4])) {
256 + err = -ENODEV;
257 + mthca_err(mdev, "Couldn't restore HCA bridge Downstream "
258 + "split transaction control, aborting.\n");
259 + goto out;
260 + }
261 /*
262 * Bridge control register is at 0x3e, so we'll
263 * naturally restore it last in this loop.
264 @@ -203,6 +233,35 @@ good:
265 }
266 }
267
268 + if (hca_pcix_cap) {
269 + if (pci_write_config_dword(mdev->pdev, hca_pcix_cap,
270 + hca_header[hca_pcix_cap / 4])) {
271 + err = -ENODEV;
272 + mthca_err(mdev, "Couldn't restore HCA PCI-X "
273 + "command register, aborting.\n");
274 + goto out;
275 + }
276 + }
277 +
278 + if (hca_pcie_cap) {
279 + devctl = hca_header[(hca_pcie_cap + PCI_EXP_DEVCTL) / 4];
280 + if (pci_write_config_word(mdev->pdev, hca_pcie_cap + PCI_EXP_DEVCTL,
281 + devctl)) {
282 + err = -ENODEV;
283 + mthca_err(mdev, "Couldn't restore HCA PCI Express "
284 + "Device Control register, aborting.\n");
285 + goto out;
286 + }
287 + linkctl = hca_header[(hca_pcie_cap + PCI_EXP_LNKCTL) / 4];
288 + if (pci_write_config_word(mdev->pdev, hca_pcie_cap + PCI_EXP_LNKCTL,
289 + linkctl)) {
290 + err = -ENODEV;
291 + mthca_err(mdev, "Couldn't restore HCA PCI Express "
292 + "Link control register, aborting.\n");
293 + goto out;
294 + }
295 + }
296 +
297 for (i = 0; i < 16; ++i) {
298 if (i * 4 == PCI_COMMAND)
299 continue;
300 diff --git a/drivers/input/input.c b/drivers/input/input.c
301 index 3038c26..b149c94 100644
302 --- a/drivers/input/input.c
303 +++ b/drivers/input/input.c
304 @@ -629,7 +629,7 @@ static ssize_t input_dev_show_modalias(s
305
306 len = input_print_modalias(buf, PAGE_SIZE, id, 1);
307
308 - return max_t(int, len, PAGE_SIZE);
309 + return min_t(int, len, PAGE_SIZE);
310 }
311 static CLASS_DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL);
312
313 diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
314 index ccc7b2e..0bcaa35 100644
315 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
316 +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
317 @@ -184,6 +184,11 @@ static struct mt352_config thomson_dtt75
318 .pll_set = thomson_dtt7579_pll_set,
319 };
320
321 +static struct zl10353_config thomson_dtt7579_zl10353_config = {
322 + .demod_address = 0x0f,
323 + .pll_set = thomson_dtt7579_pll_set,
324 +};
325 +
326 static int cx24108_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
327 {
328 u32 freq = params->frequency;
329 @@ -617,6 +622,11 @@ static void frontend_init(struct dvb_bt8
330 switch(type) {
331 case BTTV_BOARD_DVICO_DVBT_LITE:
332 card->fe = mt352_attach(&thomson_dtt7579_config, card->i2c_adapter);
333 +
334 + if (card->fe == NULL)
335 + card->fe = zl10353_attach(&thomson_dtt7579_zl10353_config,
336 + card->i2c_adapter);
337 +
338 if (card->fe != NULL) {
339 card->fe->ops->info.frequency_min = 174000000;
340 card->fe->ops->info.frequency_max = 862000000;
341 diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.h b/drivers/media/dvb/bt8xx/dvb-bt8xx.h
342 index 00dd9fa..e41066a 100644
343 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.h
344 +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.h
345 @@ -37,6 +37,7 @@ #include "nxt6000.h"
346 #include "cx24110.h"
347 #include "or51211.h"
348 #include "lgdt330x.h"
349 +#include "zl10353.h"
350
351 struct dvb_bt8xx_card {
352 struct mutex lock;
353 diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
354 index a051790..cb69372 100644
355 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c
356 +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
357 @@ -519,7 +519,9 @@ static int dvb_frontend_thread(void *dat
358 fepriv->delay = 3*HZ;
359 fepriv->status = 0;
360 fepriv->wakeup = 0;
361 - fepriv->reinitialise = 1;
362 + fepriv->reinitialise = 0;
363 +
364 + dvb_frontend_init(fe);
365
366 while (1) {
367 up(&fepriv->sem); /* is locked when we enter the thread... */
368 @@ -996,17 +998,17 @@ static int dvb_frontend_open(struct inod
369 return ret;
370
371 if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
372 + /* normal tune mode when opened R/W */
373 + fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
374 + fepriv->tone = -1;
375 + fepriv->voltage = -1;
376 +
377 ret = dvb_frontend_start (fe);
378 if (ret)
379 dvb_generic_release (inode, file);
380
381 /* empty event queue */
382 fepriv->events.eventr = fepriv->events.eventw = 0;
383 -
384 - /* normal tune mode when opened R/W */
385 - fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
386 - fepriv->tone = -1;
387 - fepriv->voltage = -1;
388 }
389
390 return ret;
391 diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
392 index 791706e..40930a3 100644
393 --- a/drivers/media/dvb/frontends/dvb-pll.c
394 +++ b/drivers/media/dvb/frontends/dvb-pll.c
395 @@ -194,11 +194,11 @@ struct dvb_pll_desc dvb_pll_tda665x = {
396 { 253834000, 36249333, 166667, 0xca, 0x62 /* 011 0 0 0 10 */ },
397 { 383834000, 36249333, 166667, 0xca, 0xa2 /* 101 0 0 0 10 */ },
398 { 443834000, 36249333, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ },
399 - { 444000000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ },
400 - { 583834000, 36249333, 166667, 0xca, 0x63 /* 011 0 0 0 11 */ },
401 - { 793834000, 36249333, 166667, 0xca, 0xa3 /* 101 0 0 0 11 */ },
402 - { 444834000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ },
403 - { 861000000, 36249333, 166667, 0xca, 0xe3 /* 111 0 0 0 11 */ },
404 + { 444000000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
405 + { 583834000, 36249333, 166667, 0xca, 0x64 /* 011 0 0 1 00 */ },
406 + { 793834000, 36249333, 166667, 0xca, 0xa4 /* 101 0 0 1 00 */ },
407 + { 444834000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
408 + { 861000000, 36249333, 166667, 0xca, 0xe4 /* 111 0 0 1 00 */ },
409 }
410 };
411 EXPORT_SYMBOL(dvb_pll_tda665x);
412 diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
413 index 8a7cd7d..aaaae40 100644
414 --- a/drivers/media/dvb/ttpci/budget-av.c
415 +++ b/drivers/media/dvb/ttpci/budget-av.c
416 @@ -1017,12 +1017,13 @@ static void frontend_init(struct budget_
417 struct saa7146_dev * saa = budget_av->budget.dev;
418 struct dvb_frontend * fe = NULL;
419
420 + /* Enable / PowerON Frontend */
421 + saa7146_setgpio(saa, 0, SAA7146_GPIO_OUTLO);
422 +
423 switch (saa->pci->subsystem_device) {
424 case SUBID_DVBS_KNC1_PLUS:
425 case SUBID_DVBC_KNC1_PLUS:
426 case SUBID_DVBT_KNC1_PLUS:
427 - // Enable / PowerON Frontend
428 - saa7146_setgpio(saa, 0, SAA7146_GPIO_OUTLO);
429 saa7146_setgpio(saa, 3, SAA7146_GPIO_OUTHI);
430 break;
431 }
432 @@ -1059,6 +1060,15 @@ static void frontend_init(struct budget_
433 break;
434
435 case SUBID_DVBC_KNC1:
436 + budget_av->reinitialise_demod = 1;
437 + fe = tda10021_attach(&philips_cu1216_config,
438 + &budget_av->budget.i2c_adap,
439 + read_pwm(budget_av));
440 + if (fe) {
441 + fe->ops.tuner_ops.set_params = philips_cu1216_tuner_set_params;
442 + }
443 + break;
444 +
445 case SUBID_DVBC_KNC1_PLUS:
446 fe = tda10021_attach(&philips_cu1216_config,
447 &budget_av->budget.i2c_adap,
448 @@ -1208,11 +1218,7 @@ static int budget_av_attach(struct saa71
449
450 budget_av->budget.dvb_adapter.priv = budget_av;
451 frontend_init(budget_av);
452 -
453 - if (!budget_av->has_saa7113) {
454 - ciintf_init(budget_av);
455 - }
456 -
457 + ciintf_init(budget_av);
458 return 0;
459 }
460
461 diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
462 index c23c02d..3cdc767 100644
463 --- a/drivers/media/dvb/ttpci/budget.c
464 +++ b/drivers/media/dvb/ttpci/budget.c
465 @@ -367,12 +367,6 @@ static void frontend_init(struct budget
466
467 // try the ALPS BSRU6 now
468 budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap);
469 - if (budget->dvb_frontend) {
470 - budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_diseqc_send_master_cmd;
471 - budget->dvb_frontend->ops->diseqc_send_burst = budget_diseqc_send_burst;
472 - budget->dvb_frontend->ops->set_tone = budget_set_tone;
473 - break;
474 - }
475 break;
476
477 case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659))
478 diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
479 index 6b41970..67d729a 100644
480 --- a/drivers/media/video/Kconfig
481 +++ b/drivers/media/video/Kconfig
482 @@ -380,10 +380,10 @@ config VIDEO_WM8739
483 source "drivers/media/video/cx25840/Kconfig"
484
485 config VIDEO_SAA711X
486 - tristate "Philips SAA7113/4/5 video decoders (OBSOLETED)"
487 - depends on VIDEO_V4L1 && I2C && EXPERIMENTAL
488 + tristate "Philips SAA7113/4/5 video decoders"
489 + depends on VIDEO_DEV && I2C && EXPERIMENTAL
490 ---help---
491 - Old support for the Philips SAA7113/4 video decoders.
492 + Support for the Philips SAA7113/4/5 video decoders.
493
494 To compile this driver as a module, choose M here: the
495 module will be called saa7115.
496 diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
497 index 07476c7..af372dd 100644
498 --- a/drivers/media/video/stradis.c
499 +++ b/drivers/media/video/stradis.c
500 @@ -2180,7 +2180,6 @@ static struct pci_device_id stradis_pci_
501 { 0 }
502 };
503
504 -MODULE_DEVICE_TABLE(pci, stradis_pci_tbl);
505
506 static struct pci_driver stradis_driver = {
507 .name = "stradis",
508 diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
509 index ed1f837..6e59ab5 100644
510 --- a/drivers/net/via-velocity.c
511 +++ b/drivers/net/via-velocity.c
512 @@ -248,6 +248,7 @@ static void velocity_free_rd_ring(struct
513 static void velocity_free_tx_buf(struct velocity_info *vptr, struct velocity_td_info *);
514 static int velocity_soft_reset(struct velocity_info *vptr);
515 static void mii_init(struct velocity_info *vptr, u32 mii_status);
516 +static u32 velocity_get_link(struct net_device *dev);
517 static u32 velocity_get_opt_media_mode(struct velocity_info *vptr);
518 static void velocity_print_link_status(struct velocity_info *vptr);
519 static void safe_disable_mii_autopoll(struct mac_regs __iomem * regs);
520 @@ -798,6 +799,9 @@ #endif
521 if (ret < 0)
522 goto err_iounmap;
523
524 + if (velocity_get_link(dev))
525 + netif_carrier_off(dev);
526 +
527 velocity_print_info(vptr);
528 pci_set_drvdata(pdev, dev);
529
530 @@ -1653,8 +1657,10 @@ static void velocity_error(struct veloci
531
532 if (linked) {
533 vptr->mii_status &= ~VELOCITY_LINK_FAIL;
534 + netif_carrier_on(vptr->dev);
535 } else {
536 vptr->mii_status |= VELOCITY_LINK_FAIL;
537 + netif_carrier_off(vptr->dev);
538 }
539
540 velocity_print_link_status(vptr);
541 diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
542 index 7ed18ca..513fc75 100644
543 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
544 +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
545 @@ -1870,6 +1870,15 @@ static irqreturn_t bcm43xx_interrupt_han
546
547 spin_lock(&bcm->_lock);
548
549 + /* Only accept IRQs, if we are initialized properly.
550 + * This avoids an RX race while initializing.
551 + * We should probably not enable IRQs before we are initialized
552 + * completely, but some careful work is needed to fix this. I think it
553 + * is best to stay with this cheap workaround for now... .
554 + */
555 + if (unlikely(!bcm->initialized))
556 + goto out;
557 +
558 reason = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON);
559 if (reason == 0xffffffff) {
560 /* irq not for us (shared irq) */
561 @@ -1891,20 +1900,11 @@ static irqreturn_t bcm43xx_interrupt_han
562
563 bcm43xx_interrupt_ack(bcm, reason);
564
565 - /* Only accept IRQs, if we are initialized properly.
566 - * This avoids an RX race while initializing.
567 - * We should probably not enable IRQs before we are initialized
568 - * completely, but some careful work is needed to fix this. I think it
569 - * is best to stay with this cheap workaround for now... .
570 - */
571 - if (likely(bcm->initialized)) {
572 - /* disable all IRQs. They are enabled again in the bottom half. */
573 - bcm->irq_savedstate = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL);
574 - /* save the reason code and call our bottom half. */
575 - bcm->irq_reason = reason;
576 - tasklet_schedule(&bcm->isr_tasklet);
577 - }
578 -
579 + /* disable all IRQs. They are enabled again in the bottom half. */
580 + bcm->irq_savedstate = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL);
581 + /* save the reason code and call our bottom half. */
582 + bcm->irq_reason = reason;
583 + tasklet_schedule(&bcm->isr_tasklet);
584 out:
585 mmiowb();
586 spin_unlock(&bcm->_lock);
587 diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig
588 index f63c387..6c8452e 100644
589 --- a/drivers/parport/Kconfig
590 +++ b/drivers/parport/Kconfig
591 @@ -48,7 +48,7 @@ config PARPORT_PC
592
593 config PARPORT_SERIAL
594 tristate "Multi-IO cards (parallel and serial)"
595 - depends on SERIAL_8250 && PARPORT_PC && PCI
596 + depends on SERIAL_8250_PCI && PARPORT_PC && PCI
597 help
598 This adds support for multi-IO PCI cards that have parallel and
599 serial ports. You should say Y or M here. If you say M, the module
600 diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
601 index 6ded527..688421d 100644
602 --- a/drivers/pnp/resource.c
603 +++ b/drivers/pnp/resource.c
604 @@ -396,7 +396,8 @@ #endif
605 /* check if the resource is already in use, skip if the
606 * device is active because it itself may be in use */
607 if(!dev->active) {
608 - if (request_irq(*irq, pnp_test_handler, SA_INTERRUPT, "pnp", NULL))
609 + if (request_irq(*irq, pnp_test_handler,
610 + SA_INTERRUPT|SA_PROBEIRQ, "pnp", NULL))
611 return 0;
612 free_irq(*irq, NULL);
613 }
614 diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
615 index b046ffa..6cd197d 100644
616 --- a/drivers/scsi/libata-core.c
617 +++ b/drivers/scsi/libata-core.c
618 @@ -1229,7 +1229,7 @@ static int ata_dev_configure(struct ata_
619 id[84], id[85], id[86], id[87], id[88]);
620
621 /* initialize to-be-configured parameters */
622 - dev->flags = 0;
623 + dev->flags &= ~ATA_DFLAG_CFG_MASK;
624 dev->max_sectors = 0;
625 dev->cdb_len = 0;
626 dev->n_sectors = 0;
627 diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
628 index bbf78aa..3863eba 100644
629 --- a/drivers/serial/8250.c
630 +++ b/drivers/serial/8250.c
631 @@ -2241,10 +2241,14 @@ serial8250_console_write(struct console
632
633 touch_nmi_watchdog();
634
635 - if (oops_in_progress) {
636 - locked = spin_trylock_irqsave(&up->port.lock, flags);
637 + local_irq_save(flags);
638 + if (up->port.sysrq) {
639 + /* serial8250_handle_port() already took the lock */
640 + locked = 0;
641 + } else if (oops_in_progress) {
642 + locked = spin_trylock(&up->port.lock);
643 } else
644 - spin_lock_irqsave(&up->port.lock, flags);
645 + spin_lock(&up->port.lock);
646
647 /*
648 * First save the IER then disable the interrupts
649 @@ -2266,7 +2270,8 @@ serial8250_console_write(struct console
650 serial_out(up, UART_IER, ier);
651
652 if (locked)
653 - spin_unlock_irqrestore(&up->port.lock, flags);
654 + spin_unlock(&up->port.lock);
655 + local_irq_restore(flags);
656 }
657
658 static int serial8250_console_setup(struct console *co, char *options)
659 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
660 index 986d762..ad9ddec 100644
661 --- a/drivers/usb/serial/ftdi_sio.c
662 +++ b/drivers/usb/serial/ftdi_sio.c
663 @@ -553,6 +553,10 @@ struct ftdi_private {
664
665 int force_baud; /* if non-zero, force the baud rate to this value */
666 int force_rtscts; /* if non-zero, force RTS-CTS to always be enabled */
667 +
668 + spinlock_t tx_lock; /* spinlock for transmit state */
669 + unsigned long tx_outstanding_bytes;
670 + unsigned long tx_outstanding_urbs;
671 };
672
673 /* Used for TIOCMIWAIT */
674 @@ -626,6 +630,9 @@ #define WDR_SHORT_TIMEOUT 1000 /* shorte
675 #define HIGH 1
676 #define LOW 0
677
678 +/* number of outstanding urbs to prevent userspace DoS from happening */
679 +#define URB_UPPER_LIMIT 42
680 +
681 /*
682 * ***************************************************************************
683 * Utlity functions
684 @@ -1156,6 +1163,7 @@ static int ftdi_sio_attach (struct usb_s
685 }
686
687 spin_lock_init(&priv->rx_lock);
688 + spin_lock_init(&priv->tx_lock);
689 init_waitqueue_head(&priv->delta_msr_wait);
690 /* This will push the characters through immediately rather
691 than queue a task to deliver them */
692 @@ -1372,6 +1380,7 @@ static int ftdi_write (struct usb_serial
693 int data_offset ; /* will be 1 for the SIO and 0 otherwise */
694 int status;
695 int transfer_size;
696 + unsigned long flags;
697
698 dbg("%s port %d, %d bytes", __FUNCTION__, port->number, count);
699
700 @@ -1379,6 +1388,13 @@ static int ftdi_write (struct usb_serial
701 dbg("write request of 0 bytes");
702 return 0;
703 }
704 + spin_lock_irqsave(&priv->tx_lock, flags);
705 + if (priv->tx_outstanding_urbs > URB_UPPER_LIMIT) {
706 + spin_unlock_irqrestore(&priv->tx_lock, flags);
707 + dbg("%s - write limit hit\n", __FUNCTION__);
708 + return 0;
709 + }
710 + spin_unlock_irqrestore(&priv->tx_lock, flags);
711
712 data_offset = priv->write_offset;
713 dbg("data_offset set to %d",data_offset);
714 @@ -1445,6 +1461,11 @@ static int ftdi_write (struct usb_serial
715 err("%s - failed submitting write urb, error %d", __FUNCTION__, status);
716 count = status;
717 kfree (buffer);
718 + } else {
719 + spin_lock_irqsave(&priv->tx_lock, flags);
720 + ++priv->tx_outstanding_urbs;
721 + priv->tx_outstanding_bytes += count;
722 + spin_unlock_irqrestore(&priv->tx_lock, flags);
723 }
724
725 /* we are done with this urb, so let the host driver
726 @@ -1460,7 +1481,11 @@ static int ftdi_write (struct usb_serial
727
728 static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
729 {
730 + unsigned long flags;
731 struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
732 + struct ftdi_private *priv;
733 + int data_offset; /* will be 1 for the SIO and 0 otherwise */
734 + unsigned long countback;
735
736 /* free up the transfer buffer, as usb_free_urb() does not do this */
737 kfree (urb->transfer_buffer);
738 @@ -1472,34 +1497,67 @@ static void ftdi_write_bulk_callback (st
739 return;
740 }
741
742 + priv = usb_get_serial_port_data(port);
743 + if (!priv) {
744 + dbg("%s - bad port private data pointer - exiting", __FUNCTION__);
745 + return;
746 + }
747 + /* account for transferred data */
748 + countback = urb->actual_length;
749 + data_offset = priv->write_offset;
750 + if (data_offset > 0) {
751 + /* Subtract the control bytes */
752 + countback -= (data_offset * ((countback + (PKTSZ - 1)) / PKTSZ));
753 + }
754 + spin_lock_irqsave(&priv->tx_lock, flags);
755 + --priv->tx_outstanding_urbs;
756 + priv->tx_outstanding_bytes -= countback;
757 + spin_unlock_irqrestore(&priv->tx_lock, flags);
758 +
759 schedule_work(&port->work);
760 } /* ftdi_write_bulk_callback */
761
762
763 static int ftdi_write_room( struct usb_serial_port *port )
764 {
765 + struct ftdi_private *priv = usb_get_serial_port_data(port);
766 + int room;
767 + unsigned long flags;
768 +
769 dbg("%s - port %d", __FUNCTION__, port->number);
770
771 - /*
772 - * We really can take anything the user throws at us
773 - * but let's pick a nice big number to tell the tty
774 - * layer that we have lots of free space
775 - */
776 - return 2048;
777 + spin_lock_irqsave(&priv->tx_lock, flags);
778 + if (priv->tx_outstanding_urbs < URB_UPPER_LIMIT) {
779 + /*
780 + * We really can take anything the user throws at us
781 + * but let's pick a nice big number to tell the tty
782 + * layer that we have lots of free space
783 + */
784 + room = 2048;
785 + } else {
786 + room = 0;
787 + }
788 + spin_unlock_irqrestore(&priv->tx_lock, flags);
789 + return room;
790 } /* ftdi_write_room */
791
792
793 static int ftdi_chars_in_buffer (struct usb_serial_port *port)
794 { /* ftdi_chars_in_buffer */
795 + struct ftdi_private *priv = usb_get_serial_port_data(port);
796 + int buffered;
797 + unsigned long flags;
798 +
799 dbg("%s - port %d", __FUNCTION__, port->number);
800
801 - /*
802 - * We can't really account for how much data we
803 - * have sent out, but hasn't made it through to the
804 - * device, so just tell the tty layer that everything
805 - * is flushed.
806 - */
807 - return 0;
808 + spin_lock_irqsave(&priv->tx_lock, flags);
809 + buffered = (int)priv->tx_outstanding_bytes;
810 + spin_unlock_irqrestore(&priv->tx_lock, flags);
811 + if (buffered < 0) {
812 + err("%s outstanding tx bytes is negative!", __FUNCTION__);
813 + buffered = 0;
814 + }
815 + return buffered;
816 } /* ftdi_chars_in_buffer */
817
818
819 diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
820 index f806553..3ced09c 100644
821 --- a/drivers/usb/serial/whiteheat.c
822 +++ b/drivers/usb/serial/whiteheat.c
823 @@ -388,7 +388,7 @@ static int whiteheat_attach (struct usb_
824 if (ret) {
825 err("%s: Couldn't send command [%d]", serial->type->description, ret);
826 goto no_firmware;
827 - } else if (alen != sizeof(command)) {
828 + } else if (alen != 2) {
829 err("%s: Send command incomplete [%d]", serial->type->description, alen);
830 goto no_firmware;
831 }
832 @@ -400,7 +400,7 @@ static int whiteheat_attach (struct usb_
833 if (ret) {
834 err("%s: Couldn't get results [%d]", serial->type->description, ret);
835 goto no_firmware;
836 - } else if (alen != sizeof(result)) {
837 + } else if (alen != sizeof(*hw_info) + 1) {
838 err("%s: Get results incomplete [%d]", serial->type->description, alen);
839 goto no_firmware;
840 } else if (result[0] != command[0]) {
841 diff --git a/fs/file.c b/fs/file.c
842 index 55f4e70..4c2cacc 100644
843 --- a/fs/file.c
844 +++ b/fs/file.c
845 @@ -277,11 +277,13 @@ #endif
846 } while (nfds <= nr);
847 new_fds = alloc_fd_array(nfds);
848 if (!new_fds)
849 - goto out;
850 + goto out2;
851 fdt->fd = new_fds;
852 fdt->max_fds = nfds;
853 fdt->free_files = NULL;
854 return fdt;
855 +out2:
856 + nfds = fdt->max_fdset;
857 out:
858 if (new_openset)
859 free_fdset(new_openset, nfds);
860 diff --git a/fs/namei.c b/fs/namei.c
861 index d6e2ee2..21be124 100644
862 --- a/fs/namei.c
863 +++ b/fs/namei.c
864 @@ -1712,8 +1712,14 @@ do_link:
865 if (error)
866 goto exit_dput;
867 error = __do_follow_link(&path, nd);
868 - if (error)
869 + if (error) {
870 + /* Does someone understand code flow here? Or it is only
871 + * me so stupid? Anathema to whoever designed this non-sense
872 + * with "intent.open".
873 + */
874 + release_open_intent(nd);
875 return error;
876 + }
877 nd->flags &= ~LOOKUP_PARENT;
878 if (nd->last_type == LAST_BIND)
879 goto ok;
880 diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
881 index c63a83e..36e1e13 100644
882 --- a/fs/ntfs/file.c
883 +++ b/fs/ntfs/file.c
884 @@ -1484,14 +1484,15 @@ static inline void ntfs_flush_dcache_pag
885 unsigned nr_pages)
886 {
887 BUG_ON(!nr_pages);
888 + /*
889 + * Warning: Do not do the decrement at the same time as the call to
890 + * flush_dcache_page() because it is a NULL macro on i386 and hence the
891 + * decrement never happens so the loop never terminates.
892 + */
893 do {
894 - /*
895 - * Warning: Do not do the decrement at the same time as the
896 - * call because flush_dcache_page() is a NULL macro on i386
897 - * and hence the decrement never happens.
898 - */
899 + --nr_pages;
900 flush_dcache_page(pages[nr_pages]);
901 - } while (--nr_pages > 0);
902 + } while (nr_pages > 0);
903 }
904
905 /**
906 diff --git a/fs/proc/base.c b/fs/proc/base.c
907 index 6cc77dc..f801693 100644
908 --- a/fs/proc/base.c
909 +++ b/fs/proc/base.c
910 @@ -1405,6 +1405,7 @@ static int pid_revalidate(struct dentry
911 inode->i_uid = 0;
912 inode->i_gid = 0;
913 }
914 + inode->i_mode &= ~(S_ISUID | S_ISGID);
915 security_task_to_inode(task, inode);
916 return 1;
917 }
918 @@ -1432,6 +1433,7 @@ static int tid_fd_revalidate(struct dent
919 inode->i_uid = 0;
920 inode->i_gid = 0;
921 }
922 + inode->i_mode &= ~(S_ISUID | S_ISGID);
923 security_task_to_inode(task, inode);
924 return 1;
925 }
926 diff --git a/fs/splice.c b/fs/splice.c
927 index a285fd7..8fef667 100644
928 --- a/fs/splice.c
929 +++ b/fs/splice.c
930 @@ -1295,6 +1295,85 @@ asmlinkage long sys_splice(int fd_in, lo
931 }
932
933 /*
934 + * Make sure there's data to read. Wait for input if we can, otherwise
935 + * return an appropriate error.
936 + */
937 +static int link_ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
938 +{
939 + int ret;
940 +
941 + /*
942 + * Check ->nrbufs without the inode lock first. This function
943 + * is speculative anyways, so missing one is ok.
944 + */
945 + if (pipe->nrbufs)
946 + return 0;
947 +
948 + ret = 0;
949 + mutex_lock(&pipe->inode->i_mutex);
950 +
951 + while (!pipe->nrbufs) {
952 + if (signal_pending(current)) {
953 + ret = -ERESTARTSYS;
954 + break;
955 + }
956 + if (!pipe->writers)
957 + break;
958 + if (!pipe->waiting_writers) {
959 + if (flags & SPLICE_F_NONBLOCK) {
960 + ret = -EAGAIN;
961 + break;
962 + }
963 + }
964 + pipe_wait(pipe);
965 + }
966 +
967 + mutex_unlock(&pipe->inode->i_mutex);
968 + return ret;
969 +}
970 +
971 +/*
972 + * Make sure there's writeable room. Wait for room if we can, otherwise
973 + * return an appropriate error.
974 + */
975 +static int link_opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
976 +{
977 + int ret;
978 +
979 + /*
980 + * Check ->nrbufs without the inode lock first. This function
981 + * is speculative anyways, so missing one is ok.
982 + */
983 + if (pipe->nrbufs < PIPE_BUFFERS)
984 + return 0;
985 +
986 + ret = 0;
987 + mutex_lock(&pipe->inode->i_mutex);
988 +
989 + while (pipe->nrbufs >= PIPE_BUFFERS) {
990 + if (!pipe->readers) {
991 + send_sig(SIGPIPE, current, 0);
992 + ret = -EPIPE;
993 + break;
994 + }
995 + if (flags & SPLICE_F_NONBLOCK) {
996 + ret = -EAGAIN;
997 + break;
998 + }
999 + if (signal_pending(current)) {
1000 + ret = -ERESTARTSYS;
1001 + break;
1002 + }
1003 + pipe->waiting_writers++;
1004 + pipe_wait(pipe);
1005 + pipe->waiting_writers--;
1006 + }
1007 +
1008 + mutex_unlock(&pipe->inode->i_mutex);
1009 + return ret;
1010 +}
1011 +
1012 +/*
1013 * Link contents of ipipe to opipe.
1014 */
1015 static int link_pipe(struct pipe_inode_info *ipipe,
1016 @@ -1302,9 +1381,7 @@ static int link_pipe(struct pipe_inode_i
1017 size_t len, unsigned int flags)
1018 {
1019 struct pipe_buffer *ibuf, *obuf;
1020 - int ret, do_wakeup, i, ipipe_first;
1021 -
1022 - ret = do_wakeup = ipipe_first = 0;
1023 + int ret = 0, i = 0, nbuf;
1024
1025 /*
1026 * Potential ABBA deadlock, work around it by ordering lock
1027 @@ -1312,7 +1389,6 @@ static int link_pipe(struct pipe_inode_i
1028 * could deadlock (one doing tee from A -> B, the other from B -> A).
1029 */
1030 if (ipipe->inode < opipe->inode) {
1031 - ipipe_first = 1;
1032 mutex_lock(&ipipe->inode->i_mutex);
1033 mutex_lock(&opipe->inode->i_mutex);
1034 } else {
1035 @@ -1320,118 +1396,55 @@ static int link_pipe(struct pipe_inode_i
1036 mutex_lock(&ipipe->inode->i_mutex);
1037 }
1038
1039 - for (i = 0;; i++) {
1040 + do {
1041 if (!opipe->readers) {
1042 send_sig(SIGPIPE, current, 0);
1043 if (!ret)
1044 ret = -EPIPE;
1045 break;
1046 }
1047 - if (ipipe->nrbufs - i) {
1048 - ibuf = ipipe->bufs + ((ipipe->curbuf + i) & (PIPE_BUFFERS - 1));
1049
1050 - /*
1051 - * If we have room, fill this buffer
1052 - */
1053 - if (opipe->nrbufs < PIPE_BUFFERS) {
1054 - int nbuf = (opipe->curbuf + opipe->nrbufs) & (PIPE_BUFFERS - 1);
1055 -
1056 - /*
1057 - * Get a reference to this pipe buffer,
1058 - * so we can copy the contents over.
1059 - */
1060 - ibuf->ops->get(ipipe, ibuf);
1061 -
1062 - obuf = opipe->bufs + nbuf;
1063 - *obuf = *ibuf;
1064 -
1065 - /*
1066 - * Don't inherit the gift flag, we need to
1067 - * prevent multiple steals of this page.
1068 - */
1069 - obuf->flags &= ~PIPE_BUF_FLAG_GIFT;
1070 -
1071 - if (obuf->len > len)
1072 - obuf->len = len;
1073 -
1074 - opipe->nrbufs++;
1075 - do_wakeup = 1;
1076 - ret += obuf->len;
1077 - len -= obuf->len;
1078 -
1079 - if (!len)
1080 - break;
1081 - if (opipe->nrbufs < PIPE_BUFFERS)
1082 - continue;
1083 - }
1084 -
1085 - /*
1086 - * We have input available, but no output room.
1087 - * If we already copied data, return that. If we
1088 - * need to drop the opipe lock, it must be ordered
1089 - * last to avoid deadlocks.
1090 - */
1091 - if ((flags & SPLICE_F_NONBLOCK) || !ipipe_first) {
1092 - if (!ret)
1093 - ret = -EAGAIN;
1094 - break;
1095 - }
1096 - if (signal_pending(current)) {
1097 - if (!ret)
1098 - ret = -ERESTARTSYS;
1099 - break;
1100 - }
1101 - if (do_wakeup) {
1102 - smp_mb();
1103 - if (waitqueue_active(&opipe->wait))
1104 - wake_up_interruptible(&opipe->wait);
1105 - kill_fasync(&opipe->fasync_readers, SIGIO, POLL_IN);
1106 - do_wakeup = 0;
1107 - }
1108 + /*
1109 + * If we have iterated all input buffers or ran out of
1110 + * output room, break.
1111 + */
1112 + if (i >= ipipe->nrbufs || opipe->nrbufs >= PIPE_BUFFERS)
1113 + break;
1114
1115 - opipe->waiting_writers++;
1116 - pipe_wait(opipe);
1117 - opipe->waiting_writers--;
1118 - continue;
1119 - }
1120 + ibuf = ipipe->bufs + ((ipipe->curbuf + i) & (PIPE_BUFFERS - 1));
1121 + nbuf = (opipe->curbuf + opipe->nrbufs) & (PIPE_BUFFERS - 1);
1122
1123 /*
1124 - * No input buffers, do the usual checks for available
1125 - * writers and blocking and wait if necessary
1126 + * Get a reference to this pipe buffer,
1127 + * so we can copy the contents over.
1128 */
1129 - if (!ipipe->writers)
1130 - break;
1131 - if (!ipipe->waiting_writers) {
1132 - if (ret)
1133 - break;
1134 - }
1135 + ibuf->ops->get(ipipe, ibuf);
1136 +
1137 + obuf = opipe->bufs + nbuf;
1138 + *obuf = *ibuf;
1139 +
1140 /*
1141 - * pipe_wait() drops the ipipe mutex. To avoid deadlocks
1142 - * with another process, we can only safely do that if
1143 - * the ipipe lock is ordered last.
1144 + * Don't inherit the gift flag, we need to
1145 + * prevent multiple steals of this page.
1146 */
1147 - if ((flags & SPLICE_F_NONBLOCK) || ipipe_first) {
1148 - if (!ret)
1149 - ret = -EAGAIN;
1150 - break;
1151 - }
1152 - if (signal_pending(current)) {
1153 - if (!ret)
1154 - ret = -ERESTARTSYS;
1155 - break;
1156 - }
1157 + obuf->flags &= ~PIPE_BUF_FLAG_GIFT;
1158
1159 - if (waitqueue_active(&ipipe->wait))
1160 - wake_up_interruptible_sync(&ipipe->wait);
1161 - kill_fasync(&ipipe->fasync_writers, SIGIO, POLL_OUT);
1162 + if (obuf->len > len)
1163 + obuf->len = len;
1164
1165 - pipe_wait(ipipe);
1166 - }
1167 + opipe->nrbufs++;
1168 + ret += obuf->len;
1169 + len -= obuf->len;
1170 + i++;
1171 + } while (len);
1172
1173 mutex_unlock(&ipipe->inode->i_mutex);
1174 mutex_unlock(&opipe->inode->i_mutex);
1175
1176 - if (do_wakeup) {
1177 + /*
1178 + * If we put data in the output pipe, wakeup any potential readers.
1179 + */
1180 + if (ret > 0) {
1181 smp_mb();
1182 if (waitqueue_active(&opipe->wait))
1183 wake_up_interruptible(&opipe->wait);
1184 @@ -1452,14 +1465,29 @@ static long do_tee(struct file *in, stru
1185 {
1186 struct pipe_inode_info *ipipe = in->f_dentry->d_inode->i_pipe;
1187 struct pipe_inode_info *opipe = out->f_dentry->d_inode->i_pipe;
1188 + int ret = -EINVAL;
1189
1190 /*
1191 - * Link ipipe to the two output pipes, consuming as we go along.
1192 + * Duplicate the contents of ipipe to opipe without actually
1193 + * copying the data.
1194 */
1195 - if (ipipe && opipe)
1196 - return link_pipe(ipipe, opipe, len, flags);
1197 + if (ipipe && opipe && ipipe != opipe) {
1198 + /*
1199 + * Keep going, unless we encounter an error. The ipipe/opipe
1200 + * ordering doesn't really matter.
1201 + */
1202 + ret = link_ipipe_prep(ipipe, flags);
1203 + if (!ret) {
1204 + ret = link_opipe_prep(opipe, flags);
1205 + if (!ret) {
1206 + ret = link_pipe(ipipe, opipe, len, flags);
1207 + if (!ret && (flags & SPLICE_F_NONBLOCK))
1208 + ret = -EAGAIN;
1209 + }
1210 + }
1211 + }
1212
1213 - return -EINVAL;
1214 + return ret;
1215 }
1216
1217 asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags)
1218 diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
1219 index ac511ab..0655cc3 100644
1220 --- a/fs/xfs/xfs_dir2_node.c
1221 +++ b/fs/xfs/xfs_dir2_node.c
1222 @@ -970,7 +970,7 @@ xfs_dir2_leafn_remove(
1223 /*
1224 * One less used entry in the free table.
1225 */
1226 - free->hdr.nused = cpu_to_be32(-1);
1227 + be32_add(&free->hdr.nused, -1);
1228 xfs_dir2_free_log_header(tp, fbp);
1229 /*
1230 * If this was the last entry in the table, we can
1231 diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h
1232 index e201dec..d79e9ee 100644
1233 --- a/include/asm-i386/alternative.h
1234 +++ b/include/asm-i386/alternative.h
1235 @@ -3,6 +3,8 @@ #define _I386_ALTERNATIVE_H
1236
1237 #ifdef __KERNEL__
1238
1239 +#include <asm/types.h>
1240 +
1241 struct alt_instr {
1242 u8 *instr; /* original instruction */
1243 u8 *replacement;
1244 diff --git a/include/linux/libata.h b/include/linux/libata.h
1245 index b80d2e7..05d3fb3 100644
1246 --- a/include/linux/libata.h
1247 +++ b/include/linux/libata.h
1248 @@ -120,9 +120,12 @@ enum {
1249 ATA_SHT_USE_CLUSTERING = 1,
1250
1251 /* struct ata_device stuff */
1252 - ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */
1253 - ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */
1254 - ATA_DFLAG_LBA = (1 << 2), /* device supports LBA */
1255 + ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */
1256 + ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */
1257 +
1258 + ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
1259 +
1260 + ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */
1261
1262 ATA_DEV_UNKNOWN = 0, /* unknown device */
1263 ATA_DEV_ATA = 1, /* ATA device */
1264 diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
1265 index bac0fb3..d5dd471 100644
1266 --- a/include/linux/pfkeyv2.h
1267 +++ b/include/linux/pfkeyv2.h
1268 @@ -159,7 +159,7 @@ struct sadb_spirange {
1269 struct sadb_x_kmprivate {
1270 uint16_t sadb_x_kmprivate_len;
1271 uint16_t sadb_x_kmprivate_exttype;
1272 - u_int32_t sadb_x_kmprivate_reserved;
1273 + uint32_t sadb_x_kmprivate_reserved;
1274 } __attribute__((packed));
1275 /* sizeof(struct sadb_x_kmprivate) == 8 */
1276
1277 diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
1278 index 7f4fea1..5f69158 100644
1279 --- a/include/net/sctp/structs.h
1280 +++ b/include/net/sctp/structs.h
1281 @@ -555,7 +555,8 @@ struct sctp_af {
1282 int (*to_addr_param) (const union sctp_addr *,
1283 union sctp_addr_param *);
1284 int (*addr_valid) (union sctp_addr *,
1285 - struct sctp_sock *);
1286 + struct sctp_sock *,
1287 + const struct sk_buff *);
1288 sctp_scope_t (*scope) (union sctp_addr *);
1289 void (*inaddr_any) (union sctp_addr *, unsigned short);
1290 int (*is_any) (const union sctp_addr *);
1291 diff --git a/include/sound/initval.h b/include/sound/initval.h
1292 index d29e3d3..d45170b 100644
1293 --- a/include/sound/initval.h
1294 +++ b/include/sound/initval.h
1295 @@ -62,7 +62,8 @@ static int snd_legacy_find_free_irq(int
1296 {
1297 while (*irq_table != -1) {
1298 if (!request_irq(*irq_table, snd_legacy_empty_irq_handler,
1299 - SA_INTERRUPT, "ALSA Test IRQ", (void *) irq_table)) {
1300 + SA_INTERRUPT | SA_PROBEIRQ, "ALSA Test IRQ",
1301 + (void *) irq_table)) {
1302 free_irq(*irq_table, (void *) irq_table);
1303 return *irq_table;
1304 }
1305 diff --git a/kernel/exit.c b/kernel/exit.c
1306 index e06d0c1..ccf791b 100644
1307 --- a/kernel/exit.c
1308 +++ b/kernel/exit.c
1309 @@ -899,7 +899,7 @@ fastcall NORET_TYPE void do_exit(long co
1310 }
1311 if (unlikely(tsk->robust_list))
1312 exit_robust_list(tsk);
1313 -#ifdef CONFIG_COMPAT
1314 +#if defined(CONFIG_FUTEX) && defined(CONFIG_COMPAT)
1315 if (unlikely(tsk->compat_robust_list))
1316 compat_exit_robust_list(tsk);
1317 #endif
1318 diff --git a/kernel/sys.c b/kernel/sys.c
1319 index 0b6ec0e..59273f7 100644
1320 --- a/kernel/sys.c
1321 +++ b/kernel/sys.c
1322 @@ -1991,7 +1991,7 @@ asmlinkage long sys_prctl(int option, un
1323 error = current->mm->dumpable;
1324 break;
1325 case PR_SET_DUMPABLE:
1326 - if (arg2 < 0 || arg2 > 2) {
1327 + if (arg2 < 0 || arg2 > 1) {
1328 error = -EINVAL;
1329 break;
1330 }
1331 diff --git a/lib/idr.c b/lib/idr.c
1332 index d226259..de19030 100644
1333 --- a/lib/idr.c
1334 +++ b/lib/idr.c
1335 @@ -48,15 +48,21 @@ static struct idr_layer *alloc_layer(str
1336 return(p);
1337 }
1338
1339 +/* only called when idp->lock is held */
1340 +static void __free_layer(struct idr *idp, struct idr_layer *p)
1341 +{
1342 + p->ary[0] = idp->id_free;
1343 + idp->id_free = p;
1344 + idp->id_free_cnt++;
1345 +}
1346 +
1347 static void free_layer(struct idr *idp, struct idr_layer *p)
1348 {
1349 /*
1350 * Depends on the return element being zeroed.
1351 */
1352 spin_lock(&idp->lock);
1353 - p->ary[0] = idp->id_free;
1354 - idp->id_free = p;
1355 - idp->id_free_cnt++;
1356 + __free_layer(idp, p);
1357 spin_unlock(&idp->lock);
1358 }
1359
1360 @@ -184,12 +190,14 @@ build_up:
1361 * The allocation failed. If we built part of
1362 * the structure tear it down.
1363 */
1364 + spin_lock(&idp->lock);
1365 for (new = p; p && p != idp->top; new = p) {
1366 p = p->ary[0];
1367 new->ary[0] = NULL;
1368 new->bitmap = new->count = 0;
1369 - free_layer(idp, new);
1370 + __free_layer(idp, new);
1371 }
1372 + spin_unlock(&idp->lock);
1373 return -1;
1374 }
1375 new->ary[0] = p;
1376 diff --git a/mm/Kconfig b/mm/Kconfig
1377 index 332f5c2..8b13ca3 100644
1378 --- a/mm/Kconfig
1379 +++ b/mm/Kconfig
1380 @@ -115,7 +115,7 @@ config SPARSEMEM_EXTREME
1381 # eventually, we can have this option just 'select SPARSEMEM'
1382 config MEMORY_HOTPLUG
1383 bool "Allow for memory hot-add"
1384 - depends on SPARSEMEM && HOTPLUG && !SOFTWARE_SUSPEND
1385 + depends on SPARSEMEM && HOTPLUG && !SOFTWARE_SUSPEND && ARCH_ENABLE_MEMORY_HOTPLUG
1386
1387 comment "Memory hotplug is currently incompatible with Software Suspend"
1388 depends on SPARSEMEM && HOTPLUG && SOFTWARE_SUSPEND
1389 diff --git a/mm/filemap.c b/mm/filemap.c
1390 index fd57442..4655fa0 100644
1391 --- a/mm/filemap.c
1392 +++ b/mm/filemap.c
1393 @@ -2004,14 +2004,21 @@ generic_file_buffered_write(struct kiocb
1394 do {
1395 unsigned long index;
1396 unsigned long offset;
1397 - unsigned long maxlen;
1398 size_t copied;
1399
1400 offset = (pos & (PAGE_CACHE_SIZE -1)); /* Within page */
1401 index = pos >> PAGE_CACHE_SHIFT;
1402 bytes = PAGE_CACHE_SIZE - offset;
1403 - if (bytes > count)
1404 - bytes = count;
1405 +
1406 + /* Limit the size of the copy to the caller's write size */
1407 + bytes = min(bytes, count);
1408 +
1409 + /*
1410 + * Limit the size of the copy to that of the current segment,
1411 + * because fault_in_pages_readable() doesn't know how to walk
1412 + * segments.
1413 + */
1414 + bytes = min(bytes, cur_iov->iov_len - iov_base);
1415
1416 /*
1417 * Bring in the user page that we will copy from _first_.
1418 @@ -2019,10 +2026,7 @@ generic_file_buffered_write(struct kiocb
1419 * same page as we're writing to, without it being marked
1420 * up-to-date.
1421 */
1422 - maxlen = cur_iov->iov_len - iov_base;
1423 - if (maxlen > bytes)
1424 - maxlen = bytes;
1425 - fault_in_pages_readable(buf, maxlen);
1426 + fault_in_pages_readable(buf, bytes);
1427
1428 page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec);
1429 if (!page) {
1430 @@ -2030,6 +2034,12 @@ generic_file_buffered_write(struct kiocb
1431 break;
1432 }
1433
1434 + if (unlikely(bytes == 0)) {
1435 + status = 0;
1436 + copied = 0;
1437 + goto zero_length_segment;
1438 + }
1439 +
1440 status = a_ops->prepare_write(file, page, offset, offset+bytes);
1441 if (unlikely(status)) {
1442 loff_t isize = i_size_read(inode);
1443 @@ -2059,7 +2069,8 @@ generic_file_buffered_write(struct kiocb
1444 page_cache_release(page);
1445 continue;
1446 }
1447 - if (likely(copied > 0)) {
1448 +zero_length_segment:
1449 + if (likely(copied >= 0)) {
1450 if (!status)
1451 status = copied;
1452
1453 diff --git a/mm/filemap.h b/mm/filemap.h
1454 index 13793ba..efd0142 100644
1455 --- a/mm/filemap.h
1456 +++ b/mm/filemap.h
1457 @@ -78,7 +78,7 @@ filemap_set_next_iovec(const struct iove
1458 const struct iovec *iov = *iovp;
1459 size_t base = *basep;
1460
1461 - while (bytes) {
1462 + do {
1463 int copy = min(bytes, iov->iov_len - base);
1464
1465 bytes -= copy;
1466 @@ -87,7 +87,7 @@ filemap_set_next_iovec(const struct iove
1467 iov++;
1468 base = 0;
1469 }
1470 - }
1471 + } while (bytes);
1472 *iovp = iov;
1473 *basep = base;
1474 }
1475 diff --git a/mm/pdflush.c b/mm/pdflush.c
1476 index c4b6d0a..4842716 100644
1477 --- a/mm/pdflush.c
1478 +++ b/mm/pdflush.c
1479 @@ -104,21 +104,20 @@ static int __pdflush(struct pdflush_work
1480 list_move(&my_work->list, &pdflush_list);
1481 my_work->when_i_went_to_sleep = jiffies;
1482 spin_unlock_irq(&pdflush_lock);
1483 -
1484 schedule();
1485 - if (try_to_freeze()) {
1486 - spin_lock_irq(&pdflush_lock);
1487 - continue;
1488 - }
1489 -
1490 + try_to_freeze();
1491 spin_lock_irq(&pdflush_lock);
1492 if (!list_empty(&my_work->list)) {
1493 - printk("pdflush: bogus wakeup!\n");
1494 + /*
1495 + * Someone woke us up, but without removing our control
1496 + * structure from the global list. swsusp will do this
1497 + * in try_to_freeze()->refrigerator(). Handle it.
1498 + */
1499 my_work->fn = NULL;
1500 continue;
1501 }
1502 if (my_work->fn == NULL) {
1503 - printk("pdflush: NULL work function\n");
1504 + printk("pdflush: bogus wakeup\n");
1505 continue;
1506 }
1507 spin_unlock_irq(&pdflush_lock);
1508 diff --git a/net/core/dev.c b/net/core/dev.c
1509 index 4fba549..7d472ed 100644
1510 --- a/net/core/dev.c
1511 +++ b/net/core/dev.c
1512 @@ -1246,6 +1246,7 @@ int __skb_linearize(struct sk_buff *skb,
1513 atomic_set(&ninfo->dataref, 1);
1514 ninfo->tso_size = skb_shinfo(skb)->tso_size;
1515 ninfo->tso_segs = skb_shinfo(skb)->tso_segs;
1516 + ninfo->ufo_size = skb_shinfo(skb)->ufo_size;
1517 ninfo->nr_frags = 0;
1518 ninfo->frag_list = NULL;
1519
1520 diff --git a/net/core/ethtool.c b/net/core/ethtool.c
1521 index e6f7610..4fe39cf 100644
1522 --- a/net/core/ethtool.c
1523 +++ b/net/core/ethtool.c
1524 @@ -437,7 +437,7 @@ static int ethtool_set_pauseparam(struct
1525 {
1526 struct ethtool_pauseparam pauseparam;
1527
1528 - if (!dev->ethtool_ops->get_pauseparam)
1529 + if (!dev->ethtool_ops->set_pauseparam)
1530 return -EOPNOTSUPP;
1531
1532 if (copy_from_user(&pauseparam, useraddr, sizeof(pauseparam)))
1533 @@ -591,7 +591,7 @@ static int ethtool_set_tso(struct net_de
1534
1535 static int ethtool_get_ufo(struct net_device *dev, char __user *useraddr)
1536 {
1537 - struct ethtool_value edata = { ETHTOOL_GTSO };
1538 + struct ethtool_value edata = { ETHTOOL_GUFO };
1539
1540 if (!dev->ethtool_ops->get_ufo)
1541 return -EOPNOTSUPP;
1542 @@ -600,6 +600,7 @@ static int ethtool_get_ufo(struct net_de
1543 return -EFAULT;
1544 return 0;
1545 }
1546 +
1547 static int ethtool_set_ufo(struct net_device *dev, char __user *useraddr)
1548 {
1549 struct ethtool_value edata;
1550 diff --git a/net/core/skbuff.c b/net/core/skbuff.c
1551 index fb3770f..0280535 100644
1552 --- a/net/core/skbuff.c
1553 +++ b/net/core/skbuff.c
1554 @@ -240,6 +240,7 @@ struct sk_buff *alloc_skb_from_cache(kme
1555 skb_shinfo(skb)->nr_frags = 0;
1556 skb_shinfo(skb)->tso_size = 0;
1557 skb_shinfo(skb)->tso_segs = 0;
1558 + skb_shinfo(skb)->ufo_size = 0;
1559 skb_shinfo(skb)->frag_list = NULL;
1560 out:
1561 return skb;
1562 @@ -529,6 +530,7 @@ #endif
1563 atomic_set(&new->users, 1);
1564 skb_shinfo(new)->tso_size = skb_shinfo(old)->tso_size;
1565 skb_shinfo(new)->tso_segs = skb_shinfo(old)->tso_segs;
1566 + skb_shinfo(new)->ufo_size = skb_shinfo(old)->ufo_size;
1567 }
1568
1569 /**
1570 diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
1571 index 446faaf..2440d05 100644
1572 --- a/net/decnet/dn_rules.c
1573 +++ b/net/decnet/dn_rules.c
1574 @@ -400,9 +400,10 @@ int dn_fib_dump_rules(struct sk_buff *sk
1575 rcu_read_lock();
1576 hlist_for_each_entry(r, node, &dn_fib_rules, r_hlist) {
1577 if (idx < s_idx)
1578 - continue;
1579 + goto next;
1580 if (dn_fib_fill_rule(skb, r, cb, NLM_F_MULTI) < 0)
1581 break;
1582 +next:
1583 idx++;
1584 }
1585 rcu_read_unlock();
1586 diff --git a/net/ieee80211/Kconfig b/net/ieee80211/Kconfig
1587 index dbb0852..f7e84e9 100644
1588 --- a/net/ieee80211/Kconfig
1589 +++ b/net/ieee80211/Kconfig
1590 @@ -58,6 +58,7 @@ config IEEE80211_CRYPT_TKIP
1591 depends on IEEE80211 && NET_RADIO
1592 select CRYPTO
1593 select CRYPTO_MICHAEL_MIC
1594 + select CRC32
1595 ---help---
1596 Include software based cipher suites in support of IEEE 802.11i
1597 (aka TGi, WPA, WPA2, WPA-PSK, etc.) for use with TKIP enabled
1598 diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
1599 index ec566f3..a66c96a 100644
1600 --- a/net/ipv4/fib_rules.c
1601 +++ b/net/ipv4/fib_rules.c
1602 @@ -458,13 +458,13 @@ int inet_dump_rules(struct sk_buff *skb,
1603
1604 rcu_read_lock();
1605 hlist_for_each_entry(r, node, &fib_rules, hlist) {
1606 -
1607 if (idx < s_idx)
1608 - continue;
1609 + goto next;
1610 if (inet_fill_rule(skb, r, NETLINK_CB(cb->skb).pid,
1611 cb->nlh->nlmsg_seq,
1612 RTM_NEWRULE, NLM_F_MULTI) < 0)
1613 break;
1614 +next:
1615 idx++;
1616 }
1617 rcu_read_unlock();
1618 diff --git a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
1619 index 0416073..2d3612c 100644
1620 --- a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
1621 +++ b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
1622 @@ -254,7 +254,7 @@ static int do_basic_checks(struct ip_con
1623 }
1624
1625 DEBUGP("Basic checks passed\n");
1626 - return 0;
1627 + return count == 0;
1628 }
1629
1630 static int new_state(enum ip_conntrack_dir dir,
1631 diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
1632 index 445006e..4da6645 100644
1633 --- a/net/ipv6/addrconf.c
1634 +++ b/net/ipv6/addrconf.c
1635 @@ -862,6 +862,8 @@ static int inline ipv6_saddr_label(const
1636 * 2002::/16 2
1637 * ::/96 3
1638 * ::ffff:0:0/96 4
1639 + * fc00::/7 5
1640 + * 2001::/32 6
1641 */
1642 if (type & IPV6_ADDR_LOOPBACK)
1643 return 0;
1644 @@ -869,8 +871,12 @@ static int inline ipv6_saddr_label(const
1645 return 3;
1646 else if (type & IPV6_ADDR_MAPPED)
1647 return 4;
1648 + else if (addr->s6_addr32[0] == htonl(0x20010000))
1649 + return 6;
1650 else if (addr->s6_addr16[0] == htons(0x2002))
1651 return 2;
1652 + else if ((addr->s6_addr[0] & 0xfe) == 0xfc)
1653 + return 5;
1654 return 1;
1655 }
1656
1657 @@ -1069,6 +1075,9 @@ #ifdef CONFIG_IPV6_PRIVACY
1658 if (hiscore.attrs & IPV6_SADDR_SCORE_PRIVACY)
1659 continue;
1660 }
1661 +#else
1662 + if (hiscore.rule < 7)
1663 + hiscore.rule++;
1664 #endif
1665 /* Rule 8: Use longest matching prefix */
1666 if (hiscore.rule < 8) {
1667 @@ -2860,6 +2869,11 @@ inet6_rtm_newaddr(struct sk_buff *skb, s
1668 return inet6_addr_add(ifm->ifa_index, pfx, ifm->ifa_prefixlen);
1669 }
1670
1671 +/* Maximum length of ifa_cacheinfo attributes */
1672 +#define INET6_IFADDR_RTA_SPACE \
1673 + RTA_SPACE(16) /* IFA_ADDRESS */ + \
1674 + RTA_SPACE(sizeof(struct ifa_cacheinfo)) /* CACHEINFO */
1675 +
1676 static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa,
1677 u32 pid, u32 seq, int event, unsigned int flags)
1678 {
1679 @@ -3092,7 +3106,7 @@ static int inet6_dump_ifacaddr(struct sk
1680 static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa)
1681 {
1682 struct sk_buff *skb;
1683 - int size = NLMSG_SPACE(sizeof(struct ifaddrmsg)+128);
1684 + int size = NLMSG_SPACE(sizeof(struct ifaddrmsg) + INET6_IFADDR_RTA_SPACE);
1685
1686 skb = alloc_skb(size, GFP_ATOMIC);
1687 if (!skb) {
1688 @@ -3142,6 +3156,17 @@ #endif
1689 #endif
1690 }
1691
1692 +/* Maximum length of ifinfomsg attributes */
1693 +#define INET6_IFINFO_RTA_SPACE \
1694 + RTA_SPACE(IFNAMSIZ) /* IFNAME */ + \
1695 + RTA_SPACE(MAX_ADDR_LEN) /* ADDRESS */ + \
1696 + RTA_SPACE(sizeof(u32)) /* MTU */ + \
1697 + RTA_SPACE(sizeof(int)) /* LINK */ + \
1698 + RTA_SPACE(0) /* PROTINFO */ + \
1699 + RTA_SPACE(sizeof(u32)) /* FLAGS */ + \
1700 + RTA_SPACE(sizeof(struct ifla_cacheinfo)) /* CACHEINFO */ + \
1701 + RTA_SPACE(sizeof(__s32[DEVCONF_MAX])) /* CONF */
1702 +
1703 static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev,
1704 u32 pid, u32 seq, int event, unsigned int flags)
1705 {
1706 @@ -3235,8 +3260,7 @@ static int inet6_dump_ifinfo(struct sk_b
1707 void inet6_ifinfo_notify(int event, struct inet6_dev *idev)
1708 {
1709 struct sk_buff *skb;
1710 - /* 128 bytes ?? */
1711 - int size = NLMSG_SPACE(sizeof(struct ifinfomsg)+128);
1712 + int size = NLMSG_SPACE(sizeof(struct ifinfomsg) + INET6_IFINFO_RTA_SPACE);
1713
1714 skb = alloc_skb(size, GFP_ATOMIC);
1715 if (!skb) {
1716 @@ -3252,6 +3276,11 @@ void inet6_ifinfo_notify(int event, stru
1717 netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV6_IFINFO, GFP_ATOMIC);
1718 }
1719
1720 +/* Maximum length of prefix_cacheinfo attributes */
1721 +#define INET6_PREFIX_RTA_SPACE \
1722 + RTA_SPACE(sizeof(((struct prefix_info *)NULL)->prefix)) /* ADDRESS */ + \
1723 + RTA_SPACE(sizeof(struct prefix_cacheinfo)) /* CACHEINFO */
1724 +
1725 static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev,
1726 struct prefix_info *pinfo, u32 pid, u32 seq,
1727 int event, unsigned int flags)
1728 @@ -3296,7 +3325,7 @@ static void inet6_prefix_notify(int even
1729 struct prefix_info *pinfo)
1730 {
1731 struct sk_buff *skb;
1732 - int size = NLMSG_SPACE(sizeof(struct prefixmsg)+128);
1733 + int size = NLMSG_SPACE(sizeof(struct prefixmsg) + INET6_PREFIX_RTA_SPACE);
1734
1735 skb = alloc_skb(size, GFP_ATOMIC);
1736 if (!skb) {
1737 diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
1738 index 0c6da49..9dab81d 100644
1739 --- a/net/netfilter/nf_conntrack_proto_sctp.c
1740 +++ b/net/netfilter/nf_conntrack_proto_sctp.c
1741 @@ -259,7 +259,7 @@ static int do_basic_checks(struct nf_con
1742 }
1743
1744 DEBUGP("Basic checks passed\n");
1745 - return 0;
1746 + return count == 0;
1747 }
1748
1749 static int new_state(enum ip_conntrack_dir dir,
1750 diff --git a/net/netfilter/xt_sctp.c b/net/netfilter/xt_sctp.c
1751 index 34bd872..c29692c 100644
1752 --- a/net/netfilter/xt_sctp.c
1753 +++ b/net/netfilter/xt_sctp.c
1754 @@ -62,7 +62,7 @@ #endif
1755
1756 do {
1757 sch = skb_header_pointer(skb, offset, sizeof(_sch), &_sch);
1758 - if (sch == NULL) {
1759 + if (sch == NULL || sch->length == 0) {
1760 duprintf("Dropping invalid SCTP packet.\n");
1761 *hotdrop = 1;
1762 return 0;
1763 diff --git a/net/sched/act_api.c b/net/sched/act_api.c
1764 index 2ffa11c..eb7dc29 100644
1765 --- a/net/sched/act_api.c
1766 +++ b/net/sched/act_api.c
1767 @@ -251,15 +251,17 @@ tcf_action_dump(struct sk_buff *skb, str
1768 RTA_PUT(skb, a->order, 0, NULL);
1769 err = tcf_action_dump_1(skb, a, bind, ref);
1770 if (err < 0)
1771 - goto rtattr_failure;
1772 + goto errout;
1773 r->rta_len = skb->tail - (u8*)r;
1774 }
1775
1776 return 0;
1777
1778 rtattr_failure:
1779 + err = -EINVAL;
1780 +errout:
1781 skb_trim(skb, b - skb->data);
1782 - return -err;
1783 + return err;
1784 }
1785
1786 struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est,
1787 @@ -306,6 +308,7 @@ #ifdef CONFIG_KMOD
1788 goto err_mod;
1789 }
1790 #endif
1791 + *err = -ENOENT;
1792 goto err_out;
1793 }
1794
1795 @@ -777,7 +780,7 @@ replay:
1796 return ret;
1797 }
1798
1799 -static char *
1800 +static struct rtattr *
1801 find_dump_kind(struct nlmsghdr *n)
1802 {
1803 struct rtattr *tb1, *tb2[TCA_ACT_MAX+1];
1804 @@ -805,7 +808,7 @@ find_dump_kind(struct nlmsghdr *n)
1805 return NULL;
1806 kind = tb2[TCA_ACT_KIND-1];
1807
1808 - return (char *) RTA_DATA(kind);
1809 + return kind;
1810 }
1811
1812 static int
1813 @@ -818,16 +821,15 @@ tc_dump_action(struct sk_buff *skb, stru
1814 struct tc_action a;
1815 int ret = 0;
1816 struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh);
1817 - char *kind = find_dump_kind(cb->nlh);
1818 + struct rtattr *kind = find_dump_kind(cb->nlh);
1819
1820 if (kind == NULL) {
1821 printk("tc_dump_action: action bad kind\n");
1822 return 0;
1823 }
1824
1825 - a_o = tc_lookup_action_n(kind);
1826 + a_o = tc_lookup_action(kind);
1827 if (a_o == NULL) {
1828 - printk("failed to find %s\n", kind);
1829 return 0;
1830 }
1831
1832 @@ -835,7 +837,7 @@ tc_dump_action(struct sk_buff *skb, stru
1833 a.ops = a_o;
1834
1835 if (a_o->walk == NULL) {
1836 - printk("tc_dump_action: %s !capable of dumping table\n", kind);
1837 + printk("tc_dump_action: %s !capable of dumping table\n", a_o->kind);
1838 goto rtattr_failure;
1839 }
1840
1841 diff --git a/net/sctp/input.c b/net/sctp/input.c
1842 index 1662f9c..70d6606 100644
1843 --- a/net/sctp/input.c
1844 +++ b/net/sctp/input.c
1845 @@ -170,7 +170,8 @@ int sctp_rcv(struct sk_buff *skb)
1846 * IP broadcast addresses cannot be used in an SCTP transport
1847 * address."
1848 */
1849 - if (!af->addr_valid(&src, NULL) || !af->addr_valid(&dest, NULL))
1850 + if (!af->addr_valid(&src, NULL, skb) ||
1851 + !af->addr_valid(&dest, NULL, skb))
1852 goto discard_it;
1853
1854 asoc = __sctp_rcv_lookup(skb, &src, &dest, &transport);
1855 diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
1856 index c20d282..8ef0807 100644
1857 --- a/net/sctp/ipv6.c
1858 +++ b/net/sctp/ipv6.c
1859 @@ -523,7 +523,9 @@ static int sctp_v6_available(union sctp_
1860 * Return 0 - If the address is a non-unicast or an illegal address.
1861 * Return 1 - If the address is a unicast.
1862 */
1863 -static int sctp_v6_addr_valid(union sctp_addr *addr, struct sctp_sock *sp)
1864 +static int sctp_v6_addr_valid(union sctp_addr *addr,
1865 + struct sctp_sock *sp,
1866 + const struct sk_buff *skb)
1867 {
1868 int ret = ipv6_addr_type(&addr->v6.sin6_addr);
1869
1870 @@ -537,7 +539,7 @@ static int sctp_v6_addr_valid(union sctp
1871 if (sp && ipv6_only_sock(sctp_opt2sk(sp)))
1872 return 0;
1873 sctp_v6_map_v4(addr);
1874 - return sctp_get_af_specific(AF_INET)->addr_valid(addr, sp);
1875 + return sctp_get_af_specific(AF_INET)->addr_valid(addr, sp, skb);
1876 }
1877
1878 /* Is this a non-unicast address */
1879 diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
1880 index f148f95..e5faa35 100644
1881 --- a/net/sctp/outqueue.c
1882 +++ b/net/sctp/outqueue.c
1883 @@ -1262,6 +1262,7 @@ #endif /* SCTP_DEBUG */
1884 if (!tchunk->tsn_gap_acked &&
1885 !tchunk->resent &&
1886 tchunk->rtt_in_progress) {
1887 + tchunk->rtt_in_progress = 0;
1888 rtt = jiffies - tchunk->sent_at;
1889 sctp_transport_update_rto(transport,
1890 rtt);
1891 diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
1892 index 2088aa9..816c033 100644
1893 --- a/net/sctp/protocol.c
1894 +++ b/net/sctp/protocol.c
1895 @@ -365,12 +365,18 @@ static int sctp_v4_is_any(const union sc
1896 * Return 0 - If the address is a non-unicast or an illegal address.
1897 * Return 1 - If the address is a unicast.
1898 */
1899 -static int sctp_v4_addr_valid(union sctp_addr *addr, struct sctp_sock *sp)
1900 +static int sctp_v4_addr_valid(union sctp_addr *addr,
1901 + struct sctp_sock *sp,
1902 + const struct sk_buff *skb)
1903 {
1904 /* Is this a non-unicast address or a unusable SCTP address? */
1905 if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr))
1906 return 0;
1907
1908 + /* Is this a broadcast address? */
1909 + if (skb && ((struct rtable *)skb->dst)->rt_flags & RTCF_BROADCAST)
1910 + return 0;
1911 +
1912 return 1;
1913 }
1914
1915 diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
1916 index 8bc2792..9e58144 100644
1917 --- a/net/sctp/sm_statefuns.c
1918 +++ b/net/sctp/sm_statefuns.c
1919 @@ -5293,10 +5293,18 @@ static int sctp_eat_data(const struct sc
1920 * seems a bit troublesome in that frag_point varies based on
1921 * PMTU. In cases, such as loopback, this might be a rather
1922 * large spill over.
1923 + * NOTE: If we have a full receive buffer here, we only renege if
1924 + * our receiver can still make progress without the tsn being
1925 + * received. We do this because in the event that the associations
1926 + * receive queue is empty we are filling a leading gap, and since
1927 + * reneging moves the gap to the end of the tsn stream, we are likely
1928 + * to stall again very shortly. Avoiding the renege when we fill a
1929 + * leading gap is a good heuristic for avoiding such steady state
1930 + * stalls.
1931 */
1932 if (!asoc->rwnd || asoc->rwnd_over ||
1933 (datalen > asoc->rwnd + asoc->frag_point) ||
1934 - rcvbuf_over) {
1935 + (rcvbuf_over && (!skb_queue_len(&sk->sk_receive_queue)))) {
1936
1937 /* If this is the next TSN, consider reneging to make
1938 * room. Note: Playing nice with a confused sender. A
1939 diff --git a/net/sctp/socket.c b/net/sctp/socket.c
1940 index 174d4d3..b811691 100644
1941 --- a/net/sctp/socket.c
1942 +++ b/net/sctp/socket.c
1943 @@ -172,7 +172,7 @@ static inline int sctp_verify_addr(struc
1944 return -EINVAL;
1945
1946 /* Is this a valid SCTP address? */
1947 - if (!af->addr_valid(addr, sctp_sk(sk)))
1948 + if (!af->addr_valid(addr, sctp_sk(sk), NULL))
1949 return -EINVAL;
1950
1951 if (!sctp_sk(sk)->pf->send_verify(sctp_sk(sk), (addr)))
1952 @@ -2530,8 +2530,32 @@ static int sctp_setsockopt_associnfo(str
1953
1954 /* Set the values to the specific association */
1955 if (asoc) {
1956 - if (assocparams.sasoc_asocmaxrxt != 0)
1957 + if (assocparams.sasoc_asocmaxrxt != 0) {
1958 + __u32 path_sum = 0;
1959 + int paths = 0;
1960 + struct list_head *pos;
1961 + struct sctp_transport *peer_addr;
1962 +
1963 + list_for_each(pos, &asoc->peer.transport_addr_list) {
1964 + peer_addr = list_entry(pos,
1965 + struct sctp_transport,
1966 + transports);
1967 + path_sum += peer_addr->pathmaxrxt;
1968 + paths++;
1969 + }
1970 +
1971 + /* Only validate asocmaxrxt if we have more then
1972 + * one path/transport. We do this because path
1973 + * retransmissions are only counted when we have more
1974 + * then one path.
1975 + */
1976 + if (paths > 1 &&
1977 + assocparams.sasoc_asocmaxrxt > path_sum)
1978 + return -EINVAL;
1979 +
1980 asoc->max_retrans = assocparams.sasoc_asocmaxrxt;
1981 + }
1982 +
1983 if (assocparams.sasoc_cookie_life != 0) {
1984 asoc->cookie_life.tv_sec =
1985 assocparams.sasoc_cookie_life / 1000;
1986 diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
1987 index ba97f97..ee23678 100644
1988 --- a/net/sctp/ulpevent.c
1989 +++ b/net/sctp/ulpevent.c
1990 @@ -51,6 +51,8 @@ #include <net/sctp/sm.h>
1991 static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event,
1992 struct sctp_association *asoc);
1993 static void sctp_ulpevent_release_data(struct sctp_ulpevent *event);
1994 +static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event);
1995 +
1996
1997 /* Initialize an ULP event from an given skb. */
1998 SCTP_STATIC void sctp_ulpevent_init(struct sctp_ulpevent *event, int msg_flags)
1999 @@ -883,6 +885,7 @@ static void sctp_ulpevent_receive_data(s
2000 static void sctp_ulpevent_release_data(struct sctp_ulpevent *event)
2001 {
2002 struct sk_buff *skb, *frag;
2003 + unsigned int len;
2004
2005 /* Current stack structures assume that the rcv buffer is
2006 * per socket. For UDP style sockets this is not true as
2007 @@ -892,7 +895,30 @@ static void sctp_ulpevent_release_data(s
2008 */
2009
2010 skb = sctp_event2skb(event);
2011 - sctp_assoc_rwnd_increase(event->asoc, skb_headlen(skb));
2012 + len = skb->len;
2013 +
2014 + if (!skb->data_len)
2015 + goto done;
2016 +
2017 + /* Don't forget the fragments. */
2018 + for (frag = skb_shinfo(skb)->frag_list; frag; frag = frag->next) {
2019 + /* NOTE: skb_shinfos are recursive. Although IP returns
2020 + * skb's with only 1 level of fragments, SCTP reassembly can
2021 + * increase the levels.
2022 + */
2023 + sctp_ulpevent_release_frag_data(sctp_skb2event(frag));
2024 + }
2025 +
2026 +done:
2027 + sctp_assoc_rwnd_increase(event->asoc, len);
2028 + sctp_ulpevent_release_owner(event);
2029 +}
2030 +
2031 +static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event)
2032 +{
2033 + struct sk_buff *skb, *frag;
2034 +
2035 + skb = sctp_event2skb(event);
2036
2037 if (!skb->data_len)
2038 goto done;
2039 @@ -903,7 +929,7 @@ static void sctp_ulpevent_release_data(s
2040 * skb's with only 1 level of fragments, SCTP reassembly can
2041 * increase the levels.
2042 */
2043 - sctp_ulpevent_release_data(sctp_skb2event(frag));
2044 + sctp_ulpevent_release_frag_data(sctp_skb2event(frag));
2045 }
2046
2047 done:
2048 diff --git a/sound/core/timer.c b/sound/core/timer.c
2049 index cdeeb63..4585600 100644
2050 --- a/sound/core/timer.c
2051 +++ b/sound/core/timer.c
2052 @@ -628,8 +628,9 @@ static void snd_timer_tasklet(unsigned l
2053 struct snd_timer_instance *ti;
2054 struct list_head *p;
2055 unsigned long resolution, ticks;
2056 + unsigned long flags;
2057
2058 - spin_lock(&timer->lock);
2059 + spin_lock_irqsave(&timer->lock, flags);
2060 /* now process all callbacks */
2061 while (!list_empty(&timer->sack_list_head)) {
2062 p = timer->sack_list_head.next; /* get first item */
2063 @@ -649,7 +650,7 @@ static void snd_timer_tasklet(unsigned l
2064 spin_lock(&timer->lock);
2065 ti->flags &= ~SNDRV_TIMER_IFLG_CALLBACK;
2066 }
2067 - spin_unlock(&timer->lock);
2068 + spin_unlock_irqrestore(&timer->lock, flags);
2069 }
2070
2071 /*
2072 diff --git a/sound/isa/cs423x/Makefile b/sound/isa/cs423x/Makefile
2073 index d2afaea..2fb4f74 100644
2074 --- a/sound/isa/cs423x/Makefile
2075 +++ b/sound/isa/cs423x/Makefile
2076 @@ -11,6 +11,7 @@ snd-cs4236-objs := cs4236.o
2077
2078 # Toplevel Module Dependency
2079 obj-$(CONFIG_SND_AZT2320) += snd-cs4231-lib.o
2080 +obj-$(CONFIG_SND_MIRO) += snd-cs4231-lib.o
2081 obj-$(CONFIG_SND_OPL3SA2) += snd-cs4231-lib.o
2082 obj-$(CONFIG_SND_CS4231) += snd-cs4231.o snd-cs4231-lib.o
2083 obj-$(CONFIG_SND_CS4232) += snd-cs4232.o snd-cs4231-lib.o
2084 diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
2085 index a208180..8f34986 100644
2086 --- a/sound/pci/Kconfig
2087 +++ b/sound/pci/Kconfig
2088 @@ -318,17 +318,19 @@ config SND_FM801
2089 To compile this driver as a module, choose M here: the module
2090 will be called snd-fm801.
2091
2092 -config SND_FM801_TEA575X
2093 - tristate "ForteMedia FM801 + TEA5757 tuner"
2094 +config SND_FM801_TEA575X_BOOL
2095 + bool "ForteMedia FM801 + TEA5757 tuner"
2096 depends on SND_FM801
2097 - select VIDEO_DEV
2098 help
2099 Say Y here to include support for soundcards based on the ForteMedia
2100 FM801 chip with a TEA5757 tuner connected to GPIO1-3 pins (Media
2101 - Forte SF256-PCS-02).
2102 + Forte SF256-PCS-02) into the snd-fm801 driver.
2103
2104 - To compile this driver as a module, choose M here: the module
2105 - will be called snd-fm801-tea575x.
2106 +config SND_FM801_TEA575X
2107 + tristate
2108 + depends on SND_FM801_TEA575X_BOOL
2109 + default SND_FM801
2110 + select VIDEO_DEV
2111
2112 config SND_HDA_INTEL
2113 tristate "Intel HD Audio"
2114 diff --git a/sound/pci/au88x0/au88x0_mpu401.c b/sound/pci/au88x0/au88x0_mpu401.c
2115 index 873f486..118dcc7 100644
2116 --- a/sound/pci/au88x0/au88x0_mpu401.c
2117 +++ b/sound/pci/au88x0/au88x0_mpu401.c
2118 @@ -47,7 +47,7 @@ static int __devinit snd_vortex_midi(vor
2119 struct snd_rawmidi *rmidi;
2120 int temp, mode;
2121 struct snd_mpu401 *mpu;
2122 - int port;
2123 + unsigned long port;
2124
2125 #ifdef VORTEX_MPU401_LEGACY
2126 /* EnableHardCodedMPU401Port() */
2127 diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
2128 index d72fc28..09a2885 100644
2129 --- a/sound/pci/fm801.c
2130 +++ b/sound/pci/fm801.c
2131 @@ -35,7 +35,7 @@ #include <sound/initval.h>
2132
2133 #include <asm/io.h>
2134
2135 -#if (defined(CONFIG_SND_FM801_TEA575X) || defined(CONFIG_SND_FM801_TEA575X_MODULE)) && (defined(CONFIG_VIDEO_DEV) || defined(CONFIG_VIDEO_DEV_MODULE))
2136 +#ifdef CONFIG_SND_FM801_TEA575X_BOOL
2137 #include <sound/tea575x-tuner.h>
2138 #define TEA575X_RADIO 1
2139 #endif
2140 diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
2141 index e821d65..9dd541d 100644
2142 --- a/sound/pci/hda/hda_intel.c
2143 +++ b/sound/pci/hda/hda_intel.c
2144 @@ -1393,10 +1393,10 @@ static int azx_free(struct azx *chip)
2145 msleep(1);
2146 }
2147
2148 - if (chip->remap_addr)
2149 - iounmap(chip->remap_addr);
2150 if (chip->irq >= 0)
2151 free_irq(chip->irq, (void*)chip);
2152 + if (chip->remap_addr)
2153 + iounmap(chip->remap_addr);
2154
2155 if (chip->bdl.area)
2156 snd_dma_free_pages(&chip->bdl);
2157 diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
2158 index 40f000b..d7343dc 100644
2159 --- a/sound/pci/hda/patch_analog.c
2160 +++ b/sound/pci/hda/patch_analog.c
2161 @@ -1488,6 +1488,9 @@ enum {
2162 /* reivision id to check workarounds */
2163 #define AD1988A_REV2 0x100200
2164
2165 +#define is_rev2(codec) \
2166 + ((codec)->vendor_id == 0x11d41988 && \
2167 + (codec)->revision_id == AD1988A_REV2)
2168
2169 /*
2170 * mixers
2171 @@ -1579,6 +1582,7 @@ static struct snd_kcontrol_new ad1988_6s
2172 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
2173 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT),
2174 HDA_CODEC_VOLUME("Side Playback Volume", 0x0a, 0x0, HDA_OUTPUT),
2175 + { } /* end */
2176 };
2177
2178 static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = {
2179 @@ -1587,6 +1591,7 @@ static struct snd_kcontrol_new ad1988_6s
2180 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT),
2181 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0a, 2, 0x0, HDA_OUTPUT),
2182 HDA_CODEC_VOLUME("Side Playback Volume", 0x06, 0x0, HDA_OUTPUT),
2183 + { } /* end */
2184 };
2185
2186 static struct snd_kcontrol_new ad1988_6stack_mixers2[] = {
2187 @@ -1625,6 +1630,7 @@ static struct snd_kcontrol_new ad1988_3s
2188 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT),
2189 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
2190 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT),
2191 + { } /* end */
2192 };
2193
2194 static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = {
2195 @@ -1632,6 +1638,7 @@ static struct snd_kcontrol_new ad1988_3s
2196 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT),
2197 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x06, 1, 0x0, HDA_OUTPUT),
2198 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x06, 2, 0x0, HDA_OUTPUT),
2199 + { } /* end */
2200 };
2201
2202 static struct snd_kcontrol_new ad1988_3stack_mixers2[] = {
2203 @@ -2138,7 +2145,7 @@ static inline hda_nid_t ad1988_idx_to_da
2204 /* A B C D E F G H */
2205 0x04, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06
2206 };
2207 - if (codec->revision_id == AD1988A_REV2)
2208 + if (is_rev2(codec))
2209 return idx_to_dac_rev2[idx];
2210 else
2211 return idx_to_dac[idx];
2212 @@ -2507,7 +2514,7 @@ static int patch_ad1988(struct hda_codec
2213 mutex_init(&spec->amp_mutex);
2214 codec->spec = spec;
2215
2216 - if (codec->revision_id == AD1988A_REV2)
2217 + if (is_rev2(codec))
2218 snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n");
2219
2220 board_config = snd_hda_check_board_config(codec, ad1988_cfg_tbl);
2221 @@ -2533,13 +2540,13 @@ static int patch_ad1988(struct hda_codec
2222 case AD1988_6STACK_DIG:
2223 spec->multiout.max_channels = 8;
2224 spec->multiout.num_dacs = 4;
2225 - if (codec->revision_id == AD1988A_REV2)
2226 + if (is_rev2(codec))
2227 spec->multiout.dac_nids = ad1988_6stack_dac_nids_rev2;
2228 else
2229 spec->multiout.dac_nids = ad1988_6stack_dac_nids;
2230 spec->input_mux = &ad1988_6stack_capture_source;
2231 spec->num_mixers = 2;
2232 - if (codec->revision_id == AD1988A_REV2)
2233 + if (is_rev2(codec))
2234 spec->mixers[0] = ad1988_6stack_mixers1_rev2;
2235 else
2236 spec->mixers[0] = ad1988_6stack_mixers1;
2237 @@ -2555,7 +2562,7 @@ static int patch_ad1988(struct hda_codec
2238 case AD1988_3STACK_DIG:
2239 spec->multiout.max_channels = 6;
2240 spec->multiout.num_dacs = 3;
2241 - if (codec->revision_id == AD1988A_REV2)
2242 + if (is_rev2(codec))
2243 spec->multiout.dac_nids = ad1988_3stack_dac_nids_rev2;
2244 else
2245 spec->multiout.dac_nids = ad1988_3stack_dac_nids;
2246 @@ -2563,7 +2570,7 @@ static int patch_ad1988(struct hda_codec
2247 spec->channel_mode = ad1988_3stack_modes;
2248 spec->num_channel_mode = ARRAY_SIZE(ad1988_3stack_modes);
2249 spec->num_mixers = 2;
2250 - if (codec->revision_id == AD1988A_REV2)
2251 + if (is_rev2(codec))
2252 spec->mixers[0] = ad1988_3stack_mixers1_rev2;
2253 else
2254 spec->mixers[0] = ad1988_3stack_mixers1;
2255 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
2256 index f0e9a9c..94cf292 100644
2257 --- a/sound/pci/hda/patch_realtek.c
2258 +++ b/sound/pci/hda/patch_realtek.c
2259 @@ -3827,7 +3827,7 @@ static struct hda_board_config alc260_cf
2260 { .modelname = "hp", .config = ALC260_HP },
2261 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3010, .config = ALC260_HP },
2262 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3011, .config = ALC260_HP },
2263 - { .pci_subvendor = 0x103c, .pci_subdevice = 0x3012, .config = ALC260_HP },
2264 + { .pci_subvendor = 0x103c, .pci_subdevice = 0x3012, .config = ALC260_HP_3013 },
2265 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3013, .config = ALC260_HP_3013 },
2266 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3014, .config = ALC260_HP },
2267 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3015, .config = ALC260_HP },
2268 diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
2269 index 8c440fb..d862295 100644
2270 --- a/sound/pci/hda/patch_sigmatel.c
2271 +++ b/sound/pci/hda/patch_sigmatel.c
2272 @@ -1262,13 +1262,13 @@ static int vaio_master_sw_put(struct snd
2273 int change;
2274
2275 change = snd_hda_codec_amp_update(codec, 0x02, 0, HDA_OUTPUT, 0,
2276 - 0x80, valp[0] & 0x80);
2277 + 0x80, (valp[0] ? 0 : 0x80));
2278 change |= snd_hda_codec_amp_update(codec, 0x02, 1, HDA_OUTPUT, 0,
2279 - 0x80, valp[1] & 0x80);
2280 + 0x80, (valp[1] ? 0 : 0x80));
2281 snd_hda_codec_amp_update(codec, 0x05, 0, HDA_OUTPUT, 0,
2282 - 0x80, valp[0] & 0x80);
2283 + 0x80, (valp[0] ? 0 : 0x80));
2284 snd_hda_codec_amp_update(codec, 0x05, 1, HDA_OUTPUT, 0,
2285 - 0x80, valp[1] & 0x80);
2286 + 0x80, (valp[1] ? 0 : 0x80));
2287 return change;
2288 }
2289
2290 diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
2291 index 61f82f0..10586e4 100644
2292 --- a/sound/pci/rme9652/hdsp.c
2293 +++ b/sound/pci/rme9652/hdsp.c
2294 @@ -389,7 +389,7 @@ #define HDSP_DMA_AREA_KILOBYTES (HDSP_DM
2295
2296 /* use hotplug firmeare loader? */
2297 #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
2298 -#ifndef HDSP_USE_HWDEP_LOADER
2299 +#if !defined(HDSP_USE_HWDEP_LOADER) && !defined(CONFIG_SND_HDSP)
2300 #define HDSP_FW_LOADER
2301 #endif
2302 #endif
2303 @@ -3169,9 +3169,10 @@ snd_hdsp_proc_read(struct snd_info_entry
2304 char *clock_source;
2305 int x;
2306
2307 - if (hdsp_check_for_iobox (hdsp))
2308 + if (hdsp_check_for_iobox (hdsp)) {
2309 snd_iprintf(buffer, "No I/O box connected.\nPlease connect one and upload firmware.\n");
2310 return;
2311 + }
2312
2313 if (hdsp_check_for_firmware(hdsp, 0)) {
2314 if (hdsp->state & HDSP_FirmwareCached) {
2315 diff --git a/usr/Makefile b/usr/Makefile
2316 index 19d74e6..e938242 100644
2317 --- a/usr/Makefile
2318 +++ b/usr/Makefile
2319 @@ -21,8 +21,7 @@ ramfs-input := $(if $(filter-out "",$(CO
2320 $(CONFIG_INITRAMFS_SOURCE),-d)
2321 ramfs-args := \
2322 $(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
2323 - $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID)) \
2324 - $(ramfs-input)
2325 + $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID))
2326
2327 # .initramfs_data.cpio.gz.d is used to identify all files included
2328 # in initramfs and to detect if any files are added/removed.