Gentoo Archives: gentoo-commits

From: "Stratos Psomadakis (psomas)" <psomas@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r2034 - genpatches-2.6/trunk/3.1
Date: Thu, 22 Dec 2011 12:03:55
Message-Id: 20111222120343.E21DC2004B@flycatcher.gentoo.org
1 Author: psomas
2 Date: 2011-12-22 12:03:42 +0000 (Thu, 22 Dec 2011)
3 New Revision: 2034
4
5 Added:
6 genpatches-2.6/trunk/3.1/1005_linux-3.1.6.patch
7 Modified:
8 genpatches-2.6/trunk/3.1/0000_README
9 Log:
10 Linux patch 3.1.6
11
12 Modified: genpatches-2.6/trunk/3.1/0000_README
13 ===================================================================
14 --- genpatches-2.6/trunk/3.1/0000_README 2011-12-10 10:25:00 UTC (rev 2033)
15 +++ genpatches-2.6/trunk/3.1/0000_README 2011-12-22 12:03:42 UTC (rev 2034)
16 @@ -59,6 +59,10 @@
17 From: http://www.kernel.org
18 Desc: Linux 3.1.5
19
20 +Patch: 1005_linux-3.1.6.patch
21 +From: http://www.kernel.org
22 +Desc: Linux 3.1.6
23 +
24 Patch: 2400_pci-enable-msi-failure-fix.patch
25 From: http://bugs.gentoo.org/show_bug.cgi?id=389215
26 Desc: Continue the init process after pci_enable_msi failure
27
28 Added: genpatches-2.6/trunk/3.1/1005_linux-3.1.6.patch
29 ===================================================================
30 --- genpatches-2.6/trunk/3.1/1005_linux-3.1.6.patch (rev 0)
31 +++ genpatches-2.6/trunk/3.1/1005_linux-3.1.6.patch 2011-12-22 12:03:42 UTC (rev 2034)
32 @@ -0,0 +1,2178 @@
33 +diff --git a/Makefile b/Makefile
34 +index 94ab2ad..2d6e0a8 100644
35 +--- a/Makefile
36 ++++ b/Makefile
37 +@@ -1,6 +1,6 @@
38 + VERSION = 3
39 + PATCHLEVEL = 1
40 +-SUBLEVEL = 5
41 ++SUBLEVEL = 6
42 + EXTRAVERSION =
43 + NAME = "Divemaster Edition"
44 +
45 +diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
46 +index e514c76..3e42faf 100644
47 +--- a/arch/arm/kernel/setup.c
48 ++++ b/arch/arm/kernel/setup.c
49 +@@ -890,6 +890,12 @@ void __init setup_arch(char **cmdline_p)
50 + machine_desc = mdesc;
51 + machine_name = mdesc->name;
52 +
53 ++#ifdef CONFIG_ZONE_DMA
54 ++ if (mdesc->dma_zone_size) {
55 ++ extern unsigned long arm_dma_zone_size;
56 ++ arm_dma_zone_size = mdesc->dma_zone_size;
57 ++ }
58 ++#endif
59 + if (mdesc->soft_reboot)
60 + reboot_setup("s");
61 +
62 +@@ -920,12 +926,6 @@ void __init setup_arch(char **cmdline_p)
63 +
64 + tcm_init();
65 +
66 +-#ifdef CONFIG_ZONE_DMA
67 +- if (mdesc->dma_zone_size) {
68 +- extern unsigned long arm_dma_zone_size;
69 +- arm_dma_zone_size = mdesc->dma_zone_size;
70 +- }
71 +-#endif
72 + #ifdef CONFIG_MULTI_IRQ_HANDLER
73 + handle_arch_irq = mdesc->handle_irq;
74 + #endif
75 +diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
76 +index 7227755..e596f45 100644
77 +--- a/arch/arm/mach-at91/at91rm9200_devices.c
78 ++++ b/arch/arm/mach-at91/at91rm9200_devices.c
79 +@@ -75,7 +75,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
80 + * USB Device (Gadget)
81 + * -------------------------------------------------------------------- */
82 +
83 +-#ifdef CONFIG_USB_GADGET_AT91
84 ++#ifdef CONFIG_USB_AT91
85 + static struct at91_udc_data udc_data;
86 +
87 + static struct resource udc_resources[] = {
88 +diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
89 +index cb397be..de4036f 100644
90 +--- a/arch/arm/mach-at91/at91sam9260.c
91 ++++ b/arch/arm/mach-at91/at91sam9260.c
92 +@@ -195,9 +195,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
93 + CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
94 + CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
95 + CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
96 +- CLKDEV_CON_DEV_ID("t3_clk", "atmel_tcb.1", &tc3_clk),
97 +- CLKDEV_CON_DEV_ID("t4_clk", "atmel_tcb.1", &tc4_clk),
98 +- CLKDEV_CON_DEV_ID("t5_clk", "atmel_tcb.1", &tc5_clk),
99 ++ CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk),
100 ++ CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
101 ++ CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
102 + CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk),
103 + };
104 +
105 +diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
106 +index 39f81f4..ec257265 100644
107 +--- a/arch/arm/mach-at91/at91sam9260_devices.c
108 ++++ b/arch/arm/mach-at91/at91sam9260_devices.c
109 +@@ -76,7 +76,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
110 + * USB Device (Gadget)
111 + * -------------------------------------------------------------------- */
112 +
113 +-#ifdef CONFIG_USB_GADGET_AT91
114 ++#ifdef CONFIG_USB_AT91
115 + static struct at91_udc_data udc_data;
116 +
117 + static struct resource udc_resources[] = {
118 +diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
119 +index 0f91792..9e113f6 100644
120 +--- a/arch/arm/mach-at91/at91sam9261_devices.c
121 ++++ b/arch/arm/mach-at91/at91sam9261_devices.c
122 +@@ -79,7 +79,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
123 + * USB Device (Gadget)
124 + * -------------------------------------------------------------------- */
125 +
126 +-#ifdef CONFIG_USB_GADGET_AT91
127 ++#ifdef CONFIG_USB_AT91
128 + static struct at91_udc_data udc_data;
129 +
130 + static struct resource udc_resources[] = {
131 +diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
132 +index a050f41..863e466 100644
133 +--- a/arch/arm/mach-at91/at91sam9263_devices.c
134 ++++ b/arch/arm/mach-at91/at91sam9263_devices.c
135 +@@ -86,7 +86,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
136 + * USB Device (Gadget)
137 + * -------------------------------------------------------------------- */
138 +
139 +-#ifdef CONFIG_USB_GADGET_AT91
140 ++#ifdef CONFIG_USB_AT91
141 + static struct at91_udc_data udc_data;
142 +
143 + static struct resource udc_resources[] = {
144 +diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
145 +index 008d514..d5ec333 100644
146 +--- a/arch/arm/mach-davinci/board-da850-evm.c
147 ++++ b/arch/arm/mach-davinci/board-da850-evm.c
148 +@@ -748,7 +748,7 @@ static struct snd_platform_data da850_evm_snd_data = {
149 + .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction),
150 + .tdm_slots = 2,
151 + .serial_dir = da850_iis_serializer_direction,
152 +- .asp_chan_q = EVENTQ_1,
153 ++ .asp_chan_q = EVENTQ_0,
154 + .version = MCASP_VERSION_2,
155 + .txnumevt = 1,
156 + .rxnumevt = 1,
157 +diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
158 +index 993a314..1cc11d8 100644
159 +--- a/arch/arm/mach-davinci/board-dm646x-evm.c
160 ++++ b/arch/arm/mach-davinci/board-dm646x-evm.c
161 +@@ -563,7 +563,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
162 + int val;
163 + u32 value;
164 +
165 +- if (!vpif_vsclkdis_reg || !cpld_client)
166 ++ if (!vpif_vidclkctl_reg || !cpld_client)
167 + return -ENXIO;
168 +
169 + val = i2c_smbus_read_byte(cpld_client);
170 +@@ -571,7 +571,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
171 + return val;
172 +
173 + spin_lock_irqsave(&vpif_reg_lock, flags);
174 +- value = __raw_readl(vpif_vsclkdis_reg);
175 ++ value = __raw_readl(vpif_vidclkctl_reg);
176 + if (mux_mode) {
177 + val &= VPIF_INPUT_TWO_CHANNEL;
178 + value |= VIDCH1CLK;
179 +@@ -579,7 +579,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
180 + val |= VPIF_INPUT_ONE_CHANNEL;
181 + value &= ~VIDCH1CLK;
182 + }
183 +- __raw_writel(value, vpif_vsclkdis_reg);
184 ++ __raw_writel(value, vpif_vidclkctl_reg);
185 + spin_unlock_irqrestore(&vpif_reg_lock, flags);
186 +
187 + err = i2c_smbus_write_byte(cpld_client, val);
188 +diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h
189 +index 35a89dd..1332f73 100644
190 +--- a/arch/arm/mach-mxs/include/mach/mxs.h
191 ++++ b/arch/arm/mach-mxs/include/mach/mxs.h
192 +@@ -30,6 +30,7 @@
193 + */
194 + #define cpu_is_mx23() ( \
195 + machine_is_mx23evk() || \
196 ++ machine_is_stmp378x() || \
197 + 0)
198 + #define cpu_is_mx28() ( \
199 + machine_is_mx28evk() || \
200 +diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
201 +index c2ff2a1..2d2f01c 100644
202 +--- a/arch/x86/include/asm/system.h
203 ++++ b/arch/x86/include/asm/system.h
204 +@@ -401,6 +401,7 @@ extern unsigned long arch_align_stack(unsigned long sp);
205 + extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
206 +
207 + void default_idle(void);
208 ++bool set_pm_idle_to_default(void);
209 +
210 + void stop_this_cpu(void *dummy);
211 +
212 +diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
213 +index 4aecc54..4d5a100 100644
214 +--- a/arch/x86/kernel/hpet.c
215 ++++ b/arch/x86/kernel/hpet.c
216 +@@ -1048,6 +1048,14 @@ int hpet_rtc_timer_init(void)
217 + }
218 + EXPORT_SYMBOL_GPL(hpet_rtc_timer_init);
219 +
220 ++static void hpet_disable_rtc_channel(void)
221 ++{
222 ++ unsigned long cfg;
223 ++ cfg = hpet_readl(HPET_T1_CFG);
224 ++ cfg &= ~HPET_TN_ENABLE;
225 ++ hpet_writel(cfg, HPET_T1_CFG);
226 ++}
227 ++
228 + /*
229 + * The functions below are called from rtc driver.
230 + * Return 0 if HPET is not being used.
231 +@@ -1059,6 +1067,9 @@ int hpet_mask_rtc_irq_bit(unsigned long bit_mask)
232 + return 0;
233 +
234 + hpet_rtc_flags &= ~bit_mask;
235 ++ if (unlikely(!hpet_rtc_flags))
236 ++ hpet_disable_rtc_channel();
237 ++
238 + return 1;
239 + }
240 + EXPORT_SYMBOL_GPL(hpet_mask_rtc_irq_bit);
241 +@@ -1124,15 +1135,11 @@ EXPORT_SYMBOL_GPL(hpet_rtc_dropped_irq);
242 +
243 + static void hpet_rtc_timer_reinit(void)
244 + {
245 +- unsigned int cfg, delta;
246 ++ unsigned int delta;
247 + int lost_ints = -1;
248 +
249 +- if (unlikely(!hpet_rtc_flags)) {
250 +- cfg = hpet_readl(HPET_T1_CFG);
251 +- cfg &= ~HPET_TN_ENABLE;
252 +- hpet_writel(cfg, HPET_T1_CFG);
253 +- return;
254 +- }
255 ++ if (unlikely(!hpet_rtc_flags))
256 ++ hpet_disable_rtc_channel();
257 +
258 + if (!(hpet_rtc_flags & RTC_PIE) || hpet_pie_limit)
259 + delta = hpet_default_delta;
260 +diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
261 +index e7e3b01..30eb651 100644
262 +--- a/arch/x86/kernel/process.c
263 ++++ b/arch/x86/kernel/process.c
264 +@@ -403,6 +403,14 @@ void default_idle(void)
265 + EXPORT_SYMBOL(default_idle);
266 + #endif
267 +
268 ++bool set_pm_idle_to_default(void)
269 ++{
270 ++ bool ret = !!pm_idle;
271 ++
272 ++ pm_idle = default_idle;
273 ++
274 ++ return ret;
275 ++}
276 + void stop_this_cpu(void *dummy)
277 + {
278 + local_irq_disable();
279 +diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
280 +index ea30585..dd74e46 100644
281 +--- a/arch/x86/mm/gup.c
282 ++++ b/arch/x86/mm/gup.c
283 +@@ -201,6 +201,8 @@ static noinline int gup_huge_pud(pud_t pud, unsigned long addr,
284 + do {
285 + VM_BUG_ON(compound_head(page) != head);
286 + pages[*nr] = page;
287 ++ if (PageTail(page))
288 ++ get_huge_page_tail(page);
289 + (*nr)++;
290 + page++;
291 + refs++;
292 +diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
293 +index 46d6d21..e191302 100644
294 +--- a/arch/x86/xen/setup.c
295 ++++ b/arch/x86/xen/setup.c
296 +@@ -191,9 +191,21 @@ static unsigned long __init xen_get_max_pages(void)
297 + domid_t domid = DOMID_SELF;
298 + int ret;
299 +
300 +- ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid);
301 +- if (ret > 0)
302 +- max_pages = ret;
303 ++ /*
304 ++ * For the initial domain we use the maximum reservation as
305 ++ * the maximum page.
306 ++ *
307 ++ * For guest domains the current maximum reservation reflects
308 ++ * the current maximum rather than the static maximum. In this
309 ++ * case the e820 map provided to us will cover the static
310 ++ * maximum region.
311 ++ */
312 ++ if (xen_initial_domain()) {
313 ++ ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid);
314 ++ if (ret > 0)
315 ++ max_pages = ret;
316 ++ }
317 ++
318 + return min(max_pages, MAX_DOMAIN_PAGES);
319 + }
320 +
321 +@@ -448,6 +460,6 @@ void __init xen_arch_setup(void)
322 + #endif
323 + disable_cpuidle();
324 + boot_option_idle_override = IDLE_HALT;
325 +-
326 ++ WARN_ON(set_pm_idle_to_default());
327 + fiddle_vdso();
328 + }
329 +diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
330 +index c811cb1..2cce44a 100644
331 +--- a/drivers/firmware/iscsi_ibft.c
332 ++++ b/drivers/firmware/iscsi_ibft.c
333 +@@ -746,6 +746,37 @@ static void __exit ibft_exit(void)
334 + ibft_cleanup();
335 + }
336 +
337 ++#ifdef CONFIG_ACPI
338 ++static const struct {
339 ++ char *sign;
340 ++} ibft_signs[] = {
341 ++ /*
342 ++ * One spec says "IBFT", the other says "iBFT". We have to check
343 ++ * for both.
344 ++ */
345 ++ { ACPI_SIG_IBFT },
346 ++ { "iBFT" },
347 ++};
348 ++
349 ++static void __init acpi_find_ibft_region(void)
350 ++{
351 ++ int i;
352 ++ struct acpi_table_header *table = NULL;
353 ++
354 ++ if (acpi_disabled)
355 ++ return;
356 ++
357 ++ for (i = 0; i < ARRAY_SIZE(ibft_signs) && !ibft_addr; i++) {
358 ++ acpi_get_table(ibft_signs[i].sign, 0, &table);
359 ++ ibft_addr = (struct acpi_table_ibft *)table;
360 ++ }
361 ++}
362 ++#else
363 ++static void __init acpi_find_ibft_region(void)
364 ++{
365 ++}
366 ++#endif
367 ++
368 + /*
369 + * ibft_init() - creates sysfs tree entries for the iBFT data.
370 + */
371 +@@ -753,9 +784,16 @@ static int __init ibft_init(void)
372 + {
373 + int rc = 0;
374 +
375 ++ /*
376 ++ As on UEFI systems the setup_arch()/find_ibft_region()
377 ++ is called before ACPI tables are parsed and it only does
378 ++ legacy finding.
379 ++ */
380 ++ if (!ibft_addr)
381 ++ acpi_find_ibft_region();
382 ++
383 + if (ibft_addr) {
384 +- printk(KERN_INFO "iBFT detected at 0x%llx.\n",
385 +- (u64)isa_virt_to_bus(ibft_addr));
386 ++ pr_info("iBFT detected.\n");
387 +
388 + rc = ibft_check_device();
389 + if (rc)
390 +diff --git a/drivers/firmware/iscsi_ibft_find.c b/drivers/firmware/iscsi_ibft_find.c
391 +index bfe7232..4da4eb9 100644
392 +--- a/drivers/firmware/iscsi_ibft_find.c
393 ++++ b/drivers/firmware/iscsi_ibft_find.c
394 +@@ -45,13 +45,6 @@ EXPORT_SYMBOL_GPL(ibft_addr);
395 + static const struct {
396 + char *sign;
397 + } ibft_signs[] = {
398 +-#ifdef CONFIG_ACPI
399 +- /*
400 +- * One spec says "IBFT", the other says "iBFT". We have to check
401 +- * for both.
402 +- */
403 +- { ACPI_SIG_IBFT },
404 +-#endif
405 + { "iBFT" },
406 + { "BIFT" }, /* Broadcom iSCSI Offload */
407 + };
408 +@@ -62,14 +55,6 @@ static const struct {
409 + #define VGA_MEM 0xA0000 /* VGA buffer */
410 + #define VGA_SIZE 0x20000 /* 128kB */
411 +
412 +-#ifdef CONFIG_ACPI
413 +-static int __init acpi_find_ibft(struct acpi_table_header *header)
414 +-{
415 +- ibft_addr = (struct acpi_table_ibft *)header;
416 +- return 0;
417 +-}
418 +-#endif /* CONFIG_ACPI */
419 +-
420 + static int __init find_ibft_in_mem(void)
421 + {
422 + unsigned long pos;
423 +@@ -94,6 +79,7 @@ static int __init find_ibft_in_mem(void)
424 + * the table cannot be valid. */
425 + if (pos + len <= (IBFT_END-1)) {
426 + ibft_addr = (struct acpi_table_ibft *)virt;
427 ++ pr_info("iBFT found at 0x%lx.\n", pos);
428 + goto done;
429 + }
430 + }
431 +@@ -108,20 +94,12 @@ done:
432 + */
433 + unsigned long __init find_ibft_region(unsigned long *sizep)
434 + {
435 +-#ifdef CONFIG_ACPI
436 +- int i;
437 +-#endif
438 + ibft_addr = NULL;
439 +
440 +-#ifdef CONFIG_ACPI
441 +- for (i = 0; i < ARRAY_SIZE(ibft_signs) && !ibft_addr; i++)
442 +- acpi_table_parse(ibft_signs[i].sign, acpi_find_ibft);
443 +-#endif /* CONFIG_ACPI */
444 +-
445 + /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will
446 + * only use ACPI for this */
447 +
448 +- if (!ibft_addr && !efi_enabled)
449 ++ if (!efi_enabled)
450 + find_ibft_in_mem();
451 +
452 + if (ibft_addr) {
453 +diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
454 +index a515b2a..9bb3d6f 100644
455 +--- a/drivers/gpu/drm/radeon/atombios_crtc.c
456 ++++ b/drivers/gpu/drm/radeon/atombios_crtc.c
457 +@@ -558,7 +558,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
458 + bpc = connector->display_info.bpc;
459 + encoder_mode = atombios_get_encoder_mode(encoder);
460 + if ((radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) ||
461 +- radeon_encoder_is_dp_bridge(encoder)) {
462 ++ (radeon_encoder_get_dp_bridge_encoder_id(encoder) != ENCODER_OBJECT_ID_NONE)) {
463 + if (connector) {
464 + struct radeon_connector *radeon_connector = to_radeon_connector(connector);
465 + struct radeon_connector_atom_dig *dig_connector =
466 +@@ -638,44 +638,29 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
467 + if (ss_enabled && ss->percentage)
468 + args.v3.sInput.ucDispPllConfig |=
469 + DISPPLL_CONFIG_SS_ENABLE;
470 +- if (radeon_encoder->devices & (ATOM_DEVICE_DFP_SUPPORT) ||
471 +- radeon_encoder_is_dp_bridge(encoder)) {
472 ++ if (encoder_mode == ATOM_ENCODER_MODE_DP) {
473 ++ args.v3.sInput.ucDispPllConfig |=
474 ++ DISPPLL_CONFIG_COHERENT_MODE;
475 ++ /* 16200 or 27000 */
476 ++ args.v3.sInput.usPixelClock = cpu_to_le16(dp_clock / 10);
477 ++ } else if (radeon_encoder->devices & (ATOM_DEVICE_DFP_SUPPORT)) {
478 + struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
479 +- if (encoder_mode == ATOM_ENCODER_MODE_DP) {
480 ++ if (encoder_mode == ATOM_ENCODER_MODE_HDMI)
481 ++ /* deep color support */
482 ++ args.v3.sInput.usPixelClock =
483 ++ cpu_to_le16((mode->clock * bpc / 8) / 10);
484 ++ if (dig->coherent_mode)
485 + args.v3.sInput.ucDispPllConfig |=
486 + DISPPLL_CONFIG_COHERENT_MODE;
487 +- /* 16200 or 27000 */
488 +- args.v3.sInput.usPixelClock = cpu_to_le16(dp_clock / 10);
489 +- } else {
490 +- if (encoder_mode == ATOM_ENCODER_MODE_HDMI) {
491 +- /* deep color support */
492 +- args.v3.sInput.usPixelClock =
493 +- cpu_to_le16((mode->clock * bpc / 8) / 10);
494 +- }
495 +- if (dig->coherent_mode)
496 +- args.v3.sInput.ucDispPllConfig |=
497 +- DISPPLL_CONFIG_COHERENT_MODE;
498 +- if (mode->clock > 165000)
499 +- args.v3.sInput.ucDispPllConfig |=
500 +- DISPPLL_CONFIG_DUAL_LINK;
501 +- }
502 +- } else if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
503 +- if (encoder_mode == ATOM_ENCODER_MODE_DP) {
504 ++ if (mode->clock > 165000)
505 + args.v3.sInput.ucDispPllConfig |=
506 +- DISPPLL_CONFIG_COHERENT_MODE;
507 +- /* 16200 or 27000 */
508 +- args.v3.sInput.usPixelClock = cpu_to_le16(dp_clock / 10);
509 +- } else if (encoder_mode != ATOM_ENCODER_MODE_LVDS) {
510 +- if (mode->clock > 165000)
511 +- args.v3.sInput.ucDispPllConfig |=
512 +- DISPPLL_CONFIG_DUAL_LINK;
513 +- }
514 ++ DISPPLL_CONFIG_DUAL_LINK;
515 + }
516 +- if (radeon_encoder_is_dp_bridge(encoder)) {
517 +- struct drm_encoder *ext_encoder = radeon_atom_get_external_encoder(encoder);
518 +- struct radeon_encoder *ext_radeon_encoder = to_radeon_encoder(ext_encoder);
519 +- args.v3.sInput.ucExtTransmitterID = ext_radeon_encoder->encoder_id;
520 +- } else
521 ++ if (radeon_encoder_get_dp_bridge_encoder_id(encoder) !=
522 ++ ENCODER_OBJECT_ID_NONE)
523 ++ args.v3.sInput.ucExtTransmitterID =
524 ++ radeon_encoder_get_dp_bridge_encoder_id(encoder);
525 ++ else
526 + args.v3.sInput.ucExtTransmitterID = 0;
527 +
528 + atom_execute_table(rdev->mode_info.atom_context,
529 +diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
530 +index 3b77ad6..03a347a 100644
531 +--- a/drivers/gpu/drm/radeon/atombios_dp.c
532 ++++ b/drivers/gpu/drm/radeon/atombios_dp.c
533 +@@ -482,7 +482,8 @@ static int radeon_dp_get_dp_link_clock(struct drm_connector *connector,
534 + int bpp = convert_bpc_to_bpp(connector->display_info.bpc);
535 + int lane_num, max_pix_clock;
536 +
537 +- if (radeon_connector_encoder_is_dp_bridge(connector))
538 ++ if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) !=
539 ++ ENCODER_OBJECT_ID_NONE)
540 + return 270000;
541 +
542 + lane_num = radeon_dp_get_dp_lane_number(connector, dpcd, pix_clock);
543 +@@ -559,8 +560,12 @@ static void radeon_dp_set_panel_mode(struct drm_encoder *encoder,
544 + if (!ASIC_IS_DCE4(rdev))
545 + return;
546 +
547 +- if (radeon_connector_encoder_is_dp_bridge(connector))
548 ++ if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) ==
549 ++ ENCODER_OBJECT_ID_NUTMEG)
550 + panel_mode = DP_PANEL_MODE_INTERNAL_DP1_MODE;
551 ++ else if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) ==
552 ++ ENCODER_OBJECT_ID_TRAVIS)
553 ++ panel_mode = DP_PANEL_MODE_INTERNAL_DP2_MODE;
554 + else if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
555 + u8 tmp = radeon_read_dpcd_reg(radeon_connector, DP_EDP_CONFIGURATION_CAP);
556 + if (tmp & 1)
557 +diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
558 +index ff6a2e0..a58b452 100644
559 +--- a/drivers/gpu/drm/radeon/radeon_connectors.c
560 ++++ b/drivers/gpu/drm/radeon/radeon_connectors.c
561 +@@ -44,8 +44,6 @@ extern void
562 + radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder,
563 + struct drm_connector *drm_connector);
564 +
565 +-bool radeon_connector_encoder_is_dp_bridge(struct drm_connector *connector);
566 +-
567 + void radeon_connector_hotplug(struct drm_connector *connector)
568 + {
569 + struct drm_device *dev = connector->dev;
570 +@@ -1204,7 +1202,8 @@ static int radeon_dp_get_modes(struct drm_connector *connector)
571 + }
572 + } else {
573 + /* need to setup ddc on the bridge */
574 +- if (radeon_connector_encoder_is_dp_bridge(connector)) {
575 ++ if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) !=
576 ++ ENCODER_OBJECT_ID_NONE) {
577 + if (encoder)
578 + radeon_atom_ext_encoder_setup_ddc(encoder);
579 + }
580 +@@ -1214,13 +1213,12 @@ static int radeon_dp_get_modes(struct drm_connector *connector)
581 + return ret;
582 + }
583 +
584 +-bool radeon_connector_encoder_is_dp_bridge(struct drm_connector *connector)
585 ++u16 radeon_connector_encoder_get_dp_bridge_encoder_id(struct drm_connector *connector)
586 + {
587 + struct drm_mode_object *obj;
588 + struct drm_encoder *encoder;
589 + struct radeon_encoder *radeon_encoder;
590 + int i;
591 +- bool found = false;
592 +
593 + for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
594 + if (connector->encoder_ids[i] == 0)
595 +@@ -1236,14 +1234,13 @@ bool radeon_connector_encoder_is_dp_bridge(struct drm_connector *connector)
596 + switch (radeon_encoder->encoder_id) {
597 + case ENCODER_OBJECT_ID_TRAVIS:
598 + case ENCODER_OBJECT_ID_NUTMEG:
599 +- found = true;
600 +- break;
601 ++ return radeon_encoder->encoder_id;
602 + default:
603 + break;
604 + }
605 + }
606 +
607 +- return found;
608 ++ return ENCODER_OBJECT_ID_NONE;
609 + }
610 +
611 + bool radeon_connector_encoder_is_hbr2(struct drm_connector *connector)
612 +@@ -1320,7 +1317,8 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
613 + if (!radeon_dig_connector->edp_on)
614 + atombios_set_edp_panel_power(connector,
615 + ATOM_TRANSMITTER_ACTION_POWER_OFF);
616 +- } else if (radeon_connector_encoder_is_dp_bridge(connector)) {
617 ++ } else if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) !=
618 ++ ENCODER_OBJECT_ID_NONE) {
619 + /* DP bridges are always DP */
620 + radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT;
621 + /* get the DPCD from the bridge */
622 +diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
623 +index 6adb3e5..07ac481 100644
624 +--- a/drivers/gpu/drm/radeon/radeon_display.c
625 ++++ b/drivers/gpu/drm/radeon/radeon_display.c
626 +@@ -708,7 +708,8 @@ int radeon_ddc_get_modes(struct radeon_connector *radeon_connector)
627 +
628 + if ((radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_DisplayPort) ||
629 + (radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_eDP) ||
630 +- radeon_connector_encoder_is_dp_bridge(&radeon_connector->base)) {
631 ++ (radeon_connector_encoder_get_dp_bridge_encoder_id(&radeon_connector->base) !=
632 ++ ENCODER_OBJECT_ID_NONE)) {
633 + struct radeon_connector_atom_dig *dig = radeon_connector->con_priv;
634 +
635 + if ((dig->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT ||
636 +diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
637 +index eb3f6dc..9838865 100644
638 +--- a/drivers/gpu/drm/radeon/radeon_encoders.c
639 ++++ b/drivers/gpu/drm/radeon/radeon_encoders.c
640 +@@ -266,7 +266,7 @@ struct drm_encoder *radeon_atom_get_external_encoder(struct drm_encoder *encoder
641 + return NULL;
642 + }
643 +
644 +-bool radeon_encoder_is_dp_bridge(struct drm_encoder *encoder)
645 ++u16 radeon_encoder_get_dp_bridge_encoder_id(struct drm_encoder *encoder)
646 + {
647 + struct drm_encoder *other_encoder = radeon_atom_get_external_encoder(encoder);
648 +
649 +@@ -368,7 +368,7 @@ static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
650 +
651 + if (ASIC_IS_DCE3(rdev) &&
652 + ((radeon_encoder->active_device & (ATOM_DEVICE_DFP_SUPPORT | ATOM_DEVICE_LCD_SUPPORT)) ||
653 +- radeon_encoder_is_dp_bridge(encoder))) {
654 ++ (radeon_encoder_get_dp_bridge_encoder_id(encoder) != ENCODER_OBJECT_ID_NONE))) {
655 + struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
656 + radeon_dp_set_link_config(connector, mode);
657 + }
658 +@@ -658,7 +658,7 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
659 + struct radeon_connector_atom_dig *dig_connector;
660 +
661 + /* dp bridges are always DP */
662 +- if (radeon_encoder_is_dp_bridge(encoder))
663 ++ if (radeon_encoder_get_dp_bridge_encoder_id(encoder) != ENCODER_OBJECT_ID_NONE)
664 + return ATOM_ENCODER_MODE_DP;
665 +
666 + /* DVO is always DVO */
667 +@@ -1638,7 +1638,7 @@ atombios_set_encoder_crtc_source(struct drm_encoder *encoder)
668 + break;
669 + case 2:
670 + args.v2.ucCRTC = radeon_crtc->crtc_id;
671 +- if (radeon_encoder_is_dp_bridge(encoder)) {
672 ++ if (radeon_encoder_get_dp_bridge_encoder_id(encoder) != ENCODER_OBJECT_ID_NONE) {
673 + struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
674 +
675 + if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)
676 +@@ -2099,7 +2099,8 @@ static void radeon_atom_encoder_prepare(struct drm_encoder *encoder)
677 +
678 + if ((radeon_encoder->active_device &
679 + (ATOM_DEVICE_DFP_SUPPORT | ATOM_DEVICE_LCD_SUPPORT)) ||
680 +- radeon_encoder_is_dp_bridge(encoder)) {
681 ++ (radeon_encoder_get_dp_bridge_encoder_id(encoder) !=
682 ++ ENCODER_OBJECT_ID_NONE)) {
683 + struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
684 + if (dig)
685 + dig->dig_encoder = radeon_atom_pick_dig_encoder(encoder);
686 +diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
687 +index ed0178f..cbf80de 100644
688 +--- a/drivers/gpu/drm/radeon/radeon_mode.h
689 ++++ b/drivers/gpu/drm/radeon/radeon_mode.h
690 +@@ -468,8 +468,8 @@ radeon_atombios_get_tv_info(struct radeon_device *rdev);
691 + extern struct drm_connector *
692 + radeon_get_connector_for_encoder(struct drm_encoder *encoder);
693 +
694 +-extern bool radeon_encoder_is_dp_bridge(struct drm_encoder *encoder);
695 +-extern bool radeon_connector_encoder_is_dp_bridge(struct drm_connector *connector);
696 ++extern u16 radeon_encoder_get_dp_bridge_encoder_id(struct drm_encoder *encoder);
697 ++extern u16 radeon_connector_encoder_get_dp_bridge_encoder_id(struct drm_connector *connector);
698 + extern bool radeon_connector_encoder_is_hbr2(struct drm_connector *connector);
699 + extern bool radeon_connector_is_dp12_capable(struct drm_connector *connector);
700 +
701 +diff --git a/drivers/hwmon/jz4740-hwmon.c b/drivers/hwmon/jz4740-hwmon.c
702 +index fea292d..b65a4da 100644
703 +--- a/drivers/hwmon/jz4740-hwmon.c
704 ++++ b/drivers/hwmon/jz4740-hwmon.c
705 +@@ -59,7 +59,7 @@ static ssize_t jz4740_hwmon_read_adcin(struct device *dev,
706 + {
707 + struct jz4740_hwmon *hwmon = dev_get_drvdata(dev);
708 + struct completion *completion = &hwmon->read_completion;
709 +- unsigned long t;
710 ++ long t;
711 + unsigned long val;
712 + int ret;
713 +
714 +diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
715 +index 14aa213..b87143d 100644
716 +--- a/drivers/mmc/host/mxcmmc.c
717 ++++ b/drivers/mmc/host/mxcmmc.c
718 +@@ -731,6 +731,7 @@ static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
719 + "failed to config DMA channel. Falling back to PIO\n");
720 + dma_release_channel(host->dma);
721 + host->do_dma = 0;
722 ++ host->dma = NULL;
723 + }
724 + }
725 +
726 +diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
727 +index cf3f999..10451a1 100644
728 +--- a/drivers/ptp/ptp_clock.c
729 ++++ b/drivers/ptp/ptp_clock.c
730 +@@ -101,7 +101,9 @@ static s32 scaled_ppm_to_ppb(long ppm)
731 +
732 + static int ptp_clock_getres(struct posix_clock *pc, struct timespec *tp)
733 + {
734 +- return 1; /* always round timer functions to one nanosecond */
735 ++ tp->tv_sec = 0;
736 ++ tp->tv_nsec = 1;
737 ++ return 0;
738 + }
739 +
740 + static int ptp_clock_settime(struct posix_clock *pc, const struct timespec *tp)
741 +diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
742 +index 7639ab9..5b979d9 100644
743 +--- a/drivers/rtc/rtc-s3c.c
744 ++++ b/drivers/rtc/rtc-s3c.c
745 +@@ -202,7 +202,6 @@ static int s3c_rtc_settime(struct device *dev, struct rtc_time *tm)
746 + void __iomem *base = s3c_rtc_base;
747 + int year = tm->tm_year - 100;
748 +
749 +- clk_enable(rtc_clk);
750 + pr_debug("set time %04d.%02d.%02d %02d:%02d:%02d\n",
751 + 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday,
752 + tm->tm_hour, tm->tm_min, tm->tm_sec);
753 +@@ -214,6 +213,7 @@ static int s3c_rtc_settime(struct device *dev, struct rtc_time *tm)
754 + return -EINVAL;
755 + }
756 +
757 ++ clk_enable(rtc_clk);
758 + writeb(bin2bcd(tm->tm_sec), base + S3C2410_RTCSEC);
759 + writeb(bin2bcd(tm->tm_min), base + S3C2410_RTCMIN);
760 + writeb(bin2bcd(tm->tm_hour), base + S3C2410_RTCHOUR);
761 +diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
762 +index 21ce2af..6cb7e28 100644
763 +--- a/drivers/staging/rtl8712/usb_intf.c
764 ++++ b/drivers/staging/rtl8712/usb_intf.c
765 +@@ -86,6 +86,7 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = {
766 + {USB_DEVICE(0x0DF6, 0x0045)},
767 + {USB_DEVICE(0x0DF6, 0x0059)}, /* 11n mode disable */
768 + {USB_DEVICE(0x0DF6, 0x004B)},
769 ++ {USB_DEVICE(0x0DF6, 0x005D)},
770 + {USB_DEVICE(0x0DF6, 0x0063)},
771 + /* Sweex */
772 + {USB_DEVICE(0x177F, 0x0154)},
773 +diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
774 +index 26a5d8b..c4ac6f6 100644
775 +--- a/drivers/target/iscsi/iscsi_target.c
776 ++++ b/drivers/target/iscsi/iscsi_target.c
777 +@@ -1043,6 +1043,8 @@ done:
778 + */
779 + send_check_condition = 1;
780 + } else {
781 ++ cmd->data_length = cmd->se_cmd.data_length;
782 ++
783 + if (iscsit_decide_list_to_build(cmd, payload_length) < 0)
784 + return iscsit_add_reject_from_cmd(
785 + ISCSI_REASON_BOOKMARK_NO_RESOURCES,
786 +@@ -2512,10 +2514,10 @@ static int iscsit_send_data_in(
787 + if (hdr->flags & ISCSI_FLAG_DATA_STATUS) {
788 + if (cmd->se_cmd.se_cmd_flags & SCF_OVERFLOW_BIT) {
789 + hdr->flags |= ISCSI_FLAG_DATA_OVERFLOW;
790 +- hdr->residual_count = cpu_to_be32(cmd->residual_count);
791 ++ hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count);
792 + } else if (cmd->se_cmd.se_cmd_flags & SCF_UNDERFLOW_BIT) {
793 + hdr->flags |= ISCSI_FLAG_DATA_UNDERFLOW;
794 +- hdr->residual_count = cpu_to_be32(cmd->residual_count);
795 ++ hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count);
796 + }
797 + }
798 + hton24(hdr->dlength, datain.length);
799 +@@ -3017,10 +3019,10 @@ static int iscsit_send_status(
800 + hdr->flags |= ISCSI_FLAG_CMD_FINAL;
801 + if (cmd->se_cmd.se_cmd_flags & SCF_OVERFLOW_BIT) {
802 + hdr->flags |= ISCSI_FLAG_CMD_OVERFLOW;
803 +- hdr->residual_count = cpu_to_be32(cmd->residual_count);
804 ++ hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count);
805 + } else if (cmd->se_cmd.se_cmd_flags & SCF_UNDERFLOW_BIT) {
806 + hdr->flags |= ISCSI_FLAG_CMD_UNDERFLOW;
807 +- hdr->residual_count = cpu_to_be32(cmd->residual_count);
808 ++ hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count);
809 + }
810 + hdr->response = cmd->iscsi_response;
811 + hdr->cmd_status = cmd->se_cmd.scsi_status;
812 +@@ -3132,6 +3134,7 @@ static int iscsit_send_task_mgt_rsp(
813 + hdr = (struct iscsi_tm_rsp *) cmd->pdu;
814 + memset(hdr, 0, ISCSI_HDR_LEN);
815 + hdr->opcode = ISCSI_OP_SCSI_TMFUNC_RSP;
816 ++ hdr->flags = ISCSI_FLAG_CMD_FINAL;
817 + hdr->response = iscsit_convert_tcm_tmr_rsp(se_tmr);
818 + hdr->itt = cpu_to_be32(cmd->init_task_tag);
819 + cmd->stat_sn = conn->stat_sn++;
820 +diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h
821 +index 470ed55..8d18b2c 100644
822 +--- a/drivers/target/iscsi/iscsi_target_core.h
823 ++++ b/drivers/target/iscsi/iscsi_target_core.h
824 +@@ -395,7 +395,6 @@ struct iscsi_cmd {
825 + u32 pdu_send_order;
826 + /* Current struct iscsi_pdu in struct iscsi_cmd->pdu_list */
827 + u32 pdu_start;
828 +- u32 residual_count;
829 + /* Next struct iscsi_seq to send in struct iscsi_cmd->seq_list */
830 + u32 seq_send_order;
831 + /* Number of struct iscsi_seq in struct iscsi_cmd->seq_list */
832 +diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c
833 +index f04d4ef..5f91397 100644
834 +--- a/drivers/target/target_core_cdb.c
835 ++++ b/drivers/target/target_core_cdb.c
836 +@@ -477,7 +477,7 @@ target_emulate_evpd_86(struct se_cmd *cmd, unsigned char *buf)
837 + if (cmd->data_length < 60)
838 + return 0;
839 +
840 +- buf[2] = 0x3c;
841 ++ buf[3] = 0x3c;
842 + /* Set HEADSUP, ORDSUP, SIMPSUP */
843 + buf[5] = 0x07;
844 +
845 +diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
846 +index bc1b336..ceb2a28 100644
847 +--- a/drivers/target/target_core_file.c
848 ++++ b/drivers/target/target_core_file.c
849 +@@ -288,9 +288,9 @@ static int fd_do_readv(struct se_task *task)
850 + return -ENOMEM;
851 + }
852 +
853 +- for (i = 0; i < task->task_sg_nents; i++) {
854 +- iov[i].iov_len = sg[i].length;
855 +- iov[i].iov_base = sg_virt(&sg[i]);
856 ++ for_each_sg(task->task_sg, sg, task->task_sg_nents, i) {
857 ++ iov[i].iov_len = sg->length;
858 ++ iov[i].iov_base = sg_virt(sg);
859 + }
860 +
861 + old_fs = get_fs();
862 +@@ -340,9 +340,9 @@ static int fd_do_writev(struct se_task *task)
863 + return -ENOMEM;
864 + }
865 +
866 +- for (i = 0; i < task->task_sg_nents; i++) {
867 +- iov[i].iov_len = sg[i].length;
868 +- iov[i].iov_base = sg_virt(&sg[i]);
869 ++ for_each_sg(task->task_sg, sg, task->task_sg_nents, i) {
870 ++ iov[i].iov_len = sg->length;
871 ++ iov[i].iov_base = sg_virt(sg);
872 + }
873 +
874 + old_fs = get_fs();
875 +diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
876 +index 013c100..e2added 100644
877 +--- a/drivers/target/target_core_transport.c
878 ++++ b/drivers/target/target_core_transport.c
879 +@@ -2562,10 +2562,15 @@ static inline u32 transport_get_sectors_6(
880 +
881 + /*
882 + * Everything else assume TYPE_DISK Sector CDB location.
883 +- * Use 8-bit sector value.
884 ++ * Use 8-bit sector value. SBC-3 says:
885 ++ *
886 ++ * A TRANSFER LENGTH field set to zero specifies that 256
887 ++ * logical blocks shall be written. Any other value
888 ++ * specifies the number of logical blocks that shall be
889 ++ * written.
890 + */
891 + type_disk:
892 +- return (u32)cdb[4];
893 ++ return cdb[4] ? : 256;
894 + }
895 +
896 + static inline u32 transport_get_sectors_10(
897 +@@ -3873,6 +3878,18 @@ int transport_generic_map_mem_to_cmd(
898 +
899 + if ((cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB) ||
900 + (cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB)) {
901 ++ /*
902 ++ * Reject SCSI data overflow with map_mem_to_cmd() as incoming
903 ++ * scatterlists already have been set to follow what the fabric
904 ++ * passes for the original expected data transfer length.
905 ++ */
906 ++ if (cmd->se_cmd_flags & SCF_OVERFLOW_BIT) {
907 ++ pr_warn("Rejecting SCSI DATA overflow for fabric using"
908 ++ " SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC\n");
909 ++ cmd->se_cmd_flags |= SCF_SCSI_CDB_EXCEPTION;
910 ++ cmd->scsi_sense_reason = TCM_INVALID_CDB_FIELD;
911 ++ return -EINVAL;
912 ++ }
913 +
914 + cmd->t_data_sg = sgl;
915 + cmd->t_data_nents = sgl_count;
916 +diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
917 +index 2ffcaa0..8faa23c 100644
918 +--- a/drivers/usb/class/cdc-acm.c
919 ++++ b/drivers/usb/class/cdc-acm.c
920 +@@ -1458,6 +1458,16 @@ static const struct usb_device_id acm_ids[] = {
921 + },
922 + { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */
923 + },
924 ++ /* Motorola H24 HSPA module: */
925 ++ { USB_DEVICE(0x22b8, 0x2d91) }, /* modem */
926 ++ { USB_DEVICE(0x22b8, 0x2d92) }, /* modem + diagnostics */
927 ++ { USB_DEVICE(0x22b8, 0x2d93) }, /* modem + AT port */
928 ++ { USB_DEVICE(0x22b8, 0x2d95) }, /* modem + AT port + diagnostics */
929 ++ { USB_DEVICE(0x22b8, 0x2d96) }, /* modem + NMEA */
930 ++ { USB_DEVICE(0x22b8, 0x2d97) }, /* modem + diagnostics + NMEA */
931 ++ { USB_DEVICE(0x22b8, 0x2d99) }, /* modem + AT port + NMEA */
932 ++ { USB_DEVICE(0x22b8, 0x2d9a) }, /* modem + AT port + diagnostics + NMEA */
933 ++
934 + { USB_DEVICE(0x0572, 0x1329), /* Hummingbird huc56s (Conexant) */
935 + .driver_info = NO_UNION_NORMAL, /* union descriptor misplaced on
936 + data interface instead of
937 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
938 +index e98a1e1..d2becb9 100644
939 +--- a/drivers/usb/serial/option.c
940 ++++ b/drivers/usb/serial/option.c
941 +@@ -659,7 +659,12 @@ static const struct usb_device_id option_ids[] = {
942 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x01) },
943 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x02) },
944 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x03) },
945 +- { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x08) },
946 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x10) },
947 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x12) },
948 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x13) },
949 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x01) }, /* E398 3G Modem */
950 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x02) }, /* E398 3G PC UI Interface */
951 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x03) }, /* E398 3G Application Interface */
952 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) },
953 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) },
954 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) },
955 +diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
956 +index 5de03ec..a090bbe 100644
957 +--- a/fs/cifs/readdir.c
958 ++++ b/fs/cifs/readdir.c
959 +@@ -554,7 +554,10 @@ static int find_cifs_entry(const int xid, struct cifs_tcon *pTcon,
960 + rc);
961 + return rc;
962 + }
963 +- cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
964 ++ /* FindFirst/Next set last_entry to NULL on malformed reply */
965 ++ if (cifsFile->srch_inf.last_entry)
966 ++ cifs_save_resume_key(cifsFile->srch_inf.last_entry,
967 ++ cifsFile);
968 + }
969 +
970 + while ((index_to_find >= cifsFile->srch_inf.index_of_last_entry) &&
971 +@@ -562,7 +565,10 @@ static int find_cifs_entry(const int xid, struct cifs_tcon *pTcon,
972 + cFYI(1, "calling findnext2");
973 + rc = CIFSFindNext(xid, pTcon, cifsFile->netfid,
974 + &cifsFile->srch_inf);
975 +- cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
976 ++ /* FindFirst/Next set last_entry to NULL on malformed reply */
977 ++ if (cifsFile->srch_inf.last_entry)
978 ++ cifs_save_resume_key(cifsFile->srch_inf.last_entry,
979 ++ cifsFile);
980 + if (rc)
981 + return -ENOENT;
982 + }
983 +diff --git a/fs/dcache.c b/fs/dcache.c
984 +index a88948b..8b732a2 100644
985 +--- a/fs/dcache.c
986 ++++ b/fs/dcache.c
987 +@@ -2398,16 +2398,14 @@ static int prepend_name(char **buffer, int *buflen, struct qstr *name)
988 + /**
989 + * prepend_path - Prepend path string to a buffer
990 + * @path: the dentry/vfsmount to report
991 +- * @root: root vfsmnt/dentry (may be modified by this function)
992 ++ * @root: root vfsmnt/dentry
993 + * @buffer: pointer to the end of the buffer
994 + * @buflen: pointer to buffer length
995 + *
996 + * Caller holds the rename_lock.
997 +- *
998 +- * If path is not reachable from the supplied root, then the value of
999 +- * root is changed (without modifying refcounts).
1000 + */
1001 +-static int prepend_path(const struct path *path, struct path *root,
1002 ++static int prepend_path(const struct path *path,
1003 ++ const struct path *root,
1004 + char **buffer, int *buflen)
1005 + {
1006 + struct dentry *dentry = path->dentry;
1007 +@@ -2442,10 +2440,10 @@ static int prepend_path(const struct path *path, struct path *root,
1008 + dentry = parent;
1009 + }
1010 +
1011 +-out:
1012 + if (!error && !slash)
1013 + error = prepend(buffer, buflen, "/", 1);
1014 +
1015 ++out:
1016 + br_read_unlock(vfsmount_lock);
1017 + return error;
1018 +
1019 +@@ -2459,15 +2457,17 @@ global_root:
1020 + WARN(1, "Root dentry has weird name <%.*s>\n",
1021 + (int) dentry->d_name.len, dentry->d_name.name);
1022 + }
1023 +- root->mnt = vfsmnt;
1024 +- root->dentry = dentry;
1025 ++ if (!slash)
1026 ++ error = prepend(buffer, buflen, "/", 1);
1027 ++ if (!error)
1028 ++ error = vfsmnt->mnt_ns ? 1 : 2;
1029 + goto out;
1030 + }
1031 +
1032 + /**
1033 + * __d_path - return the path of a dentry
1034 + * @path: the dentry/vfsmount to report
1035 +- * @root: root vfsmnt/dentry (may be modified by this function)
1036 ++ * @root: root vfsmnt/dentry
1037 + * @buf: buffer to return value in
1038 + * @buflen: buffer length
1039 + *
1040 +@@ -2478,10 +2478,10 @@ global_root:
1041 + *
1042 + * "buflen" should be positive.
1043 + *
1044 +- * If path is not reachable from the supplied root, then the value of
1045 +- * root is changed (without modifying refcounts).
1046 ++ * If the path is not reachable from the supplied root, return %NULL.
1047 + */
1048 +-char *__d_path(const struct path *path, struct path *root,
1049 ++char *__d_path(const struct path *path,
1050 ++ const struct path *root,
1051 + char *buf, int buflen)
1052 + {
1053 + char *res = buf + buflen;
1054 +@@ -2492,7 +2492,28 @@ char *__d_path(const struct path *path, struct path *root,
1055 + error = prepend_path(path, root, &res, &buflen);
1056 + write_sequnlock(&rename_lock);
1057 +
1058 +- if (error)
1059 ++ if (error < 0)
1060 ++ return ERR_PTR(error);
1061 ++ if (error > 0)
1062 ++ return NULL;
1063 ++ return res;
1064 ++}
1065 ++
1066 ++char *d_absolute_path(const struct path *path,
1067 ++ char *buf, int buflen)
1068 ++{
1069 ++ struct path root = {};
1070 ++ char *res = buf + buflen;
1071 ++ int error;
1072 ++
1073 ++ prepend(&res, &buflen, "\0", 1);
1074 ++ write_seqlock(&rename_lock);
1075 ++ error = prepend_path(path, &root, &res, &buflen);
1076 ++ write_sequnlock(&rename_lock);
1077 ++
1078 ++ if (error > 1)
1079 ++ error = -EINVAL;
1080 ++ if (error < 0)
1081 + return ERR_PTR(error);
1082 + return res;
1083 + }
1084 +@@ -2500,8 +2521,9 @@ char *__d_path(const struct path *path, struct path *root,
1085 + /*
1086 + * same as __d_path but appends "(deleted)" for unlinked files.
1087 + */
1088 +-static int path_with_deleted(const struct path *path, struct path *root,
1089 +- char **buf, int *buflen)
1090 ++static int path_with_deleted(const struct path *path,
1091 ++ const struct path *root,
1092 ++ char **buf, int *buflen)
1093 + {
1094 + prepend(buf, buflen, "\0", 1);
1095 + if (d_unlinked(path->dentry)) {
1096 +@@ -2538,7 +2560,6 @@ char *d_path(const struct path *path, char *buf, int buflen)
1097 + {
1098 + char *res = buf + buflen;
1099 + struct path root;
1100 +- struct path tmp;
1101 + int error;
1102 +
1103 + /*
1104 +@@ -2553,9 +2574,8 @@ char *d_path(const struct path *path, char *buf, int buflen)
1105 +
1106 + get_fs_root(current->fs, &root);
1107 + write_seqlock(&rename_lock);
1108 +- tmp = root;
1109 +- error = path_with_deleted(path, &tmp, &res, &buflen);
1110 +- if (error)
1111 ++ error = path_with_deleted(path, &root, &res, &buflen);
1112 ++ if (error < 0)
1113 + res = ERR_PTR(error);
1114 + write_sequnlock(&rename_lock);
1115 + path_put(&root);
1116 +@@ -2576,7 +2596,6 @@ char *d_path_with_unreachable(const struct path *path, char *buf, int buflen)
1117 + {
1118 + char *res = buf + buflen;
1119 + struct path root;
1120 +- struct path tmp;
1121 + int error;
1122 +
1123 + if (path->dentry->d_op && path->dentry->d_op->d_dname)
1124 +@@ -2584,9 +2603,8 @@ char *d_path_with_unreachable(const struct path *path, char *buf, int buflen)
1125 +
1126 + get_fs_root(current->fs, &root);
1127 + write_seqlock(&rename_lock);
1128 +- tmp = root;
1129 +- error = path_with_deleted(path, &tmp, &res, &buflen);
1130 +- if (!error && !path_equal(&tmp, &root))
1131 ++ error = path_with_deleted(path, &root, &res, &buflen);
1132 ++ if (error > 0)
1133 + error = prepend_unreachable(&res, &buflen);
1134 + write_sequnlock(&rename_lock);
1135 + path_put(&root);
1136 +@@ -2717,19 +2735,18 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
1137 + write_seqlock(&rename_lock);
1138 + if (!d_unlinked(pwd.dentry)) {
1139 + unsigned long len;
1140 +- struct path tmp = root;
1141 + char *cwd = page + PAGE_SIZE;
1142 + int buflen = PAGE_SIZE;
1143 +
1144 + prepend(&cwd, &buflen, "\0", 1);
1145 +- error = prepend_path(&pwd, &tmp, &cwd, &buflen);
1146 ++ error = prepend_path(&pwd, &root, &cwd, &buflen);
1147 + write_sequnlock(&rename_lock);
1148 +
1149 +- if (error)
1150 ++ if (error < 0)
1151 + goto out;
1152 +
1153 + /* Unreachable from current root */
1154 +- if (!path_equal(&tmp, &root)) {
1155 ++ if (error > 0) {
1156 + error = prepend_unreachable(&cwd, &buflen);
1157 + if (error)
1158 + goto out;
1159 +diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
1160 +index b644b9c..5dbdb6b 100644
1161 +--- a/fs/ext4/inode.c
1162 ++++ b/fs/ext4/inode.c
1163 +@@ -1261,8 +1261,11 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd,
1164 + clear_buffer_unwritten(bh);
1165 + }
1166 +
1167 +- /* skip page if block allocation undone */
1168 +- if (buffer_delay(bh) || buffer_unwritten(bh))
1169 ++ /*
1170 ++ * skip page if block allocation undone and
1171 ++ * block is dirty
1172 ++ */
1173 ++ if (ext4_bh_delay_or_unwritten(NULL, bh))
1174 + skip_page = 1;
1175 + bh = bh->b_this_page;
1176 + block_start += bh->b_size;
1177 +@@ -2367,7 +2370,7 @@ static int ext4_da_write_end(struct file *file,
1178 + */
1179 +
1180 + new_i_size = pos + copied;
1181 +- if (new_i_size > EXT4_I(inode)->i_disksize) {
1182 ++ if (copied && new_i_size > EXT4_I(inode)->i_disksize) {
1183 + if (ext4_da_should_update_i_disksize(page, end)) {
1184 + down_write(&EXT4_I(inode)->i_data_sem);
1185 + if (new_i_size > EXT4_I(inode)->i_disksize) {
1186 +@@ -2630,10 +2633,11 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset,
1187 + iocb->private, io_end->inode->i_ino, iocb, offset,
1188 + size);
1189 +
1190 ++ iocb->private = NULL;
1191 ++
1192 + /* if not aio dio with unwritten extents, just free io and return */
1193 + if (!(io_end->flag & EXT4_IO_END_UNWRITTEN)) {
1194 + ext4_free_io_end(io_end);
1195 +- iocb->private = NULL;
1196 + out:
1197 + if (is_async)
1198 + aio_complete(iocb, ret, 0);
1199 +@@ -2656,7 +2660,6 @@ out:
1200 + spin_unlock_irqrestore(&ei->i_completed_io_lock, flags);
1201 +
1202 + /* queue the work to convert unwritten extents to written */
1203 +- iocb->private = NULL;
1204 + queue_work(wq, &io_end->work);
1205 +
1206 + /* XXX: probably should move into the real I/O completion handler */
1207 +diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
1208 +index 92f38ee..78ab854 100644
1209 +--- a/fs/ext4/page-io.c
1210 ++++ b/fs/ext4/page-io.c
1211 +@@ -401,6 +401,18 @@ int ext4_bio_write_page(struct ext4_io_submit *io,
1212 +
1213 + block_end = block_start + blocksize;
1214 + if (block_start >= len) {
1215 ++ /*
1216 ++ * Comments copied from block_write_full_page_endio:
1217 ++ *
1218 ++ * The page straddles i_size. It must be zeroed out on
1219 ++ * each and every writepage invocation because it may
1220 ++ * be mmapped. "A file is mapped in multiples of the
1221 ++ * page size. For a file that is not a multiple of
1222 ++ * the page size, the remaining memory is zeroed when
1223 ++ * mapped, and writes to that region are not written
1224 ++ * out to the file."
1225 ++ */
1226 ++ zero_user_segment(page, block_start, block_end);
1227 + clear_buffer_dirty(bh);
1228 + set_buffer_uptodate(bh);
1229 + continue;
1230 +diff --git a/fs/ext4/super.c b/fs/ext4/super.c
1231 +index 44d0c8d..065ff37 100644
1232 +--- a/fs/ext4/super.c
1233 ++++ b/fs/ext4/super.c
1234 +@@ -1140,9 +1140,9 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
1235 + seq_puts(seq, ",block_validity");
1236 +
1237 + if (!test_opt(sb, INIT_INODE_TABLE))
1238 +- seq_puts(seq, ",noinit_inode_table");
1239 ++ seq_puts(seq, ",noinit_itable");
1240 + else if (sbi->s_li_wait_mult != EXT4_DEF_LI_WAIT_MULT)
1241 +- seq_printf(seq, ",init_inode_table=%u",
1242 ++ seq_printf(seq, ",init_itable=%u",
1243 + (unsigned) sbi->s_li_wait_mult);
1244 +
1245 + ext4_show_quota_options(seq, sb);
1246 +@@ -1318,8 +1318,7 @@ enum {
1247 + Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity,
1248 + Opt_inode_readahead_blks, Opt_journal_ioprio,
1249 + Opt_dioread_nolock, Opt_dioread_lock,
1250 +- Opt_discard, Opt_nodiscard,
1251 +- Opt_init_inode_table, Opt_noinit_inode_table,
1252 ++ Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable,
1253 + };
1254 +
1255 + static const match_table_t tokens = {
1256 +@@ -1392,9 +1391,9 @@ static const match_table_t tokens = {
1257 + {Opt_dioread_lock, "dioread_lock"},
1258 + {Opt_discard, "discard"},
1259 + {Opt_nodiscard, "nodiscard"},
1260 +- {Opt_init_inode_table, "init_itable=%u"},
1261 +- {Opt_init_inode_table, "init_itable"},
1262 +- {Opt_noinit_inode_table, "noinit_itable"},
1263 ++ {Opt_init_itable, "init_itable=%u"},
1264 ++ {Opt_init_itable, "init_itable"},
1265 ++ {Opt_noinit_itable, "noinit_itable"},
1266 + {Opt_err, NULL},
1267 + };
1268 +
1269 +@@ -1871,7 +1870,7 @@ set_qf_format:
1270 + case Opt_dioread_lock:
1271 + clear_opt(sb, DIOREAD_NOLOCK);
1272 + break;
1273 +- case Opt_init_inode_table:
1274 ++ case Opt_init_itable:
1275 + set_opt(sb, INIT_INODE_TABLE);
1276 + if (args[0].from) {
1277 + if (match_int(&args[0], &option))
1278 +@@ -1882,7 +1881,7 @@ set_qf_format:
1279 + return 0;
1280 + sbi->s_li_wait_mult = option;
1281 + break;
1282 +- case Opt_noinit_inode_table:
1283 ++ case Opt_noinit_itable:
1284 + clear_opt(sb, INIT_INODE_TABLE);
1285 + break;
1286 + default:
1287 +diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
1288 +index 5cb8614..2aaf3ea 100644
1289 +--- a/fs/fuse/dev.c
1290 ++++ b/fs/fuse/dev.c
1291 +@@ -1512,7 +1512,7 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode,
1292 + else if (outarg->offset + num > file_size)
1293 + num = file_size - outarg->offset;
1294 +
1295 +- while (num) {
1296 ++ while (num && req->num_pages < FUSE_MAX_PAGES_PER_REQ) {
1297 + struct page *page;
1298 + unsigned int this_num;
1299 +
1300 +@@ -1526,6 +1526,7 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode,
1301 +
1302 + num -= this_num;
1303 + total_len += this_num;
1304 ++ index++;
1305 + }
1306 + req->misc.retrieve_in.offset = outarg->offset;
1307 + req->misc.retrieve_in.size = total_len;
1308 +diff --git a/fs/fuse/file.c b/fs/fuse/file.c
1309 +index 594f07a..19029e9 100644
1310 +--- a/fs/fuse/file.c
1311 ++++ b/fs/fuse/file.c
1312 +@@ -1556,7 +1556,7 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin)
1313 + struct inode *inode = file->f_path.dentry->d_inode;
1314 +
1315 + mutex_lock(&inode->i_mutex);
1316 +- if (origin != SEEK_CUR || origin != SEEK_SET) {
1317 ++ if (origin != SEEK_CUR && origin != SEEK_SET) {
1318 + retval = fuse_update_attributes(inode, NULL, file, NULL);
1319 + if (retval)
1320 + goto exit;
1321 +diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c
1322 +index 3ebc437..1cbdeea 100644
1323 +--- a/fs/hfs/btree.c
1324 ++++ b/fs/hfs/btree.c
1325 +@@ -46,11 +46,26 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
1326 + case HFS_EXT_CNID:
1327 + hfs_inode_read_fork(tree->inode, mdb->drXTExtRec, mdb->drXTFlSize,
1328 + mdb->drXTFlSize, be32_to_cpu(mdb->drXTClpSiz));
1329 ++ if (HFS_I(tree->inode)->alloc_blocks >
1330 ++ HFS_I(tree->inode)->first_blocks) {
1331 ++ printk(KERN_ERR "hfs: invalid btree extent records\n");
1332 ++ unlock_new_inode(tree->inode);
1333 ++ goto free_inode;
1334 ++ }
1335 ++
1336 + tree->inode->i_mapping->a_ops = &hfs_btree_aops;
1337 + break;
1338 + case HFS_CAT_CNID:
1339 + hfs_inode_read_fork(tree->inode, mdb->drCTExtRec, mdb->drCTFlSize,
1340 + mdb->drCTFlSize, be32_to_cpu(mdb->drCTClpSiz));
1341 ++
1342 ++ if (!HFS_I(tree->inode)->first_blocks) {
1343 ++ printk(KERN_ERR "hfs: invalid btree extent records "
1344 ++ "(0 size).\n");
1345 ++ unlock_new_inode(tree->inode);
1346 ++ goto free_inode;
1347 ++ }
1348 ++
1349 + tree->inode->i_mapping->a_ops = &hfs_btree_aops;
1350 + break;
1351 + default:
1352 +@@ -59,11 +74,6 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
1353 + }
1354 + unlock_new_inode(tree->inode);
1355 +
1356 +- if (!HFS_I(tree->inode)->first_blocks) {
1357 +- printk(KERN_ERR "hfs: invalid btree extent records (0 size).\n");
1358 +- goto free_inode;
1359 +- }
1360 +-
1361 + mapping = tree->inode->i_mapping;
1362 + page = read_mapping_page(mapping, 0, NULL);
1363 + if (IS_ERR(page))
1364 +diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
1365 +index 9fe061f..fea8dd6 100644
1366 +--- a/fs/jbd/journal.c
1367 ++++ b/fs/jbd/journal.c
1368 +@@ -1135,6 +1135,14 @@ static int journal_get_superblock(journal_t *journal)
1369 + goto out;
1370 + }
1371 +
1372 ++ if (be32_to_cpu(sb->s_first) == 0 ||
1373 ++ be32_to_cpu(sb->s_first) >= journal->j_maxlen) {
1374 ++ printk(KERN_WARNING
1375 ++ "JBD: Invalid start block of journal: %u\n",
1376 ++ be32_to_cpu(sb->s_first));
1377 ++ goto out;
1378 ++ }
1379 ++
1380 + return 0;
1381 +
1382 + out:
1383 +diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
1384 +index f24df13..d6e93d0 100644
1385 +--- a/fs/jbd2/journal.c
1386 ++++ b/fs/jbd2/journal.c
1387 +@@ -1251,6 +1251,14 @@ static int journal_get_superblock(journal_t *journal)
1388 + goto out;
1389 + }
1390 +
1391 ++ if (be32_to_cpu(sb->s_first) == 0 ||
1392 ++ be32_to_cpu(sb->s_first) >= journal->j_maxlen) {
1393 ++ printk(KERN_WARNING
1394 ++ "JBD2: Invalid start block of journal: %u\n",
1395 ++ be32_to_cpu(sb->s_first));
1396 ++ goto out;
1397 ++ }
1398 ++
1399 + return 0;
1400 +
1401 + out:
1402 +diff --git a/fs/namespace.c b/fs/namespace.c
1403 +index e5e1c7d..5e7f2e9 100644
1404 +--- a/fs/namespace.c
1405 ++++ b/fs/namespace.c
1406 +@@ -1048,15 +1048,12 @@ static int show_mountinfo(struct seq_file *m, void *v)
1407 + if (err)
1408 + goto out;
1409 + seq_putc(m, ' ');
1410 +- seq_path_root(m, &mnt_path, &root, " \t\n\\");
1411 +- if (root.mnt != p->root.mnt || root.dentry != p->root.dentry) {
1412 +- /*
1413 +- * Mountpoint is outside root, discard that one. Ugly,
1414 +- * but less so than trying to do that in iterator in a
1415 +- * race-free way (due to renames).
1416 +- */
1417 +- return SEQ_SKIP;
1418 +- }
1419 ++
1420 ++ /* mountpoints outside of chroot jail will give SEQ_SKIP on this */
1421 ++ err = seq_path_root(m, &mnt_path, &root, " \t\n\\");
1422 ++ if (err)
1423 ++ goto out;
1424 ++
1425 + seq_puts(m, mnt->mnt_flags & MNT_READONLY ? " ro" : " rw");
1426 + show_mnt_opts(m, mnt);
1427 +
1428 +@@ -2744,3 +2741,8 @@ void kern_unmount(struct vfsmount *mnt)
1429 + }
1430 + }
1431 + EXPORT_SYMBOL(kern_unmount);
1432 ++
1433 ++bool our_mnt(struct vfsmount *mnt)
1434 ++{
1435 ++ return check_mnt(mnt);
1436 ++}
1437 +diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
1438 +index 5861741..80e4645 100644
1439 +--- a/fs/proc/meminfo.c
1440 ++++ b/fs/proc/meminfo.c
1441 +@@ -131,12 +131,13 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
1442 + K(i.freeswap),
1443 + K(global_page_state(NR_FILE_DIRTY)),
1444 + K(global_page_state(NR_WRITEBACK)),
1445 +- K(global_page_state(NR_ANON_PAGES)
1446 + #ifdef CONFIG_TRANSPARENT_HUGEPAGE
1447 ++ K(global_page_state(NR_ANON_PAGES)
1448 + + global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
1449 +- HPAGE_PMD_NR
1450 ++ HPAGE_PMD_NR),
1451 ++#else
1452 ++ K(global_page_state(NR_ANON_PAGES)),
1453 + #endif
1454 +- ),
1455 + K(global_page_state(NR_FILE_MAPPED)),
1456 + K(global_page_state(NR_SHMEM)),
1457 + K(global_page_state(NR_SLAB_RECLAIMABLE) +
1458 +diff --git a/fs/seq_file.c b/fs/seq_file.c
1459 +index 05d6b0e..dba43c3 100644
1460 +--- a/fs/seq_file.c
1461 ++++ b/fs/seq_file.c
1462 +@@ -449,8 +449,6 @@ EXPORT_SYMBOL(seq_path);
1463 +
1464 + /*
1465 + * Same as seq_path, but relative to supplied root.
1466 +- *
1467 +- * root may be changed, see __d_path().
1468 + */
1469 + int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
1470 + char *esc)
1471 +@@ -463,6 +461,8 @@ int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
1472 + char *p;
1473 +
1474 + p = __d_path(path, root, buf, size);
1475 ++ if (!p)
1476 ++ return SEQ_SKIP;
1477 + res = PTR_ERR(p);
1478 + if (!IS_ERR(p)) {
1479 + char *end = mangle_path(buf, p, esc);
1480 +@@ -474,7 +474,7 @@ int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
1481 + }
1482 + seq_commit(m, res);
1483 +
1484 +- return res < 0 ? res : 0;
1485 ++ return res < 0 && res != -ENAMETOOLONG ? res : 0;
1486 + }
1487 +
1488 + /*
1489 +diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
1490 +index 4e4fbb8..14b6cd0 100644
1491 +--- a/include/drm/drm_pciids.h
1492 ++++ b/include/drm/drm_pciids.h
1493 +@@ -182,8 +182,11 @@
1494 + {0x1002, 0x6748, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1495 + {0x1002, 0x6749, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1496 + {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1497 ++ {0x1002, 0x6751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1498 + {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1499 + {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1500 ++ {0x1002, 0x675B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1501 ++ {0x1002, 0x675D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1502 + {0x1002, 0x675F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1503 + {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1504 + {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1505 +@@ -195,8 +198,10 @@
1506 + {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1507 + {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1508 + {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1509 ++ {0x1002, 0x6772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1510 + {0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1511 + {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1512 ++ {0x1002, 0x677B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1513 + {0x1002, 0x6840, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1514 + {0x1002, 0x6841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1515 + {0x1002, 0x6842, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1516 +@@ -246,6 +251,7 @@
1517 + {0x1002, 0x68f2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \
1518 + {0x1002, 0x68f8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \
1519 + {0x1002, 0x68f9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \
1520 ++ {0x1002, 0x68fa, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \
1521 + {0x1002, 0x68fe, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \
1522 + {0x1002, 0x7100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R520|RADEON_NEW_MEMMAP}, \
1523 + {0x1002, 0x7101, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R520|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1524 +@@ -488,6 +494,8 @@
1525 + {0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
1526 + {0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
1527 + {0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1528 ++ {0x1002, 0x964b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1529 ++ {0x1002, 0x964c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1530 + {0x1002, 0x964e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
1531 + {0x1002, 0x964f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
1532 + {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1533 +@@ -502,6 +510,8 @@
1534 + {0x1002, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1535 + {0x1002, 0x9806, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1536 + {0x1002, 0x9807, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1537 ++ {0x1002, 0x9808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1538 ++ {0x1002, 0x9809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1539 + {0, 0, 0}
1540 +
1541 + #define r128_PCI_IDS \
1542 +diff --git a/include/linux/dcache.h b/include/linux/dcache.h
1543 +index 62157c0..713c7c6 100644
1544 +--- a/include/linux/dcache.h
1545 ++++ b/include/linux/dcache.h
1546 +@@ -337,7 +337,8 @@ extern int d_validate(struct dentry *, struct dentry *);
1547 + */
1548 + extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
1549 +
1550 +-extern char *__d_path(const struct path *path, struct path *root, char *, int);
1551 ++extern char *__d_path(const struct path *, const struct path *, char *, int);
1552 ++extern char *d_absolute_path(const struct path *, char *, int);
1553 + extern char *d_path(const struct path *, char *, int);
1554 + extern char *d_path_with_unreachable(const struct path *, char *, int);
1555 + extern char *dentry_path_raw(struct dentry *, char *, int);
1556 +diff --git a/include/linux/fs.h b/include/linux/fs.h
1557 +index 277f497..cf7bc25 100644
1558 +--- a/include/linux/fs.h
1559 ++++ b/include/linux/fs.h
1560 +@@ -1907,6 +1907,7 @@ extern int fd_statfs(int, struct kstatfs *);
1561 + extern int statfs_by_dentry(struct dentry *, struct kstatfs *);
1562 + extern int freeze_super(struct super_block *super);
1563 + extern int thaw_super(struct super_block *super);
1564 ++extern bool our_mnt(struct vfsmount *mnt);
1565 +
1566 + extern int current_umask(void);
1567 +
1568 +diff --git a/include/linux/log2.h b/include/linux/log2.h
1569 +index 25b8086..fd7ff3d 100644
1570 +--- a/include/linux/log2.h
1571 ++++ b/include/linux/log2.h
1572 +@@ -185,7 +185,6 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
1573 + #define rounddown_pow_of_two(n) \
1574 + ( \
1575 + __builtin_constant_p(n) ? ( \
1576 +- (n == 1) ? 0 : \
1577 + (1UL << ilog2(n))) : \
1578 + __rounddown_pow_of_two(n) \
1579 + )
1580 +diff --git a/kernel/lockdep.c b/kernel/lockdep.c
1581 +index 91d67ce..4479606 100644
1582 +--- a/kernel/lockdep.c
1583 ++++ b/kernel/lockdep.c
1584 +@@ -44,6 +44,7 @@
1585 + #include <linux/stringify.h>
1586 + #include <linux/bitops.h>
1587 + #include <linux/gfp.h>
1588 ++#include <linux/kmemcheck.h>
1589 +
1590 + #include <asm/sections.h>
1591 +
1592 +@@ -2874,7 +2875,12 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
1593 + void lockdep_init_map(struct lockdep_map *lock, const char *name,
1594 + struct lock_class_key *key, int subclass)
1595 + {
1596 +- memset(lock, 0, sizeof(*lock));
1597 ++ int i;
1598 ++
1599 ++ kmemcheck_mark_initialized(lock, sizeof(*lock));
1600 ++
1601 ++ for (i = 0; i < NR_LOCKDEP_CACHING_CLASSES; i++)
1602 ++ lock->class_cache[i] = NULL;
1603 +
1604 + #ifdef CONFIG_LOCK_STAT
1605 + lock->cpu = raw_smp_processor_id();
1606 +diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
1607 +index ea5e1a9..8b70c76 100644
1608 +--- a/kernel/time/alarmtimer.c
1609 ++++ b/kernel/time/alarmtimer.c
1610 +@@ -181,7 +181,7 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer)
1611 + struct alarm *alarm;
1612 + ktime_t expired = next->expires;
1613 +
1614 +- if (expired.tv64 >= now.tv64)
1615 ++ if (expired.tv64 > now.tv64)
1616 + break;
1617 +
1618 + alarm = container_of(next, struct alarm, node);
1619 +diff --git a/mm/hugetlb.c b/mm/hugetlb.c
1620 +index bb28a5f..73f17c0 100644
1621 +--- a/mm/hugetlb.c
1622 ++++ b/mm/hugetlb.c
1623 +@@ -576,6 +576,7 @@ static void prep_compound_gigantic_page(struct page *page, unsigned long order)
1624 + __SetPageHead(page);
1625 + for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) {
1626 + __SetPageTail(p);
1627 ++ set_page_count(p, 0);
1628 + p->first_page = page;
1629 + }
1630 + }
1631 +diff --git a/mm/page_alloc.c b/mm/page_alloc.c
1632 +index 6e8ecb6..e8fae15 100644
1633 +--- a/mm/page_alloc.c
1634 ++++ b/mm/page_alloc.c
1635 +@@ -355,8 +355,8 @@ void prep_compound_page(struct page *page, unsigned long order)
1636 + __SetPageHead(page);
1637 + for (i = 1; i < nr_pages; i++) {
1638 + struct page *p = page + i;
1639 +-
1640 + __SetPageTail(p);
1641 ++ set_page_count(p, 0);
1642 + p->first_page = page;
1643 + }
1644 + }
1645 +@@ -3370,9 +3370,15 @@ static void setup_zone_migrate_reserve(struct zone *zone)
1646 + unsigned long block_migratetype;
1647 + int reserve;
1648 +
1649 +- /* Get the start pfn, end pfn and the number of blocks to reserve */
1650 ++ /*
1651 ++ * Get the start pfn, end pfn and the number of blocks to reserve
1652 ++ * We have to be careful to be aligned to pageblock_nr_pages to
1653 ++ * make sure that we always check pfn_valid for the first page in
1654 ++ * the block.
1655 ++ */
1656 + start_pfn = zone->zone_start_pfn;
1657 + end_pfn = start_pfn + zone->spanned_pages;
1658 ++ start_pfn = roundup(start_pfn, pageblock_nr_pages);
1659 + reserve = roundup(min_wmark_pages(zone), pageblock_nr_pages) >>
1660 + pageblock_order;
1661 +
1662 +diff --git a/mm/percpu-vm.c b/mm/percpu-vm.c
1663 +index ea53496..bfad724 100644
1664 +--- a/mm/percpu-vm.c
1665 ++++ b/mm/percpu-vm.c
1666 +@@ -143,8 +143,8 @@ static void pcpu_pre_unmap_flush(struct pcpu_chunk *chunk,
1667 + int page_start, int page_end)
1668 + {
1669 + flush_cache_vunmap(
1670 +- pcpu_chunk_addr(chunk, pcpu_first_unit_cpu, page_start),
1671 +- pcpu_chunk_addr(chunk, pcpu_last_unit_cpu, page_end));
1672 ++ pcpu_chunk_addr(chunk, pcpu_low_unit_cpu, page_start),
1673 ++ pcpu_chunk_addr(chunk, pcpu_high_unit_cpu, page_end));
1674 + }
1675 +
1676 + static void __pcpu_unmap_pages(unsigned long addr, int nr_pages)
1677 +@@ -206,8 +206,8 @@ static void pcpu_post_unmap_tlb_flush(struct pcpu_chunk *chunk,
1678 + int page_start, int page_end)
1679 + {
1680 + flush_tlb_kernel_range(
1681 +- pcpu_chunk_addr(chunk, pcpu_first_unit_cpu, page_start),
1682 +- pcpu_chunk_addr(chunk, pcpu_last_unit_cpu, page_end));
1683 ++ pcpu_chunk_addr(chunk, pcpu_low_unit_cpu, page_start),
1684 ++ pcpu_chunk_addr(chunk, pcpu_high_unit_cpu, page_end));
1685 + }
1686 +
1687 + static int __pcpu_map_pages(unsigned long addr, struct page **pages,
1688 +@@ -284,8 +284,8 @@ static void pcpu_post_map_flush(struct pcpu_chunk *chunk,
1689 + int page_start, int page_end)
1690 + {
1691 + flush_cache_vmap(
1692 +- pcpu_chunk_addr(chunk, pcpu_first_unit_cpu, page_start),
1693 +- pcpu_chunk_addr(chunk, pcpu_last_unit_cpu, page_end));
1694 ++ pcpu_chunk_addr(chunk, pcpu_low_unit_cpu, page_start),
1695 ++ pcpu_chunk_addr(chunk, pcpu_high_unit_cpu, page_end));
1696 + }
1697 +
1698 + /**
1699 +diff --git a/mm/percpu.c b/mm/percpu.c
1700 +index bf80e55..93b5a7c 100644
1701 +--- a/mm/percpu.c
1702 ++++ b/mm/percpu.c
1703 +@@ -116,9 +116,9 @@ static int pcpu_atom_size __read_mostly;
1704 + static int pcpu_nr_slots __read_mostly;
1705 + static size_t pcpu_chunk_struct_size __read_mostly;
1706 +
1707 +-/* cpus with the lowest and highest unit numbers */
1708 +-static unsigned int pcpu_first_unit_cpu __read_mostly;
1709 +-static unsigned int pcpu_last_unit_cpu __read_mostly;
1710 ++/* cpus with the lowest and highest unit addresses */
1711 ++static unsigned int pcpu_low_unit_cpu __read_mostly;
1712 ++static unsigned int pcpu_high_unit_cpu __read_mostly;
1713 +
1714 + /* the address of the first chunk which starts with the kernel static area */
1715 + void *pcpu_base_addr __read_mostly;
1716 +@@ -984,19 +984,19 @@ phys_addr_t per_cpu_ptr_to_phys(void *addr)
1717 + {
1718 + void __percpu *base = __addr_to_pcpu_ptr(pcpu_base_addr);
1719 + bool in_first_chunk = false;
1720 +- unsigned long first_start, first_end;
1721 ++ unsigned long first_low, first_high;
1722 + unsigned int cpu;
1723 +
1724 + /*
1725 +- * The following test on first_start/end isn't strictly
1726 ++ * The following test on unit_low/high isn't strictly
1727 + * necessary but will speed up lookups of addresses which
1728 + * aren't in the first chunk.
1729 + */
1730 +- first_start = pcpu_chunk_addr(pcpu_first_chunk, pcpu_first_unit_cpu, 0);
1731 +- first_end = pcpu_chunk_addr(pcpu_first_chunk, pcpu_last_unit_cpu,
1732 +- pcpu_unit_pages);
1733 +- if ((unsigned long)addr >= first_start &&
1734 +- (unsigned long)addr < first_end) {
1735 ++ first_low = pcpu_chunk_addr(pcpu_first_chunk, pcpu_low_unit_cpu, 0);
1736 ++ first_high = pcpu_chunk_addr(pcpu_first_chunk, pcpu_high_unit_cpu,
1737 ++ pcpu_unit_pages);
1738 ++ if ((unsigned long)addr >= first_low &&
1739 ++ (unsigned long)addr < first_high) {
1740 + for_each_possible_cpu(cpu) {
1741 + void *start = per_cpu_ptr(base, cpu);
1742 +
1743 +@@ -1233,7 +1233,9 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
1744 +
1745 + for (cpu = 0; cpu < nr_cpu_ids; cpu++)
1746 + unit_map[cpu] = UINT_MAX;
1747 +- pcpu_first_unit_cpu = NR_CPUS;
1748 ++
1749 ++ pcpu_low_unit_cpu = NR_CPUS;
1750 ++ pcpu_high_unit_cpu = NR_CPUS;
1751 +
1752 + for (group = 0, unit = 0; group < ai->nr_groups; group++, unit += i) {
1753 + const struct pcpu_group_info *gi = &ai->groups[group];
1754 +@@ -1253,9 +1255,13 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
1755 + unit_map[cpu] = unit + i;
1756 + unit_off[cpu] = gi->base_offset + i * ai->unit_size;
1757 +
1758 +- if (pcpu_first_unit_cpu == NR_CPUS)
1759 +- pcpu_first_unit_cpu = cpu;
1760 +- pcpu_last_unit_cpu = cpu;
1761 ++ /* determine low/high unit_cpu */
1762 ++ if (pcpu_low_unit_cpu == NR_CPUS ||
1763 ++ unit_off[cpu] < unit_off[pcpu_low_unit_cpu])
1764 ++ pcpu_low_unit_cpu = cpu;
1765 ++ if (pcpu_high_unit_cpu == NR_CPUS ||
1766 ++ unit_off[cpu] > unit_off[pcpu_high_unit_cpu])
1767 ++ pcpu_high_unit_cpu = cpu;
1768 + }
1769 + }
1770 + pcpu_nr_units = unit;
1771 +diff --git a/mm/vmalloc.c b/mm/vmalloc.c
1772 +index 56faf31..3a65d6f7 100644
1773 +--- a/mm/vmalloc.c
1774 ++++ b/mm/vmalloc.c
1775 +@@ -1634,6 +1634,8 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
1776 + return NULL;
1777 +
1778 + addr = __vmalloc_area_node(area, gfp_mask, prot, node, caller);
1779 ++ if (!addr)
1780 ++ return NULL;
1781 +
1782 + /*
1783 + * In this function, newly allocated vm_struct is not added
1784 +diff --git a/security/apparmor/path.c b/security/apparmor/path.c
1785 +index 36cc0cc..b566eba 100644
1786 +--- a/security/apparmor/path.c
1787 ++++ b/security/apparmor/path.c
1788 +@@ -57,23 +57,44 @@ static int prepend(char **buffer, int buflen, const char *str, int namelen)
1789 + static int d_namespace_path(struct path *path, char *buf, int buflen,
1790 + char **name, int flags)
1791 + {
1792 +- struct path root, tmp;
1793 + char *res;
1794 +- int connected, error = 0;
1795 ++ int error = 0;
1796 ++ int connected = 1;
1797 ++
1798 ++ if (path->mnt->mnt_flags & MNT_INTERNAL) {
1799 ++ /* it's not mounted anywhere */
1800 ++ res = dentry_path(path->dentry, buf, buflen);
1801 ++ *name = res;
1802 ++ if (IS_ERR(res)) {
1803 ++ *name = buf;
1804 ++ return PTR_ERR(res);
1805 ++ }
1806 ++ if (path->dentry->d_sb->s_magic == PROC_SUPER_MAGIC &&
1807 ++ strncmp(*name, "/sys/", 5) == 0) {
1808 ++ /* TODO: convert over to using a per namespace
1809 ++ * control instead of hard coded /proc
1810 ++ */
1811 ++ return prepend(name, *name - buf, "/proc", 5);
1812 ++ }
1813 ++ return 0;
1814 ++ }
1815 +
1816 +- /* Get the root we want to resolve too, released below */
1817 ++ /* resolve paths relative to chroot?*/
1818 + if (flags & PATH_CHROOT_REL) {
1819 +- /* resolve paths relative to chroot */
1820 ++ struct path root;
1821 + get_fs_root(current->fs, &root);
1822 +- } else {
1823 +- /* resolve paths relative to namespace */
1824 +- root.mnt = current->nsproxy->mnt_ns->root;
1825 +- root.dentry = root.mnt->mnt_root;
1826 +- path_get(&root);
1827 ++ res = __d_path(path, &root, buf, buflen);
1828 ++ if (res && !IS_ERR(res)) {
1829 ++ /* everything's fine */
1830 ++ *name = res;
1831 ++ path_put(&root);
1832 ++ goto ok;
1833 ++ }
1834 ++ path_put(&root);
1835 ++ connected = 0;
1836 + }
1837 +
1838 +- tmp = root;
1839 +- res = __d_path(path, &tmp, buf, buflen);
1840 ++ res = d_absolute_path(path, buf, buflen);
1841 +
1842 + *name = res;
1843 + /* handle error conditions - and still allow a partial path to
1844 +@@ -84,7 +105,10 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
1845 + *name = buf;
1846 + goto out;
1847 + }
1848 ++ if (!our_mnt(path->mnt))
1849 ++ connected = 0;
1850 +
1851 ++ok:
1852 + /* Handle two cases:
1853 + * 1. A deleted dentry && profile is not allowing mediation of deleted
1854 + * 2. On some filesystems, newly allocated dentries appear to the
1855 +@@ -97,10 +121,7 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
1856 + goto out;
1857 + }
1858 +
1859 +- /* Determine if the path is connected to the expected root */
1860 +- connected = tmp.dentry == root.dentry && tmp.mnt == root.mnt;
1861 +-
1862 +- /* If the path is not connected,
1863 ++ /* If the path is not connected to the expected root,
1864 + * check if it is a sysctl and handle specially else remove any
1865 + * leading / that __d_path may have returned.
1866 + * Unless
1867 +@@ -112,17 +133,9 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
1868 + * namespace root.
1869 + */
1870 + if (!connected) {
1871 +- /* is the disconnect path a sysctl? */
1872 +- if (tmp.dentry->d_sb->s_magic == PROC_SUPER_MAGIC &&
1873 +- strncmp(*name, "/sys/", 5) == 0) {
1874 +- /* TODO: convert over to using a per namespace
1875 +- * control instead of hard coded /proc
1876 +- */
1877 +- error = prepend(name, *name - buf, "/proc", 5);
1878 +- } else if (!(flags & PATH_CONNECT_PATH) &&
1879 ++ if (!(flags & PATH_CONNECT_PATH) &&
1880 + !(((flags & CHROOT_NSCONNECT) == CHROOT_NSCONNECT) &&
1881 +- (tmp.mnt == current->nsproxy->mnt_ns->root &&
1882 +- tmp.dentry == tmp.mnt->mnt_root))) {
1883 ++ our_mnt(path->mnt))) {
1884 + /* disconnected path, don't return pathname starting
1885 + * with '/'
1886 + */
1887 +@@ -133,8 +146,6 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
1888 + }
1889 +
1890 + out:
1891 +- path_put(&root);
1892 +-
1893 + return error;
1894 + }
1895 +
1896 +diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c
1897 +index 6c601bd..d46922d 100644
1898 +--- a/security/tomoyo/realpath.c
1899 ++++ b/security/tomoyo/realpath.c
1900 +@@ -83,9 +83,8 @@ static char *tomoyo_get_absolute_path(struct path *path, char * const buffer,
1901 + {
1902 + char *pos = ERR_PTR(-ENOMEM);
1903 + if (buflen >= 256) {
1904 +- struct path ns_root = { };
1905 + /* go to whatever namespace root we are under */
1906 +- pos = __d_path(path, &ns_root, buffer, buflen - 1);
1907 ++ pos = d_absolute_path(path, buffer, buflen - 1);
1908 + if (!IS_ERR(pos) && *pos == '/' && pos[1]) {
1909 + struct inode *inode = path->dentry->d_inode;
1910 + if (inode && S_ISDIR(inode->i_mode)) {
1911 +@@ -276,8 +275,16 @@ char *tomoyo_realpath_from_path(struct path *path)
1912 + pos = tomoyo_get_local_path(path->dentry, buf,
1913 + buf_len - 1);
1914 + /* Get absolute name for the rest. */
1915 +- else
1916 ++ else {
1917 + pos = tomoyo_get_absolute_path(path, buf, buf_len - 1);
1918 ++ /*
1919 ++ * Fall back to local name if absolute name is not
1920 ++ * available.
1921 ++ */
1922 ++ if (pos == ERR_PTR(-EINVAL))
1923 ++ pos = tomoyo_get_local_path(path->dentry, buf,
1924 ++ buf_len - 1);
1925 ++ }
1926 + encode:
1927 + if (IS_ERR(pos))
1928 + continue;
1929 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1930 +index c687e14..20d92074 100644
1931 +--- a/sound/pci/hda/patch_realtek.c
1932 ++++ b/sound/pci/hda/patch_realtek.c
1933 +@@ -280,6 +280,8 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,
1934 + imux = &spec->input_mux[mux_idx];
1935 + if (!imux->num_items && mux_idx > 0)
1936 + imux = &spec->input_mux[0];
1937 ++ if (!imux->num_items)
1938 ++ return 0;
1939 +
1940 + if (idx >= imux->num_items)
1941 + idx = imux->num_items - 1;
1942 +diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
1943 +index 4538caa..5261fd8 100644
1944 +--- a/sound/pci/hda/patch_sigmatel.c
1945 ++++ b/sound/pci/hda/patch_sigmatel.c
1946 +@@ -214,6 +214,7 @@ struct sigmatel_spec {
1947 + unsigned int gpio_mute;
1948 + unsigned int gpio_led;
1949 + unsigned int gpio_led_polarity;
1950 ++ unsigned int vref_mute_led_nid; /* pin NID for mute-LED vref control */
1951 + unsigned int vref_led;
1952 +
1953 + /* stream */
1954 +@@ -4298,12 +4299,10 @@ static void stac_store_hints(struct hda_codec *codec)
1955 + spec->eapd_switch = val;
1956 + get_int_hint(codec, "gpio_led_polarity", &spec->gpio_led_polarity);
1957 + if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) {
1958 +- if (spec->gpio_led <= 8) {
1959 +- spec->gpio_mask |= spec->gpio_led;
1960 +- spec->gpio_dir |= spec->gpio_led;
1961 +- if (spec->gpio_led_polarity)
1962 +- spec->gpio_data |= spec->gpio_led;
1963 +- }
1964 ++ spec->gpio_mask |= spec->gpio_led;
1965 ++ spec->gpio_dir |= spec->gpio_led;
1966 ++ if (spec->gpio_led_polarity)
1967 ++ spec->gpio_data |= spec->gpio_led;
1968 + }
1969 + }
1970 +
1971 +@@ -4893,8 +4892,14 @@ static int find_mute_led_gpio(struct hda_codec *codec, int default_polarity)
1972 + if (sscanf(dev->name, "HP_Mute_LED_%d_%x",
1973 + &spec->gpio_led_polarity,
1974 + &spec->gpio_led) == 2) {
1975 +- if (spec->gpio_led < 4)
1976 ++ unsigned int max_gpio;
1977 ++ max_gpio = snd_hda_param_read(codec, codec->afg,
1978 ++ AC_PAR_GPIO_CAP);
1979 ++ max_gpio &= AC_GPIO_IO_COUNT;
1980 ++ if (spec->gpio_led < max_gpio)
1981 + spec->gpio_led = 1 << spec->gpio_led;
1982 ++ else
1983 ++ spec->vref_mute_led_nid = spec->gpio_led;
1984 + return 1;
1985 + }
1986 + if (sscanf(dev->name, "HP_Mute_LED_%d",
1987 +@@ -5023,15 +5028,12 @@ static int stac92xx_pre_resume(struct hda_codec *codec)
1988 + struct sigmatel_spec *spec = codec->spec;
1989 +
1990 + /* sync mute LED */
1991 +- if (spec->gpio_led) {
1992 +- if (spec->gpio_led <= 8) {
1993 +- stac_gpio_set(codec, spec->gpio_mask,
1994 +- spec->gpio_dir, spec->gpio_data);
1995 +- } else {
1996 +- stac_vrefout_set(codec,
1997 +- spec->gpio_led, spec->vref_led);
1998 +- }
1999 +- }
2000 ++ if (spec->vref_mute_led_nid)
2001 ++ stac_vrefout_set(codec, spec->vref_mute_led_nid,
2002 ++ spec->vref_led);
2003 ++ else if (spec->gpio_led)
2004 ++ stac_gpio_set(codec, spec->gpio_mask,
2005 ++ spec->gpio_dir, spec->gpio_data);
2006 + return 0;
2007 + }
2008 +
2009 +@@ -5042,7 +5044,7 @@ static void stac92xx_set_power_state(struct hda_codec *codec, hda_nid_t fg,
2010 + struct sigmatel_spec *spec = codec->spec;
2011 +
2012 + if (power_state == AC_PWRST_D3) {
2013 +- if (spec->gpio_led > 8) {
2014 ++ if (spec->vref_mute_led_nid) {
2015 + /* with vref-out pin used for mute led control
2016 + * codec AFG is prevented from D3 state
2017 + */
2018 +@@ -5095,7 +5097,7 @@ static int stac92xx_update_led_status(struct hda_codec *codec)
2019 + }
2020 + }
2021 + /*polarity defines *not* muted state level*/
2022 +- if (spec->gpio_led <= 8) {
2023 ++ if (!spec->vref_mute_led_nid) {
2024 + if (muted)
2025 + spec->gpio_data &= ~spec->gpio_led; /* orange */
2026 + else
2027 +@@ -5113,7 +5115,8 @@ static int stac92xx_update_led_status(struct hda_codec *codec)
2028 + muted_lvl = spec->gpio_led_polarity ?
2029 + AC_PINCTL_VREF_GRD : AC_PINCTL_VREF_HIZ;
2030 + spec->vref_led = muted ? muted_lvl : notmtd_lvl;
2031 +- stac_vrefout_set(codec, spec->gpio_led, spec->vref_led);
2032 ++ stac_vrefout_set(codec, spec->vref_mute_led_nid,
2033 ++ spec->vref_led);
2034 + }
2035 + return 0;
2036 + }
2037 +@@ -5634,7 +5637,7 @@ again:
2038 +
2039 + #ifdef CONFIG_SND_HDA_POWER_SAVE
2040 + if (spec->gpio_led) {
2041 +- if (spec->gpio_led <= 8) {
2042 ++ if (!spec->vref_mute_led_nid) {
2043 + spec->gpio_mask |= spec->gpio_led;
2044 + spec->gpio_dir |= spec->gpio_led;
2045 + spec->gpio_data |= spec->gpio_led;
2046 +@@ -5955,7 +5958,7 @@ again:
2047 +
2048 + #ifdef CONFIG_SND_HDA_POWER_SAVE
2049 + if (spec->gpio_led) {
2050 +- if (spec->gpio_led <= 8) {
2051 ++ if (!spec->vref_mute_led_nid) {
2052 + spec->gpio_mask |= spec->gpio_led;
2053 + spec->gpio_dir |= spec->gpio_led;
2054 + spec->gpio_data |= spec->gpio_led;
2055 +diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c
2056 +index bcf6152..fdc78ad 100644
2057 +--- a/sound/pci/sis7019.c
2058 ++++ b/sound/pci/sis7019.c
2059 +@@ -41,6 +41,7 @@ MODULE_SUPPORTED_DEVICE("{{SiS,SiS7019 Audio Accelerator}}");
2060 + static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
2061 + static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
2062 + static int enable = 1;
2063 ++static int codecs = 1;
2064 +
2065 + module_param(index, int, 0444);
2066 + MODULE_PARM_DESC(index, "Index value for SiS7019 Audio Accelerator.");
2067 +@@ -48,6 +49,8 @@ module_param(id, charp, 0444);
2068 + MODULE_PARM_DESC(id, "ID string for SiS7019 Audio Accelerator.");
2069 + module_param(enable, bool, 0444);
2070 + MODULE_PARM_DESC(enable, "Enable SiS7019 Audio Accelerator.");
2071 ++module_param(codecs, int, 0444);
2072 ++MODULE_PARM_DESC(codecs, "Set bit to indicate that codec number is expected to be present (default 1)");
2073 +
2074 + static DEFINE_PCI_DEVICE_TABLE(snd_sis7019_ids) = {
2075 + { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x7019) },
2076 +@@ -140,6 +143,9 @@ struct sis7019 {
2077 + dma_addr_t silence_dma_addr;
2078 + };
2079 +
2080 ++/* These values are also used by the module param 'codecs' to indicate
2081 ++ * which codecs should be present.
2082 ++ */
2083 + #define SIS_PRIMARY_CODEC_PRESENT 0x0001
2084 + #define SIS_SECONDARY_CODEC_PRESENT 0x0002
2085 + #define SIS_TERTIARY_CODEC_PRESENT 0x0004
2086 +@@ -1078,6 +1084,7 @@ static int sis_chip_init(struct sis7019 *sis)
2087 + {
2088 + unsigned long io = sis->ioport;
2089 + void __iomem *ioaddr = sis->ioaddr;
2090 ++ unsigned long timeout;
2091 + u16 status;
2092 + int count;
2093 + int i;
2094 +@@ -1104,21 +1111,45 @@ static int sis_chip_init(struct sis7019 *sis)
2095 + while ((inw(io + SIS_AC97_STATUS) & SIS_AC97_STATUS_BUSY) && --count)
2096 + udelay(1);
2097 +
2098 ++ /* Command complete, we can let go of the semaphore now.
2099 ++ */
2100 ++ outl(SIS_AC97_SEMA_RELEASE, io + SIS_AC97_SEMA);
2101 ++ if (!count)
2102 ++ return -EIO;
2103 ++
2104 + /* Now that we've finished the reset, find out what's attached.
2105 ++ * There are some codec/board combinations that take an extremely
2106 ++ * long time to come up. 350+ ms has been observed in the field,
2107 ++ * so we'll give them up to 500ms.
2108 + */
2109 +- status = inl(io + SIS_AC97_STATUS);
2110 +- if (status & SIS_AC97_STATUS_CODEC_READY)
2111 +- sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT;
2112 +- if (status & SIS_AC97_STATUS_CODEC2_READY)
2113 +- sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT;
2114 +- if (status & SIS_AC97_STATUS_CODEC3_READY)
2115 +- sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT;
2116 +-
2117 +- /* All done, let go of the semaphore, and check for errors
2118 ++ sis->codecs_present = 0;
2119 ++ timeout = msecs_to_jiffies(500) + jiffies;
2120 ++ while (time_before_eq(jiffies, timeout)) {
2121 ++ status = inl(io + SIS_AC97_STATUS);
2122 ++ if (status & SIS_AC97_STATUS_CODEC_READY)
2123 ++ sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT;
2124 ++ if (status & SIS_AC97_STATUS_CODEC2_READY)
2125 ++ sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT;
2126 ++ if (status & SIS_AC97_STATUS_CODEC3_READY)
2127 ++ sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT;
2128 ++
2129 ++ if (sis->codecs_present == codecs)
2130 ++ break;
2131 ++
2132 ++ msleep(1);
2133 ++ }
2134 ++
2135 ++ /* All done, check for errors.
2136 + */
2137 +- outl(SIS_AC97_SEMA_RELEASE, io + SIS_AC97_SEMA);
2138 +- if (!sis->codecs_present || !count)
2139 ++ if (!sis->codecs_present) {
2140 ++ printk(KERN_ERR "sis7019: could not find any codecs\n");
2141 + return -EIO;
2142 ++ }
2143 ++
2144 ++ if (sis->codecs_present != codecs) {
2145 ++ printk(KERN_WARNING "sis7019: missing codecs, found %0x, expected %0x\n",
2146 ++ sis->codecs_present, codecs);
2147 ++ }
2148 +
2149 + /* Let the hardware know that the audio driver is alive,
2150 + * and enable PCM slots on the AC-link for L/R playback (3 & 4) and
2151 +@@ -1390,6 +1421,17 @@ static int __devinit snd_sis7019_probe(struct pci_dev *pci,
2152 + if (!enable)
2153 + goto error_out;
2154 +
2155 ++ /* The user can specify which codecs should be present so that we
2156 ++ * can wait for them to show up if they are slow to recover from
2157 ++ * the AC97 cold reset. We default to a single codec, the primary.
2158 ++ *
2159 ++ * We assume that SIS_PRIMARY_*_PRESENT matches bits 0-2.
2160 ++ */
2161 ++ codecs &= SIS_PRIMARY_CODEC_PRESENT | SIS_SECONDARY_CODEC_PRESENT |
2162 ++ SIS_TERTIARY_CODEC_PRESENT;
2163 ++ if (!codecs)
2164 ++ codecs = SIS_PRIMARY_CODEC_PRESENT;
2165 ++
2166 + rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card);
2167 + if (rc < 0)
2168 + goto error_out;
2169 +diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
2170 +index ec921ec..cd987de 100644
2171 +--- a/sound/soc/soc-utils.c
2172 ++++ b/sound/soc/soc-utils.c
2173 +@@ -57,7 +57,36 @@ int snd_soc_params_to_bclk(struct snd_pcm_hw_params *params)
2174 + }
2175 + EXPORT_SYMBOL_GPL(snd_soc_params_to_bclk);
2176 +
2177 +-static struct snd_soc_platform_driver dummy_platform;
2178 ++static const struct snd_pcm_hardware dummy_dma_hardware = {
2179 ++ .formats = 0xffffffff,
2180 ++ .channels_min = 1,
2181 ++ .channels_max = UINT_MAX,
2182 ++
2183 ++ /* Random values to keep userspace happy when checking constraints */
2184 ++ .info = SNDRV_PCM_INFO_INTERLEAVED |
2185 ++ SNDRV_PCM_INFO_BLOCK_TRANSFER,
2186 ++ .buffer_bytes_max = 128*1024,
2187 ++ .period_bytes_min = PAGE_SIZE,
2188 ++ .period_bytes_max = PAGE_SIZE*2,
2189 ++ .periods_min = 2,
2190 ++ .periods_max = 128,
2191 ++};
2192 ++
2193 ++static int dummy_dma_open(struct snd_pcm_substream *substream)
2194 ++{
2195 ++ snd_soc_set_runtime_hwparams(substream, &dummy_dma_hardware);
2196 ++
2197 ++ return 0;
2198 ++}
2199 ++
2200 ++static struct snd_pcm_ops dummy_dma_ops = {
2201 ++ .open = dummy_dma_open,
2202 ++ .ioctl = snd_pcm_lib_ioctl,
2203 ++};
2204 ++
2205 ++static struct snd_soc_platform_driver dummy_platform = {
2206 ++ .ops = &dummy_dma_ops,
2207 ++};
2208 +
2209 + static __devinit int snd_soc_dummy_probe(struct platform_device *pdev)
2210 + {