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