/[linux-patches]/genpatches-2.6/tags/3.0-30/1013_linux-3.0.14.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1013_linux-3.0.14.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (2 years, 8 months ago) by mpagano
File size: 64941 byte(s)
3.0-30 release
1 diff --git a/Makefile b/Makefile
2 index 5ccc962..f4f577b 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 0
8 -SUBLEVEL = 13
9 +SUBLEVEL = 14
10 EXTRAVERSION =
11 NAME = Sneaky Weasel
12
13 diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
14 index 7d606b0..eeb9478 100644
15 --- a/arch/arm/mach-at91/at91sam9260.c
16 +++ b/arch/arm/mach-at91/at91sam9260.c
17 @@ -237,9 +237,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
18 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
19 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
20 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
21 - CLKDEV_CON_DEV_ID("t3_clk", "atmel_tcb.1", &tc3_clk),
22 - CLKDEV_CON_DEV_ID("t4_clk", "atmel_tcb.1", &tc4_clk),
23 - CLKDEV_CON_DEV_ID("t5_clk", "atmel_tcb.1", &tc5_clk),
24 + CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk),
25 + CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
26 + CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
27 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk),
28 };
29
30 diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
31 index e83cc86..f893617 100644
32 --- a/arch/arm/mach-davinci/board-da850-evm.c
33 +++ b/arch/arm/mach-davinci/board-da850-evm.c
34 @@ -748,7 +748,7 @@ static struct snd_platform_data da850_evm_snd_data = {
35 .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction),
36 .tdm_slots = 2,
37 .serial_dir = da850_iis_serializer_direction,
38 - .asp_chan_q = EVENTQ_1,
39 + .asp_chan_q = EVENTQ_0,
40 .version = MCASP_VERSION_2,
41 .txnumevt = 1,
42 .rxnumevt = 1,
43 diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
44 index f6ac9ba..3cdd237 100644
45 --- a/arch/arm/mach-davinci/board-dm646x-evm.c
46 +++ b/arch/arm/mach-davinci/board-dm646x-evm.c
47 @@ -563,7 +563,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
48 int val;
49 u32 value;
50
51 - if (!vpif_vsclkdis_reg || !cpld_client)
52 + if (!vpif_vidclkctl_reg || !cpld_client)
53 return -ENXIO;
54
55 val = i2c_smbus_read_byte(cpld_client);
56 @@ -571,7 +571,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
57 return val;
58
59 spin_lock_irqsave(&vpif_reg_lock, flags);
60 - value = __raw_readl(vpif_vsclkdis_reg);
61 + value = __raw_readl(vpif_vidclkctl_reg);
62 if (mux_mode) {
63 val &= VPIF_INPUT_TWO_CHANNEL;
64 value |= VIDCH1CLK;
65 @@ -579,7 +579,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
66 val |= VPIF_INPUT_ONE_CHANNEL;
67 value &= ~VIDCH1CLK;
68 }
69 - __raw_writel(value, vpif_vsclkdis_reg);
70 + __raw_writel(value, vpif_vidclkctl_reg);
71 spin_unlock_irqrestore(&vpif_reg_lock, flags);
72
73 err = i2c_smbus_write_byte(cpld_client, val);
74 diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h
75 index 35a89dd..1332f73 100644
76 --- a/arch/arm/mach-mxs/include/mach/mxs.h
77 +++ b/arch/arm/mach-mxs/include/mach/mxs.h
78 @@ -30,6 +30,7 @@
79 */
80 #define cpu_is_mx23() ( \
81 machine_is_mx23evk() || \
82 + machine_is_stmp378x() || \
83 0)
84 #define cpu_is_mx28() ( \
85 machine_is_mx28evk() || \
86 diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
87 index 6781765..aa083d3 100644
88 --- a/arch/x86/kernel/hpet.c
89 +++ b/arch/x86/kernel/hpet.c
90 @@ -1054,6 +1054,14 @@ int hpet_rtc_timer_init(void)
91 }
92 EXPORT_SYMBOL_GPL(hpet_rtc_timer_init);
93
94 +static void hpet_disable_rtc_channel(void)
95 +{
96 + unsigned long cfg;
97 + cfg = hpet_readl(HPET_T1_CFG);
98 + cfg &= ~HPET_TN_ENABLE;
99 + hpet_writel(cfg, HPET_T1_CFG);
100 +}
101 +
102 /*
103 * The functions below are called from rtc driver.
104 * Return 0 if HPET is not being used.
105 @@ -1065,6 +1073,9 @@ int hpet_mask_rtc_irq_bit(unsigned long bit_mask)
106 return 0;
107
108 hpet_rtc_flags &= ~bit_mask;
109 + if (unlikely(!hpet_rtc_flags))
110 + hpet_disable_rtc_channel();
111 +
112 return 1;
113 }
114 EXPORT_SYMBOL_GPL(hpet_mask_rtc_irq_bit);
115 @@ -1130,15 +1141,11 @@ EXPORT_SYMBOL_GPL(hpet_rtc_dropped_irq);
116
117 static void hpet_rtc_timer_reinit(void)
118 {
119 - unsigned int cfg, delta;
120 + unsigned int delta;
121 int lost_ints = -1;
122
123 - if (unlikely(!hpet_rtc_flags)) {
124 - cfg = hpet_readl(HPET_T1_CFG);
125 - cfg &= ~HPET_TN_ENABLE;
126 - hpet_writel(cfg, HPET_T1_CFG);
127 - return;
128 - }
129 + if (unlikely(!hpet_rtc_flags))
130 + hpet_disable_rtc_channel();
131
132 if (!(hpet_rtc_flags & RTC_PIE) || hpet_pie_limit)
133 delta = hpet_default_delta;
134 diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
135 index ea30585..dd74e46 100644
136 --- a/arch/x86/mm/gup.c
137 +++ b/arch/x86/mm/gup.c
138 @@ -201,6 +201,8 @@ static noinline int gup_huge_pud(pud_t pud, unsigned long addr,
139 do {
140 VM_BUG_ON(compound_head(page) != head);
141 pages[*nr] = page;
142 + if (PageTail(page))
143 + get_huge_page_tail(page);
144 (*nr)++;
145 page++;
146 refs++;
147 diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
148 index acea42e..f8dcda4 100644
149 --- a/arch/x86/xen/setup.c
150 +++ b/arch/x86/xen/setup.c
151 @@ -192,9 +192,21 @@ static unsigned long __init xen_get_max_pages(void)
152 domid_t domid = DOMID_SELF;
153 int ret;
154
155 - ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid);
156 - if (ret > 0)
157 - max_pages = ret;
158 + /*
159 + * For the initial domain we use the maximum reservation as
160 + * the maximum page.
161 + *
162 + * For guest domains the current maximum reservation reflects
163 + * the current maximum rather than the static maximum. In this
164 + * case the e820 map provided to us will cover the static
165 + * maximum region.
166 + */
167 + if (xen_initial_domain()) {
168 + ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid);
169 + if (ret > 0)
170 + max_pages = ret;
171 + }
172 +
173 return min(max_pages, MAX_DOMAIN_PAGES);
174 }
175
176 diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
177 index ce33f46..2763643 100644
178 --- a/drivers/firmware/iscsi_ibft.c
179 +++ b/drivers/firmware/iscsi_ibft.c
180 @@ -738,6 +738,37 @@ static void __exit ibft_exit(void)
181 ibft_cleanup();
182 }
183
184 +#ifdef CONFIG_ACPI
185 +static const struct {
186 + char *sign;
187 +} ibft_signs[] = {
188 + /*
189 + * One spec says "IBFT", the other says "iBFT". We have to check
190 + * for both.
191 + */
192 + { ACPI_SIG_IBFT },
193 + { "iBFT" },
194 +};
195 +
196 +static void __init acpi_find_ibft_region(void)
197 +{
198 + int i;
199 + struct acpi_table_header *table = NULL;
200 +
201 + if (acpi_disabled)
202 + return;
203 +
204 + for (i = 0; i < ARRAY_SIZE(ibft_signs) && !ibft_addr; i++) {
205 + acpi_get_table(ibft_signs[i].sign, 0, &table);
206 + ibft_addr = (struct acpi_table_ibft *)table;
207 + }
208 +}
209 +#else
210 +static void __init acpi_find_ibft_region(void)
211 +{
212 +}
213 +#endif
214 +
215 /*
216 * ibft_init() - creates sysfs tree entries for the iBFT data.
217 */
218 @@ -745,9 +776,16 @@ static int __init ibft_init(void)
219 {
220 int rc = 0;
221
222 + /*
223 + As on UEFI systems the setup_arch()/find_ibft_region()
224 + is called before ACPI tables are parsed and it only does
225 + legacy finding.
226 + */
227 + if (!ibft_addr)
228 + acpi_find_ibft_region();
229 +
230 if (ibft_addr) {
231 - printk(KERN_INFO "iBFT detected at 0x%llx.\n",
232 - (u64)isa_virt_to_bus(ibft_addr));
233 + pr_info("iBFT detected.\n");
234
235 rc = ibft_check_device();
236 if (rc)
237 diff --git a/drivers/firmware/iscsi_ibft_find.c b/drivers/firmware/iscsi_ibft_find.c
238 index bfe7232..4da4eb9 100644
239 --- a/drivers/firmware/iscsi_ibft_find.c
240 +++ b/drivers/firmware/iscsi_ibft_find.c
241 @@ -45,13 +45,6 @@ EXPORT_SYMBOL_GPL(ibft_addr);
242 static const struct {
243 char *sign;
244 } ibft_signs[] = {
245 -#ifdef CONFIG_ACPI
246 - /*
247 - * One spec says "IBFT", the other says "iBFT". We have to check
248 - * for both.
249 - */
250 - { ACPI_SIG_IBFT },
251 -#endif
252 { "iBFT" },
253 { "BIFT" }, /* Broadcom iSCSI Offload */
254 };
255 @@ -62,14 +55,6 @@ static const struct {
256 #define VGA_MEM 0xA0000 /* VGA buffer */
257 #define VGA_SIZE 0x20000 /* 128kB */
258
259 -#ifdef CONFIG_ACPI
260 -static int __init acpi_find_ibft(struct acpi_table_header *header)
261 -{
262 - ibft_addr = (struct acpi_table_ibft *)header;
263 - return 0;
264 -}
265 -#endif /* CONFIG_ACPI */
266 -
267 static int __init find_ibft_in_mem(void)
268 {
269 unsigned long pos;
270 @@ -94,6 +79,7 @@ static int __init find_ibft_in_mem(void)
271 * the table cannot be valid. */
272 if (pos + len <= (IBFT_END-1)) {
273 ibft_addr = (struct acpi_table_ibft *)virt;
274 + pr_info("iBFT found at 0x%lx.\n", pos);
275 goto done;
276 }
277 }
278 @@ -108,20 +94,12 @@ done:
279 */
280 unsigned long __init find_ibft_region(unsigned long *sizep)
281 {
282 -#ifdef CONFIG_ACPI
283 - int i;
284 -#endif
285 ibft_addr = NULL;
286
287 -#ifdef CONFIG_ACPI
288 - for (i = 0; i < ARRAY_SIZE(ibft_signs) && !ibft_addr; i++)
289 - acpi_table_parse(ibft_signs[i].sign, acpi_find_ibft);
290 -#endif /* CONFIG_ACPI */
291 -
292 /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will
293 * only use ACPI for this */
294
295 - if (!ibft_addr && !efi_enabled)
296 + if (!efi_enabled)
297 find_ibft_in_mem();
298
299 if (ibft_addr) {
300 diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
301 index 835ae42..6163cfa 100644
302 --- a/drivers/hwmon/coretemp.c
303 +++ b/drivers/hwmon/coretemp.c
304 @@ -747,6 +747,8 @@ static void __cpuinit put_core_offline(unsigned int cpu)
305 return;
306
307 pdata = platform_get_drvdata(pdev);
308 + if (!pdata)
309 + return;
310
311 indx = TO_ATTR_NO(cpu);
312
313 diff --git a/drivers/hwmon/jz4740-hwmon.c b/drivers/hwmon/jz4740-hwmon.c
314 index fea292d..b65a4da 100644
315 --- a/drivers/hwmon/jz4740-hwmon.c
316 +++ b/drivers/hwmon/jz4740-hwmon.c
317 @@ -59,7 +59,7 @@ static ssize_t jz4740_hwmon_read_adcin(struct device *dev,
318 {
319 struct jz4740_hwmon *hwmon = dev_get_drvdata(dev);
320 struct completion *completion = &hwmon->read_completion;
321 - unsigned long t;
322 + long t;
323 unsigned long val;
324 int ret;
325
326 diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
327 index cbb50d3..1f6c68d 100644
328 --- a/drivers/md/raid5.c
329 +++ b/drivers/md/raid5.c
330 @@ -3078,7 +3078,7 @@ static void handle_stripe5(struct stripe_head *sh)
331 /* Not in-sync */;
332 else if (test_bit(In_sync, &rdev->flags))
333 set_bit(R5_Insync, &dev->flags);
334 - else {
335 + else if (!test_bit(Faulty, &rdev->flags)) {
336 /* could be in-sync depending on recovery/reshape status */
337 if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset)
338 set_bit(R5_Insync, &dev->flags);
339 diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
340 index cc20e02..e12fbc5 100644
341 --- a/drivers/mmc/host/mxcmmc.c
342 +++ b/drivers/mmc/host/mxcmmc.c
343 @@ -731,6 +731,7 @@ static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
344 "failed to config DMA channel. Falling back to PIO\n");
345 dma_release_channel(host->dma);
346 host->do_dma = 0;
347 + host->dma = NULL;
348 }
349 }
350
351 diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
352 index 09f679d..b849ad7 100644
353 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
354 +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
355 @@ -411,6 +411,24 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
356 return 0;
357 }
358
359 +void iwlagn_config_ht40(struct ieee80211_conf *conf,
360 + struct iwl_rxon_context *ctx)
361 +{
362 + if (conf_is_ht40_minus(conf)) {
363 + ctx->ht.extension_chan_offset =
364 + IEEE80211_HT_PARAM_CHA_SEC_BELOW;
365 + ctx->ht.is_40mhz = true;
366 + } else if (conf_is_ht40_plus(conf)) {
367 + ctx->ht.extension_chan_offset =
368 + IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
369 + ctx->ht.is_40mhz = true;
370 + } else {
371 + ctx->ht.extension_chan_offset =
372 + IEEE80211_HT_PARAM_CHA_SEC_NONE;
373 + ctx->ht.is_40mhz = false;
374 + }
375 +}
376 +
377 int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
378 {
379 struct iwl_priv *priv = hw->priv;
380 @@ -470,19 +488,11 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
381 ctx->ht.enabled = conf_is_ht(conf);
382
383 if (ctx->ht.enabled) {
384 - if (conf_is_ht40_minus(conf)) {
385 - ctx->ht.extension_chan_offset =
386 - IEEE80211_HT_PARAM_CHA_SEC_BELOW;
387 - ctx->ht.is_40mhz = true;
388 - } else if (conf_is_ht40_plus(conf)) {
389 - ctx->ht.extension_chan_offset =
390 - IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
391 - ctx->ht.is_40mhz = true;
392 - } else {
393 - ctx->ht.extension_chan_offset =
394 - IEEE80211_HT_PARAM_CHA_SEC_NONE;
395 - ctx->ht.is_40mhz = false;
396 - }
397 + /* if HT40 is used, it should not change
398 + * after associated except channel switch */
399 + if (iwl_is_associated_ctx(ctx) &&
400 + !ctx->ht.is_40mhz)
401 + iwlagn_config_ht40(conf, ctx);
402 } else
403 ctx->ht.is_40mhz = false;
404
405 diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
406 index baec52d..67d4c2d 100644
407 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c
408 +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
409 @@ -2872,21 +2872,9 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
410
411 /* Configure HT40 channels */
412 ctx->ht.enabled = conf_is_ht(conf);
413 - if (ctx->ht.enabled) {
414 - if (conf_is_ht40_minus(conf)) {
415 - ctx->ht.extension_chan_offset =
416 - IEEE80211_HT_PARAM_CHA_SEC_BELOW;
417 - ctx->ht.is_40mhz = true;
418 - } else if (conf_is_ht40_plus(conf)) {
419 - ctx->ht.extension_chan_offset =
420 - IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
421 - ctx->ht.is_40mhz = true;
422 - } else {
423 - ctx->ht.extension_chan_offset =
424 - IEEE80211_HT_PARAM_CHA_SEC_NONE;
425 - ctx->ht.is_40mhz = false;
426 - }
427 - } else
428 + if (ctx->ht.enabled)
429 + iwlagn_config_ht40(conf, ctx);
430 + else
431 ctx->ht.is_40mhz = false;
432
433 if ((le16_to_cpu(ctx->staging.channel) != ch))
434 diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
435 index d171684..5a0acab 100644
436 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h
437 +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
438 @@ -152,6 +152,8 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
439 struct ieee80211_vif *vif,
440 struct ieee80211_bss_conf *bss_conf,
441 u32 changes);
442 +void iwlagn_config_ht40(struct ieee80211_conf *conf,
443 + struct iwl_rxon_context *ctx);
444
445 /* uCode */
446 void iwlagn_rx_calib_result(struct iwl_priv *priv,
447 diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
448 index f02c34d..0ec8930 100644
449 --- a/drivers/pci/intel-iommu.c
450 +++ b/drivers/pci/intel-iommu.c
451 @@ -307,6 +307,11 @@ static inline bool dma_pte_present(struct dma_pte *pte)
452 return (pte->val & 3) != 0;
453 }
454
455 +static inline bool dma_pte_superpage(struct dma_pte *pte)
456 +{
457 + return (pte->val & (1 << 7));
458 +}
459 +
460 static inline int first_pte_in_page(struct dma_pte *pte)
461 {
462 return !((unsigned long)pte & ~VTD_PAGE_MASK);
463 @@ -578,17 +583,18 @@ static void domain_update_iommu_snooping(struct dmar_domain *domain)
464
465 static void domain_update_iommu_superpage(struct dmar_domain *domain)
466 {
467 - int i, mask = 0xf;
468 + struct dmar_drhd_unit *drhd;
469 + struct intel_iommu *iommu = NULL;
470 + int mask = 0xf;
471
472 if (!intel_iommu_superpage) {
473 domain->iommu_superpage = 0;
474 return;
475 }
476
477 - domain->iommu_superpage = 4; /* 1TiB */
478 -
479 - for_each_set_bit(i, &domain->iommu_bmp, g_num_of_iommus) {
480 - mask |= cap_super_page_val(g_iommus[i]->cap);
481 + /* set iommu_superpage to the smallest common denominator */
482 + for_each_active_iommu(iommu, drhd) {
483 + mask &= cap_super_page_val(iommu->cap);
484 if (!mask) {
485 break;
486 }
487 @@ -731,29 +737,23 @@ out:
488 }
489
490 static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain,
491 - unsigned long pfn, int large_level)
492 + unsigned long pfn, int target_level)
493 {
494 int addr_width = agaw_to_width(domain->agaw) - VTD_PAGE_SHIFT;
495 struct dma_pte *parent, *pte = NULL;
496 int level = agaw_to_level(domain->agaw);
497 - int offset, target_level;
498 + int offset;
499
500 BUG_ON(!domain->pgd);
501 BUG_ON(addr_width < BITS_PER_LONG && pfn >> addr_width);
502 parent = domain->pgd;
503
504 - /* Search pte */
505 - if (!large_level)
506 - target_level = 1;
507 - else
508 - target_level = large_level;
509 -
510 while (level > 0) {
511 void *tmp_page;
512
513 offset = pfn_level_offset(pfn, level);
514 pte = &parent[offset];
515 - if (!large_level && (pte->val & DMA_PTE_LARGE_PAGE))
516 + if (!target_level && (dma_pte_superpage(pte) || !dma_pte_present(pte)))
517 break;
518 if (level == target_level)
519 break;
520 @@ -817,13 +817,14 @@ static struct dma_pte *dma_pfn_level_pte(struct dmar_domain *domain,
521 }
522
523 /* clear last level pte, a tlb flush should be followed */
524 -static void dma_pte_clear_range(struct dmar_domain *domain,
525 +static int dma_pte_clear_range(struct dmar_domain *domain,
526 unsigned long start_pfn,
527 unsigned long last_pfn)
528 {
529 int addr_width = agaw_to_width(domain->agaw) - VTD_PAGE_SHIFT;
530 unsigned int large_page = 1;
531 struct dma_pte *first_pte, *pte;
532 + int order;
533
534 BUG_ON(addr_width < BITS_PER_LONG && start_pfn >> addr_width);
535 BUG_ON(addr_width < BITS_PER_LONG && last_pfn >> addr_width);
536 @@ -847,6 +848,9 @@ static void dma_pte_clear_range(struct dmar_domain *domain,
537 (void *)pte - (void *)first_pte);
538
539 } while (start_pfn && start_pfn <= last_pfn);
540 +
541 + order = (large_page - 1) * 9;
542 + return order;
543 }
544
545 /* free page table pages. last level pte should already be cleared */
546 @@ -3740,6 +3744,7 @@ static int intel_iommu_domain_init(struct iommu_domain *domain)
547 vm_domain_exit(dmar_domain);
548 return -ENOMEM;
549 }
550 + domain_update_iommu_cap(dmar_domain);
551 domain->priv = dmar_domain;
552
553 return 0;
554 @@ -3865,14 +3870,15 @@ static int intel_iommu_unmap(struct iommu_domain *domain,
555 {
556 struct dmar_domain *dmar_domain = domain->priv;
557 size_t size = PAGE_SIZE << gfp_order;
558 + int order;
559
560 - dma_pte_clear_range(dmar_domain, iova >> VTD_PAGE_SHIFT,
561 + order = dma_pte_clear_range(dmar_domain, iova >> VTD_PAGE_SHIFT,
562 (iova + size - 1) >> VTD_PAGE_SHIFT);
563
564 if (dmar_domain->max_addr == iova + size)
565 dmar_domain->max_addr = iova;
566
567 - return gfp_order;
568 + return order;
569 }
570
571 static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain,
572 diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
573 index cf3f999..10451a1 100644
574 --- a/drivers/ptp/ptp_clock.c
575 +++ b/drivers/ptp/ptp_clock.c
576 @@ -101,7 +101,9 @@ static s32 scaled_ppm_to_ppb(long ppm)
577
578 static int ptp_clock_getres(struct posix_clock *pc, struct timespec *tp)
579 {
580 - return 1; /* always round timer functions to one nanosecond */
581 + tp->tv_sec = 0;
582 + tp->tv_nsec = 1;
583 + return 0;
584 }
585
586 static int ptp_clock_settime(struct posix_clock *pc, const struct timespec *tp)
587 diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
588 index 21ce2af..6cb7e28 100644
589 --- a/drivers/staging/rtl8712/usb_intf.c
590 +++ b/drivers/staging/rtl8712/usb_intf.c
591 @@ -86,6 +86,7 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = {
592 {USB_DEVICE(0x0DF6, 0x0045)},
593 {USB_DEVICE(0x0DF6, 0x0059)}, /* 11n mode disable */
594 {USB_DEVICE(0x0DF6, 0x004B)},
595 + {USB_DEVICE(0x0DF6, 0x005D)},
596 {USB_DEVICE(0x0DF6, 0x0063)},
597 /* Sweex */
598 {USB_DEVICE(0x177F, 0x0154)},
599 diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
600 index 4b9b716..1340ffd 100644
601 --- a/drivers/target/target_core_transport.c
602 +++ b/drivers/target/target_core_transport.c
603 @@ -2777,10 +2777,15 @@ static inline u32 transport_get_sectors_6(
604
605 /*
606 * Everything else assume TYPE_DISK Sector CDB location.
607 - * Use 8-bit sector value.
608 + * Use 8-bit sector value. SBC-3 says:
609 + *
610 + * A TRANSFER LENGTH field set to zero specifies that 256
611 + * logical blocks shall be written. Any other value
612 + * specifies the number of logical blocks that shall be
613 + * written.
614 */
615 type_disk:
616 - return (u32)cdb[4];
617 + return cdb[4] ? : 256;
618 }
619
620 static inline u32 transport_get_sectors_10(
621 diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
622 index 2ffcaa0..8faa23c 100644
623 --- a/drivers/usb/class/cdc-acm.c
624 +++ b/drivers/usb/class/cdc-acm.c
625 @@ -1458,6 +1458,16 @@ static const struct usb_device_id acm_ids[] = {
626 },
627 { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */
628 },
629 + /* Motorola H24 HSPA module: */
630 + { USB_DEVICE(0x22b8, 0x2d91) }, /* modem */
631 + { USB_DEVICE(0x22b8, 0x2d92) }, /* modem + diagnostics */
632 + { USB_DEVICE(0x22b8, 0x2d93) }, /* modem + AT port */
633 + { USB_DEVICE(0x22b8, 0x2d95) }, /* modem + AT port + diagnostics */
634 + { USB_DEVICE(0x22b8, 0x2d96) }, /* modem + NMEA */
635 + { USB_DEVICE(0x22b8, 0x2d97) }, /* modem + diagnostics + NMEA */
636 + { USB_DEVICE(0x22b8, 0x2d99) }, /* modem + AT port + NMEA */
637 + { USB_DEVICE(0x22b8, 0x2d9a) }, /* modem + AT port + diagnostics + NMEA */
638 +
639 { USB_DEVICE(0x0572, 0x1329), /* Hummingbird huc56s (Conexant) */
640 .driver_info = NO_UNION_NORMAL, /* union descriptor misplaced on
641 data interface instead of
642 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
643 index e98a1e1..d2becb9 100644
644 --- a/drivers/usb/serial/option.c
645 +++ b/drivers/usb/serial/option.c
646 @@ -659,7 +659,12 @@ static const struct usb_device_id option_ids[] = {
647 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x01) },
648 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x02) },
649 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x03) },
650 - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x08) },
651 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x10) },
652 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x12) },
653 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x13) },
654 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x01) }, /* E398 3G Modem */
655 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x02) }, /* E398 3G PC UI Interface */
656 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x03) }, /* E398 3G Application Interface */
657 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) },
658 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) },
659 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) },
660 diff --git a/fs/dcache.c b/fs/dcache.c
661 index fbdcbca..d2f8feb 100644
662 --- a/fs/dcache.c
663 +++ b/fs/dcache.c
664 @@ -2487,16 +2487,14 @@ static int prepend_name(char **buffer, int *buflen, struct qstr *name)
665 /**
666 * prepend_path - Prepend path string to a buffer
667 * @path: the dentry/vfsmount to report
668 - * @root: root vfsmnt/dentry (may be modified by this function)
669 + * @root: root vfsmnt/dentry
670 * @buffer: pointer to the end of the buffer
671 * @buflen: pointer to buffer length
672 *
673 * Caller holds the rename_lock.
674 - *
675 - * If path is not reachable from the supplied root, then the value of
676 - * root is changed (without modifying refcounts).
677 */
678 -static int prepend_path(const struct path *path, struct path *root,
679 +static int prepend_path(const struct path *path,
680 + const struct path *root,
681 char **buffer, int *buflen)
682 {
683 struct dentry *dentry = path->dentry;
684 @@ -2531,10 +2529,10 @@ static int prepend_path(const struct path *path, struct path *root,
685 dentry = parent;
686 }
687
688 -out:
689 if (!error && !slash)
690 error = prepend(buffer, buflen, "/", 1);
691
692 +out:
693 br_read_unlock(vfsmount_lock);
694 return error;
695
696 @@ -2548,15 +2546,17 @@ global_root:
697 WARN(1, "Root dentry has weird name <%.*s>\n",
698 (int) dentry->d_name.len, dentry->d_name.name);
699 }
700 - root->mnt = vfsmnt;
701 - root->dentry = dentry;
702 + if (!slash)
703 + error = prepend(buffer, buflen, "/", 1);
704 + if (!error)
705 + error = vfsmnt->mnt_ns ? 1 : 2;
706 goto out;
707 }
708
709 /**
710 * __d_path - return the path of a dentry
711 * @path: the dentry/vfsmount to report
712 - * @root: root vfsmnt/dentry (may be modified by this function)
713 + * @root: root vfsmnt/dentry
714 * @buf: buffer to return value in
715 * @buflen: buffer length
716 *
717 @@ -2567,10 +2567,10 @@ global_root:
718 *
719 * "buflen" should be positive.
720 *
721 - * If path is not reachable from the supplied root, then the value of
722 - * root is changed (without modifying refcounts).
723 + * If the path is not reachable from the supplied root, return %NULL.
724 */
725 -char *__d_path(const struct path *path, struct path *root,
726 +char *__d_path(const struct path *path,
727 + const struct path *root,
728 char *buf, int buflen)
729 {
730 char *res = buf + buflen;
731 @@ -2581,7 +2581,28 @@ char *__d_path(const struct path *path, struct path *root,
732 error = prepend_path(path, root, &res, &buflen);
733 write_sequnlock(&rename_lock);
734
735 - if (error)
736 + if (error < 0)
737 + return ERR_PTR(error);
738 + if (error > 0)
739 + return NULL;
740 + return res;
741 +}
742 +
743 +char *d_absolute_path(const struct path *path,
744 + char *buf, int buflen)
745 +{
746 + struct path root = {};
747 + char *res = buf + buflen;
748 + int error;
749 +
750 + prepend(&res, &buflen, "\0", 1);
751 + write_seqlock(&rename_lock);
752 + error = prepend_path(path, &root, &res, &buflen);
753 + write_sequnlock(&rename_lock);
754 +
755 + if (error > 1)
756 + error = -EINVAL;
757 + if (error < 0)
758 return ERR_PTR(error);
759 return res;
760 }
761 @@ -2589,8 +2610,9 @@ char *__d_path(const struct path *path, struct path *root,
762 /*
763 * same as __d_path but appends "(deleted)" for unlinked files.
764 */
765 -static int path_with_deleted(const struct path *path, struct path *root,
766 - char **buf, int *buflen)
767 +static int path_with_deleted(const struct path *path,
768 + const struct path *root,
769 + char **buf, int *buflen)
770 {
771 prepend(buf, buflen, "\0", 1);
772 if (d_unlinked(path->dentry)) {
773 @@ -2627,7 +2649,6 @@ char *d_path(const struct path *path, char *buf, int buflen)
774 {
775 char *res = buf + buflen;
776 struct path root;
777 - struct path tmp;
778 int error;
779
780 /*
781 @@ -2642,9 +2663,8 @@ char *d_path(const struct path *path, char *buf, int buflen)
782
783 get_fs_root(current->fs, &root);
784 write_seqlock(&rename_lock);
785 - tmp = root;
786 - error = path_with_deleted(path, &tmp, &res, &buflen);
787 - if (error)
788 + error = path_with_deleted(path, &root, &res, &buflen);
789 + if (error < 0)
790 res = ERR_PTR(error);
791 write_sequnlock(&rename_lock);
792 path_put(&root);
793 @@ -2665,7 +2685,6 @@ char *d_path_with_unreachable(const struct path *path, char *buf, int buflen)
794 {
795 char *res = buf + buflen;
796 struct path root;
797 - struct path tmp;
798 int error;
799
800 if (path->dentry->d_op && path->dentry->d_op->d_dname)
801 @@ -2673,9 +2692,8 @@ char *d_path_with_unreachable(const struct path *path, char *buf, int buflen)
802
803 get_fs_root(current->fs, &root);
804 write_seqlock(&rename_lock);
805 - tmp = root;
806 - error = path_with_deleted(path, &tmp, &res, &buflen);
807 - if (!error && !path_equal(&tmp, &root))
808 + error = path_with_deleted(path, &root, &res, &buflen);
809 + if (error > 0)
810 error = prepend_unreachable(&res, &buflen);
811 write_sequnlock(&rename_lock);
812 path_put(&root);
813 @@ -2806,19 +2824,18 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
814 write_seqlock(&rename_lock);
815 if (!d_unlinked(pwd.dentry)) {
816 unsigned long len;
817 - struct path tmp = root;
818 char *cwd = page + PAGE_SIZE;
819 int buflen = PAGE_SIZE;
820
821 prepend(&cwd, &buflen, "\0", 1);
822 - error = prepend_path(&pwd, &tmp, &cwd, &buflen);
823 + error = prepend_path(&pwd, &root, &cwd, &buflen);
824 write_sequnlock(&rename_lock);
825
826 - if (error)
827 + if (error < 0)
828 goto out;
829
830 /* Unreachable from current root */
831 - if (!path_equal(&tmp, &root)) {
832 + if (error > 0) {
833 error = prepend_unreachable(&cwd, &buflen);
834 if (error)
835 goto out;
836 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
837 index 1265904..af09060 100644
838 --- a/fs/ext4/inode.c
839 +++ b/fs/ext4/inode.c
840 @@ -2126,8 +2126,11 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd,
841 clear_buffer_unwritten(bh);
842 }
843
844 - /* skip page if block allocation undone */
845 - if (buffer_delay(bh) || buffer_unwritten(bh))
846 + /*
847 + * skip page if block allocation undone and
848 + * block is dirty
849 + */
850 + if (ext4_bh_delay_or_unwritten(NULL, bh))
851 skip_page = 1;
852 bh = bh->b_this_page;
853 block_start += bh->b_size;
854 @@ -3231,7 +3234,7 @@ static int ext4_da_write_end(struct file *file,
855 */
856
857 new_i_size = pos + copied;
858 - if (new_i_size > EXT4_I(inode)->i_disksize) {
859 + if (copied && new_i_size > EXT4_I(inode)->i_disksize) {
860 if (ext4_da_should_update_i_disksize(page, end)) {
861 down_write(&EXT4_I(inode)->i_data_sem);
862 if (new_i_size > EXT4_I(inode)->i_disksize) {
863 diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
864 index bd6a85e..d99d74a 100644
865 --- a/fs/ext4/page-io.c
866 +++ b/fs/ext4/page-io.c
867 @@ -405,6 +405,18 @@ int ext4_bio_write_page(struct ext4_io_submit *io,
868
869 block_end = block_start + blocksize;
870 if (block_start >= len) {
871 + /*
872 + * Comments copied from block_write_full_page_endio:
873 + *
874 + * The page straddles i_size. It must be zeroed out on
875 + * each and every writepage invocation because it may
876 + * be mmapped. "A file is mapped in multiples of the
877 + * page size. For a file that is not a multiple of
878 + * the page size, the remaining memory is zeroed when
879 + * mapped, and writes to that region are not written
880 + * out to the file."
881 + */
882 + zero_user_segment(page, block_start, block_end);
883 clear_buffer_dirty(bh);
884 set_buffer_uptodate(bh);
885 continue;
886 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
887 index 111ed9d..7aa77f0 100644
888 --- a/fs/ext4/super.c
889 +++ b/fs/ext4/super.c
890 @@ -1113,9 +1113,9 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
891 seq_puts(seq, ",block_validity");
892
893 if (!test_opt(sb, INIT_INODE_TABLE))
894 - seq_puts(seq, ",noinit_inode_table");
895 + seq_puts(seq, ",noinit_itable");
896 else if (sbi->s_li_wait_mult != EXT4_DEF_LI_WAIT_MULT)
897 - seq_printf(seq, ",init_inode_table=%u",
898 + seq_printf(seq, ",init_itable=%u",
899 (unsigned) sbi->s_li_wait_mult);
900
901 ext4_show_quota_options(seq, sb);
902 @@ -1291,8 +1291,7 @@ enum {
903 Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity,
904 Opt_inode_readahead_blks, Opt_journal_ioprio,
905 Opt_dioread_nolock, Opt_dioread_lock,
906 - Opt_discard, Opt_nodiscard,
907 - Opt_init_inode_table, Opt_noinit_inode_table,
908 + Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable,
909 };
910
911 static const match_table_t tokens = {
912 @@ -1365,9 +1364,9 @@ static const match_table_t tokens = {
913 {Opt_dioread_lock, "dioread_lock"},
914 {Opt_discard, "discard"},
915 {Opt_nodiscard, "nodiscard"},
916 - {Opt_init_inode_table, "init_itable=%u"},
917 - {Opt_init_inode_table, "init_itable"},
918 - {Opt_noinit_inode_table, "noinit_itable"},
919 + {Opt_init_itable, "init_itable=%u"},
920 + {Opt_init_itable, "init_itable"},
921 + {Opt_noinit_itable, "noinit_itable"},
922 {Opt_err, NULL},
923 };
924
925 @@ -1844,7 +1843,7 @@ set_qf_format:
926 case Opt_dioread_lock:
927 clear_opt(sb, DIOREAD_NOLOCK);
928 break;
929 - case Opt_init_inode_table:
930 + case Opt_init_itable:
931 set_opt(sb, INIT_INODE_TABLE);
932 if (args[0].from) {
933 if (match_int(&args[0], &option))
934 @@ -1855,7 +1854,7 @@ set_qf_format:
935 return 0;
936 sbi->s_li_wait_mult = option;
937 break;
938 - case Opt_noinit_inode_table:
939 + case Opt_noinit_itable:
940 clear_opt(sb, INIT_INODE_TABLE);
941 break;
942 default:
943 diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
944 index 5cb8614..2aaf3ea 100644
945 --- a/fs/fuse/dev.c
946 +++ b/fs/fuse/dev.c
947 @@ -1512,7 +1512,7 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode,
948 else if (outarg->offset + num > file_size)
949 num = file_size - outarg->offset;
950
951 - while (num) {
952 + while (num && req->num_pages < FUSE_MAX_PAGES_PER_REQ) {
953 struct page *page;
954 unsigned int this_num;
955
956 @@ -1526,6 +1526,7 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode,
957
958 num -= this_num;
959 total_len += this_num;
960 + index++;
961 }
962 req->misc.retrieve_in.offset = outarg->offset;
963 req->misc.retrieve_in.size = total_len;
964 diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c
965 index 3ebc437..1cbdeea 100644
966 --- a/fs/hfs/btree.c
967 +++ b/fs/hfs/btree.c
968 @@ -46,11 +46,26 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
969 case HFS_EXT_CNID:
970 hfs_inode_read_fork(tree->inode, mdb->drXTExtRec, mdb->drXTFlSize,
971 mdb->drXTFlSize, be32_to_cpu(mdb->drXTClpSiz));
972 + if (HFS_I(tree->inode)->alloc_blocks >
973 + HFS_I(tree->inode)->first_blocks) {
974 + printk(KERN_ERR "hfs: invalid btree extent records\n");
975 + unlock_new_inode(tree->inode);
976 + goto free_inode;
977 + }
978 +
979 tree->inode->i_mapping->a_ops = &hfs_btree_aops;
980 break;
981 case HFS_CAT_CNID:
982 hfs_inode_read_fork(tree->inode, mdb->drCTExtRec, mdb->drCTFlSize,
983 mdb->drCTFlSize, be32_to_cpu(mdb->drCTClpSiz));
984 +
985 + if (!HFS_I(tree->inode)->first_blocks) {
986 + printk(KERN_ERR "hfs: invalid btree extent records "
987 + "(0 size).\n");
988 + unlock_new_inode(tree->inode);
989 + goto free_inode;
990 + }
991 +
992 tree->inode->i_mapping->a_ops = &hfs_btree_aops;
993 break;
994 default:
995 @@ -59,11 +74,6 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
996 }
997 unlock_new_inode(tree->inode);
998
999 - if (!HFS_I(tree->inode)->first_blocks) {
1000 - printk(KERN_ERR "hfs: invalid btree extent records (0 size).\n");
1001 - goto free_inode;
1002 - }
1003 -
1004 mapping = tree->inode->i_mapping;
1005 page = read_mapping_page(mapping, 0, NULL);
1006 if (IS_ERR(page))
1007 diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
1008 index e2d4285..9f36384 100644
1009 --- a/fs/jbd/journal.c
1010 +++ b/fs/jbd/journal.c
1011 @@ -1131,6 +1131,14 @@ static int journal_get_superblock(journal_t *journal)
1012 goto out;
1013 }
1014
1015 + if (be32_to_cpu(sb->s_first) == 0 ||
1016 + be32_to_cpu(sb->s_first) >= journal->j_maxlen) {
1017 + printk(KERN_WARNING
1018 + "JBD: Invalid start block of journal: %u\n",
1019 + be32_to_cpu(sb->s_first));
1020 + goto out;
1021 + }
1022 +
1023 return 0;
1024
1025 out:
1026 diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
1027 index 0dfa5b5..40c5fb7 100644
1028 --- a/fs/jbd2/journal.c
1029 +++ b/fs/jbd2/journal.c
1030 @@ -1251,6 +1251,14 @@ static int journal_get_superblock(journal_t *journal)
1031 goto out;
1032 }
1033
1034 + if (be32_to_cpu(sb->s_first) == 0 ||
1035 + be32_to_cpu(sb->s_first) >= journal->j_maxlen) {
1036 + printk(KERN_WARNING
1037 + "JBD2: Invalid start block of journal: %u\n",
1038 + be32_to_cpu(sb->s_first));
1039 + goto out;
1040 + }
1041 +
1042 return 0;
1043
1044 out:
1045 diff --git a/fs/namespace.c b/fs/namespace.c
1046 index 537dd96..edc1c4a 100644
1047 --- a/fs/namespace.c
1048 +++ b/fs/namespace.c
1049 @@ -1048,15 +1048,12 @@ static int show_mountinfo(struct seq_file *m, void *v)
1050 if (err)
1051 goto out;
1052 seq_putc(m, ' ');
1053 - seq_path_root(m, &mnt_path, &root, " \t\n\\");
1054 - if (root.mnt != p->root.mnt || root.dentry != p->root.dentry) {
1055 - /*
1056 - * Mountpoint is outside root, discard that one. Ugly,
1057 - * but less so than trying to do that in iterator in a
1058 - * race-free way (due to renames).
1059 - */
1060 - return SEQ_SKIP;
1061 - }
1062 +
1063 + /* mountpoints outside of chroot jail will give SEQ_SKIP on this */
1064 + err = seq_path_root(m, &mnt_path, &root, " \t\n\\");
1065 + if (err)
1066 + goto out;
1067 +
1068 seq_puts(m, mnt->mnt_flags & MNT_READONLY ? " ro" : " rw");
1069 show_mnt_opts(m, mnt);
1070
1071 @@ -2725,3 +2722,8 @@ struct vfsmount *kern_mount_data(struct file_system_type *type, void *data)
1072 return vfs_kern_mount(type, MS_KERNMOUNT, type->name, data);
1073 }
1074 EXPORT_SYMBOL_GPL(kern_mount_data);
1075 +
1076 +bool our_mnt(struct vfsmount *mnt)
1077 +{
1078 + return check_mnt(mnt);
1079 +}
1080 diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
1081 index ed257d1..a962827 100644
1082 --- a/fs/proc/meminfo.c
1083 +++ b/fs/proc/meminfo.c
1084 @@ -131,12 +131,13 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
1085 K(i.freeswap),
1086 K(global_page_state(NR_FILE_DIRTY)),
1087 K(global_page_state(NR_WRITEBACK)),
1088 - K(global_page_state(NR_ANON_PAGES)
1089 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
1090 + K(global_page_state(NR_ANON_PAGES)
1091 + global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
1092 - HPAGE_PMD_NR
1093 + HPAGE_PMD_NR),
1094 +#else
1095 + K(global_page_state(NR_ANON_PAGES)),
1096 #endif
1097 - ),
1098 K(global_page_state(NR_FILE_MAPPED)),
1099 K(global_page_state(NR_SHMEM)),
1100 K(global_page_state(NR_SLAB_RECLAIMABLE) +
1101 diff --git a/fs/seq_file.c b/fs/seq_file.c
1102 index 05d6b0e..dba43c3 100644
1103 --- a/fs/seq_file.c
1104 +++ b/fs/seq_file.c
1105 @@ -449,8 +449,6 @@ EXPORT_SYMBOL(seq_path);
1106
1107 /*
1108 * Same as seq_path, but relative to supplied root.
1109 - *
1110 - * root may be changed, see __d_path().
1111 */
1112 int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
1113 char *esc)
1114 @@ -463,6 +461,8 @@ int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
1115 char *p;
1116
1117 p = __d_path(path, root, buf, size);
1118 + if (!p)
1119 + return SEQ_SKIP;
1120 res = PTR_ERR(p);
1121 if (!IS_ERR(p)) {
1122 char *end = mangle_path(buf, p, esc);
1123 @@ -474,7 +474,7 @@ int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
1124 }
1125 seq_commit(m, res);
1126
1127 - return res < 0 ? res : 0;
1128 + return res < 0 && res != -ENAMETOOLONG ? res : 0;
1129 }
1130
1131 /*
1132 diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c
1133 index f4f878f..fed3f3c 100644
1134 --- a/fs/xfs/linux-2.6/xfs_export.c
1135 +++ b/fs/xfs/linux-2.6/xfs_export.c
1136 @@ -98,22 +98,22 @@ xfs_fs_encode_fh(
1137 switch (fileid_type) {
1138 case FILEID_INO32_GEN_PARENT:
1139 spin_lock(&dentry->d_lock);
1140 - fid->i32.parent_ino = dentry->d_parent->d_inode->i_ino;
1141 + fid->i32.parent_ino = XFS_I(dentry->d_parent->d_inode)->i_ino;
1142 fid->i32.parent_gen = dentry->d_parent->d_inode->i_generation;
1143 spin_unlock(&dentry->d_lock);
1144 /*FALLTHRU*/
1145 case FILEID_INO32_GEN:
1146 - fid->i32.ino = inode->i_ino;
1147 + fid->i32.ino = XFS_I(inode)->i_ino;
1148 fid->i32.gen = inode->i_generation;
1149 break;
1150 case FILEID_INO32_GEN_PARENT | XFS_FILEID_TYPE_64FLAG:
1151 spin_lock(&dentry->d_lock);
1152 - fid64->parent_ino = dentry->d_parent->d_inode->i_ino;
1153 + fid64->parent_ino = XFS_I(dentry->d_parent->d_inode)->i_ino;
1154 fid64->parent_gen = dentry->d_parent->d_inode->i_generation;
1155 spin_unlock(&dentry->d_lock);
1156 /*FALLTHRU*/
1157 case FILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAG:
1158 - fid64->ino = inode->i_ino;
1159 + fid64->ino = XFS_I(inode)->i_ino;
1160 fid64->gen = inode->i_generation;
1161 break;
1162 }
1163 diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
1164 index 01d2072..99d4011 100644
1165 --- a/fs/xfs/xfs_attr.c
1166 +++ b/fs/xfs/xfs_attr.c
1167 @@ -822,17 +822,9 @@ xfs_attr_inactive(xfs_inode_t *dp)
1168 error = xfs_attr_root_inactive(&trans, dp);
1169 if (error)
1170 goto out;
1171 - /*
1172 - * signal synchronous inactive transactions unless this
1173 - * is a synchronous mount filesystem in which case we
1174 - * know that we're here because we've been called out of
1175 - * xfs_inactive which means that the last reference is gone
1176 - * and the unlink transaction has already hit the disk so
1177 - * async inactive transactions are safe.
1178 - */
1179 - if ((error = xfs_itruncate_finish(&trans, dp, 0LL, XFS_ATTR_FORK,
1180 - (!(mp->m_flags & XFS_MOUNT_WSYNC)
1181 - ? 1 : 0))))
1182 +
1183 + error = xfs_itruncate_finish(&trans, dp, 0LL, XFS_ATTR_FORK, 0);
1184 + if (error)
1185 goto out;
1186
1187 /*
1188 diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
1189 index e546a33..a175933 100644
1190 --- a/fs/xfs/xfs_bmap.c
1191 +++ b/fs/xfs/xfs_bmap.c
1192 @@ -3785,19 +3785,11 @@ xfs_bmap_compute_maxlevels(
1193 * Routine to be called at transaction's end by xfs_bmapi, xfs_bunmapi
1194 * caller. Frees all the extents that need freeing, which must be done
1195 * last due to locking considerations. We never free any extents in
1196 - * the first transaction. This is to allow the caller to make the first
1197 - * transaction a synchronous one so that the pointers to the data being
1198 - * broken in this transaction will be permanent before the data is actually
1199 - * freed. This is necessary to prevent blocks from being reallocated
1200 - * and written to before the free and reallocation are actually permanent.
1201 - * We do not just make the first transaction synchronous here, because
1202 - * there are more efficient ways to gain the same protection in some cases
1203 - * (see the file truncation code).
1204 + * the first transaction.
1205 *
1206 * Return 1 if the given transaction was committed and a new one
1207 * started, and 0 otherwise in the committed parameter.
1208 */
1209 -/*ARGSUSED*/
1210 int /* error */
1211 xfs_bmap_finish(
1212 xfs_trans_t **tp, /* transaction pointer addr */
1213 diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
1214 index c6888a4..5715279 100644
1215 --- a/fs/xfs/xfs_inode.c
1216 +++ b/fs/xfs/xfs_inode.c
1217 @@ -1528,15 +1528,7 @@ xfs_itruncate_finish(
1218 xfs_trans_log_inode(ntp, ip, XFS_ILOG_CORE);
1219 }
1220 }
1221 - } else if (sync) {
1222 - ASSERT(!(mp->m_flags & XFS_MOUNT_WSYNC));
1223 - if (ip->i_d.di_anextents > 0)
1224 - xfs_trans_set_sync(ntp);
1225 }
1226 - ASSERT(fork == XFS_DATA_FORK ||
1227 - (fork == XFS_ATTR_FORK &&
1228 - ((sync && !(mp->m_flags & XFS_MOUNT_WSYNC)) ||
1229 - (sync == 0 && (mp->m_flags & XFS_MOUNT_WSYNC)))));
1230
1231 /*
1232 * Since it is possible for space to become allocated beyond
1233 diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
1234 index 4e4fbb8..14b6cd0 100644
1235 --- a/include/drm/drm_pciids.h
1236 +++ b/include/drm/drm_pciids.h
1237 @@ -182,8 +182,11 @@
1238 {0x1002, 0x6748, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1239 {0x1002, 0x6749, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1240 {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1241 + {0x1002, 0x6751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1242 {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1243 {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1244 + {0x1002, 0x675B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1245 + {0x1002, 0x675D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1246 {0x1002, 0x675F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1247 {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1248 {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1249 @@ -195,8 +198,10 @@
1250 {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1251 {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1252 {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1253 + {0x1002, 0x6772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1254 {0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1255 {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1256 + {0x1002, 0x677B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1257 {0x1002, 0x6840, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1258 {0x1002, 0x6841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1259 {0x1002, 0x6842, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1260 @@ -246,6 +251,7 @@
1261 {0x1002, 0x68f2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \
1262 {0x1002, 0x68f8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \
1263 {0x1002, 0x68f9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \
1264 + {0x1002, 0x68fa, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \
1265 {0x1002, 0x68fe, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \
1266 {0x1002, 0x7100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R520|RADEON_NEW_MEMMAP}, \
1267 {0x1002, 0x7101, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R520|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1268 @@ -488,6 +494,8 @@
1269 {0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
1270 {0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
1271 {0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1272 + {0x1002, 0x964b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1273 + {0x1002, 0x964c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1274 {0x1002, 0x964e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
1275 {0x1002, 0x964f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
1276 {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1277 @@ -502,6 +510,8 @@
1278 {0x1002, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1279 {0x1002, 0x9806, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1280 {0x1002, 0x9807, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1281 + {0x1002, 0x9808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1282 + {0x1002, 0x9809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
1283 {0, 0, 0}
1284
1285 #define r128_PCI_IDS \
1286 diff --git a/include/linux/dcache.h b/include/linux/dcache.h
1287 index 19d90a5..8f848e4 100644
1288 --- a/include/linux/dcache.h
1289 +++ b/include/linux/dcache.h
1290 @@ -340,7 +340,8 @@ extern int d_validate(struct dentry *, struct dentry *);
1291 */
1292 extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
1293
1294 -extern char *__d_path(const struct path *path, struct path *root, char *, int);
1295 +extern char *__d_path(const struct path *, const struct path *, char *, int);
1296 +extern char *d_absolute_path(const struct path *, char *, int);
1297 extern char *d_path(const struct path *, char *, int);
1298 extern char *d_path_with_unreachable(const struct path *, char *, int);
1299 extern char *dentry_path_raw(struct dentry *, char *, int);
1300 diff --git a/include/linux/fs.h b/include/linux/fs.h
1301 index b5b9792..7b17db7 100644
1302 --- a/include/linux/fs.h
1303 +++ b/include/linux/fs.h
1304 @@ -1882,6 +1882,7 @@ extern int fd_statfs(int, struct kstatfs *);
1305 extern int statfs_by_dentry(struct dentry *, struct kstatfs *);
1306 extern int freeze_super(struct super_block *super);
1307 extern int thaw_super(struct super_block *super);
1308 +extern bool our_mnt(struct vfsmount *mnt);
1309
1310 extern int current_umask(void);
1311
1312 diff --git a/include/linux/log2.h b/include/linux/log2.h
1313 index 25b8086..fd7ff3d 100644
1314 --- a/include/linux/log2.h
1315 +++ b/include/linux/log2.h
1316 @@ -185,7 +185,6 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
1317 #define rounddown_pow_of_two(n) \
1318 ( \
1319 __builtin_constant_p(n) ? ( \
1320 - (n == 1) ? 0 : \
1321 (1UL << ilog2(n))) : \
1322 __rounddown_pow_of_two(n) \
1323 )
1324 diff --git a/kernel/taskstats.c b/kernel/taskstats.c
1325 index fc0f220..8d597b1 100644
1326 --- a/kernel/taskstats.c
1327 +++ b/kernel/taskstats.c
1328 @@ -657,6 +657,7 @@ static struct genl_ops taskstats_ops = {
1329 .cmd = TASKSTATS_CMD_GET,
1330 .doit = taskstats_user_cmd,
1331 .policy = taskstats_cmd_get_policy,
1332 + .flags = GENL_ADMIN_PERM,
1333 };
1334
1335 static struct genl_ops cgroupstats_ops = {
1336 diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
1337 index ea5e1a9..8b70c76 100644
1338 --- a/kernel/time/alarmtimer.c
1339 +++ b/kernel/time/alarmtimer.c
1340 @@ -181,7 +181,7 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer)
1341 struct alarm *alarm;
1342 ktime_t expired = next->expires;
1343
1344 - if (expired.tv64 >= now.tv64)
1345 + if (expired.tv64 > now.tv64)
1346 break;
1347
1348 alarm = container_of(next, struct alarm, node);
1349 diff --git a/mm/hugetlb.c b/mm/hugetlb.c
1350 index 2b57cd9..80936a1 100644
1351 --- a/mm/hugetlb.c
1352 +++ b/mm/hugetlb.c
1353 @@ -575,6 +575,7 @@ static void prep_compound_gigantic_page(struct page *page, unsigned long order)
1354 __SetPageHead(page);
1355 for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) {
1356 __SetPageTail(p);
1357 + set_page_count(p, 0);
1358 p->first_page = page;
1359 }
1360 }
1361 diff --git a/mm/page_alloc.c b/mm/page_alloc.c
1362 index 0f50cdb..8439d2a 100644
1363 --- a/mm/page_alloc.c
1364 +++ b/mm/page_alloc.c
1365 @@ -355,8 +355,8 @@ void prep_compound_page(struct page *page, unsigned long order)
1366 __SetPageHead(page);
1367 for (i = 1; i < nr_pages; i++) {
1368 struct page *p = page + i;
1369 -
1370 __SetPageTail(p);
1371 + set_page_count(p, 0);
1372 p->first_page = page;
1373 }
1374 }
1375 @@ -3388,9 +3388,15 @@ static void setup_zone_migrate_reserve(struct zone *zone)
1376 unsigned long block_migratetype;
1377 int reserve;
1378
1379 - /* Get the start pfn, end pfn and the number of blocks to reserve */
1380 + /*
1381 + * Get the start pfn, end pfn and the number of blocks to reserve
1382 + * We have to be careful to be aligned to pageblock_nr_pages to
1383 + * make sure that we always check pfn_valid for the first page in
1384 + * the block.
1385 + */
1386 start_pfn = zone->zone_start_pfn;
1387 end_pfn = start_pfn + zone->spanned_pages;
1388 + start_pfn = roundup(start_pfn, pageblock_nr_pages);
1389 reserve = roundup(min_wmark_pages(zone), pageblock_nr_pages) >>
1390 pageblock_order;
1391
1392 diff --git a/mm/percpu-vm.c b/mm/percpu-vm.c
1393 index ea53496..bfad724 100644
1394 --- a/mm/percpu-vm.c
1395 +++ b/mm/percpu-vm.c
1396 @@ -143,8 +143,8 @@ static void pcpu_pre_unmap_flush(struct pcpu_chunk *chunk,
1397 int page_start, int page_end)
1398 {
1399 flush_cache_vunmap(
1400 - pcpu_chunk_addr(chunk, pcpu_first_unit_cpu, page_start),
1401 - pcpu_chunk_addr(chunk, pcpu_last_unit_cpu, page_end));
1402 + pcpu_chunk_addr(chunk, pcpu_low_unit_cpu, page_start),
1403 + pcpu_chunk_addr(chunk, pcpu_high_unit_cpu, page_end));
1404 }
1405
1406 static void __pcpu_unmap_pages(unsigned long addr, int nr_pages)
1407 @@ -206,8 +206,8 @@ static void pcpu_post_unmap_tlb_flush(struct pcpu_chunk *chunk,
1408 int page_start, int page_end)
1409 {
1410 flush_tlb_kernel_range(
1411 - pcpu_chunk_addr(chunk, pcpu_first_unit_cpu, page_start),
1412 - pcpu_chunk_addr(chunk, pcpu_last_unit_cpu, page_end));
1413 + pcpu_chunk_addr(chunk, pcpu_low_unit_cpu, page_start),
1414 + pcpu_chunk_addr(chunk, pcpu_high_unit_cpu, page_end));
1415 }
1416
1417 static int __pcpu_map_pages(unsigned long addr, struct page **pages,
1418 @@ -284,8 +284,8 @@ static void pcpu_post_map_flush(struct pcpu_chunk *chunk,
1419 int page_start, int page_end)
1420 {
1421 flush_cache_vmap(
1422 - pcpu_chunk_addr(chunk, pcpu_first_unit_cpu, page_start),
1423 - pcpu_chunk_addr(chunk, pcpu_last_unit_cpu, page_end));
1424 + pcpu_chunk_addr(chunk, pcpu_low_unit_cpu, page_start),
1425 + pcpu_chunk_addr(chunk, pcpu_high_unit_cpu, page_end));
1426 }
1427
1428 /**
1429 diff --git a/mm/percpu.c b/mm/percpu.c
1430 index bf80e55..93b5a7c 100644
1431 --- a/mm/percpu.c
1432 +++ b/mm/percpu.c
1433 @@ -116,9 +116,9 @@ static int pcpu_atom_size __read_mostly;
1434 static int pcpu_nr_slots __read_mostly;
1435 static size_t pcpu_chunk_struct_size __read_mostly;
1436
1437 -/* cpus with the lowest and highest unit numbers */
1438 -static unsigned int pcpu_first_unit_cpu __read_mostly;
1439 -static unsigned int pcpu_last_unit_cpu __read_mostly;
1440 +/* cpus with the lowest and highest unit addresses */
1441 +static unsigned int pcpu_low_unit_cpu __read_mostly;
1442 +static unsigned int pcpu_high_unit_cpu __read_mostly;
1443
1444 /* the address of the first chunk which starts with the kernel static area */
1445 void *pcpu_base_addr __read_mostly;
1446 @@ -984,19 +984,19 @@ phys_addr_t per_cpu_ptr_to_phys(void *addr)
1447 {
1448 void __percpu *base = __addr_to_pcpu_ptr(pcpu_base_addr);
1449 bool in_first_chunk = false;
1450 - unsigned long first_start, first_end;
1451 + unsigned long first_low, first_high;
1452 unsigned int cpu;
1453
1454 /*
1455 - * The following test on first_start/end isn't strictly
1456 + * The following test on unit_low/high isn't strictly
1457 * necessary but will speed up lookups of addresses which
1458 * aren't in the first chunk.
1459 */
1460 - first_start = pcpu_chunk_addr(pcpu_first_chunk, pcpu_first_unit_cpu, 0);
1461 - first_end = pcpu_chunk_addr(pcpu_first_chunk, pcpu_last_unit_cpu,
1462 - pcpu_unit_pages);
1463 - if ((unsigned long)addr >= first_start &&
1464 - (unsigned long)addr < first_end) {
1465 + first_low = pcpu_chunk_addr(pcpu_first_chunk, pcpu_low_unit_cpu, 0);
1466 + first_high = pcpu_chunk_addr(pcpu_first_chunk, pcpu_high_unit_cpu,
1467 + pcpu_unit_pages);
1468 + if ((unsigned long)addr >= first_low &&
1469 + (unsigned long)addr < first_high) {
1470 for_each_possible_cpu(cpu) {
1471 void *start = per_cpu_ptr(base, cpu);
1472
1473 @@ -1233,7 +1233,9 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
1474
1475 for (cpu = 0; cpu < nr_cpu_ids; cpu++)
1476 unit_map[cpu] = UINT_MAX;
1477 - pcpu_first_unit_cpu = NR_CPUS;
1478 +
1479 + pcpu_low_unit_cpu = NR_CPUS;
1480 + pcpu_high_unit_cpu = NR_CPUS;
1481
1482 for (group = 0, unit = 0; group < ai->nr_groups; group++, unit += i) {
1483 const struct pcpu_group_info *gi = &ai->groups[group];
1484 @@ -1253,9 +1255,13 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
1485 unit_map[cpu] = unit + i;
1486 unit_off[cpu] = gi->base_offset + i * ai->unit_size;
1487
1488 - if (pcpu_first_unit_cpu == NR_CPUS)
1489 - pcpu_first_unit_cpu = cpu;
1490 - pcpu_last_unit_cpu = cpu;
1491 + /* determine low/high unit_cpu */
1492 + if (pcpu_low_unit_cpu == NR_CPUS ||
1493 + unit_off[cpu] < unit_off[pcpu_low_unit_cpu])
1494 + pcpu_low_unit_cpu = cpu;
1495 + if (pcpu_high_unit_cpu == NR_CPUS ||
1496 + unit_off[cpu] > unit_off[pcpu_high_unit_cpu])
1497 + pcpu_high_unit_cpu = cpu;
1498 }
1499 }
1500 pcpu_nr_units = unit;
1501 diff --git a/mm/vmalloc.c b/mm/vmalloc.c
1502 index 65d5fd2..43b44db 100644
1503 --- a/mm/vmalloc.c
1504 +++ b/mm/vmalloc.c
1505 @@ -1648,6 +1648,8 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
1506 return NULL;
1507
1508 addr = __vmalloc_area_node(area, gfp_mask, prot, node, caller);
1509 + if (!addr)
1510 + return NULL;
1511
1512 /*
1513 * In this function, newly allocated vm_struct is not added
1514 diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
1515 index 42a59c2..db7db43 100644
1516 --- a/net/mac80211/agg-tx.c
1517 +++ b/net/mac80211/agg-tx.c
1518 @@ -792,12 +792,27 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
1519 goto out;
1520 }
1521
1522 - del_timer(&tid_tx->addba_resp_timer);
1523 + del_timer_sync(&tid_tx->addba_resp_timer);
1524
1525 #ifdef CONFIG_MAC80211_HT_DEBUG
1526 printk(KERN_DEBUG "switched off addBA timer for tid %d\n", tid);
1527 #endif
1528
1529 + /*
1530 + * addba_resp_timer may have fired before we got here, and
1531 + * caused WANT_STOP to be set. If the stop then was already
1532 + * processed further, STOPPING might be set.
1533 + */
1534 + if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) ||
1535 + test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) {
1536 +#ifdef CONFIG_MAC80211_HT_DEBUG
1537 + printk(KERN_DEBUG
1538 + "got addBA resp for tid %d but we already gave up\n",
1539 + tid);
1540 +#endif
1541 + goto out;
1542 + }
1543 +
1544 if (le16_to_cpu(mgmt->u.action.u.addba_resp.status)
1545 == WLAN_STATUS_SUCCESS) {
1546 /*
1547 diff --git a/security/apparmor/path.c b/security/apparmor/path.c
1548 index 36cc0cc..b566eba 100644
1549 --- a/security/apparmor/path.c
1550 +++ b/security/apparmor/path.c
1551 @@ -57,23 +57,44 @@ static int prepend(char **buffer, int buflen, const char *str, int namelen)
1552 static int d_namespace_path(struct path *path, char *buf, int buflen,
1553 char **name, int flags)
1554 {
1555 - struct path root, tmp;
1556 char *res;
1557 - int connected, error = 0;
1558 + int error = 0;
1559 + int connected = 1;
1560 +
1561 + if (path->mnt->mnt_flags & MNT_INTERNAL) {
1562 + /* it's not mounted anywhere */
1563 + res = dentry_path(path->dentry, buf, buflen);
1564 + *name = res;
1565 + if (IS_ERR(res)) {
1566 + *name = buf;
1567 + return PTR_ERR(res);
1568 + }
1569 + if (path->dentry->d_sb->s_magic == PROC_SUPER_MAGIC &&
1570 + strncmp(*name, "/sys/", 5) == 0) {
1571 + /* TODO: convert over to using a per namespace
1572 + * control instead of hard coded /proc
1573 + */
1574 + return prepend(name, *name - buf, "/proc", 5);
1575 + }
1576 + return 0;
1577 + }
1578
1579 - /* Get the root we want to resolve too, released below */
1580 + /* resolve paths relative to chroot?*/
1581 if (flags & PATH_CHROOT_REL) {
1582 - /* resolve paths relative to chroot */
1583 + struct path root;
1584 get_fs_root(current->fs, &root);
1585 - } else {
1586 - /* resolve paths relative to namespace */
1587 - root.mnt = current->nsproxy->mnt_ns->root;
1588 - root.dentry = root.mnt->mnt_root;
1589 - path_get(&root);
1590 + res = __d_path(path, &root, buf, buflen);
1591 + if (res && !IS_ERR(res)) {
1592 + /* everything's fine */
1593 + *name = res;
1594 + path_put(&root);
1595 + goto ok;
1596 + }
1597 + path_put(&root);
1598 + connected = 0;
1599 }
1600
1601 - tmp = root;
1602 - res = __d_path(path, &tmp, buf, buflen);
1603 + res = d_absolute_path(path, buf, buflen);
1604
1605 *name = res;
1606 /* handle error conditions - and still allow a partial path to
1607 @@ -84,7 +105,10 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
1608 *name = buf;
1609 goto out;
1610 }
1611 + if (!our_mnt(path->mnt))
1612 + connected = 0;
1613
1614 +ok:
1615 /* Handle two cases:
1616 * 1. A deleted dentry && profile is not allowing mediation of deleted
1617 * 2. On some filesystems, newly allocated dentries appear to the
1618 @@ -97,10 +121,7 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
1619 goto out;
1620 }
1621
1622 - /* Determine if the path is connected to the expected root */
1623 - connected = tmp.dentry == root.dentry && tmp.mnt == root.mnt;
1624 -
1625 - /* If the path is not connected,
1626 + /* If the path is not connected to the expected root,
1627 * check if it is a sysctl and handle specially else remove any
1628 * leading / that __d_path may have returned.
1629 * Unless
1630 @@ -112,17 +133,9 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
1631 * namespace root.
1632 */
1633 if (!connected) {
1634 - /* is the disconnect path a sysctl? */
1635 - if (tmp.dentry->d_sb->s_magic == PROC_SUPER_MAGIC &&
1636 - strncmp(*name, "/sys/", 5) == 0) {
1637 - /* TODO: convert over to using a per namespace
1638 - * control instead of hard coded /proc
1639 - */
1640 - error = prepend(name, *name - buf, "/proc", 5);
1641 - } else if (!(flags & PATH_CONNECT_PATH) &&
1642 + if (!(flags & PATH_CONNECT_PATH) &&
1643 !(((flags & CHROOT_NSCONNECT) == CHROOT_NSCONNECT) &&
1644 - (tmp.mnt == current->nsproxy->mnt_ns->root &&
1645 - tmp.dentry == tmp.mnt->mnt_root))) {
1646 + our_mnt(path->mnt))) {
1647 /* disconnected path, don't return pathname starting
1648 * with '/'
1649 */
1650 @@ -133,8 +146,6 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
1651 }
1652
1653 out:
1654 - path_put(&root);
1655 -
1656 return error;
1657 }
1658
1659 diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c
1660 index d1e05b0..a339187 100644
1661 --- a/security/tomoyo/realpath.c
1662 +++ b/security/tomoyo/realpath.c
1663 @@ -95,7 +95,6 @@ char *tomoyo_realpath_from_path(struct path *path)
1664 return NULL;
1665 is_dir = dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode);
1666 while (1) {
1667 - struct path ns_root = { .mnt = NULL, .dentry = NULL };
1668 char *pos;
1669 buf_len <<= 1;
1670 kfree(buf);
1671 @@ -128,8 +127,12 @@ char *tomoyo_realpath_from_path(struct path *path)
1672 /* If we don't have a vfsmount, we can't calculate. */
1673 if (!path->mnt)
1674 break;
1675 - /* go to whatever namespace root we are under */
1676 - pos = __d_path(path, &ns_root, buf, buf_len);
1677 + pos = d_absolute_path(path, buf, buf_len - 1);
1678 + /* If path is disconnected, use "[unknown]" instead. */
1679 + if (pos == ERR_PTR(-EINVAL)) {
1680 + name = tomoyo_encode("[unknown]");
1681 + break;
1682 + }
1683 /* Prepend "/proc" prefix if using internal proc vfs mount. */
1684 if (!IS_ERR(pos) && (path->mnt->mnt_flags & MNT_INTERNAL) &&
1685 (path->mnt->mnt_sb->s_magic == PROC_SUPER_MAGIC)) {
1686 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1687 index e7dc034..eb0a141 100644
1688 --- a/sound/pci/hda/patch_realtek.c
1689 +++ b/sound/pci/hda/patch_realtek.c
1690 @@ -509,6 +509,8 @@ static int alc_mux_enum_put(struct snd_kcontrol *kcontrol,
1691 imux = &spec->input_mux[mux_idx];
1692 if (!imux->num_items && mux_idx > 0)
1693 imux = &spec->input_mux[0];
1694 + if (!imux->num_items)
1695 + return 0;
1696
1697 type = get_wcaps_type(get_wcaps(codec, nid));
1698 if (type == AC_WID_AUD_MIX) {
1699 diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c
1700 index 2b5c7a95..5fe840b 100644
1701 --- a/sound/pci/sis7019.c
1702 +++ b/sound/pci/sis7019.c
1703 @@ -41,6 +41,7 @@ MODULE_SUPPORTED_DEVICE("{{SiS,SiS7019 Audio Accelerator}}");
1704 static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
1705 static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
1706 static int enable = 1;
1707 +static int codecs = 1;
1708
1709 module_param(index, int, 0444);
1710 MODULE_PARM_DESC(index, "Index value for SiS7019 Audio Accelerator.");
1711 @@ -48,6 +49,8 @@ module_param(id, charp, 0444);
1712 MODULE_PARM_DESC(id, "ID string for SiS7019 Audio Accelerator.");
1713 module_param(enable, bool, 0444);
1714 MODULE_PARM_DESC(enable, "Enable SiS7019 Audio Accelerator.");
1715 +module_param(codecs, int, 0444);
1716 +MODULE_PARM_DESC(codecs, "Set bit to indicate that codec number is expected to be present (default 1)");
1717
1718 static DEFINE_PCI_DEVICE_TABLE(snd_sis7019_ids) = {
1719 { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x7019) },
1720 @@ -140,6 +143,9 @@ struct sis7019 {
1721 dma_addr_t silence_dma_addr;
1722 };
1723
1724 +/* These values are also used by the module param 'codecs' to indicate
1725 + * which codecs should be present.
1726 + */
1727 #define SIS_PRIMARY_CODEC_PRESENT 0x0001
1728 #define SIS_SECONDARY_CODEC_PRESENT 0x0002
1729 #define SIS_TERTIARY_CODEC_PRESENT 0x0004
1730 @@ -1078,6 +1084,7 @@ static int sis_chip_init(struct sis7019 *sis)
1731 {
1732 unsigned long io = sis->ioport;
1733 void __iomem *ioaddr = sis->ioaddr;
1734 + unsigned long timeout;
1735 u16 status;
1736 int count;
1737 int i;
1738 @@ -1104,21 +1111,45 @@ static int sis_chip_init(struct sis7019 *sis)
1739 while ((inw(io + SIS_AC97_STATUS) & SIS_AC97_STATUS_BUSY) && --count)
1740 udelay(1);
1741
1742 + /* Command complete, we can let go of the semaphore now.
1743 + */
1744 + outl(SIS_AC97_SEMA_RELEASE, io + SIS_AC97_SEMA);
1745 + if (!count)
1746 + return -EIO;
1747 +
1748 /* Now that we've finished the reset, find out what's attached.
1749 + * There are some codec/board combinations that take an extremely
1750 + * long time to come up. 350+ ms has been observed in the field,
1751 + * so we'll give them up to 500ms.
1752 */
1753 - status = inl(io + SIS_AC97_STATUS);
1754 - if (status & SIS_AC97_STATUS_CODEC_READY)
1755 - sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT;
1756 - if (status & SIS_AC97_STATUS_CODEC2_READY)
1757 - sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT;
1758 - if (status & SIS_AC97_STATUS_CODEC3_READY)
1759 - sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT;
1760 -
1761 - /* All done, let go of the semaphore, and check for errors
1762 + sis->codecs_present = 0;
1763 + timeout = msecs_to_jiffies(500) + jiffies;
1764 + while (time_before_eq(jiffies, timeout)) {
1765 + status = inl(io + SIS_AC97_STATUS);
1766 + if (status & SIS_AC97_STATUS_CODEC_READY)
1767 + sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT;
1768 + if (status & SIS_AC97_STATUS_CODEC2_READY)
1769 + sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT;
1770 + if (status & SIS_AC97_STATUS_CODEC3_READY)
1771 + sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT;
1772 +
1773 + if (sis->codecs_present == codecs)
1774 + break;
1775 +
1776 + msleep(1);
1777 + }
1778 +
1779 + /* All done, check for errors.
1780 */
1781 - outl(SIS_AC97_SEMA_RELEASE, io + SIS_AC97_SEMA);
1782 - if (!sis->codecs_present || !count)
1783 + if (!sis->codecs_present) {
1784 + printk(KERN_ERR "sis7019: could not find any codecs\n");
1785 return -EIO;
1786 + }
1787 +
1788 + if (sis->codecs_present != codecs) {
1789 + printk(KERN_WARNING "sis7019: missing codecs, found %0x, expected %0x\n",
1790 + sis->codecs_present, codecs);
1791 + }
1792
1793 /* Let the hardware know that the audio driver is alive,
1794 * and enable PCM slots on the AC-link for L/R playback (3 & 4) and
1795 @@ -1390,6 +1421,17 @@ static int __devinit snd_sis7019_probe(struct pci_dev *pci,
1796 if (!enable)
1797 goto error_out;
1798
1799 + /* The user can specify which codecs should be present so that we
1800 + * can wait for them to show up if they are slow to recover from
1801 + * the AC97 cold reset. We default to a single codec, the primary.
1802 + *
1803 + * We assume that SIS_PRIMARY_*_PRESENT matches bits 0-2.
1804 + */
1805 + codecs &= SIS_PRIMARY_CODEC_PRESENT | SIS_SECONDARY_CODEC_PRESENT |
1806 + SIS_TERTIARY_CODEC_PRESENT;
1807 + if (!codecs)
1808 + codecs = SIS_PRIMARY_CODEC_PRESENT;
1809 +
1810 rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card);
1811 if (rc < 0)
1812 goto error_out;
1813 diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
1814 index 59abd84..493ae7c 100644
1815 --- a/sound/soc/soc-core.c
1816 +++ b/sound/soc/soc-core.c
1817 @@ -1257,7 +1257,7 @@ static void soc_resume_deferred(struct work_struct *work)
1818 int snd_soc_resume(struct device *dev)
1819 {
1820 struct snd_soc_card *card = dev_get_drvdata(dev);
1821 - int i;
1822 + int i, ac97_control = 0;
1823
1824 /* AC97 devices might have other drivers hanging off them so
1825 * need to resume immediately. Other drivers don't have that
1826 @@ -1266,14 +1266,15 @@ int snd_soc_resume(struct device *dev)
1827 */
1828 for (i = 0; i < card->num_rtd; i++) {
1829 struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai;
1830 - if (cpu_dai->driver->ac97_control) {
1831 - dev_dbg(dev, "Resuming AC97 immediately\n");
1832 - soc_resume_deferred(&card->deferred_resume_work);
1833 - } else {
1834 - dev_dbg(dev, "Scheduling resume work\n");
1835 - if (!schedule_work(&card->deferred_resume_work))
1836 - dev_err(dev, "resume work item may be lost\n");
1837 - }
1838 + ac97_control |= cpu_dai->driver->ac97_control;
1839 + }
1840 + if (ac97_control) {
1841 + dev_dbg(dev, "Resuming AC97 immediately\n");
1842 + soc_resume_deferred(&card->deferred_resume_work);
1843 + } else {
1844 + dev_dbg(dev, "Scheduling resume work\n");
1845 + if (!schedule_work(&card->deferred_resume_work))
1846 + dev_err(dev, "resume work item may be lost\n");
1847 }
1848
1849 return 0;
1850 diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
1851 index ec921ec..cd987de 100644
1852 --- a/sound/soc/soc-utils.c
1853 +++ b/sound/soc/soc-utils.c
1854 @@ -57,7 +57,36 @@ int snd_soc_params_to_bclk(struct snd_pcm_hw_params *params)
1855 }
1856 EXPORT_SYMBOL_GPL(snd_soc_params_to_bclk);
1857
1858 -static struct snd_soc_platform_driver dummy_platform;
1859 +static const struct snd_pcm_hardware dummy_dma_hardware = {
1860 + .formats = 0xffffffff,
1861 + .channels_min = 1,
1862 + .channels_max = UINT_MAX,
1863 +
1864 + /* Random values to keep userspace happy when checking constraints */
1865 + .info = SNDRV_PCM_INFO_INTERLEAVED |
1866 + SNDRV_PCM_INFO_BLOCK_TRANSFER,
1867 + .buffer_bytes_max = 128*1024,
1868 + .period_bytes_min = PAGE_SIZE,
1869 + .period_bytes_max = PAGE_SIZE*2,
1870 + .periods_min = 2,
1871 + .periods_max = 128,
1872 +};
1873 +
1874 +static int dummy_dma_open(struct snd_pcm_substream *substream)
1875 +{
1876 + snd_soc_set_runtime_hwparams(substream, &dummy_dma_hardware);
1877 +
1878 + return 0;
1879 +}
1880 +
1881 +static struct snd_pcm_ops dummy_dma_ops = {
1882 + .open = dummy_dma_open,
1883 + .ioctl = snd_pcm_lib_ioctl,
1884 +};
1885 +
1886 +static struct snd_soc_platform_driver dummy_platform = {
1887 + .ops = &dummy_dma_ops,
1888 +};
1889
1890 static __devinit int snd_soc_dummy_probe(struct platform_device *pdev)
1891 {

  ViewVC Help
Powered by ViewVC 1.1.20