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