Advertisement
Guest User

patch-2.6.37.2-to-6_plus_v1_CFS_compaction_zcache_no-2.6.38

a guest
Apr 14th, 2011
1,321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 361.07 KB | None | 0 0
  1. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/microblaze/include/asm/uaccess.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/microblaze/include/asm/uaccess.h
  2. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/microblaze/include/asm/uaccess.h 2011-04-01 17:56:57.679710688 +0200
  3. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/microblaze/include/asm/uaccess.h 2011-04-02 01:37:43.889688353 +0200
  4. @@ -120,16 +120,16 @@ static inline unsigned long __must_check
  5. {
  6. /* normal memset with two words to __ex_table */
  7. __asm__ __volatile__ ( \
  8. - "1: sb r0, %2, r0;" \
  9. + "1: sb r0, %1, r0;" \
  10. " addik %0, %0, -1;" \
  11. " bneid %0, 1b;" \
  12. - " addik %2, %2, 1;" \
  13. + " addik %1, %1, 1;" \
  14. "2: " \
  15. __EX_TABLE_SECTION \
  16. ".word 1b,2b;" \
  17. ".previous;" \
  18. - : "=r"(n) \
  19. - : "0"(n), "r"(to)
  20. + : "=r"(n), "=r"(to) \
  21. + : "0"(n), "1"(to)
  22. );
  23. return n;
  24. }
  25. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/mips/alchemy/mtx-1/platform.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/mips/alchemy/mtx-1/platform.c
  26. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/mips/alchemy/mtx-1/platform.c 2011-04-01 17:56:57.802710686 +0200
  27. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/mips/alchemy/mtx-1/platform.c 2011-04-02 01:37:43.912688353 +0200
  28. @@ -28,6 +28,8 @@
  29. #include <linux/mtd/physmap.h>
  30. #include <mtd/mtd-abi.h>
  31.  
  32. +#include <asm/mach-au1x00/au1xxx_eth.h>
  33. +
  34. static struct gpio_keys_button mtx1_gpio_button[] = {
  35. {
  36. .gpio = 207,
  37. @@ -140,10 +142,17 @@ static struct __initdata platform_device
  38. &mtx1_mtd,
  39. };
  40.  
  41. +static struct au1000_eth_platform_data mtx1_au1000_eth0_pdata = {
  42. + .phy_search_highest_addr = 1,
  43. + .phy1_search_mac0 = 1,
  44. +};
  45. +
  46. static int __init mtx1_register_devices(void)
  47. {
  48. int rc;
  49.  
  50. + au1xxx_override_eth_cfg(0, &mtx1_au1000_eth0_pdata);
  51. +
  52. rc = gpio_request(mtx1_gpio_button[0].gpio,
  53. mtx1_gpio_button[0].desc);
  54. if (rc < 0) {
  55. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/parisc/kernel/irq.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/parisc/kernel/irq.c
  56. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/parisc/kernel/irq.c 2011-04-01 17:56:58.074710686 +0200
  57. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/parisc/kernel/irq.c 2011-04-02 01:37:44.182688351 +0200
  58. @@ -108,7 +108,7 @@ int cpu_check_affinity(unsigned int irq,
  59. int cpu_dest;
  60.  
  61. /* timer and ipi have to always be received on all CPUs */
  62. - if (CHECK_IRQ_PER_CPU(irq)) {
  63. + if (CHECK_IRQ_PER_CPU(irq_to_desc(irq)->status)) {
  64. /* Bad linux design decision. The mask has already
  65. * been set; we must reset it */
  66. cpumask_setall(irq_desc[irq].affinity);
  67. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/powerpc/include/asm/reg.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/powerpc/include/asm/reg.h
  68. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/powerpc/include/asm/reg.h 2011-04-01 17:56:58.308710687 +0200
  69. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/powerpc/include/asm/reg.h 2011-04-02 01:37:44.352688352 +0200
  70. @@ -878,6 +878,7 @@
  71. #define PV_970 0x0039
  72. #define PV_POWER5 0x003A
  73. #define PV_POWER5p 0x003B
  74. +#define PV_POWER7 0x003F
  75. #define PV_970FX 0x003C
  76. #define PV_630 0x0040
  77. #define PV_630p 0x0041
  78. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/powerpc/kernel/perf_event.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/powerpc/kernel/perf_event.c
  79. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/powerpc/kernel/perf_event.c 2011-04-01 17:56:58.321710687 +0200
  80. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/powerpc/kernel/perf_event.c 2011-04-02 01:37:44.392688351 +0200
  81. @@ -1268,6 +1268,28 @@ unsigned long perf_instruction_pointer(s
  82. return ip;
  83. }
  84.  
  85. +static bool pmc_overflow(unsigned long val)
  86. +{
  87. + if ((int)val < 0)
  88. + return true;
  89. +
  90. + /*
  91. + * Events on POWER7 can roll back if a speculative event doesn't
  92. + * eventually complete. Unfortunately in some rare cases they will
  93. + * raise a performance monitor exception. We need to catch this to
  94. + * ensure we reset the PMC. In all cases the PMC will be 256 or less
  95. + * cycles from overflow.
  96. + *
  97. + * We only do this if the first pass fails to find any overflowing
  98. + * PMCs because a user might set a period of less than 256 and we
  99. + * don't want to mistakenly reset them.
  100. + */
  101. + if (__is_processor(PV_POWER7) && ((0x80000000 - val) <= 256))
  102. + return true;
  103. +
  104. + return false;
  105. +}
  106. +
  107. /*
  108. * Performance monitor interrupt stuff
  109. */
  110. @@ -1315,7 +1337,7 @@ static void perf_event_interrupt(struct
  111. if (is_limited_pmc(i + 1))
  112. continue;
  113. val = read_pmc(i + 1);
  114. - if ((int)val < 0)
  115. + if (pmc_overflow(val))
  116. write_pmc(i + 1, 0);
  117. }
  118. }
  119. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/sh/kernel/ptrace_32.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/sh/kernel/ptrace_32.c
  120. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/sh/kernel/ptrace_32.c 2011-04-01 17:56:57.559710687 +0200
  121. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/sh/kernel/ptrace_32.c 2011-04-02 01:38:34.957688311 +0200
  122. @@ -101,6 +101,8 @@ static int set_single_step(struct task_s
  123.  
  124. attr = bp->attr;
  125. attr.bp_addr = addr;
  126. + /* reenable breakpoint */
  127. + attr.disabled = false;
  128. err = modify_user_hw_breakpoint(bp, &attr);
  129. if (unlikely(err))
  130. return err;
  131. @@ -392,6 +394,9 @@ long arch_ptrace(struct task_struct *chi
  132. tmp = 0;
  133. } else {
  134. unsigned long index;
  135. + ret = init_fpu(child);
  136. + if (ret)
  137. + break;
  138. index = addr - offsetof(struct user, fpu);
  139. tmp = ((unsigned long *)child->thread.xstate)
  140. [index >> 2];
  141. @@ -423,6 +428,9 @@ long arch_ptrace(struct task_struct *chi
  142. else if (addr >= offsetof(struct user, fpu) &&
  143. addr < offsetof(struct user, u_fpvalid)) {
  144. unsigned long index;
  145. + ret = init_fpu(child);
  146. + if (ret)
  147. + break;
  148. index = addr - offsetof(struct user, fpu);
  149. set_stopped_child_used_math(child);
  150. ((unsigned long *)child->thread.xstate)
  151. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/sh/kernel/ptrace_64.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/sh/kernel/ptrace_64.c
  152. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/sh/kernel/ptrace_64.c 2011-04-01 17:56:57.559710687 +0200
  153. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/sh/kernel/ptrace_64.c 2011-04-02 01:38:34.958688308 +0200
  154. @@ -403,6 +403,9 @@ long arch_ptrace(struct task_struct *chi
  155. else if ((addr >= offsetof(struct user, fpu)) &&
  156. (addr < offsetof(struct user, u_fpvalid))) {
  157. unsigned long index;
  158. + ret = init_fpu(child);
  159. + if (ret)
  160. + break;
  161. index = addr - offsetof(struct user, fpu);
  162. tmp = get_fpu_long(child, index);
  163. } else if (addr == offsetof(struct user, u_fpvalid)) {
  164. @@ -442,6 +445,9 @@ long arch_ptrace(struct task_struct *chi
  165. else if ((addr >= offsetof(struct user, fpu)) &&
  166. (addr < offsetof(struct user, u_fpvalid))) {
  167. unsigned long index;
  168. + ret = init_fpu(child);
  169. + if (ret)
  170. + break;
  171. index = addr - offsetof(struct user, fpu);
  172. ret = put_fpu_long(child, index, data);
  173. }
  174. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/acpi.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/acpi.h
  175. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/acpi.h 2011-04-01 17:56:58.767710686 +0200
  176. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/acpi.h 2011-04-02 01:37:44.751688352 +0200
  177. @@ -88,6 +88,7 @@ extern int acpi_disabled;
  178. extern int acpi_pci_disabled;
  179. extern int acpi_skip_timer_override;
  180. extern int acpi_use_timer_override;
  181. +extern int acpi_fix_pin2_polarity;
  182.  
  183. extern u8 acpi_sci_flags;
  184. extern int acpi_sci_override_gsi;
  185. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/msr-index.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/msr-index.h
  186. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/msr-index.h 2011-04-01 17:56:58.750710687 +0200
  187. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/msr-index.h 2011-04-02 01:38:34.959688308 +0200
  188. @@ -36,6 +36,11 @@
  189. #define MSR_IA32_PERFCTR1 0x000000c2
  190. #define MSR_FSB_FREQ 0x000000cd
  191.  
  192. +#define MSR_NHM_SNB_PKG_CST_CFG_CTL 0x000000e2
  193. +#define NHM_C3_AUTO_DEMOTE (1UL << 25)
  194. +#define NHM_C1_AUTO_DEMOTE (1UL << 26)
  195. +#define ATM_LNC_C6_AUTO_DEMOTE (1UL << 25)
  196. +
  197. #define MSR_MTRRcap 0x000000fe
  198. #define MSR_IA32_BBL_CR_CTL 0x00000119
  199.  
  200. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/pgtable-3level.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/pgtable-3level.h
  201. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/pgtable-3level.h 2011-04-01 17:56:58.758710687 +0200
  202. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/pgtable-3level.h 2011-04-02 01:37:44.750688352 +0200
  203. @@ -69,8 +69,6 @@ static inline void native_pmd_clear(pmd_
  204.  
  205. static inline void pud_clear(pud_t *pudp)
  206. {
  207. - unsigned long pgd;
  208. -
  209. set_pud(pudp, __pud(0));
  210.  
  211. /*
  212. @@ -79,13 +77,10 @@ static inline void pud_clear(pud_t *pudp
  213. * section 8.1: in PAE mode we explicitly have to flush the
  214. * TLB via cr3 if the top-level pgd is changed...
  215. *
  216. - * Make sure the pud entry we're updating is within the
  217. - * current pgd to avoid unnecessary TLB flushes.
  218. + * Currently all places where pud_clear() is called either have
  219. + * flush_tlb_mm() followed or don't need TLB flush (x86_64 code or
  220. + * pud_clear_bad()), so we don't need TLB flush here.
  221. */
  222. - pgd = read_cr3();
  223. - if (__pa(pudp) >= pgd && __pa(pudp) <
  224. - (pgd + sizeof(pgd_t)*PTRS_PER_PGD))
  225. - write_cr3(pgd);
  226. }
  227.  
  228. #ifdef CONFIG_SMP
  229. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/smpboot_hooks.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/smpboot_hooks.h
  230. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/smpboot_hooks.h 2011-04-01 17:56:58.770710687 +0200
  231. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/include/asm/smpboot_hooks.h 2011-04-02 01:37:44.755688351 +0200
  232. @@ -34,7 +34,7 @@ static inline void smpboot_restore_warm_
  233. */
  234. CMOS_WRITE(0, 0xf);
  235.  
  236. - *((volatile long *)phys_to_virt(apic->trampoline_phys_low)) = 0;
  237. + *((volatile u32 *)phys_to_virt(apic->trampoline_phys_low)) = 0;
  238. }
  239.  
  240. static inline void __init smpboot_setup_io_apic(void)
  241. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/acpi/boot.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/acpi/boot.c
  242. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/acpi/boot.c 2011-04-01 17:56:58.783710687 +0200
  243. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/acpi/boot.c 2011-04-02 01:37:44.766688351 +0200
  244. @@ -72,6 +72,7 @@ u8 acpi_sci_flags __initdata;
  245. int acpi_sci_override_gsi __initdata;
  246. int acpi_skip_timer_override __initdata;
  247. int acpi_use_timer_override __initdata;
  248. +int acpi_fix_pin2_polarity __initdata;
  249.  
  250. #ifdef CONFIG_X86_LOCAL_APIC
  251. static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
  252. @@ -410,10 +411,15 @@ acpi_parse_int_src_ovr(struct acpi_subta
  253. return 0;
  254. }
  255.  
  256. - if (acpi_skip_timer_override &&
  257. - intsrc->source_irq == 0 && intsrc->global_irq == 2) {
  258. - printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
  259. - return 0;
  260. + if (intsrc->source_irq == 0 && intsrc->global_irq == 2) {
  261. + if (acpi_skip_timer_override) {
  262. + printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
  263. + return 0;
  264. + }
  265. + if (acpi_fix_pin2_polarity && (intsrc->inti_flags & ACPI_MADT_POLARITY_MASK)) {
  266. + intsrc->inti_flags &= ~ACPI_MADT_POLARITY_MASK;
  267. + printk(PREFIX "BIOS IRQ0 pin2 override: forcing polarity to high active.\n");
  268. + }
  269. }
  270.  
  271. mp_override_legacy_irq(intsrc->source_irq,
  272. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/alternative.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/alternative.c
  273. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/alternative.c 2011-04-01 17:56:58.793710687 +0200
  274. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/alternative.c 2011-04-02 01:37:44.768688352 +0200
  275. @@ -417,7 +417,12 @@ int alternatives_text_reserved(void *sta
  276. return 1;
  277. }
  278. }
  279. -
  280. + /*
  281. + * Intel Archiecture Software Developer's Manual section 7.1.3 specifies
  282. + * that a core serializing instruction such as "cpuid" should be
  283. + * executed on _each_ core before the new instruction is made visible.
  284. + */
  285. + sync_core();
  286. return 0;
  287. }
  288. #endif
  289. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/check.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/check.c
  290. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/check.c 2011-04-01 17:56:58.792710687 +0200
  291. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/check.c 2011-04-02 01:37:44.766688352 +0200
  292. @@ -106,8 +106,8 @@ void __init setup_bios_corruption_check(
  293. addr += size;
  294. }
  295.  
  296. - printk(KERN_INFO "Scanning %d areas for low memory corruption\n",
  297. - num_scan_areas);
  298. + if (num_scan_areas)
  299. + printk(KERN_INFO "Scanning %d areas for low memory corruption\n", num_scan_areas);
  300. }
  301.  
  302.  
  303. @@ -143,12 +143,12 @@ static void check_corruption(struct work
  304. {
  305. check_for_bios_corruption();
  306. schedule_delayed_work(&bios_check_work,
  307. - round_jiffies_relative(corruption_check_period*HZ));
  308. + round_jiffies_relative(corruption_check_period*HZ));
  309. }
  310.  
  311. static int start_periodic_check_for_corruption(void)
  312. {
  313. - if (!memory_corruption_check || corruption_check_period == 0)
  314. + if (!num_scan_areas || !memory_corruption_check || corruption_check_period == 0)
  315. return 0;
  316.  
  317. printk(KERN_INFO "Scanning for low memory corruption every %d seconds\n",
  318. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
  319. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c 2011-04-01 17:56:58.781710687 +0200
  320. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c 2011-04-02 01:37:44.758688352 +0200
  321. @@ -195,7 +195,7 @@ static unsigned int pcc_get_freq(unsigne
  322. cmd_incomplete:
  323. iowrite16(0, &pcch_hdr->status);
  324. spin_unlock(&pcc_lock);
  325. - return -EINVAL;
  326. + return 0;
  327. }
  328.  
  329. static int pcc_cpufreq_target(struct cpufreq_policy *policy,
  330. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/e820.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/e820.c
  331. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/e820.c 2011-04-01 17:56:58.773710687 +0200
  332. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/e820.c 2011-04-02 01:37:44.757688352 +0200
  333. @@ -846,15 +846,21 @@ static int __init parse_memopt(char *p)
  334. if (!p)
  335. return -EINVAL;
  336.  
  337. -#ifdef CONFIG_X86_32
  338. if (!strcmp(p, "nopentium")) {
  339. +#ifdef CONFIG_X86_32
  340. setup_clear_cpu_cap(X86_FEATURE_PSE);
  341. return 0;
  342. - }
  343. +#else
  344. + printk(KERN_WARNING "mem=nopentium ignored! (only supported on x86_32)\n");
  345. + return -EINVAL;
  346. #endif
  347. + }
  348.  
  349. userdef = 1;
  350. mem_size = memparse(p, &p);
  351. + /* don't remove all of memory when handling "mem={invalid}" param */
  352. + if (mem_size == 0)
  353. + return -EINVAL;
  354. e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
  355.  
  356. return 0;
  357. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/early-quirks.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/early-quirks.c
  358. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/early-quirks.c 2011-04-01 17:56:58.793710687 +0200
  359. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/early-quirks.c 2011-04-02 01:37:44.768688352 +0200
  360. @@ -143,15 +143,10 @@ static void __init ati_bugs(int num, int
  361.  
  362. static u32 __init ati_sbx00_rev(int num, int slot, int func)
  363. {
  364. - u32 old, d;
  365. + u32 d;
  366.  
  367. - d = read_pci_config(num, slot, func, 0x70);
  368. - old = d;
  369. - d &= ~(1<<8);
  370. - write_pci_config(num, slot, func, 0x70, d);
  371. d = read_pci_config(num, slot, func, 0x8);
  372. d &= 0xff;
  373. - write_pci_config(num, slot, func, 0x70, old);
  374.  
  375. return d;
  376. }
  377. @@ -160,11 +155,19 @@ static void __init ati_bugs_contd(int nu
  378. {
  379. u32 d, rev;
  380.  
  381. - if (acpi_use_timer_override)
  382. + rev = ati_sbx00_rev(num, slot, func);
  383. + if (rev >= 0x40)
  384. + acpi_fix_pin2_polarity = 1;
  385. +
  386. + /*
  387. + * SB600: revisions 0x11, 0x12, 0x13, 0x14, ...
  388. + * SB700: revisions 0x39, 0x3a, ...
  389. + * SB800: revisions 0x40, 0x41, ...
  390. + */
  391. + if (rev >= 0x39)
  392. return;
  393.  
  394. - rev = ati_sbx00_rev(num, slot, func);
  395. - if (rev > 0x13)
  396. + if (acpi_use_timer_override)
  397. return;
  398.  
  399. /* check for IRQ0 interrupt swap */
  400. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/entry_64.S linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/entry_64.S
  401. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/entry_64.S 2011-04-01 17:56:58.792710687 +0200
  402. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/entry_64.S 2011-04-02 01:37:44.766688352 +0200
  403. @@ -1238,7 +1238,7 @@ ENTRY(xen_do_hypervisor_callback) # do
  404. decl PER_CPU_VAR(irq_count)
  405. jmp error_exit
  406. CFI_ENDPROC
  407. -END(do_hypervisor_callback)
  408. +END(xen_do_hypervisor_callback)
  409.  
  410. /*
  411. * Hypervisor uses this for application faults while it executes.
  412. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/head64.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/head64.c
  413. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/head64.c 2011-04-01 17:56:58.792710687 +0200
  414. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/head64.c 2011-04-02 01:38:34.959688308 +0200
  415. @@ -77,9 +77,6 @@ void __init x86_64_start_kernel(char * r
  416. /* Make NULL pointers segfault */
  417. zap_identity_mappings();
  418.  
  419. - /* Cleanup the over mapped high alias */
  420. - cleanup_highmap();
  421. -
  422. max_pfn_mapped = KERNEL_IMAGE_SIZE >> PAGE_SHIFT;
  423.  
  424. for (i = 0; i < NUM_EXCEPTION_VECTORS; i++) {
  425. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/setup.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/setup.c
  426. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/setup.c 2011-04-01 17:56:58.773710687 +0200
  427. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/kernel/setup.c 2011-04-02 01:38:34.959688309 +0200
  428. @@ -297,6 +297,9 @@ static void __init init_gbpages(void)
  429. static inline void init_gbpages(void)
  430. {
  431. }
  432. +static void __init cleanup_highmap(void)
  433. +{
  434. +}
  435. #endif
  436.  
  437. static void __init reserve_brk(void)
  438. @@ -922,6 +925,8 @@ void __init setup_arch(char **cmdline_p)
  439. */
  440. reserve_brk();
  441.  
  442. + cleanup_highmap();
  443. +
  444. memblock.current_limit = get_max_mapped();
  445. memblock_x86_fill();
  446.  
  447. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/fault.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/fault.c
  448. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/fault.c 2011-04-01 17:57:39.313710653 +0200
  449. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/fault.c 2011-04-02 01:37:44.756688351 +0200
  450. @@ -827,6 +827,13 @@ mm_fault_error(struct pt_regs *regs, uns
  451. unsigned long address, unsigned int fault)
  452. {
  453. if (fault & VM_FAULT_OOM) {
  454. + /* Kernel mode? Handle exceptions or die: */
  455. + if (!(error_code & PF_USER)) {
  456. + up_read(&current->mm->mmap_sem);
  457. + no_context(regs, error_code, address);
  458. + return;
  459. + }
  460. +
  461. out_of_memory(regs, error_code, address);
  462. } else {
  463. if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON|
  464. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/init_64.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/init_64.c
  465. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/init_64.c 2011-04-01 17:57:39.314710653 +0200
  466. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/init_64.c 2011-04-02 01:38:34.960688312 +0200
  467. @@ -51,6 +51,7 @@
  468. #include <asm/numa.h>
  469. #include <asm/cacheflush.h>
  470. #include <asm/init.h>
  471. +#include <asm/setup.h>
  472.  
  473. static int __init parse_direct_gbpages_off(char *arg)
  474. {
  475. @@ -293,18 +294,18 @@ void __init init_extra_mapping_uc(unsign
  476. * to the compile time generated pmds. This results in invalid pmds up
  477. * to the point where we hit the physaddr 0 mapping.
  478. *
  479. - * We limit the mappings to the region from _text to _end. _end is
  480. - * rounded up to the 2MB boundary. This catches the invalid pmds as
  481. + * We limit the mappings to the region from _text to _brk_end. _brk_end
  482. + * is rounded up to the 2MB boundary. This catches the invalid pmds as
  483. * well, as they are located before _text:
  484. */
  485. void __init cleanup_highmap(void)
  486. {
  487. unsigned long vaddr = __START_KERNEL_map;
  488. - unsigned long end = roundup((unsigned long)_end, PMD_SIZE) - 1;
  489. + unsigned long vaddr_end = __START_KERNEL_map + (max_pfn_mapped << PAGE_SHIFT);
  490. + unsigned long end = roundup((unsigned long)_brk_end, PMD_SIZE) - 1;
  491. pmd_t *pmd = level2_kernel_pgt;
  492. - pmd_t *last_pmd = pmd + PTRS_PER_PMD;
  493.  
  494. - for (; pmd < last_pmd; pmd++, vaddr += PMD_SIZE) {
  495. + for (; vaddr + PMD_SIZE - 1 < vaddr_end; pmd++, vaddr += PMD_SIZE) {
  496. if (pmd_none(*pmd))
  497. continue;
  498. if (vaddr < (unsigned long) _text || vaddr > end)
  499. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/init.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/init.c
  500. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/init.c 2011-04-01 17:56:58.771710687 +0200
  501. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/init.c 2011-04-02 01:38:34.962688312 +0200
  502. @@ -279,25 +279,6 @@ unsigned long __init_refok init_memory_m
  503. load_cr3(swapper_pg_dir);
  504. #endif
  505.  
  506. -#ifdef CONFIG_X86_64
  507. - if (!after_bootmem && !start) {
  508. - pud_t *pud;
  509. - pmd_t *pmd;
  510. -
  511. - mmu_cr4_features = read_cr4();
  512. -
  513. - /*
  514. - * _brk_end cannot change anymore, but it and _end may be
  515. - * located on different 2M pages. cleanup_highmap(), however,
  516. - * can only consider _end when it runs, so destroy any
  517. - * mappings beyond _brk_end here.
  518. - */
  519. - pud = pud_offset(pgd_offset_k(_brk_end), _brk_end);
  520. - pmd = pmd_offset(pud, _brk_end - 1);
  521. - while (++pmd <= pmd_offset(pud, (unsigned long)_end - 1))
  522. - pmd_clear(pmd);
  523. - }
  524. -#endif
  525. __flush_tlb_all();
  526.  
  527. if (!after_bootmem && e820_table_end > e820_table_start)
  528. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/pgtable.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/pgtable.c
  529. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/pgtable.c 2011-04-01 17:57:39.314710653 +0200
  530. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/mm/pgtable.c 2011-04-02 01:37:44.756688352 +0200
  531. @@ -168,8 +168,7 @@ void pud_populate(struct mm_struct *mm,
  532. * section 8.1: in PAE mode we explicitly have to flush the
  533. * TLB via cr3 if the top-level pgd is changed...
  534. */
  535. - if (mm == current->active_mm)
  536. - write_cr3(read_cr3());
  537. + flush_tlb_mm(mm);
  538. }
  539. #else /* !CONFIG_X86_PAE */
  540.  
  541. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/xen/mmu.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/xen/mmu.c
  542. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/xen/mmu.c 2011-04-01 17:57:39.315710653 +0200
  543. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//arch/x86/xen/mmu.c 2011-04-02 01:38:34.963688312 +0200
  544. @@ -2027,9 +2027,6 @@ static __init void xen_map_identity_earl
  545. for (pteidx = 0; pteidx < PTRS_PER_PTE; pteidx++, pfn++) {
  546. pte_t pte;
  547.  
  548. - if (pfn > max_pfn_mapped)
  549. - max_pfn_mapped = pfn;
  550. -
  551. if (!pte_none(pte_page[pteidx]))
  552. continue;
  553.  
  554. @@ -2087,6 +2084,12 @@ __init pgd_t *xen_setup_kernel_pagetable
  555. pud_t *l3;
  556. pmd_t *l2;
  557.  
  558. + /* max_pfn_mapped is the last pfn mapped in the initial memory
  559. + * mappings. Considering that on Xen after the kernel mappings we
  560. + * have the mappings of some pages that don't exist in pfn space, we
  561. + * set max_pfn_mapped to the last real pfn mapped. */
  562. + max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->mfn_list));
  563. +
  564. /* Zap identity mapping */
  565. init_level4_pgt[0] = __pgd(0);
  566.  
  567. @@ -2191,9 +2194,7 @@ __init pgd_t *xen_setup_kernel_pagetable
  568. initial_kernel_pmd =
  569. extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE);
  570.  
  571. - max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) +
  572. - xen_start_info->nr_pt_frames * PAGE_SIZE +
  573. - 512*1024);
  574. + max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->mfn_list));
  575.  
  576. kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd);
  577. memcpy(initial_kernel_pmd, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD);
  578. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-core.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-core.c
  579. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-core.c 2011-04-01 17:56:55.969710689 +0200
  580. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-core.c 2011-04-02 01:37:42.118688354 +0200
  581. @@ -352,7 +352,7 @@ void blk_start_queue(struct request_queu
  582. WARN_ON(!irqs_disabled());
  583.  
  584. queue_flag_clear(QUEUE_FLAG_STOPPED, q);
  585. - __blk_run_queue(q);
  586. + __blk_run_queue(q, false);
  587. }
  588. EXPORT_SYMBOL(blk_start_queue);
  589.  
  590. @@ -403,13 +403,14 @@ EXPORT_SYMBOL(blk_sync_queue);
  591. /**
  592. * __blk_run_queue - run a single device queue
  593. * @q: The queue to run
  594. + * @force_kblockd: Don't run @q->request_fn directly. Use kblockd.
  595. *
  596. * Description:
  597. * See @blk_run_queue. This variant must be called with the queue lock
  598. * held and interrupts disabled.
  599. *
  600. */
  601. -void __blk_run_queue(struct request_queue *q)
  602. +void __blk_run_queue(struct request_queue *q, bool force_kblockd)
  603. {
  604. blk_remove_plug(q);
  605.  
  606. @@ -423,7 +424,7 @@ void __blk_run_queue(struct request_queu
  607. * Only recurse once to avoid overrunning the stack, let the unplug
  608. * handling reinvoke the handler shortly if we already got there.
  609. */
  610. - if (!queue_flag_test_and_set(QUEUE_FLAG_REENTER, q)) {
  611. + if (!force_kblockd && !queue_flag_test_and_set(QUEUE_FLAG_REENTER, q)) {
  612. q->request_fn(q);
  613. queue_flag_clear(QUEUE_FLAG_REENTER, q);
  614. } else {
  615. @@ -446,7 +447,7 @@ void blk_run_queue(struct request_queue
  616. unsigned long flags;
  617.  
  618. spin_lock_irqsave(q->queue_lock, flags);
  619. - __blk_run_queue(q);
  620. + __blk_run_queue(q, false);
  621. spin_unlock_irqrestore(q->queue_lock, flags);
  622. }
  623. EXPORT_SYMBOL(blk_run_queue);
  624. @@ -1053,7 +1054,7 @@ void blk_insert_request(struct request_q
  625.  
  626. drive_stat_acct(rq, 1);
  627. __elv_add_request(q, rq, where, 0);
  628. - __blk_run_queue(q);
  629. + __blk_run_queue(q, false);
  630. spin_unlock_irqrestore(q->queue_lock, flags);
  631. }
  632. EXPORT_SYMBOL(blk_insert_request);
  633. @@ -2610,13 +2611,6 @@ int kblockd_schedule_work(struct request
  634. }
  635. EXPORT_SYMBOL(kblockd_schedule_work);
  636.  
  637. -int kblockd_schedule_delayed_work(struct request_queue *q,
  638. - struct delayed_work *dwork, unsigned long delay)
  639. -{
  640. - return queue_delayed_work(kblockd_workqueue, dwork, delay);
  641. -}
  642. -EXPORT_SYMBOL(kblockd_schedule_delayed_work);
  643. -
  644. int __init blk_dev_init(void)
  645. {
  646. BUILD_BUG_ON(__REQ_NR_BITS > 8 *
  647. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-flush.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-flush.c
  648. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-flush.c 2011-04-01 17:57:39.319710653 +0200
  649. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-flush.c 2011-04-02 01:37:42.119688354 +0200
  650. @@ -66,10 +66,12 @@ static void blk_flush_complete_seq_end_i
  651.  
  652. /*
  653. * Moving a request silently to empty queue_head may stall the
  654. - * queue. Kick the queue in those cases.
  655. + * queue. Kick the queue in those cases. This function is called
  656. + * from request completion path and calling directly into
  657. + * request_fn may confuse the driver. Always use kblockd.
  658. */
  659. if (was_empty && next_rq)
  660. - __blk_run_queue(q);
  661. + __blk_run_queue(q, true);
  662. }
  663.  
  664. static void pre_flush_end_io(struct request *rq, int error)
  665. @@ -130,7 +132,7 @@ static struct request *queue_next_fseq(s
  666. BUG();
  667. }
  668.  
  669. - elv_insert(q, rq, ELEVATOR_INSERT_FRONT);
  670. + elv_insert(q, rq, ELEVATOR_INSERT_REQUEUE);
  671. return rq;
  672. }
  673.  
  674. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-lib.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-lib.c
  675. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-lib.c 2011-04-01 17:56:55.969710689 +0200
  676. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-lib.c 2011-04-02 01:37:42.119688354 +0200
  677. @@ -109,7 +109,6 @@ struct bio_batch
  678. atomic_t done;
  679. unsigned long flags;
  680. struct completion *wait;
  681. - bio_end_io_t *end_io;
  682. };
  683.  
  684. static void bio_batch_end_io(struct bio *bio, int err)
  685. @@ -122,12 +121,9 @@ static void bio_batch_end_io(struct bio
  686. else
  687. clear_bit(BIO_UPTODATE, &bb->flags);
  688. }
  689. - if (bb) {
  690. - if (bb->end_io)
  691. - bb->end_io(bio, err);
  692. - atomic_inc(&bb->done);
  693. - complete(bb->wait);
  694. - }
  695. + if (bb)
  696. + if (atomic_dec_and_test(&bb->done))
  697. + complete(bb->wait);
  698. bio_put(bio);
  699. }
  700.  
  701. @@ -150,13 +146,12 @@ int blkdev_issue_zeroout(struct block_de
  702. int ret;
  703. struct bio *bio;
  704. struct bio_batch bb;
  705. - unsigned int sz, issued = 0;
  706. + unsigned int sz;
  707. DECLARE_COMPLETION_ONSTACK(wait);
  708.  
  709. - atomic_set(&bb.done, 0);
  710. + atomic_set(&bb.done, 1);
  711. bb.flags = 1 << BIO_UPTODATE;
  712. bb.wait = &wait;
  713. - bb.end_io = NULL;
  714.  
  715. submit:
  716. ret = 0;
  717. @@ -185,12 +180,12 @@ submit:
  718. break;
  719. }
  720. ret = 0;
  721. - issued++;
  722. + atomic_inc(&bb.done);
  723. submit_bio(WRITE, bio);
  724. }
  725.  
  726. /* Wait for bios in-flight */
  727. - while (issued != atomic_read(&bb.done))
  728. + if (!atomic_dec_and_test(&bb.done))
  729. wait_for_completion(&wait);
  730.  
  731. if (!test_bit(BIO_UPTODATE, &bb.flags))
  732. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-throttle.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-throttle.c
  733. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-throttle.c 2011-04-01 17:56:55.969710689 +0200
  734. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/blk-throttle.c 2011-04-02 01:37:42.118688354 +0200
  735. @@ -20,6 +20,11 @@ static int throtl_quantum = 32;
  736. /* Throttling is performed over 100ms slice and after that slice is renewed */
  737. static unsigned long throtl_slice = HZ/10; /* 100 ms */
  738.  
  739. +/* A workqueue to queue throttle related work */
  740. +static struct workqueue_struct *kthrotld_workqueue;
  741. +static void throtl_schedule_delayed_work(struct throtl_data *td,
  742. + unsigned long delay);
  743. +
  744. struct throtl_rb_root {
  745. struct rb_root rb;
  746. struct rb_node *left;
  747. @@ -337,10 +342,9 @@ static void throtl_schedule_next_dispatc
  748. update_min_dispatch_time(st);
  749.  
  750. if (time_before_eq(st->min_disptime, jiffies))
  751. - throtl_schedule_delayed_work(td->queue, 0);
  752. + throtl_schedule_delayed_work(td, 0);
  753. else
  754. - throtl_schedule_delayed_work(td->queue,
  755. - (st->min_disptime - jiffies));
  756. + throtl_schedule_delayed_work(td, (st->min_disptime - jiffies));
  757. }
  758.  
  759. static inline void
  760. @@ -807,10 +811,10 @@ void blk_throtl_work(struct work_struct
  761. }
  762.  
  763. /* Call with queue lock held */
  764. -void throtl_schedule_delayed_work(struct request_queue *q, unsigned long delay)
  765. +static void
  766. +throtl_schedule_delayed_work(struct throtl_data *td, unsigned long delay)
  767. {
  768.  
  769. - struct throtl_data *td = q->td;
  770. struct delayed_work *dwork = &td->throtl_work;
  771.  
  772. if (total_nr_queued(td) > 0) {
  773. @@ -819,12 +823,11 @@ void throtl_schedule_delayed_work(struct
  774. * Cancel that and schedule a new one.
  775. */
  776. __cancel_delayed_work(dwork);
  777. - kblockd_schedule_delayed_work(q, dwork, delay);
  778. + queue_delayed_work(kthrotld_workqueue, dwork, delay);
  779. throtl_log(td, "schedule work. delay=%lu jiffies=%lu",
  780. delay, jiffies);
  781. }
  782. }
  783. -EXPORT_SYMBOL(throtl_schedule_delayed_work);
  784.  
  785. static void
  786. throtl_destroy_tg(struct throtl_data *td, struct throtl_grp *tg)
  787. @@ -912,7 +915,7 @@ static void throtl_update_blkio_group_re
  788. smp_mb__after_atomic_inc();
  789.  
  790. /* Schedule a work now to process the limit change */
  791. - throtl_schedule_delayed_work(td->queue, 0);
  792. + throtl_schedule_delayed_work(td, 0);
  793. }
  794.  
  795. static void throtl_update_blkio_group_write_bps(void *key,
  796. @@ -926,7 +929,7 @@ static void throtl_update_blkio_group_wr
  797. smp_mb__before_atomic_inc();
  798. atomic_inc(&td->limits_changed);
  799. smp_mb__after_atomic_inc();
  800. - throtl_schedule_delayed_work(td->queue, 0);
  801. + throtl_schedule_delayed_work(td, 0);
  802. }
  803.  
  804. static void throtl_update_blkio_group_read_iops(void *key,
  805. @@ -940,7 +943,7 @@ static void throtl_update_blkio_group_re
  806. smp_mb__before_atomic_inc();
  807. atomic_inc(&td->limits_changed);
  808. smp_mb__after_atomic_inc();
  809. - throtl_schedule_delayed_work(td->queue, 0);
  810. + throtl_schedule_delayed_work(td, 0);
  811. }
  812.  
  813. static void throtl_update_blkio_group_write_iops(void *key,
  814. @@ -954,7 +957,7 @@ static void throtl_update_blkio_group_wr
  815. smp_mb__before_atomic_inc();
  816. atomic_inc(&td->limits_changed);
  817. smp_mb__after_atomic_inc();
  818. - throtl_schedule_delayed_work(td->queue, 0);
  819. + throtl_schedule_delayed_work(td, 0);
  820. }
  821.  
  822. void throtl_shutdown_timer_wq(struct request_queue *q)
  823. @@ -1127,6 +1130,10 @@ void blk_throtl_exit(struct request_queu
  824.  
  825. static int __init throtl_init(void)
  826. {
  827. + kthrotld_workqueue = alloc_workqueue("kthrotld", WQ_MEM_RECLAIM, 0);
  828. + if (!kthrotld_workqueue)
  829. + panic("Failed to create kthrotld\n");
  830. +
  831. blkio_policy_register(&blkio_policy_throtl);
  832. return 0;
  833. }
  834. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/cfq-iosched.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/cfq-iosched.c
  835. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/cfq-iosched.c 2011-04-01 17:57:39.321710653 +0200
  836. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/cfq-iosched.c 2011-04-02 01:37:42.118688354 +0200
  837. @@ -3358,7 +3358,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, s
  838. cfqd->busy_queues > 1) {
  839. cfq_del_timer(cfqd, cfqq);
  840. cfq_clear_cfqq_wait_request(cfqq);
  841. - __blk_run_queue(cfqd->queue);
  842. + __blk_run_queue(cfqd->queue, false);
  843. } else {
  844. cfq_blkiocg_update_idle_time_stats(
  845. &cfqq->cfqg->blkg);
  846. @@ -3373,7 +3373,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, s
  847. * this new queue is RT and the current one is BE
  848. */
  849. cfq_preempt_queue(cfqd, cfqq);
  850. - __blk_run_queue(cfqd->queue);
  851. + __blk_run_queue(cfqd->queue, false);
  852. }
  853. }
  854.  
  855. @@ -3734,7 +3734,7 @@ static void cfq_kick_queue(struct work_s
  856. struct request_queue *q = cfqd->queue;
  857.  
  858. spin_lock_irq(q->queue_lock);
  859. - __blk_run_queue(cfqd->queue);
  860. + __blk_run_queue(cfqd->queue, false);
  861. spin_unlock_irq(q->queue_lock);
  862. }
  863.  
  864. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/elevator.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/elevator.c
  865. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/elevator.c 2011-04-01 17:56:55.969710689 +0200
  866. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/elevator.c 2011-04-02 01:37:42.118688354 +0200
  867. @@ -602,7 +602,7 @@ void elv_quiesce_start(struct request_qu
  868. */
  869. elv_drain_elevator(q);
  870. while (q->rq.elvpriv) {
  871. - __blk_run_queue(q);
  872. + __blk_run_queue(q, false);
  873. spin_unlock_irq(q->queue_lock);
  874. msleep(10);
  875. spin_lock_irq(q->queue_lock);
  876. @@ -651,7 +651,7 @@ void elv_insert(struct request_queue *q,
  877. * with anything. There's no point in delaying queue
  878. * processing.
  879. */
  880. - __blk_run_queue(q);
  881. + __blk_run_queue(q, false);
  882. break;
  883.  
  884. case ELEVATOR_INSERT_SORT:
  885. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/genhd.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/genhd.c
  886. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//block/genhd.c 2011-04-01 17:57:39.321710653 +0200
  887. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//block/genhd.c 2011-04-02 01:37:42.119688354 +0200
  888. @@ -1297,7 +1297,7 @@ int invalidate_partition(struct gendisk
  889. struct block_device *bdev = bdget_disk(disk, partno);
  890. if (bdev) {
  891. fsync_bdev(bdev);
  892. - res = __invalidate_device(bdev);
  893. + res = __invalidate_device(bdev, true);
  894. bdput(bdev);
  895. }
  896. return res;
  897. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//Documentation/i2c/instantiating-devices linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//Documentation/i2c/instantiating-devices
  898. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//Documentation/i2c/instantiating-devices 2011-04-01 17:56:55.963710689 +0200
  899. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//Documentation/i2c/instantiating-devices 2011-04-02 01:37:42.111688352 +0200
  900. @@ -100,7 +100,7 @@ static int __devinit usb_hcd_pnx4008_pro
  901. (...)
  902. i2c_adap = i2c_get_adapter(2);
  903. memset(&i2c_info, 0, sizeof(struct i2c_board_info));
  904. - strlcpy(i2c_info.name, "isp1301_pnx", I2C_NAME_SIZE);
  905. + strlcpy(i2c_info.type, "isp1301_pnx", I2C_NAME_SIZE);
  906. isp1301_i2c_client = i2c_new_probed_device(i2c_adap, &i2c_info,
  907. normal_i2c, NULL);
  908. i2c_put_adapter(i2c_adap);
  909. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//Documentation/networking/dns_resolver.txt linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//Documentation/networking/dns_resolver.txt
  910. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//Documentation/networking/dns_resolver.txt 2011-04-01 17:56:55.934710687 +0200
  911. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//Documentation/networking/dns_resolver.txt 2011-04-02 01:37:42.077688355 +0200
  912. @@ -61,7 +61,6 @@ before the more general line given above
  913. create dns_resolver foo:* * /usr/sbin/dns.foo %k
  914.  
  915.  
  916. -
  917. =====
  918. USAGE
  919. =====
  920. @@ -104,6 +103,14 @@ implemented in the module can be called
  921. returned also.
  922.  
  923.  
  924. +===============================
  925. +READING DNS KEYS FROM USERSPACE
  926. +===============================
  927. +
  928. +Keys of dns_resolver type can be read from userspace using keyctl_read() or
  929. +"keyctl read/print/pipe".
  930. +
  931. +
  932. =========
  933. MECHANISM
  934. =========
  935. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/acpi/debugfs.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/acpi/debugfs.c
  936. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/acpi/debugfs.c 2011-04-01 17:56:56.018710689 +0200
  937. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/acpi/debugfs.c 2011-04-02 01:37:42.173688354 +0200
  938. @@ -26,7 +26,9 @@ static ssize_t cm_write(struct file *fil
  939. size_t count, loff_t *ppos)
  940. {
  941. static char *buf;
  942. - static int uncopied_bytes;
  943. + static u32 max_size;
  944. + static u32 uncopied_bytes;
  945. +
  946. struct acpi_table_header table;
  947. acpi_status status;
  948.  
  949. @@ -37,19 +39,24 @@ static ssize_t cm_write(struct file *fil
  950. if (copy_from_user(&table, user_buf,
  951. sizeof(struct acpi_table_header)))
  952. return -EFAULT;
  953. - uncopied_bytes = table.length;
  954. - buf = kzalloc(uncopied_bytes, GFP_KERNEL);
  955. + uncopied_bytes = max_size = table.length;
  956. + buf = kzalloc(max_size, GFP_KERNEL);
  957. if (!buf)
  958. return -ENOMEM;
  959. }
  960.  
  961. - if (uncopied_bytes < count) {
  962. - kfree(buf);
  963. + if (buf == NULL)
  964. + return -EINVAL;
  965. +
  966. + if ((*ppos > max_size) ||
  967. + (*ppos + count > max_size) ||
  968. + (*ppos + count < count) ||
  969. + (count > uncopied_bytes))
  970. return -EINVAL;
  971. - }
  972.  
  973. if (copy_from_user(buf + (*ppos), user_buf, count)) {
  974. kfree(buf);
  975. + buf = NULL;
  976. return -EFAULT;
  977. }
  978.  
  979. @@ -59,6 +66,7 @@ static ssize_t cm_write(struct file *fil
  980. if (!uncopied_bytes) {
  981. status = acpi_install_method(buf);
  982. kfree(buf);
  983. + buf = NULL;
  984. if (ACPI_FAILURE(status))
  985. return -EINVAL;
  986. add_taint(TAINT_OVERRIDDEN_ACPI_TABLE);
  987. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/ata/ahci.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/ata/ahci.c
  988. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/ata/ahci.c 2011-04-01 17:56:56.028710689 +0200
  989. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/ata/ahci.c 2011-04-02 01:37:42.183688354 +0200
  990. @@ -260,6 +260,8 @@ static const struct pci_device_id ahci_p
  991. { PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */
  992. { PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */
  993. { PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */
  994. + { PCI_VDEVICE(INTEL, 0x2826), board_ahci }, /* PBG RAID */
  995. + { PCI_VDEVICE(INTEL, 0x2323), board_ahci }, /* DH89xxCC AHCI */
  996.  
  997. /* JMicron 360/1/3/5/6, match class to avoid IDE function */
  998. { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
  999. @@ -380,6 +382,8 @@ static const struct pci_device_id ahci_p
  1000. { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */
  1001. { PCI_DEVICE(0x1b4b, 0x9123),
  1002. .driver_data = board_ahci_yes_fbs }, /* 88se9128 */
  1003. + { PCI_DEVICE(0x1b4b, 0x9125),
  1004. + .driver_data = board_ahci_yes_fbs }, /* 88se9125 */
  1005.  
  1006. /* Promise */
  1007. { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */
  1008. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/ata/libata-eh.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/ata/libata-eh.c
  1009. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/ata/libata-eh.c 2011-04-01 17:56:56.028710689 +0200
  1010. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/ata/libata-eh.c 2011-04-02 01:37:42.184688354 +0200
  1011. @@ -1618,7 +1618,7 @@ static void ata_eh_analyze_serror(struct
  1012. * host links. For disabled PMP links, only N bit is
  1013. * considered as X bit is left at 1 for link plugging.
  1014. */
  1015. - if (link->lpm_policy != ATA_LPM_MAX_POWER)
  1016. + if (link->lpm_policy > ATA_LPM_MAX_POWER)
  1017. hotplug_mask = 0; /* hotplug doesn't work w/ LPM */
  1018. else if (!(link->flags & ATA_LFLAG_DISABLED) || ata_is_host_link(link))
  1019. hotplug_mask = SERR_PHYRDY_CHG | SERR_DEV_XCHG;
  1020. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/block/floppy.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/block/floppy.c
  1021. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/block/floppy.c 2011-04-01 17:56:56.020710689 +0200
  1022. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/block/floppy.c 2011-04-02 01:37:42.176688354 +0200
  1023. @@ -3276,7 +3276,7 @@ static int set_geometry(unsigned int cmd
  1024. struct block_device *bdev = opened_bdev[cnt];
  1025. if (!bdev || ITYPE(drive_state[cnt].fd_device) != type)
  1026. continue;
  1027. - __invalidate_device(bdev);
  1028. + __invalidate_device(bdev, true);
  1029. }
  1030. mutex_unlock(&open_lock);
  1031. } else {
  1032. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/block/loop.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/block/loop.c
  1033. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/block/loop.c 2011-04-01 17:56:56.021710689 +0200
  1034. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/block/loop.c 2011-04-02 01:37:42.176688354 +0200
  1035. @@ -78,7 +78,6 @@
  1036.  
  1037. #include <asm/uaccess.h>
  1038.  
  1039. -static DEFINE_MUTEX(loop_mutex);
  1040. static LIST_HEAD(loop_devices);
  1041. static DEFINE_MUTEX(loop_devices_mutex);
  1042.  
  1043. @@ -1505,11 +1504,9 @@ static int lo_open(struct block_device *
  1044. {
  1045. struct loop_device *lo = bdev->bd_disk->private_data;
  1046.  
  1047. - mutex_lock(&loop_mutex);
  1048. mutex_lock(&lo->lo_ctl_mutex);
  1049. lo->lo_refcnt++;
  1050. mutex_unlock(&lo->lo_ctl_mutex);
  1051. - mutex_unlock(&loop_mutex);
  1052.  
  1053. return 0;
  1054. }
  1055. @@ -1519,7 +1516,6 @@ static int lo_release(struct gendisk *di
  1056. struct loop_device *lo = disk->private_data;
  1057. int err;
  1058.  
  1059. - mutex_lock(&loop_mutex);
  1060. mutex_lock(&lo->lo_ctl_mutex);
  1061.  
  1062. if (--lo->lo_refcnt)
  1063. @@ -1544,7 +1540,6 @@ static int lo_release(struct gendisk *di
  1064. out:
  1065. mutex_unlock(&lo->lo_ctl_mutex);
  1066. out_unlocked:
  1067. - mutex_unlock(&loop_mutex);
  1068. return 0;
  1069. }
  1070.  
  1071. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/bluetooth/ath3k.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/bluetooth/ath3k.c
  1072. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/bluetooth/ath3k.c 2011-04-01 17:56:56.022710689 +0200
  1073. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/bluetooth/ath3k.c 2011-04-02 01:37:42.178688354 +0200
  1074. @@ -39,6 +39,11 @@ static struct usb_device_id ath3k_table[
  1075. /* Atheros AR3011 with sflash firmware*/
  1076. { USB_DEVICE(0x0CF3, 0x3002) },
  1077.  
  1078. + /* Atheros AR9285 Malbec with sflash firmware */
  1079. + { USB_DEVICE(0x03F0, 0x311D) },
  1080. +
  1081. + /* Atheros AR5BBU12 with sflash firmware */
  1082. + { USB_DEVICE(0x0489, 0xE02C) },
  1083. { } /* Terminating entry */
  1084. };
  1085.  
  1086. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/bluetooth/btusb.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/bluetooth/btusb.c
  1087. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/bluetooth/btusb.c 2011-04-01 17:56:56.022710689 +0200
  1088. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/bluetooth/btusb.c 2011-04-02 01:37:42.178688354 +0200
  1089. @@ -102,6 +102,12 @@ static struct usb_device_id blacklist_ta
  1090. /* Atheros 3011 with sflash firmware */
  1091. { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE },
  1092.  
  1093. + /* Atheros AR9285 Malbec with sflash firmware */
  1094. + { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
  1095. +
  1096. + /* Atheros AR5BBU12 with sflash firmware */
  1097. + { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
  1098. +
  1099. /* Broadcom BCM2035 */
  1100. { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU },
  1101. { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU },
  1102. @@ -826,7 +832,7 @@ static void btusb_work(struct work_struc
  1103.  
  1104. if (hdev->conn_hash.sco_num > 0) {
  1105. if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) {
  1106. - err = usb_autopm_get_interface(data->isoc);
  1107. + err = usb_autopm_get_interface(data->isoc ? data->isoc : data->intf);
  1108. if (err < 0) {
  1109. clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
  1110. usb_kill_anchored_urbs(&data->isoc_anchor);
  1111. @@ -855,7 +861,7 @@ static void btusb_work(struct work_struc
  1112.  
  1113. __set_isoc_interface(hdev, 0);
  1114. if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags))
  1115. - usb_autopm_put_interface(data->isoc);
  1116. + usb_autopm_put_interface(data->isoc ? data->isoc : data->intf);
  1117. }
  1118. }
  1119.  
  1120. @@ -1038,8 +1044,6 @@ static int btusb_probe(struct usb_interf
  1121.  
  1122. usb_set_intfdata(intf, data);
  1123.  
  1124. - usb_enable_autosuspend(interface_to_usbdev(intf));
  1125. -
  1126. return 0;
  1127. }
  1128.  
  1129. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/char/virtio_console.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/char/virtio_console.c
  1130. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/char/virtio_console.c 2011-04-01 17:56:56.054710689 +0200
  1131. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/char/virtio_console.c 2011-04-02 01:37:42.211688354 +0200
  1132. @@ -387,6 +387,10 @@ static void discard_port_data(struct por
  1133. unsigned int len;
  1134. int ret;
  1135.  
  1136. + if (!port->portdev) {
  1137. + /* Device has been unplugged. vqs are already gone. */
  1138. + return;
  1139. + }
  1140. vq = port->in_vq;
  1141. if (port->inbuf)
  1142. buf = port->inbuf;
  1143. @@ -469,6 +473,10 @@ static void reclaim_consumed_buffers(str
  1144. void *buf;
  1145. unsigned int len;
  1146.  
  1147. + if (!port->portdev) {
  1148. + /* Device has been unplugged. vqs are already gone. */
  1149. + return;
  1150. + }
  1151. while ((buf = virtqueue_get_buf(port->out_vq, &len))) {
  1152. kfree(buf);
  1153. port->outvq_full = false;
  1154. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/firmware/dcdbas.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/firmware/dcdbas.c
  1155. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/firmware/dcdbas.c 2011-04-01 17:56:55.972710689 +0200
  1156. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/firmware/dcdbas.c 2011-04-02 01:38:34.963688312 +0200
  1157. @@ -268,8 +268,10 @@ int dcdbas_smi_request(struct smi_cmd *s
  1158. }
  1159.  
  1160. /* generate SMI */
  1161. + /* inb to force posted write through and make SMI happen now */
  1162. asm volatile (
  1163. - "outb %b0,%w1"
  1164. + "outb %b0,%w1\n"
  1165. + "inb %w1"
  1166. : /* no output args */
  1167. : "a" (smi_cmd->command_code),
  1168. "d" (smi_cmd->command_address),
  1169. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_crtc.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_crtc.c
  1170. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_crtc.c 2011-04-01 17:56:56.354710688 +0200
  1171. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_crtc.c 2011-04-02 01:38:34.964688312 +0200
  1172. @@ -1073,6 +1073,9 @@ int drm_mode_getresources(struct drm_dev
  1173. uint32_t __user *encoder_id;
  1174. struct drm_mode_group *mode_group;
  1175.  
  1176. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1177. + return -EINVAL;
  1178. +
  1179. mutex_lock(&dev->mode_config.mutex);
  1180.  
  1181. /*
  1182. @@ -1244,6 +1247,9 @@ int drm_mode_getcrtc(struct drm_device *
  1183. struct drm_mode_object *obj;
  1184. int ret = 0;
  1185.  
  1186. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1187. + return -EINVAL;
  1188. +
  1189. mutex_lock(&dev->mode_config.mutex);
  1190.  
  1191. obj = drm_mode_object_find(dev, crtc_resp->crtc_id,
  1192. @@ -1312,6 +1318,9 @@ int drm_mode_getconnector(struct drm_dev
  1193. uint64_t __user *prop_values;
  1194. uint32_t __user *encoder_ptr;
  1195.  
  1196. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1197. + return -EINVAL;
  1198. +
  1199. memset(&u_mode, 0, sizeof(struct drm_mode_modeinfo));
  1200.  
  1201. DRM_DEBUG_KMS("[CONNECTOR:%d:?]\n", out_resp->connector_id);
  1202. @@ -1431,6 +1440,9 @@ int drm_mode_getencoder(struct drm_devic
  1203. struct drm_encoder *encoder;
  1204. int ret = 0;
  1205.  
  1206. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1207. + return -EINVAL;
  1208. +
  1209. mutex_lock(&dev->mode_config.mutex);
  1210. obj = drm_mode_object_find(dev, enc_resp->encoder_id,
  1211. DRM_MODE_OBJECT_ENCODER);
  1212. @@ -1486,6 +1498,9 @@ int drm_mode_setcrtc(struct drm_device *
  1213. int ret = 0;
  1214. int i;
  1215.  
  1216. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1217. + return -EINVAL;
  1218. +
  1219. mutex_lock(&dev->mode_config.mutex);
  1220. obj = drm_mode_object_find(dev, crtc_req->crtc_id,
  1221. DRM_MODE_OBJECT_CRTC);
  1222. @@ -1603,6 +1618,9 @@ int drm_mode_cursor_ioctl(struct drm_dev
  1223. struct drm_crtc *crtc;
  1224. int ret = 0;
  1225.  
  1226. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1227. + return -EINVAL;
  1228. +
  1229. if (!req->flags) {
  1230. DRM_ERROR("no operation set\n");
  1231. return -EINVAL;
  1232. @@ -1667,6 +1685,9 @@ int drm_mode_addfb(struct drm_device *de
  1233. struct drm_framebuffer *fb;
  1234. int ret = 0;
  1235.  
  1236. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1237. + return -EINVAL;
  1238. +
  1239. if ((config->min_width > r->width) || (r->width > config->max_width)) {
  1240. DRM_ERROR("mode new framebuffer width not within limits\n");
  1241. return -EINVAL;
  1242. @@ -1724,6 +1745,9 @@ int drm_mode_rmfb(struct drm_device *dev
  1243. int ret = 0;
  1244. int found = 0;
  1245.  
  1246. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1247. + return -EINVAL;
  1248. +
  1249. mutex_lock(&dev->mode_config.mutex);
  1250. obj = drm_mode_object_find(dev, *id, DRM_MODE_OBJECT_FB);
  1251. /* TODO check that we realy get a framebuffer back. */
  1252. @@ -1780,6 +1804,9 @@ int drm_mode_getfb(struct drm_device *de
  1253. struct drm_framebuffer *fb;
  1254. int ret = 0;
  1255.  
  1256. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1257. + return -EINVAL;
  1258. +
  1259. mutex_lock(&dev->mode_config.mutex);
  1260. obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB);
  1261. if (!obj) {
  1262. @@ -1813,6 +1840,9 @@ int drm_mode_dirtyfb_ioctl(struct drm_de
  1263. int num_clips;
  1264. int ret = 0;
  1265.  
  1266. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1267. + return -EINVAL;
  1268. +
  1269. mutex_lock(&dev->mode_config.mutex);
  1270. obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB);
  1271. if (!obj) {
  1272. @@ -1996,6 +2026,9 @@ int drm_mode_attachmode_ioctl(struct drm
  1273. struct drm_mode_modeinfo *umode = &mode_cmd->mode;
  1274. int ret = 0;
  1275.  
  1276. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1277. + return -EINVAL;
  1278. +
  1279. mutex_lock(&dev->mode_config.mutex);
  1280.  
  1281. obj = drm_mode_object_find(dev, mode_cmd->connector_id, DRM_MODE_OBJECT_CONNECTOR);
  1282. @@ -2042,6 +2075,9 @@ int drm_mode_detachmode_ioctl(struct drm
  1283. struct drm_mode_modeinfo *umode = &mode_cmd->mode;
  1284. int ret = 0;
  1285.  
  1286. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1287. + return -EINVAL;
  1288. +
  1289. mutex_lock(&dev->mode_config.mutex);
  1290.  
  1291. obj = drm_mode_object_find(dev, mode_cmd->connector_id, DRM_MODE_OBJECT_CONNECTOR);
  1292. @@ -2211,6 +2247,9 @@ int drm_mode_getproperty_ioctl(struct dr
  1293. uint64_t __user *values_ptr;
  1294. uint32_t __user *blob_length_ptr;
  1295.  
  1296. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1297. + return -EINVAL;
  1298. +
  1299. mutex_lock(&dev->mode_config.mutex);
  1300. obj = drm_mode_object_find(dev, out_resp->prop_id, DRM_MODE_OBJECT_PROPERTY);
  1301. if (!obj) {
  1302. @@ -2333,6 +2372,9 @@ int drm_mode_getblob_ioctl(struct drm_de
  1303. int ret = 0;
  1304. void *blob_ptr;
  1305.  
  1306. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1307. + return -EINVAL;
  1308. +
  1309. mutex_lock(&dev->mode_config.mutex);
  1310. obj = drm_mode_object_find(dev, out_resp->blob_id, DRM_MODE_OBJECT_BLOB);
  1311. if (!obj) {
  1312. @@ -2393,6 +2435,9 @@ int drm_mode_connector_property_set_ioct
  1313. int ret = -EINVAL;
  1314. int i;
  1315.  
  1316. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1317. + return -EINVAL;
  1318. +
  1319. mutex_lock(&dev->mode_config.mutex);
  1320.  
  1321. obj = drm_mode_object_find(dev, out_resp->connector_id, DRM_MODE_OBJECT_CONNECTOR);
  1322. @@ -2509,6 +2554,9 @@ int drm_mode_gamma_set_ioctl(struct drm_
  1323. int size;
  1324. int ret = 0;
  1325.  
  1326. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1327. + return -EINVAL;
  1328. +
  1329. mutex_lock(&dev->mode_config.mutex);
  1330. obj = drm_mode_object_find(dev, crtc_lut->crtc_id, DRM_MODE_OBJECT_CRTC);
  1331. if (!obj) {
  1332. @@ -2560,6 +2608,9 @@ int drm_mode_gamma_get_ioctl(struct drm_
  1333. int size;
  1334. int ret = 0;
  1335.  
  1336. + if (!drm_core_check_feature(dev, DRIVER_MODESET))
  1337. + return -EINVAL;
  1338. +
  1339. mutex_lock(&dev->mode_config.mutex);
  1340. obj = drm_mode_object_find(dev, crtc_lut->crtc_id, DRM_MODE_OBJECT_CRTC);
  1341. if (!obj) {
  1342. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_gem.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_gem.c
  1343. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_gem.c 2011-04-01 17:56:56.367710689 +0200
  1344. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_gem.c 2011-04-02 01:38:34.964688312 +0200
  1345. @@ -498,11 +498,12 @@ EXPORT_SYMBOL(drm_gem_vm_open);
  1346. void drm_gem_vm_close(struct vm_area_struct *vma)
  1347. {
  1348. struct drm_gem_object *obj = vma->vm_private_data;
  1349. + struct drm_device *dev = obj->dev;
  1350.  
  1351. - mutex_lock(&obj->dev->struct_mutex);
  1352. + mutex_lock(&dev->struct_mutex);
  1353. drm_vm_close_locked(vma);
  1354. drm_gem_object_unreference(obj);
  1355. - mutex_unlock(&obj->dev->struct_mutex);
  1356. + mutex_unlock(&dev->struct_mutex);
  1357. }
  1358. EXPORT_SYMBOL(drm_gem_vm_close);
  1359.  
  1360. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_irq.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_irq.c
  1361. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_irq.c 2011-04-01 17:56:56.367710689 +0200
  1362. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_irq.c 2011-04-02 01:37:42.452688353 +0200
  1363. @@ -549,7 +549,8 @@ int drm_modeset_ctl(struct drm_device *d
  1364. struct drm_file *file_priv)
  1365. {
  1366. struct drm_modeset_ctl *modeset = data;
  1367. - int crtc, ret = 0;
  1368. + int ret = 0;
  1369. + unsigned int crtc;
  1370.  
  1371. /* If drm_vblank_init() hasn't been called yet, just no-op */
  1372. if (!dev->num_crtcs)
  1373. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_sysfs.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_sysfs.c
  1374. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_sysfs.c 2011-04-01 17:56:56.367710689 +0200
  1375. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/drm_sysfs.c 2011-04-02 01:37:42.452688353 +0200
  1376. @@ -158,8 +158,15 @@ static ssize_t status_show(struct device
  1377. {
  1378. struct drm_connector *connector = to_drm_connector(device);
  1379. enum drm_connector_status status;
  1380. + int ret;
  1381. +
  1382. + ret = mutex_lock_interruptible(&connector->dev->mode_config.mutex);
  1383. + if (ret)
  1384. + return ret;
  1385.  
  1386. status = connector->funcs->detect(connector, true);
  1387. + mutex_unlock(&connector->dev->mode_config.mutex);
  1388. +
  1389. return snprintf(buf, PAGE_SIZE, "%s\n",
  1390. drm_get_connector_status_name(status));
  1391. }
  1392. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/i915_dma.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/i915_dma.c
  1393. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/i915_dma.c 2011-04-01 17:56:56.380710689 +0200
  1394. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/i915_dma.c 2011-04-02 01:37:42.456688353 +0200
  1395. @@ -1943,6 +1943,17 @@ int i915_driver_load(struct drm_device *
  1396. if (IS_GEN2(dev))
  1397. dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(30));
  1398.  
  1399. + /* 965GM sometimes incorrectly writes to hardware status page (HWS)
  1400. + * using 32bit addressing, overwriting memory if HWS is located
  1401. + * above 4GB.
  1402. + *
  1403. + * The documentation also mentions an issue with undefined
  1404. + * behaviour if any general state is accessed within a page above 4GB,
  1405. + * which also needs to be handled carefully.
  1406. + */
  1407. + if (IS_BROADWATER(dev) || IS_CRESTLINE(dev))
  1408. + dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(32));
  1409. +
  1410. dev_priv->regs = ioremap(base, size);
  1411. if (!dev_priv->regs) {
  1412. DRM_ERROR("failed to map registers\n");
  1413. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/i915_gem.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/i915_gem.c
  1414. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/i915_gem.c 2011-04-01 17:56:56.380710689 +0200
  1415. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/i915_gem.c 2011-04-02 01:38:34.965688312 +0200
  1416. @@ -1748,8 +1748,10 @@ i915_gem_request_remove_from_client(stru
  1417. return;
  1418.  
  1419. spin_lock(&file_priv->mm.lock);
  1420. - list_del(&request->client_list);
  1421. - request->file_priv = NULL;
  1422. + if (request->file_priv) {
  1423. + list_del(&request->client_list);
  1424. + request->file_priv = NULL;
  1425. + }
  1426. spin_unlock(&file_priv->mm.lock);
  1427. }
  1428.  
  1429. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/intel_panel.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/intel_panel.c
  1430. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/intel_panel.c 2011-04-01 17:56:56.380710689 +0200
  1431. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/i915/intel_panel.c 2011-04-02 01:37:42.453688354 +0200
  1432. @@ -176,7 +176,6 @@ u32 intel_panel_get_backlight(struct drm
  1433. val &= ~1;
  1434. pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc);
  1435. val *= lbpc;
  1436. - val >>= 1;
  1437. }
  1438. }
  1439.  
  1440. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/atombios_crtc.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/atombios_crtc.c
  1441. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/atombios_crtc.c 2011-04-01 17:56:56.365710689 +0200
  1442. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/atombios_crtc.c 2011-04-02 01:38:34.965688312 +0200
  1443. @@ -921,7 +921,11 @@ static void atombios_crtc_set_pll(struct
  1444. /* adjust pixel clock as needed */
  1445. adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss);
  1446.  
  1447. - if (ASIC_IS_AVIVO(rdev))
  1448. + if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))
  1449. + /* TV seems to prefer the legacy algo on some boards */
  1450. + radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
  1451. + &ref_div, &post_div);
  1452. + else if (ASIC_IS_AVIVO(rdev))
  1453. radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
  1454. &ref_div, &post_div);
  1455. else
  1456. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_combios.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_combios.c
  1457. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_combios.c 2011-04-01 17:56:56.364710689 +0200
  1458. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_combios.c 2011-04-02 01:38:34.966688311 +0200
  1459. @@ -448,7 +448,7 @@ static uint16_t combios_get_table_offset
  1460.  
  1461. bool radeon_combios_check_hardcoded_edid(struct radeon_device *rdev)
  1462. {
  1463. - int edid_info;
  1464. + int edid_info, size;
  1465. struct edid *edid;
  1466. unsigned char *raw;
  1467. edid_info = combios_get_table_offset(rdev->ddev, COMBIOS_HARDCODED_EDID_TABLE);
  1468. @@ -456,11 +456,12 @@ bool radeon_combios_check_hardcoded_edid
  1469. return false;
  1470.  
  1471. raw = rdev->bios + edid_info;
  1472. - edid = kmalloc(EDID_LENGTH * (raw[0x7e] + 1), GFP_KERNEL);
  1473. + size = EDID_LENGTH * (raw[0x7e] + 1);
  1474. + edid = kmalloc(size, GFP_KERNEL);
  1475. if (edid == NULL)
  1476. return false;
  1477.  
  1478. - memcpy((unsigned char *)edid, raw, EDID_LENGTH * (raw[0x7e] + 1));
  1479. + memcpy((unsigned char *)edid, raw, size);
  1480.  
  1481. if (!drm_edid_is_valid(edid)) {
  1482. kfree(edid);
  1483. @@ -468,14 +469,24 @@ bool radeon_combios_check_hardcoded_edid
  1484. }
  1485.  
  1486. rdev->mode_info.bios_hardcoded_edid = edid;
  1487. + rdev->mode_info.bios_hardcoded_edid_size = size;
  1488. return true;
  1489. }
  1490.  
  1491. struct edid *
  1492. radeon_combios_get_hardcoded_edid(struct radeon_device *rdev)
  1493. {
  1494. - if (rdev->mode_info.bios_hardcoded_edid)
  1495. - return rdev->mode_info.bios_hardcoded_edid;
  1496. + struct edid *edid;
  1497. +
  1498. + if (rdev->mode_info.bios_hardcoded_edid) {
  1499. + edid = kmalloc(rdev->mode_info.bios_hardcoded_edid_size, GFP_KERNEL);
  1500. + if (edid) {
  1501. + memcpy((unsigned char *)edid,
  1502. + (unsigned char *)rdev->mode_info.bios_hardcoded_edid,
  1503. + rdev->mode_info.bios_hardcoded_edid_size);
  1504. + return edid;
  1505. + }
  1506. + }
  1507. return NULL;
  1508. }
  1509.  
  1510. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_connectors.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_connectors.c
  1511. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_connectors.c 2011-04-01 17:56:56.362710689 +0200
  1512. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_connectors.c 2011-04-02 01:38:34.967688311 +0200
  1513. @@ -626,6 +626,8 @@ static int radeon_vga_mode_valid(struct
  1514. static enum drm_connector_status
  1515. radeon_vga_detect(struct drm_connector *connector, bool force)
  1516. {
  1517. + struct drm_device *dev = connector->dev;
  1518. + struct radeon_device *rdev = dev->dev_private;
  1519. struct radeon_connector *radeon_connector = to_radeon_connector(connector);
  1520. struct drm_encoder *encoder;
  1521. struct drm_encoder_helper_funcs *encoder_funcs;
  1522. @@ -676,6 +678,17 @@ radeon_vga_detect(struct drm_connector *
  1523.  
  1524. if (ret == connector_status_connected)
  1525. ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, true);
  1526. +
  1527. + /* RN50 and some RV100 asics in servers often have a hardcoded EDID in the
  1528. + * vbios to deal with KVMs. If we have one and are not able to detect a monitor
  1529. + * by other means, assume the CRT is connected and use that EDID.
  1530. + */
  1531. + if ((!rdev->is_atom_bios) &&
  1532. + (ret == connector_status_disconnected) &&
  1533. + rdev->mode_info.bios_hardcoded_edid_size) {
  1534. + ret = connector_status_connected;
  1535. + }
  1536. +
  1537. radeon_connector_update_scratch_regs(connector, ret);
  1538. return ret;
  1539. }
  1540. @@ -787,6 +800,8 @@ static int radeon_dvi_get_modes(struct d
  1541. static enum drm_connector_status
  1542. radeon_dvi_detect(struct drm_connector *connector, bool force)
  1543. {
  1544. + struct drm_device *dev = connector->dev;
  1545. + struct radeon_device *rdev = dev->dev_private;
  1546. struct radeon_connector *radeon_connector = to_radeon_connector(connector);
  1547. struct drm_encoder *encoder = NULL;
  1548. struct drm_encoder_helper_funcs *encoder_funcs;
  1549. @@ -826,8 +841,6 @@ radeon_dvi_detect(struct drm_connector *
  1550. * you don't really know what's connected to which port as both are digital.
  1551. */
  1552. if (radeon_connector->shared_ddc && (ret == connector_status_connected)) {
  1553. - struct drm_device *dev = connector->dev;
  1554. - struct radeon_device *rdev = dev->dev_private;
  1555. struct drm_connector *list_connector;
  1556. struct radeon_connector *list_radeon_connector;
  1557. list_for_each_entry(list_connector, &dev->mode_config.connector_list, head) {
  1558. @@ -892,6 +905,19 @@ radeon_dvi_detect(struct drm_connector *
  1559. ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, true);
  1560. }
  1561.  
  1562. + /* RN50 and some RV100 asics in servers often have a hardcoded EDID in the
  1563. + * vbios to deal with KVMs. If we have one and are not able to detect a monitor
  1564. + * by other means, assume the DFP is connected and use that EDID. In most
  1565. + * cases the DVI port is actually a virtual KVM port connected to the service
  1566. + * processor.
  1567. + */
  1568. + if ((!rdev->is_atom_bios) &&
  1569. + (ret == connector_status_disconnected) &&
  1570. + rdev->mode_info.bios_hardcoded_edid_size) {
  1571. + radeon_connector->use_digital = true;
  1572. + ret = connector_status_connected;
  1573. + }
  1574. +
  1575. out:
  1576. /* updated in get modes as well since we need to know if it's analog or digital */
  1577. radeon_connector_update_scratch_regs(connector, ret);
  1578. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_display.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_display.c
  1579. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_display.c 2011-04-01 17:56:56.363710689 +0200
  1580. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_display.c 2011-04-02 01:37:42.441688352 +0200
  1581. @@ -639,7 +639,7 @@ void radeon_compute_pll_legacy(struct ra
  1582. max_fractional_feed_div = pll->max_frac_feedback_div;
  1583. }
  1584.  
  1585. - for (post_div = min_post_div; post_div <= max_post_div; ++post_div) {
  1586. + for (post_div = max_post_div; post_div >= min_post_div; --post_div) {
  1587. uint32_t ref_div;
  1588.  
  1589. if ((pll->flags & RADEON_PLL_NO_ODD_POST_DIV) && (post_div & 1))
  1590. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_mode.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_mode.h
  1591. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_mode.h 2011-04-01 17:56:56.363710689 +0200
  1592. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/gpu/drm/radeon/radeon_mode.h 2011-04-02 01:38:34.967688311 +0200
  1593. @@ -239,6 +239,7 @@ struct radeon_mode_info {
  1594. struct drm_property *underscan_vborder_property;
  1595. /* hardcoded DFP edid from BIOS */
  1596. struct edid *bios_hardcoded_edid;
  1597. + int bios_hardcoded_edid_size;
  1598.  
  1599. /* pointer to fbdev info structure */
  1600. struct radeon_fbdev *rfbdev;
  1601. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-core.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-core.c
  1602. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-core.c 2011-04-01 17:56:56.026710689 +0200
  1603. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-core.c 2011-04-02 01:37:42.181688354 +0200
  1604. @@ -1365,6 +1365,7 @@ static const struct hid_device_id hid_bl
  1605. { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_16) },
  1606. { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_17) },
  1607. { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18) },
  1608. + { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },
  1609. { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
  1610. { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },
  1611. { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH) },
  1612. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-ids.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-ids.h
  1613. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-ids.h 2011-04-01 17:56:56.025710689 +0200
  1614. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-ids.h 2011-04-02 01:37:42.181688354 +0200
  1615. @@ -445,6 +445,7 @@
  1616. #define USB_DEVICE_ID_ONTRAK_ADU100 0x0064
  1617.  
  1618. #define USB_VENDOR_ID_ORTEK 0x05a4
  1619. +#define USB_DEVICE_ID_ORTEK_PKB1700 0x1700
  1620. #define USB_DEVICE_ID_ORTEK_WKB2000 0x2000
  1621.  
  1622. #define USB_VENDOR_ID_PANJIT 0x134c
  1623. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-magicmouse.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-magicmouse.c
  1624. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-magicmouse.c 2011-04-01 17:56:56.025710689 +0200
  1625. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-magicmouse.c 2011-04-02 01:37:42.180688354 +0200
  1626. @@ -256,7 +256,7 @@ static void magicmouse_emit_touch(struct
  1627. input_report_abs(input, ABS_MT_TRACKING_ID, id);
  1628. input_report_abs(input, ABS_MT_TOUCH_MAJOR, touch_major << 2);
  1629. input_report_abs(input, ABS_MT_TOUCH_MINOR, touch_minor << 2);
  1630. - input_report_abs(input, ABS_MT_ORIENTATION, orientation);
  1631. + input_report_abs(input, ABS_MT_ORIENTATION, -orientation);
  1632. input_report_abs(input, ABS_MT_POSITION_X, x);
  1633. input_report_abs(input, ABS_MT_POSITION_Y, y);
  1634.  
  1635. @@ -395,7 +395,7 @@ static void magicmouse_setup_input(struc
  1636. input_set_abs_params(input, ABS_MT_TRACKING_ID, 0, 15, 0, 0);
  1637. input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 255, 4, 0);
  1638. input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 255, 4, 0);
  1639. - input_set_abs_params(input, ABS_MT_ORIENTATION, -32, 31, 1, 0);
  1640. + input_set_abs_params(input, ABS_MT_ORIENTATION, -31, 32, 1, 0);
  1641.  
  1642. /* Note: Touch Y position from the device is inverted relative
  1643. * to how pointer motion is reported (and relative to how USB
  1644. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-mosart.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-mosart.c
  1645. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-mosart.c 2011-04-01 17:56:56.025710689 +0200
  1646. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-mosart.c 2011-04-02 01:37:42.181688354 +0200
  1647. @@ -90,6 +90,10 @@ static int mosart_input_mapping(struct h
  1648. case 0xff000000:
  1649. /* ignore HID features */
  1650. return -1;
  1651. +
  1652. + case HID_UP_BUTTON:
  1653. + /* ignore buttons */
  1654. + return -1;
  1655. }
  1656.  
  1657. return 0;
  1658. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-ortek.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-ortek.c
  1659. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-ortek.c 2011-04-01 17:56:56.025710689 +0200
  1660. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/hid-ortek.c 2011-04-02 01:37:42.181688354 +0200
  1661. @@ -1,5 +1,5 @@
  1662. /*
  1663. - * HID driver for Ortek WKB-2000 (wireless keyboard + mouse trackpad).
  1664. + * HID driver for Ortek PKB-1700/WKB-2000 (wireless keyboard + mouse trackpad).
  1665. * Fixes LogicalMaximum error in USB report description, see
  1666. * http://bugzilla.kernel.org/show_bug.cgi?id=14787
  1667. *
  1668. @@ -31,6 +31,7 @@ static __u8 *ortek_report_fixup(struct h
  1669. }
  1670.  
  1671. static const struct hid_device_id ortek_devices[] = {
  1672. + { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },
  1673. { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
  1674. { }
  1675. };
  1676. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/Kconfig linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/Kconfig
  1677. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/Kconfig 2011-04-01 17:56:56.026710689 +0200
  1678. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hid/Kconfig 2011-04-02 01:37:42.181688354 +0200
  1679. @@ -291,10 +291,10 @@ config HID_NTRIG
  1680. Support for N-Trig touch screen.
  1681.  
  1682. config HID_ORTEK
  1683. - tristate "Ortek WKB-2000 wireless keyboard and mouse trackpad"
  1684. + tristate "Ortek PKB-1700/WKB-2000 wireless keyboard and mouse trackpad"
  1685. depends on USB_HID
  1686. ---help---
  1687. - Support for Ortek WKB-2000 wireless keyboard + mouse trackpad.
  1688. + Support for Ortek PKB-1700/WKB-2000 wireless keyboard + mouse trackpad.
  1689.  
  1690. config HID_PANTHERLORD
  1691. tristate "Pantherlord/GreenAsia game controller"
  1692. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hwmon/f71882fg.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hwmon/f71882fg.c
  1693. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hwmon/f71882fg.c 2011-04-01 17:56:56.483710689 +0200
  1694. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hwmon/f71882fg.c 2011-04-02 01:37:42.570688353 +0200
  1695. @@ -2110,7 +2110,6 @@ static int f71882fg_remove(struct platfo
  1696. int nr_fans = (data->type == f71882fg) ? 4 : 3;
  1697. u8 start_reg = f71882fg_read8(data, F71882FG_REG_START);
  1698.  
  1699. - platform_set_drvdata(pdev, NULL);
  1700. if (data->hwmon_dev)
  1701. hwmon_device_unregister(data->hwmon_dev);
  1702.  
  1703. @@ -2177,6 +2176,7 @@ static int f71882fg_remove(struct platfo
  1704. }
  1705. }
  1706.  
  1707. + platform_set_drvdata(pdev, NULL);
  1708. kfree(data);
  1709.  
  1710. return 0;
  1711. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hwmon/sht15.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hwmon/sht15.c
  1712. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hwmon/sht15.c 2011-04-01 17:56:56.485710689 +0200
  1713. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/hwmon/sht15.c 2011-04-02 01:37:42.573688353 +0200
  1714. @@ -333,11 +333,11 @@ static inline int sht15_calc_humid(struc
  1715.  
  1716. const int c1 = -4;
  1717. const int c2 = 40500; /* x 10 ^ -6 */
  1718. - const int c3 = -2800; /* x10 ^ -9 */
  1719. + const int c3 = -28; /* x 10 ^ -7 */
  1720.  
  1721. RHlinear = c1*1000
  1722. + c2 * data->val_humid/1000
  1723. - + (data->val_humid * data->val_humid * c3)/1000000;
  1724. + + (data->val_humid * data->val_humid * c3) / 10000;
  1725. return (temp - 25000) * (10000 + 80 * data->val_humid)
  1726. / 1000000 + RHlinear;
  1727. }
  1728. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/idle/intel_idle.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/idle/intel_idle.c
  1729. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/idle/intel_idle.c 2011-04-01 17:56:56.389710689 +0200
  1730. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/idle/intel_idle.c 2011-04-02 01:38:34.968688310 +0200
  1731. @@ -62,6 +62,7 @@
  1732. #include <linux/notifier.h>
  1733. #include <linux/cpu.h>
  1734. #include <asm/mwait.h>
  1735. +#include <asm/msr.h>
  1736.  
  1737. #define INTEL_IDLE_VERSION "0.4"
  1738. #define PREFIX "intel_idle: "
  1739. @@ -85,6 +86,12 @@ static int intel_idle(struct cpuidle_dev
  1740. static struct cpuidle_state *cpuidle_state_table;
  1741.  
  1742. /*
  1743. + * Hardware C-state auto-demotion may not always be optimal.
  1744. + * Indicate which enable bits to clear here.
  1745. + */
  1746. +static unsigned long long auto_demotion_disable_flags;
  1747. +
  1748. +/*
  1749. * States are indexed by the cstate number,
  1750. * which is also the index into the MWAIT hint array.
  1751. * Thus C0 is a dummy.
  1752. @@ -276,6 +283,15 @@ static struct notifier_block setup_broad
  1753. .notifier_call = setup_broadcast_cpuhp_notify,
  1754. };
  1755.  
  1756. +static void auto_demotion_disable(void *dummy)
  1757. +{
  1758. + unsigned long long msr_bits;
  1759. +
  1760. + rdmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits);
  1761. + msr_bits &= ~auto_demotion_disable_flags;
  1762. + wrmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits);
  1763. +}
  1764. +
  1765. /*
  1766. * intel_idle_probe()
  1767. */
  1768. @@ -319,11 +335,17 @@ static int intel_idle_probe(void)
  1769. case 0x25: /* Westmere */
  1770. case 0x2C: /* Westmere */
  1771. cpuidle_state_table = nehalem_cstates;
  1772. + auto_demotion_disable_flags =
  1773. + (NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE);
  1774. break;
  1775.  
  1776. case 0x1C: /* 28 - Atom Processor */
  1777. + cpuidle_state_table = atom_cstates;
  1778. + break;
  1779. +
  1780. case 0x26: /* 38 - Lincroft Atom Processor */
  1781. cpuidle_state_table = atom_cstates;
  1782. + auto_demotion_disable_flags = ATM_LNC_C6_AUTO_DEMOTE;
  1783. break;
  1784.  
  1785. case 0x2A: /* SNB */
  1786. @@ -431,6 +453,8 @@ static int intel_idle_cpuidle_devices_in
  1787. return -EIO;
  1788. }
  1789. }
  1790. + if (auto_demotion_disable_flags)
  1791. + smp_call_function(auto_demotion_disable, NULL, 1);
  1792.  
  1793. return 0;
  1794. }
  1795. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/infiniband/core/cma.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/infiniband/core/cma.c
  1796. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/infiniband/core/cma.c 2011-04-01 17:56:55.986710689 +0200
  1797. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/infiniband/core/cma.c 2011-04-02 01:37:42.132688354 +0200
  1798. @@ -1210,6 +1210,11 @@ static int cma_req_handler(struct ib_cm_
  1799. cm_id->context = conn_id;
  1800. cm_id->cm_handler = cma_ib_handler;
  1801.  
  1802. + /*
  1803. + * Protect against the user destroying conn_id from another thread
  1804. + * until we're done accessing it.
  1805. + */
  1806. + atomic_inc(&conn_id->refcount);
  1807. ret = conn_id->id.event_handler(&conn_id->id, &event);
  1808. if (!ret) {
  1809. /*
  1810. @@ -1222,8 +1227,10 @@ static int cma_req_handler(struct ib_cm_
  1811. ib_send_cm_mra(cm_id, CMA_CM_MRA_SETTING, NULL, 0);
  1812. mutex_unlock(&lock);
  1813. mutex_unlock(&conn_id->handler_mutex);
  1814. + cma_deref_id(conn_id);
  1815. goto out;
  1816. }
  1817. + cma_deref_id(conn_id);
  1818.  
  1819. /* Destroy the CM ID by returning a non-zero value. */
  1820. conn_id->cm_id.ib = NULL;
  1821. @@ -1425,17 +1432,25 @@ static int iw_conn_req_handler(struct iw
  1822. event.param.conn.private_data_len = iw_event->private_data_len;
  1823. event.param.conn.initiator_depth = attr.max_qp_init_rd_atom;
  1824. event.param.conn.responder_resources = attr.max_qp_rd_atom;
  1825. +
  1826. + /*
  1827. + * Protect against the user destroying conn_id from another thread
  1828. + * until we're done accessing it.
  1829. + */
  1830. + atomic_inc(&conn_id->refcount);
  1831. ret = conn_id->id.event_handler(&conn_id->id, &event);
  1832. if (ret) {
  1833. /* User wants to destroy the CM ID */
  1834. conn_id->cm_id.iw = NULL;
  1835. cma_exch(conn_id, CMA_DESTROYING);
  1836. mutex_unlock(&conn_id->handler_mutex);
  1837. + cma_deref_id(conn_id);
  1838. rdma_destroy_id(&conn_id->id);
  1839. goto out;
  1840. }
  1841.  
  1842. mutex_unlock(&conn_id->handler_mutex);
  1843. + cma_deref_id(conn_id);
  1844.  
  1845. out:
  1846. if (dev)
  1847. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/infiniband/core/cm.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/infiniband/core/cm.c
  1848. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/infiniband/core/cm.c 2011-04-01 17:56:55.986710689 +0200
  1849. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/infiniband/core/cm.c 2011-04-02 01:37:42.132688354 +0200
  1850. @@ -2989,6 +2989,7 @@ static int cm_sidr_req_handler(struct cm
  1851. goto out; /* No match. */
  1852. }
  1853. atomic_inc(&cur_cm_id_priv->refcount);
  1854. + atomic_inc(&cm_id_priv->refcount);
  1855. spin_unlock_irq(&cm.lock);
  1856.  
  1857. cm_id_priv->id.cm_handler = cur_cm_id_priv->id.cm_handler;
  1858. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/input/xen-kbdfront.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/input/xen-kbdfront.c
  1859. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/input/xen-kbdfront.c 2011-04-01 17:56:56.442710687 +0200
  1860. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/input/xen-kbdfront.c 2011-04-02 01:38:34.968688310 +0200
  1861. @@ -109,7 +109,7 @@ static irqreturn_t input_handler(int rq,
  1862. static int __devinit xenkbd_probe(struct xenbus_device *dev,
  1863. const struct xenbus_device_id *id)
  1864. {
  1865. - int ret, i;
  1866. + int ret, i, abs;
  1867. struct xenkbd_info *info;
  1868. struct input_dev *kbd, *ptr;
  1869.  
  1870. @@ -127,6 +127,11 @@ static int __devinit xenkbd_probe(struct
  1871. if (!info->page)
  1872. goto error_nomem;
  1873.  
  1874. + if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-abs-pointer", "%d", &abs) < 0)
  1875. + abs = 0;
  1876. + if (abs)
  1877. + xenbus_printf(XBT_NIL, dev->nodename, "request-abs-pointer", "1");
  1878. +
  1879. /* keyboard */
  1880. kbd = input_allocate_device();
  1881. if (!kbd)
  1882. @@ -136,11 +141,12 @@ static int __devinit xenkbd_probe(struct
  1883. kbd->id.bustype = BUS_PCI;
  1884. kbd->id.vendor = 0x5853;
  1885. kbd->id.product = 0xffff;
  1886. - kbd->evbit[0] = BIT(EV_KEY);
  1887. +
  1888. + __set_bit(EV_KEY, kbd->evbit);
  1889. for (i = KEY_ESC; i < KEY_UNKNOWN; i++)
  1890. - set_bit(i, kbd->keybit);
  1891. + __set_bit(i, kbd->keybit);
  1892. for (i = KEY_OK; i < KEY_MAX; i++)
  1893. - set_bit(i, kbd->keybit);
  1894. + __set_bit(i, kbd->keybit);
  1895.  
  1896. ret = input_register_device(kbd);
  1897. if (ret) {
  1898. @@ -159,12 +165,20 @@ static int __devinit xenkbd_probe(struct
  1899. ptr->id.bustype = BUS_PCI;
  1900. ptr->id.vendor = 0x5853;
  1901. ptr->id.product = 0xfffe;
  1902. - ptr->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS);
  1903. +
  1904. + if (abs) {
  1905. + __set_bit(EV_ABS, ptr->evbit);
  1906. + input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
  1907. + input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
  1908. + } else {
  1909. + input_set_capability(ptr, EV_REL, REL_X);
  1910. + input_set_capability(ptr, EV_REL, REL_Y);
  1911. + }
  1912. + input_set_capability(ptr, EV_REL, REL_WHEEL);
  1913. +
  1914. + __set_bit(EV_KEY, ptr->evbit);
  1915. for (i = BTN_LEFT; i <= BTN_TASK; i++)
  1916. - set_bit(i, ptr->keybit);
  1917. - ptr->relbit[0] = BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL);
  1918. - input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
  1919. - input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
  1920. + __set_bit(i, ptr->keybit);
  1921.  
  1922. ret = input_register_device(ptr);
  1923. if (ret) {
  1924. @@ -271,7 +285,7 @@ static void xenkbd_backend_changed(struc
  1925. enum xenbus_state backend_state)
  1926. {
  1927. struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
  1928. - int ret, val;
  1929. + int val;
  1930.  
  1931. switch (backend_state) {
  1932. case XenbusStateInitialising:
  1933. @@ -284,17 +298,6 @@ static void xenkbd_backend_changed(struc
  1934.  
  1935. case XenbusStateInitWait:
  1936. InitWait:
  1937. - ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
  1938. - "feature-abs-pointer", "%d", &val);
  1939. - if (ret < 0)
  1940. - val = 0;
  1941. - if (val) {
  1942. - ret = xenbus_printf(XBT_NIL, info->xbdev->nodename,
  1943. - "request-abs-pointer", "1");
  1944. - if (ret)
  1945. - printk(KERN_WARNING
  1946. - "xenkbd: can't request abs-pointer");
  1947. - }
  1948. xenbus_switch_state(dev, XenbusStateConnected);
  1949. break;
  1950.  
  1951. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/linear.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/linear.c
  1952. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/linear.c 2011-04-01 17:56:56.502710689 +0200
  1953. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/linear.c 2011-04-02 01:37:42.587688354 +0200
  1954. @@ -216,7 +216,6 @@ static int linear_run (mddev_t *mddev)
  1955.  
  1956. if (md_check_no_bitmap(mddev))
  1957. return -EINVAL;
  1958. - mddev->queue->queue_lock = &mddev->queue->__queue_lock;
  1959. conf = linear_conf(mddev, mddev->raid_disks);
  1960.  
  1961. if (!conf)
  1962. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/md.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/md.c
  1963. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/md.c 2011-04-01 17:56:56.502710689 +0200
  1964. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/md.c 2011-04-02 01:37:42.589688354 +0200
  1965. @@ -553,6 +553,9 @@ static mddev_t * mddev_find(dev_t unit)
  1966. {
  1967. mddev_t *mddev, *new = NULL;
  1968.  
  1969. + if (unit && MAJOR(unit) != MD_MAJOR)
  1970. + unit &= ~((1<<MdpMinorShift)-1);
  1971. +
  1972. retry:
  1973. spin_lock(&all_mddevs_lock);
  1974.  
  1975. @@ -4611,6 +4614,7 @@ static int do_md_run(mddev_t *mddev)
  1976. }
  1977. set_capacity(mddev->gendisk, mddev->array_sectors);
  1978. revalidate_disk(mddev->gendisk);
  1979. + mddev->changed = 1;
  1980. kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE);
  1981. out:
  1982. return err;
  1983. @@ -4699,6 +4703,7 @@ static void md_clean(mddev_t *mddev)
  1984. mddev->sync_speed_min = mddev->sync_speed_max = 0;
  1985. mddev->recovery = 0;
  1986. mddev->in_sync = 0;
  1987. + mddev->changed = 0;
  1988. mddev->degraded = 0;
  1989. mddev->safemode = 0;
  1990. mddev->bitmap_info.offset = 0;
  1991. @@ -4808,6 +4813,7 @@ static int do_md_stop(mddev_t * mddev, i
  1992.  
  1993. set_capacity(disk, 0);
  1994. mutex_unlock(&mddev->open_mutex);
  1995. + mddev->changed = 1;
  1996. revalidate_disk(disk);
  1997.  
  1998. if (mddev->ro)
  1999. @@ -5991,7 +5997,7 @@ static int md_open(struct block_device *
  2000. atomic_inc(&mddev->openers);
  2001. mutex_unlock(&mddev->open_mutex);
  2002.  
  2003. - check_disk_size_change(mddev->gendisk, bdev);
  2004. + check_disk_change(bdev);
  2005. out:
  2006. return err;
  2007. }
  2008. @@ -6006,6 +6012,21 @@ static int md_release(struct gendisk *di
  2009.  
  2010. return 0;
  2011. }
  2012. +
  2013. +static int md_media_changed(struct gendisk *disk)
  2014. +{
  2015. + mddev_t *mddev = disk->private_data;
  2016. +
  2017. + return mddev->changed;
  2018. +}
  2019. +
  2020. +static int md_revalidate(struct gendisk *disk)
  2021. +{
  2022. + mddev_t *mddev = disk->private_data;
  2023. +
  2024. + mddev->changed = 0;
  2025. + return 0;
  2026. +}
  2027. static const struct block_device_operations md_fops =
  2028. {
  2029. .owner = THIS_MODULE,
  2030. @@ -6016,6 +6037,8 @@ static const struct block_device_operati
  2031. .compat_ioctl = md_compat_ioctl,
  2032. #endif
  2033. .getgeo = md_getgeo,
  2034. + .media_changed = md_media_changed,
  2035. + .revalidate_disk= md_revalidate,
  2036. };
  2037.  
  2038. static int md_thread(void * arg)
  2039. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/md.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/md.h
  2040. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/md.h 2011-04-01 17:56:56.503710689 +0200
  2041. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/md.h 2011-04-02 01:37:42.589688354 +0200
  2042. @@ -270,6 +270,8 @@ struct mddev_s
  2043. atomic_t active; /* general refcount */
  2044. atomic_t openers; /* number of active opens */
  2045.  
  2046. + int changed; /* True if we might need to
  2047. + * reread partition info */
  2048. int degraded; /* whether md should consider
  2049. * adding a spare
  2050. */
  2051. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/multipath.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/multipath.c
  2052. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/multipath.c 2011-04-01 17:56:56.502710689 +0200
  2053. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/multipath.c 2011-04-02 01:37:42.586688354 +0200
  2054. @@ -435,7 +435,6 @@ static int multipath_run (mddev_t *mddev
  2055. * bookkeeping area. [whatever we allocate in multipath_run(),
  2056. * should be freed in multipath_stop()]
  2057. */
  2058. - mddev->queue->queue_lock = &mddev->queue->__queue_lock;
  2059.  
  2060. conf = kzalloc(sizeof(multipath_conf_t), GFP_KERNEL);
  2061. mddev->private = conf;
  2062. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid0.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid0.c
  2063. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid0.c 2011-04-01 17:56:56.502710689 +0200
  2064. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid0.c 2011-04-02 01:37:42.587688354 +0200
  2065. @@ -353,7 +353,6 @@ static int raid0_run(mddev_t *mddev)
  2066. if (md_check_no_bitmap(mddev))
  2067. return -EINVAL;
  2068. blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
  2069. - mddev->queue->queue_lock = &mddev->queue->__queue_lock;
  2070.  
  2071. /* if private is not null, we are here after takeover */
  2072. if (mddev->private == NULL) {
  2073. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid10.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid10.c
  2074. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid10.c 2011-04-01 17:56:56.502710689 +0200
  2075. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid10.c 2011-04-02 01:37:42.589688354 +0200
  2076. @@ -662,7 +662,10 @@ static int flush_pending_writes(conf_t *
  2077. if (conf->pending_bio_list.head) {
  2078. struct bio *bio;
  2079. bio = bio_list_get(&conf->pending_bio_list);
  2080. + /* Spinlock only taken to quiet a warning */
  2081. + spin_lock(conf->mddev->queue->queue_lock);
  2082. blk_remove_plug(conf->mddev->queue);
  2083. + spin_unlock(conf->mddev->queue->queue_lock);
  2084. spin_unlock_irq(&conf->device_lock);
  2085. /* flush any pending bitmap writes to disk
  2086. * before proceeding w/ I/O */
  2087. @@ -971,7 +974,7 @@ static int make_request(mddev_t *mddev,
  2088. atomic_inc(&r10_bio->remaining);
  2089. spin_lock_irqsave(&conf->device_lock, flags);
  2090. bio_list_add(&conf->pending_bio_list, mbio);
  2091. - blk_plug_device(mddev->queue);
  2092. + blk_plug_device_unlocked(mddev->queue);
  2093. spin_unlock_irqrestore(&conf->device_lock, flags);
  2094. }
  2095.  
  2096. @@ -2303,8 +2306,6 @@ static int run(mddev_t *mddev)
  2097. if (!conf)
  2098. goto out;
  2099.  
  2100. - mddev->queue->queue_lock = &conf->device_lock;
  2101. -
  2102. mddev->thread = conf->thread;
  2103. conf->thread = NULL;
  2104.  
  2105. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid1.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid1.c
  2106. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid1.c 2011-04-01 17:56:56.502710689 +0200
  2107. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid1.c 2011-04-02 01:37:42.587688354 +0200
  2108. @@ -593,7 +593,10 @@ static int flush_pending_writes(conf_t *
  2109. if (conf->pending_bio_list.head) {
  2110. struct bio *bio;
  2111. bio = bio_list_get(&conf->pending_bio_list);
  2112. + /* Only take the spinlock to quiet a warning */
  2113. + spin_lock(conf->mddev->queue->queue_lock);
  2114. blk_remove_plug(conf->mddev->queue);
  2115. + spin_unlock(conf->mddev->queue->queue_lock);
  2116. spin_unlock_irq(&conf->device_lock);
  2117. /* flush any pending bitmap writes to
  2118. * disk before proceeding w/ I/O */
  2119. @@ -959,7 +962,7 @@ static int make_request(mddev_t *mddev,
  2120. atomic_inc(&r1_bio->remaining);
  2121. spin_lock_irqsave(&conf->device_lock, flags);
  2122. bio_list_add(&conf->pending_bio_list, mbio);
  2123. - blk_plug_device(mddev->queue);
  2124. + blk_plug_device_unlocked(mddev->queue);
  2125. spin_unlock_irqrestore(&conf->device_lock, flags);
  2126. }
  2127. r1_bio_write_done(r1_bio, bio->bi_vcnt, behind_pages, behind_pages != NULL);
  2128. @@ -2024,7 +2027,6 @@ static int run(mddev_t *mddev)
  2129. if (IS_ERR(conf))
  2130. return PTR_ERR(conf);
  2131.  
  2132. - mddev->queue->queue_lock = &conf->device_lock;
  2133. list_for_each_entry(rdev, &mddev->disks, same_set) {
  2134. disk_stack_limits(mddev->gendisk, rdev->bdev,
  2135. rdev->data_offset << 9);
  2136. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid5.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid5.c
  2137. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid5.c 2011-04-01 17:56:56.501710689 +0200
  2138. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/md/raid5.c 2011-04-02 01:37:42.586688354 +0200
  2139. @@ -5205,7 +5205,6 @@ static int run(mddev_t *mddev)
  2140.  
  2141. mddev->queue->backing_dev_info.congested_data = mddev;
  2142. mddev->queue->backing_dev_info.congested_fn = raid5_congested;
  2143. - mddev->queue->queue_lock = &conf->device_lock;
  2144. mddev->queue->unplug_fn = raid5_unplug_queue;
  2145.  
  2146. chunk_size = mddev->chunk_sectors << 9;
  2147. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/dvb-usb/dib0700_devices.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/dvb-usb/dib0700_devices.c
  2148. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/dvb-usb/dib0700_devices.c 2011-04-01 17:56:56.277710689 +0200
  2149. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/dvb-usb/dib0700_devices.c 2011-04-02 01:37:42.356688353 +0200
  2150. @@ -870,6 +870,23 @@ static int dib7070p_tuner_attach(struct
  2151. return 0;
  2152. }
  2153.  
  2154. +static int stk7700p_pid_filter(struct dvb_usb_adapter *adapter, int index,
  2155. + u16 pid, int onoff)
  2156. +{
  2157. + struct dib0700_state *st = adapter->dev->priv;
  2158. + if (st->is_dib7000pc)
  2159. + return dib7000p_pid_filter(adapter->fe, index, pid, onoff);
  2160. + return dib7000m_pid_filter(adapter->fe, index, pid, onoff);
  2161. +}
  2162. +
  2163. +static int stk7700p_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff)
  2164. +{
  2165. + struct dib0700_state *st = adapter->dev->priv;
  2166. + if (st->is_dib7000pc)
  2167. + return dib7000p_pid_filter_ctrl(adapter->fe, onoff);
  2168. + return dib7000m_pid_filter_ctrl(adapter->fe, onoff);
  2169. +}
  2170. +
  2171. static int stk70x0p_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff)
  2172. {
  2173. return dib7000p_pid_filter(adapter->fe, index, pid, onoff);
  2174. @@ -1875,8 +1892,8 @@ struct dvb_usb_device_properties dib0700
  2175. {
  2176. .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
  2177. .pid_filter_count = 32,
  2178. - .pid_filter = stk70x0p_pid_filter,
  2179. - .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
  2180. + .pid_filter = stk7700p_pid_filter,
  2181. + .pid_filter_ctrl = stk7700p_pid_filter_ctrl,
  2182. .frontend_attach = stk7700p_frontend_attach,
  2183. .tuner_attach = stk7700p_tuner_attach,
  2184.  
  2185. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/frontends/dib7000m.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/frontends/dib7000m.c
  2186. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/frontends/dib7000m.c 2011-04-01 17:56:56.290710689 +0200
  2187. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/frontends/dib7000m.c 2011-04-02 01:37:42.380688354 +0200
  2188. @@ -1285,6 +1285,25 @@ struct i2c_adapter * dib7000m_get_i2c_ma
  2189. }
  2190. EXPORT_SYMBOL(dib7000m_get_i2c_master);
  2191.  
  2192. +int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff)
  2193. +{
  2194. + struct dib7000m_state *state = fe->demodulator_priv;
  2195. + u16 val = dib7000m_read_word(state, 294 + state->reg_offs) & 0xffef;
  2196. + val |= (onoff & 0x1) << 4;
  2197. + dprintk("PID filter enabled %d", onoff);
  2198. + return dib7000m_write_word(state, 294 + state->reg_offs, val);
  2199. +}
  2200. +EXPORT_SYMBOL(dib7000m_pid_filter_ctrl);
  2201. +
  2202. +int dib7000m_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff)
  2203. +{
  2204. + struct dib7000m_state *state = fe->demodulator_priv;
  2205. + dprintk("PID filter: index %x, PID %d, OnOff %d", id, pid, onoff);
  2206. + return dib7000m_write_word(state, 300 + state->reg_offs + id,
  2207. + onoff ? (1 << 13) | pid : 0);
  2208. +}
  2209. +EXPORT_SYMBOL(dib7000m_pid_filter);
  2210. +
  2211. #if 0
  2212. /* used with some prototype boards */
  2213. int dib7000m_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods,
  2214. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/frontends/dib7000m.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/frontends/dib7000m.h
  2215. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/frontends/dib7000m.h 2011-04-01 17:56:56.281710689 +0200
  2216. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/dvb/frontends/dib7000m.h 2011-04-02 01:37:42.362688353 +0200
  2217. @@ -46,6 +46,8 @@ extern struct dvb_frontend *dib7000m_att
  2218. extern struct i2c_adapter *dib7000m_get_i2c_master(struct dvb_frontend *,
  2219. enum dibx000_i2c_interface,
  2220. int);
  2221. +extern int dib7000m_pid_filter(struct dvb_frontend *, u8 id, u16 pid, u8 onoff);
  2222. +extern int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff);
  2223. #else
  2224. static inline
  2225. struct dvb_frontend *dib7000m_attach(struct i2c_adapter *i2c_adap,
  2226. @@ -63,6 +65,19 @@ struct i2c_adapter *dib7000m_get_i2c_mas
  2227. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  2228. return NULL;
  2229. }
  2230. +static inline int dib7000m_pid_filter(struct dvb_frontend *fe, u8 id,
  2231. + u16 pid, u8 onoff)
  2232. +{
  2233. + printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  2234. + return -ENODEV;
  2235. +}
  2236. +
  2237. +static inline int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe,
  2238. + uint8_t onoff)
  2239. +{
  2240. + printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  2241. + return -ENODEV;
  2242. +}
  2243. #endif
  2244.  
  2245. /* TODO
  2246. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/cx23885/cx23885-i2c.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/cx23885/cx23885-i2c.c
  2247. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/cx23885/cx23885-i2c.c 2011-04-01 17:56:56.319710689 +0200
  2248. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/cx23885/cx23885-i2c.c 2011-04-02 01:37:42.399688353 +0200
  2249. @@ -122,10 +122,6 @@ static int i2c_sendbytes(struct i2c_adap
  2250.  
  2251. if (!i2c_wait_done(i2c_adap))
  2252. goto eio;
  2253. - if (!i2c_slave_did_ack(i2c_adap)) {
  2254. - retval = -ENXIO;
  2255. - goto err;
  2256. - }
  2257. if (i2c_debug) {
  2258. printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]);
  2259. if (!(ctrl & I2C_NOSTOP))
  2260. @@ -209,10 +205,6 @@ static int i2c_readbytes(struct i2c_adap
  2261.  
  2262. if (!i2c_wait_done(i2c_adap))
  2263. goto eio;
  2264. - if (cnt == 0 && !i2c_slave_did_ack(i2c_adap)) {
  2265. - retval = -ENXIO;
  2266. - goto err;
  2267. - }
  2268. msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff;
  2269. if (i2c_debug) {
  2270. dprintk(1, " %02x", msg->buf[cnt]);
  2271. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/cx25840/cx25840-core.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/cx25840/cx25840-core.c
  2272. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/cx25840/cx25840-core.c 2011-04-01 17:56:56.342710689 +0200
  2273. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/cx25840/cx25840-core.c 2011-04-02 01:37:42.434688352 +0200
  2274. @@ -2031,7 +2031,8 @@ static int cx25840_probe(struct i2c_clie
  2275. kfree(state);
  2276. return err;
  2277. }
  2278. - v4l2_ctrl_cluster(2, &state->volume);
  2279. + if (!is_cx2583x(state))
  2280. + v4l2_ctrl_cluster(2, &state->volume);
  2281. v4l2_ctrl_handler_setup(&state->hdl);
  2282.  
  2283. cx25840_ir_probe(sd);
  2284. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/ivtv/ivtv-irq.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/ivtv/ivtv-irq.c
  2285. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/ivtv/ivtv-irq.c 2011-04-01 17:56:56.320710689 +0200
  2286. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/ivtv/ivtv-irq.c 2011-04-02 01:37:42.406688353 +0200
  2287. @@ -628,22 +628,66 @@ static void ivtv_irq_enc_pio_complete(st
  2288. static void ivtv_irq_dma_err(struct ivtv *itv)
  2289. {
  2290. u32 data[CX2341X_MBOX_MAX_DATA];
  2291. + u32 status;
  2292.  
  2293. del_timer(&itv->dma_timer);
  2294. +
  2295. ivtv_api_get_data(&itv->enc_mbox, IVTV_MBOX_DMA_END, 2, data);
  2296. + status = read_reg(IVTV_REG_DMASTATUS);
  2297. IVTV_DEBUG_WARN("DMA ERROR %08x %08x %08x %d\n", data[0], data[1],
  2298. - read_reg(IVTV_REG_DMASTATUS), itv->cur_dma_stream);
  2299. - write_reg(read_reg(IVTV_REG_DMASTATUS) & 3, IVTV_REG_DMASTATUS);
  2300. + status, itv->cur_dma_stream);
  2301. + /*
  2302. + * We do *not* write back to the IVTV_REG_DMASTATUS register to
  2303. + * clear the error status, if either the encoder write (0x02) or
  2304. + * decoder read (0x01) bus master DMA operation do not indicate
  2305. + * completed. We can race with the DMA engine, which may have
  2306. + * transitioned to completed status *after* we read the register.
  2307. + * Setting a IVTV_REG_DMASTATUS flag back to "busy" status, after the
  2308. + * DMA engine has completed, will cause the DMA engine to stop working.
  2309. + */
  2310. + status &= 0x3;
  2311. + if (status == 0x3)
  2312. + write_reg(status, IVTV_REG_DMASTATUS);
  2313. +
  2314. if (!test_bit(IVTV_F_I_UDMA, &itv->i_flags) &&
  2315. itv->cur_dma_stream >= 0 && itv->cur_dma_stream < IVTV_MAX_STREAMS) {
  2316. struct ivtv_stream *s = &itv->streams[itv->cur_dma_stream];
  2317.  
  2318. - /* retry */
  2319. - if (s->type >= IVTV_DEC_STREAM_TYPE_MPG)
  2320. + if (s->type >= IVTV_DEC_STREAM_TYPE_MPG) {
  2321. + /* retry */
  2322. + /*
  2323. + * FIXME - handle cases of DMA error similar to
  2324. + * encoder below, except conditioned on status & 0x1
  2325. + */
  2326. ivtv_dma_dec_start(s);
  2327. - else
  2328. - ivtv_dma_enc_start(s);
  2329. - return;
  2330. + return;
  2331. + } else {
  2332. + if ((status & 0x2) == 0) {
  2333. + /*
  2334. + * CX2341x Bus Master DMA write is ongoing.
  2335. + * Reset the timer and let it complete.
  2336. + */
  2337. + itv->dma_timer.expires =
  2338. + jiffies + msecs_to_jiffies(600);
  2339. + add_timer(&itv->dma_timer);
  2340. + return;
  2341. + }
  2342. +
  2343. + if (itv->dma_retries < 3) {
  2344. + /*
  2345. + * CX2341x Bus Master DMA write has ended.
  2346. + * Retry the write, starting with the first
  2347. + * xfer segment. Just retrying the current
  2348. + * segment is not sufficient.
  2349. + */
  2350. + s->sg_processed = 0;
  2351. + itv->dma_retries++;
  2352. + ivtv_dma_enc_start_xfer(s);
  2353. + return;
  2354. + }
  2355. + /* Too many retries, give up on this one */
  2356. + }
  2357. +
  2358. }
  2359. if (test_bit(IVTV_F_I_UDMA, &itv->i_flags)) {
  2360. ivtv_udma_start(itv);
  2361. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/uvc/uvc_driver.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/uvc/uvc_driver.c
  2362. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/uvc/uvc_driver.c 2011-04-01 17:56:56.301710689 +0200
  2363. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/uvc/uvc_driver.c 2011-04-02 01:38:34.969688310 +0200
  2364. @@ -1264,6 +1264,14 @@ static int uvc_scan_chain_entity(struct
  2365.  
  2366. break;
  2367.  
  2368. + case UVC_OTT_VENDOR_SPECIFIC:
  2369. + case UVC_OTT_DISPLAY:
  2370. + case UVC_OTT_MEDIA_TRANSPORT_OUTPUT:
  2371. + if (uvc_trace_param & UVC_TRACE_PROBE)
  2372. + printk(" OT %d", entity->id);
  2373. +
  2374. + break;
  2375. +
  2376. case UVC_TT_STREAMING:
  2377. if (UVC_ENTITY_IS_ITERM(entity)) {
  2378. if (uvc_trace_param & UVC_TRACE_PROBE)
  2379. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/uvc/uvc_video.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/uvc/uvc_video.c
  2380. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/uvc/uvc_video.c 2011-04-01 17:56:56.301710689 +0200
  2381. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/media/video/uvc/uvc_video.c 2011-04-02 01:38:34.969688310 +0200
  2382. @@ -89,15 +89,19 @@ int uvc_query_ctrl(struct uvc_device *de
  2383. static void uvc_fixup_video_ctrl(struct uvc_streaming *stream,
  2384. struct uvc_streaming_control *ctrl)
  2385. {
  2386. - struct uvc_format *format;
  2387. + struct uvc_format *format = NULL;
  2388. struct uvc_frame *frame = NULL;
  2389. unsigned int i;
  2390.  
  2391. - if (ctrl->bFormatIndex <= 0 ||
  2392. - ctrl->bFormatIndex > stream->nformats)
  2393. - return;
  2394. + for (i = 0; i < stream->nformats; ++i) {
  2395. + if (stream->format[i].index == ctrl->bFormatIndex) {
  2396. + format = &stream->format[i];
  2397. + break;
  2398. + }
  2399. + }
  2400.  
  2401. - format = &stream->format[ctrl->bFormatIndex - 1];
  2402. + if (format == NULL)
  2403. + return;
  2404.  
  2405. for (i = 0; i < format->nframes; ++i) {
  2406. if (format->frame[i].bFrameIndex == ctrl->bFrameIndex) {
  2407. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mfd/tps6586x.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mfd/tps6586x.c
  2408. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mfd/tps6586x.c 2011-04-01 17:56:56.215710688 +0200
  2409. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mfd/tps6586x.c 2011-04-02 01:37:42.333688353 +0200
  2410. @@ -152,12 +152,12 @@ static inline int __tps6586x_write(struc
  2411. static inline int __tps6586x_writes(struct i2c_client *client, int reg,
  2412. int len, uint8_t *val)
  2413. {
  2414. - int ret;
  2415. + int ret, i;
  2416.  
  2417. - ret = i2c_smbus_write_i2c_block_data(client, reg, len, val);
  2418. - if (ret < 0) {
  2419. - dev_err(&client->dev, "failed writings to 0x%02x\n", reg);
  2420. - return ret;
  2421. + for (i = 0; i < len; i++) {
  2422. + ret = __tps6586x_write(client, reg + i, *(val + i));
  2423. + if (ret < 0)
  2424. + return ret;
  2425. }
  2426.  
  2427. return 0;
  2428. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mfd/ucb1x00-ts.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mfd/ucb1x00-ts.c
  2429. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mfd/ucb1x00-ts.c 2011-04-01 17:56:56.215710688 +0200
  2430. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mfd/ucb1x00-ts.c 2011-04-02 01:37:42.333688353 +0200
  2431. @@ -385,12 +385,18 @@ static int ucb1x00_ts_add(struct ucb1x00
  2432. idev->close = ucb1x00_ts_close;
  2433.  
  2434. __set_bit(EV_ABS, idev->evbit);
  2435. - __set_bit(ABS_X, idev->absbit);
  2436. - __set_bit(ABS_Y, idev->absbit);
  2437. - __set_bit(ABS_PRESSURE, idev->absbit);
  2438.  
  2439. input_set_drvdata(idev, ts);
  2440.  
  2441. + ucb1x00_adc_enable(ts->ucb);
  2442. + ts->x_res = ucb1x00_ts_read_xres(ts);
  2443. + ts->y_res = ucb1x00_ts_read_yres(ts);
  2444. + ucb1x00_adc_disable(ts->ucb);
  2445. +
  2446. + input_set_abs_params(idev, ABS_X, 0, ts->x_res, 0, 0);
  2447. + input_set_abs_params(idev, ABS_Y, 0, ts->y_res, 0, 0);
  2448. + input_set_abs_params(idev, ABS_PRESSURE, 0, 0, 0, 0);
  2449. +
  2450. err = input_register_device(idev);
  2451. if (err)
  2452. goto fail;
  2453. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/misc/bmp085.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/misc/bmp085.c
  2454. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/misc/bmp085.c 2011-04-01 17:56:56.259710688 +0200
  2455. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/misc/bmp085.c 2011-04-02 01:37:42.351688353 +0200
  2456. @@ -449,6 +449,7 @@ static const struct i2c_device_id bmp085
  2457. { "bmp085", 0 },
  2458. { }
  2459. };
  2460. +MODULE_DEVICE_TABLE(i2c, bmp085_id);
  2461.  
  2462. static struct i2c_driver bmp085_driver = {
  2463. .driver = {
  2464. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mmc/core/sdio.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mmc/core/sdio.c
  2465. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mmc/core/sdio.c 2011-04-01 17:56:56.034710689 +0200
  2466. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mmc/core/sdio.c 2011-04-02 01:37:42.190688354 +0200
  2467. @@ -395,6 +395,14 @@ static int mmc_sdio_init_card(struct mmc
  2468. if (err)
  2469. goto remove;
  2470.  
  2471. + /*
  2472. + * Update oldcard with the new RCA received from the SDIO
  2473. + * device -- we're doing this so that it's updated in the
  2474. + * "card" struct when oldcard overwrites that later.
  2475. + */
  2476. + if (oldcard)
  2477. + oldcard->rca = card->rca;
  2478. +
  2479. mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
  2480. }
  2481.  
  2482. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mmc/host/sdhci-pci.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mmc/host/sdhci-pci.c
  2483. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mmc/host/sdhci-pci.c 2011-04-01 17:56:56.033710689 +0200
  2484. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mmc/host/sdhci-pci.c 2011-04-02 01:37:42.189688354 +0200
  2485. @@ -454,6 +454,14 @@ static const struct pci_device_id pci_id
  2486. },
  2487.  
  2488. {
  2489. + .vendor = PCI_VENDOR_ID_RICOH,
  2490. + .device = 0xe823,
  2491. + .subvendor = PCI_ANY_ID,
  2492. + .subdevice = PCI_ANY_ID,
  2493. + .driver_data = (kernel_ulong_t)&sdhci_ricoh_mmc,
  2494. + },
  2495. +
  2496. + {
  2497. .vendor = PCI_VENDOR_ID_ENE,
  2498. .device = PCI_DEVICE_ID_ENE_CB712_SD,
  2499. .subvendor = PCI_ANY_ID,
  2500. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/chips/cfi_cmdset_0001.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/chips/cfi_cmdset_0001.c
  2501. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/chips/cfi_cmdset_0001.c 2011-04-01 17:56:56.477710689 +0200
  2502. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/chips/cfi_cmdset_0001.c 2011-04-02 01:37:42.567688353 +0200
  2503. @@ -1229,10 +1229,32 @@ static int inval_cache_and_wait_for_oper
  2504. sleep_time = chip_op_time / 2;
  2505.  
  2506. for (;;) {
  2507. + if (chip->state != chip_state) {
  2508. + /* Someone's suspended the operation: sleep */
  2509. + DECLARE_WAITQUEUE(wait, current);
  2510. + set_current_state(TASK_UNINTERRUPTIBLE);
  2511. + add_wait_queue(&chip->wq, &wait);
  2512. + mutex_unlock(&chip->mutex);
  2513. + schedule();
  2514. + remove_wait_queue(&chip->wq, &wait);
  2515. + mutex_lock(&chip->mutex);
  2516. + continue;
  2517. + }
  2518. +
  2519. status = map_read(map, cmd_adr);
  2520. if (map_word_andequal(map, status, status_OK, status_OK))
  2521. break;
  2522.  
  2523. + if (chip->erase_suspended && chip_state == FL_ERASING) {
  2524. + /* Erase suspend occured while sleep: reset timeout */
  2525. + timeo = reset_timeo;
  2526. + chip->erase_suspended = 0;
  2527. + }
  2528. + if (chip->write_suspended && chip_state == FL_WRITING) {
  2529. + /* Write suspend occured while sleep: reset timeout */
  2530. + timeo = reset_timeo;
  2531. + chip->write_suspended = 0;
  2532. + }
  2533. if (!timeo) {
  2534. map_write(map, CMD(0x70), cmd_adr);
  2535. chip->state = FL_STATUS;
  2536. @@ -1256,27 +1278,6 @@ static int inval_cache_and_wait_for_oper
  2537. timeo--;
  2538. }
  2539. mutex_lock(&chip->mutex);
  2540. -
  2541. - while (chip->state != chip_state) {
  2542. - /* Someone's suspended the operation: sleep */
  2543. - DECLARE_WAITQUEUE(wait, current);
  2544. - set_current_state(TASK_UNINTERRUPTIBLE);
  2545. - add_wait_queue(&chip->wq, &wait);
  2546. - mutex_unlock(&chip->mutex);
  2547. - schedule();
  2548. - remove_wait_queue(&chip->wq, &wait);
  2549. - mutex_lock(&chip->mutex);
  2550. - }
  2551. - if (chip->erase_suspended && chip_state == FL_ERASING) {
  2552. - /* Erase suspend occured while sleep: reset timeout */
  2553. - timeo = reset_timeo;
  2554. - chip->erase_suspended = 0;
  2555. - }
  2556. - if (chip->write_suspended && chip_state == FL_WRITING) {
  2557. - /* Write suspend occured while sleep: reset timeout */
  2558. - timeo = reset_timeo;
  2559. - chip->write_suspended = 0;
  2560. - }
  2561. }
  2562.  
  2563. /* Done and happy. */
  2564. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/chips/jedec_probe.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/chips/jedec_probe.c
  2565. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/chips/jedec_probe.c 2011-04-01 17:56:56.476710689 +0200
  2566. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/chips/jedec_probe.c 2011-04-02 01:37:42.567688353 +0200
  2567. @@ -1935,14 +1935,14 @@ static void jedec_reset(u32 base, struct
  2568. }
  2569.  
  2570.  
  2571. -static int cfi_jedec_setup(struct cfi_private *p_cfi, int index)
  2572. +static int cfi_jedec_setup(struct map_info *map, struct cfi_private *cfi, int index)
  2573. {
  2574. int i,num_erase_regions;
  2575. uint8_t uaddr;
  2576.  
  2577. - if (! (jedec_table[index].devtypes & p_cfi->device_type)) {
  2578. + if (!(jedec_table[index].devtypes & cfi->device_type)) {
  2579. DEBUG(MTD_DEBUG_LEVEL1, "Rejecting potential %s with incompatible %d-bit device type\n",
  2580. - jedec_table[index].name, 4 * (1<<p_cfi->device_type));
  2581. + jedec_table[index].name, 4 * (1<<cfi->device_type));
  2582. return 0;
  2583. }
  2584.  
  2585. @@ -1950,27 +1950,28 @@ static int cfi_jedec_setup(struct cfi_pr
  2586.  
  2587. num_erase_regions = jedec_table[index].nr_regions;
  2588.  
  2589. - p_cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
  2590. - if (!p_cfi->cfiq) {
  2591. + cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
  2592. + if (!cfi->cfiq) {
  2593. //xx printk(KERN_WARNING "%s: kmalloc failed for CFI ident structure\n", map->name);
  2594. return 0;
  2595. }
  2596.  
  2597. - memset(p_cfi->cfiq,0,sizeof(struct cfi_ident));
  2598. + memset(cfi->cfiq, 0, sizeof(struct cfi_ident));
  2599.  
  2600. - p_cfi->cfiq->P_ID = jedec_table[index].cmd_set;
  2601. - p_cfi->cfiq->NumEraseRegions = jedec_table[index].nr_regions;
  2602. - p_cfi->cfiq->DevSize = jedec_table[index].dev_size;
  2603. - p_cfi->cfi_mode = CFI_MODE_JEDEC;
  2604. + cfi->cfiq->P_ID = jedec_table[index].cmd_set;
  2605. + cfi->cfiq->NumEraseRegions = jedec_table[index].nr_regions;
  2606. + cfi->cfiq->DevSize = jedec_table[index].dev_size;
  2607. + cfi->cfi_mode = CFI_MODE_JEDEC;
  2608. + cfi->sector_erase_cmd = CMD(0x30);
  2609.  
  2610. for (i=0; i<num_erase_regions; i++){
  2611. - p_cfi->cfiq->EraseRegionInfo[i] = jedec_table[index].regions[i];
  2612. + cfi->cfiq->EraseRegionInfo[i] = jedec_table[index].regions[i];
  2613. }
  2614. - p_cfi->cmdset_priv = NULL;
  2615. + cfi->cmdset_priv = NULL;
  2616.  
  2617. /* This may be redundant for some cases, but it doesn't hurt */
  2618. - p_cfi->mfr = jedec_table[index].mfr_id;
  2619. - p_cfi->id = jedec_table[index].dev_id;
  2620. + cfi->mfr = jedec_table[index].mfr_id;
  2621. + cfi->id = jedec_table[index].dev_id;
  2622.  
  2623. uaddr = jedec_table[index].uaddr;
  2624.  
  2625. @@ -1978,8 +1979,8 @@ static int cfi_jedec_setup(struct cfi_pr
  2626. our brains explode when we see the datasheets talking about address
  2627. lines numbered from A-1 to A18. The CFI table has unlock addresses
  2628. in device-words according to the mode the device is connected in */
  2629. - p_cfi->addr_unlock1 = unlock_addrs[uaddr].addr1 / p_cfi->device_type;
  2630. - p_cfi->addr_unlock2 = unlock_addrs[uaddr].addr2 / p_cfi->device_type;
  2631. + cfi->addr_unlock1 = unlock_addrs[uaddr].addr1 / cfi->device_type;
  2632. + cfi->addr_unlock2 = unlock_addrs[uaddr].addr2 / cfi->device_type;
  2633.  
  2634. return 1; /* ok */
  2635. }
  2636. @@ -2175,7 +2176,7 @@ static int jedec_probe_chip(struct map_i
  2637. "MTD %s(): matched device 0x%x,0x%x unlock_addrs: 0x%.4x 0x%.4x\n",
  2638. __func__, cfi->mfr, cfi->id,
  2639. cfi->addr_unlock1, cfi->addr_unlock2 );
  2640. - if (!cfi_jedec_setup(cfi, i))
  2641. + if (!cfi_jedec_setup(map, cfi, i))
  2642. return 0;
  2643. goto ok_out;
  2644. }
  2645. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/mtd_blkdevs.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/mtd_blkdevs.c
  2646. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/mtd_blkdevs.c 2011-04-01 17:56:56.477710689 +0200
  2647. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/mtd_blkdevs.c 2011-04-02 01:37:42.567688353 +0200
  2648. @@ -413,7 +413,6 @@ error3:
  2649. error2:
  2650. list_del(&new->list);
  2651. error1:
  2652. - kfree(new);
  2653. return ret;
  2654. }
  2655.  
  2656. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/nand/omap2.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/nand/omap2.c
  2657. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/nand/omap2.c 2011-04-01 17:56:56.471710689 +0200
  2658. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/nand/omap2.c 2011-04-02 01:37:42.558688354 +0200
  2659. @@ -968,6 +968,6 @@ static void __exit omap_nand_exit(void)
  2660. module_init(omap_nand_init);
  2661. module_exit(omap_nand_exit);
  2662.  
  2663. -MODULE_ALIAS(DRIVER_NAME);
  2664. +MODULE_ALIAS("platform:" DRIVER_NAME);
  2665. MODULE_LICENSE("GPL");
  2666. MODULE_DESCRIPTION("Glue layer for NAND flash on TI OMAP boards");
  2667. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/onenand/generic.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/onenand/generic.c
  2668. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/onenand/generic.c 2011-04-01 17:56:56.478710689 +0200
  2669. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/onenand/generic.c 2011-04-02 01:37:42.569688353 +0200
  2670. @@ -131,7 +131,7 @@ static struct platform_driver generic_on
  2671. .remove = __devexit_p(generic_onenand_remove),
  2672. };
  2673.  
  2674. -MODULE_ALIAS(DRIVER_NAME);
  2675. +MODULE_ALIAS("platform:" DRIVER_NAME);
  2676.  
  2677. static int __init generic_onenand_init(void)
  2678. {
  2679. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/onenand/omap2.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/onenand/omap2.c
  2680. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/onenand/omap2.c 2011-04-01 17:56:56.478710689 +0200
  2681. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/mtd/onenand/omap2.c 2011-04-02 01:37:42.569688353 +0200
  2682. @@ -815,7 +815,7 @@ static void __exit omap2_onenand_exit(vo
  2683. module_init(omap2_onenand_init);
  2684. module_exit(omap2_onenand_exit);
  2685.  
  2686. -MODULE_ALIAS(DRIVER_NAME);
  2687. +MODULE_ALIAS("platform:" DRIVER_NAME);
  2688. MODULE_LICENSE("GPL");
  2689. MODULE_AUTHOR("Jarkko Lavinen <jarkko.lavinen@nokia.com>");
  2690. MODULE_DESCRIPTION("Glue layer for OneNAND flash on OMAP2 / OMAP3");
  2691. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/ich8lan.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/ich8lan.c
  2692. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/ich8lan.c 2011-04-01 17:56:56.187710689 +0200
  2693. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/ich8lan.c 2011-04-02 01:37:42.312688354 +0200
  2694. @@ -338,12 +338,17 @@ static s32 e1000_init_phy_params_pchlan(
  2695. }
  2696.  
  2697. phy->id = e1000_phy_unknown;
  2698. - ret_val = e1000e_get_phy_id(hw);
  2699. - if (ret_val)
  2700. - goto out;
  2701. - if ((phy->id == 0) || (phy->id == PHY_REVISION_MASK)) {
  2702. + switch (hw->mac.type) {
  2703. + default:
  2704. + ret_val = e1000e_get_phy_id(hw);
  2705. + if (ret_val)
  2706. + goto out;
  2707. + if ((phy->id != 0) && (phy->id != PHY_REVISION_MASK))
  2708. + break;
  2709. + /* fall-through */
  2710. + case e1000_pch2lan:
  2711. /*
  2712. - * In case the PHY needs to be in mdio slow mode (eg. 82577),
  2713. + * In case the PHY needs to be in mdio slow mode,
  2714. * set slow mode and try to get the PHY id again.
  2715. */
  2716. ret_val = e1000_set_mdio_slow_mode_hv(hw);
  2717. @@ -352,6 +357,7 @@ static s32 e1000_init_phy_params_pchlan(
  2718. ret_val = e1000e_get_phy_id(hw);
  2719. if (ret_val)
  2720. goto out;
  2721. + break;
  2722. }
  2723. phy->type = e1000e_get_phy_type_from_id(phy->id);
  2724.  
  2725. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/netdev.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/netdev.c
  2726. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/netdev.c 2011-04-01 17:56:56.187710689 +0200
  2727. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/netdev.c 2011-04-02 01:37:42.312688354 +0200
  2728. @@ -5884,7 +5884,8 @@ static int __devinit e1000_probe(struct
  2729. /* APME bit in EEPROM is mapped to WUC.APME */
  2730. eeprom_data = er32(WUC);
  2731. eeprom_apme_mask = E1000_WUC_APME;
  2732. - if (eeprom_data & E1000_WUC_PHY_WAKE)
  2733. + if ((hw->mac.type > e1000_ich10lan) &&
  2734. + (eeprom_data & E1000_WUC_PHY_WAKE))
  2735. adapter->flags2 |= FLAG2_HAS_PHY_WAKEUP;
  2736. } else if (adapter->flags & FLAG_APME_IN_CTRL3) {
  2737. if (adapter->flags & FLAG_APME_CHECK_PORT_B &&
  2738. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/phy.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/phy.c
  2739. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/phy.c 2011-04-01 17:56:56.187710689 +0200
  2740. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/e1000e/phy.c 2011-04-02 01:37:42.312688354 +0200
  2741. @@ -226,6 +226,13 @@ s32 e1000e_read_phy_reg_mdic(struct e100
  2742. }
  2743. *data = (u16) mdic;
  2744.  
  2745. + /*
  2746. + * Allow some time after each MDIC transaction to avoid
  2747. + * reading duplicate data in the next MDIC transaction.
  2748. + */
  2749. + if (hw->mac.type == e1000_pch2lan)
  2750. + udelay(100);
  2751. +
  2752. return 0;
  2753. }
  2754.  
  2755. @@ -279,6 +286,13 @@ s32 e1000e_write_phy_reg_mdic(struct e10
  2756. return -E1000_ERR_PHY;
  2757. }
  2758.  
  2759. + /*
  2760. + * Allow some time after each MDIC transaction to avoid
  2761. + * reading duplicate data in the next MDIC transaction.
  2762. + */
  2763. + if (hw->mac.type == e1000_pch2lan)
  2764. + udelay(100);
  2765. +
  2766. return 0;
  2767. }
  2768.  
  2769. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/forcedeth.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/forcedeth.c
  2770. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/forcedeth.c 2011-04-01 17:56:56.145710688 +0200
  2771. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/forcedeth.c 2011-04-02 01:37:42.294688354 +0200
  2772. @@ -5816,6 +5816,8 @@ static int __devinit nv_probe(struct pci
  2773. goto out_error;
  2774. }
  2775.  
  2776. + netif_carrier_off(dev);
  2777. +
  2778. dev_printk(KERN_INFO, &pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, "
  2779. "addr %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n",
  2780. dev->name,
  2781. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_common.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_common.c
  2782. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_common.c 2011-04-01 17:56:56.143710689 +0200
  2783. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_common.c 2011-04-02 01:37:42.293688354 +0200
  2784. @@ -1292,6 +1292,9 @@ s32 ixgbe_init_rx_addrs_generic(struct i
  2785. hw_dbg(hw, " New MAC Addr =%pM\n", hw->mac.addr);
  2786.  
  2787. hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0, IXGBE_RAH_AV);
  2788. +
  2789. + /* clear VMDq pool/queue selection for RAR 0 */
  2790. + hw->mac.ops.clear_vmdq(hw, 0, IXGBE_CLEAR_VMDQ_ALL);
  2791. }
  2792. hw->addr_ctrl.overflow_promisc = 0;
  2793.  
  2794. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_fcoe.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_fcoe.c
  2795. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_fcoe.c 2011-04-01 17:56:56.143710689 +0200
  2796. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_fcoe.c 2011-04-02 01:37:42.293688354 +0200
  2797. @@ -151,7 +151,7 @@ int ixgbe_fcoe_ddp_get(struct net_device
  2798. struct scatterlist *sg;
  2799. unsigned int i, j, dmacount;
  2800. unsigned int len;
  2801. - static const unsigned int bufflen = 4096;
  2802. + static const unsigned int bufflen = IXGBE_FCBUFF_MIN;
  2803. unsigned int firstoff = 0;
  2804. unsigned int lastsize;
  2805. unsigned int thisoff = 0;
  2806. @@ -241,6 +241,24 @@ int ixgbe_fcoe_ddp_get(struct net_device
  2807. /* only the last buffer may have non-full bufflen */
  2808. lastsize = thisoff + thislen;
  2809.  
  2810. + /*
  2811. + * lastsize can not be buffer len.
  2812. + * If it is then adding another buffer with lastsize = 1.
  2813. + */
  2814. + if (lastsize == bufflen) {
  2815. + if (j >= IXGBE_BUFFCNT_MAX) {
  2816. + e_err(drv, "xid=%x:%d,%d,%d:addr=%llx "
  2817. + "not enough user buffers. We need an extra "
  2818. + "buffer because lastsize is bufflen.\n",
  2819. + xid, i, j, dmacount, (u64)addr);
  2820. + goto out_noddp_free;
  2821. + }
  2822. +
  2823. + ddp->udl[j] = (u64)(fcoe->extra_ddp_buffer_dma);
  2824. + j++;
  2825. + lastsize = 1;
  2826. + }
  2827. +
  2828. fcbuff = (IXGBE_FCBUFF_4KB << IXGBE_FCBUFF_BUFFSIZE_SHIFT);
  2829. fcbuff |= ((j & 0xff) << IXGBE_FCBUFF_BUFFCNT_SHIFT);
  2830. fcbuff |= (firstoff << IXGBE_FCBUFF_OFFSET_SHIFT);
  2831. @@ -519,6 +537,24 @@ void ixgbe_configure_fcoe(struct ixgbe_a
  2832. e_err(drv, "failed to allocated FCoE DDP pool\n");
  2833.  
  2834. spin_lock_init(&fcoe->lock);
  2835. +
  2836. + /* Extra buffer to be shared by all DDPs for HW work around */
  2837. + fcoe->extra_ddp_buffer = kmalloc(IXGBE_FCBUFF_MIN, GFP_ATOMIC);
  2838. + if (fcoe->extra_ddp_buffer == NULL) {
  2839. + e_err(drv, "failed to allocated extra DDP buffer\n");
  2840. + goto out_extra_ddp_buffer_alloc;
  2841. + }
  2842. +
  2843. + fcoe->extra_ddp_buffer_dma =
  2844. + dma_map_single(&adapter->pdev->dev,
  2845. + fcoe->extra_ddp_buffer,
  2846. + IXGBE_FCBUFF_MIN,
  2847. + DMA_FROM_DEVICE);
  2848. + if (dma_mapping_error(&adapter->pdev->dev,
  2849. + fcoe->extra_ddp_buffer_dma)) {
  2850. + e_err(drv, "failed to map extra DDP buffer\n");
  2851. + goto out_extra_ddp_buffer_dma;
  2852. + }
  2853. }
  2854.  
  2855. /* Enable L2 eth type filter for FCoE */
  2856. @@ -568,6 +604,14 @@ void ixgbe_configure_fcoe(struct ixgbe_a
  2857. }
  2858. }
  2859. #endif
  2860. +
  2861. + return;
  2862. +
  2863. +out_extra_ddp_buffer_dma:
  2864. + kfree(fcoe->extra_ddp_buffer);
  2865. +out_extra_ddp_buffer_alloc:
  2866. + pci_pool_destroy(fcoe->pool);
  2867. + fcoe->pool = NULL;
  2868. }
  2869.  
  2870. /**
  2871. @@ -587,6 +631,11 @@ void ixgbe_cleanup_fcoe(struct ixgbe_ada
  2872. if (fcoe->pool) {
  2873. for (i = 0; i < IXGBE_FCOE_DDP_MAX; i++)
  2874. ixgbe_fcoe_ddp_put(adapter->netdev, i);
  2875. + dma_unmap_single(&adapter->pdev->dev,
  2876. + fcoe->extra_ddp_buffer_dma,
  2877. + IXGBE_FCBUFF_MIN,
  2878. + DMA_FROM_DEVICE);
  2879. + kfree(fcoe->extra_ddp_buffer);
  2880. pci_pool_destroy(fcoe->pool);
  2881. fcoe->pool = NULL;
  2882. }
  2883. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_fcoe.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_fcoe.h
  2884. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_fcoe.h 2011-04-01 17:56:56.130710689 +0200
  2885. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_fcoe.h 2011-04-02 01:37:42.293688354 +0200
  2886. @@ -70,6 +70,8 @@ struct ixgbe_fcoe {
  2887. spinlock_t lock;
  2888. struct pci_pool *pool;
  2889. struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX];
  2890. + unsigned char *extra_ddp_buffer;
  2891. + dma_addr_t extra_ddp_buffer_dma;
  2892. };
  2893.  
  2894. #endif /* _IXGBE_FCOE_H */
  2895. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_main.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_main.c
  2896. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_main.c 2011-04-01 17:56:56.130710689 +0200
  2897. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_main.c 2011-04-02 01:37:42.293688354 +0200
  2898. @@ -2923,6 +2923,10 @@ static void ixgbe_set_rx_buffer_len(stru
  2899. if (hw->mac.type == ixgbe_mac_82599EB)
  2900. adapter->flags &= ~IXGBE_FLAG_RX_PS_ENABLED;
  2901.  
  2902. + /* Disable packet split due to 82599 erratum #45 */
  2903. + if (hw->mac.type == ixgbe_mac_82599EB)
  2904. + adapter->flags &= ~IXGBE_FLAG_RX_PS_ENABLED;
  2905. +
  2906. /* Set the RX buffer length according to the mode */
  2907. if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) {
  2908. rx_buf_len = IXGBE_RX_HDR_SIZE;
  2909. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_sriov.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_sriov.c
  2910. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_sriov.c 2011-04-01 17:56:56.130710689 +0200
  2911. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/ixgbe/ixgbe_sriov.c 2011-04-02 01:37:42.293688354 +0200
  2912. @@ -110,12 +110,10 @@ static int ixgbe_set_vf_vlan(struct ixgb
  2913. return adapter->hw.mac.ops.set_vfta(&adapter->hw, vid, vf, (bool)add);
  2914. }
  2915.  
  2916. -
  2917. static void ixgbe_set_vmolr(struct ixgbe_hw *hw, u32 vf, bool aupe)
  2918. {
  2919. u32 vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
  2920. vmolr |= (IXGBE_VMOLR_ROMPE |
  2921. - IXGBE_VMOLR_ROPE |
  2922. IXGBE_VMOLR_BAM);
  2923. if (aupe)
  2924. vmolr |= IXGBE_VMOLR_AUPE;
  2925. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/r8169.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/r8169.c
  2926. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/r8169.c 2011-04-01 17:56:56.067710689 +0200
  2927. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/r8169.c 2011-04-02 01:37:42.225688354 +0200
  2928. @@ -24,6 +24,7 @@
  2929. #include <linux/init.h>
  2930. #include <linux/dma-mapping.h>
  2931. #include <linux/pm_runtime.h>
  2932. +#include <linux/pci-aspm.h>
  2933.  
  2934. #include <asm/system.h>
  2935. #include <asm/io.h>
  2936. @@ -757,7 +758,8 @@ static void __rtl8169_check_link_status(
  2937. if (pm)
  2938. pm_request_resume(&tp->pci_dev->dev);
  2939. netif_carrier_on(dev);
  2940. - netif_info(tp, ifup, dev, "link up\n");
  2941. + if (net_ratelimit())
  2942. + netif_info(tp, ifup, dev, "link up\n");
  2943. } else {
  2944. netif_carrier_off(dev);
  2945. netif_info(tp, ifdown, dev, "link down\n");
  2946. @@ -3047,6 +3049,11 @@ rtl8169_init_one(struct pci_dev *pdev, c
  2947. mii->reg_num_mask = 0x1f;
  2948. mii->supports_gmii = !!(cfg->features & RTL_FEATURE_GMII);
  2949.  
  2950. + /* disable ASPM completely as that cause random device stop working
  2951. + * problems as well as full system hangs for some PCIe devices users */
  2952. + pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
  2953. + PCIE_LINK_STATE_CLKPM);
  2954. +
  2955. /* enable device (incl. PCI PM wakeup and hotplug setup) */
  2956. rc = pci_enable_device(pdev);
  2957. if (rc < 0) {
  2958. @@ -3229,6 +3236,8 @@ rtl8169_init_one(struct pci_dev *pdev, c
  2959. if (pci_dev_run_wake(pdev))
  2960. pm_runtime_put_noidle(&pdev->dev);
  2961.  
  2962. + netif_carrier_off(dev);
  2963. +
  2964. out:
  2965. return rc;
  2966.  
  2967. @@ -3719,7 +3728,8 @@ static void rtl_hw_start_8168(struct net
  2968. RTL_W16(IntrMitigate, 0x5151);
  2969.  
  2970. /* Work around for RxFIFO overflow. */
  2971. - if (tp->mac_version == RTL_GIGA_MAC_VER_11) {
  2972. + if (tp->mac_version == RTL_GIGA_MAC_VER_11 ||
  2973. + tp->mac_version == RTL_GIGA_MAC_VER_22) {
  2974. tp->intr_event |= RxFIFOOver | PCSTimeout;
  2975. tp->intr_event &= ~RxOverflow;
  2976. }
  2977. @@ -4596,12 +4606,32 @@ static irqreturn_t rtl8169_interrupt(int
  2978. break;
  2979. }
  2980.  
  2981. - /* Work around for rx fifo overflow */
  2982. - if (unlikely(status & RxFIFOOver) &&
  2983. - (tp->mac_version == RTL_GIGA_MAC_VER_11)) {
  2984. - netif_stop_queue(dev);
  2985. - rtl8169_tx_timeout(dev);
  2986. - break;
  2987. + if (unlikely(status & RxFIFOOver)) {
  2988. + switch (tp->mac_version) {
  2989. + /* Work around for rx fifo overflow */
  2990. + case RTL_GIGA_MAC_VER_11:
  2991. + case RTL_GIGA_MAC_VER_22:
  2992. + case RTL_GIGA_MAC_VER_26:
  2993. + netif_stop_queue(dev);
  2994. + rtl8169_tx_timeout(dev);
  2995. + goto done;
  2996. + /* Testers needed. */
  2997. + case RTL_GIGA_MAC_VER_17:
  2998. + case RTL_GIGA_MAC_VER_19:
  2999. + case RTL_GIGA_MAC_VER_20:
  3000. + case RTL_GIGA_MAC_VER_21:
  3001. + case RTL_GIGA_MAC_VER_23:
  3002. + case RTL_GIGA_MAC_VER_24:
  3003. + case RTL_GIGA_MAC_VER_27:
  3004. + /* Experimental science. Pktgen proof. */
  3005. + case RTL_GIGA_MAC_VER_12:
  3006. + case RTL_GIGA_MAC_VER_25:
  3007. + if (status == RxFIFOOver)
  3008. + goto done;
  3009. + break;
  3010. + default:
  3011. + break;
  3012. + }
  3013. }
  3014.  
  3015. if (unlikely(status & SYSErr)) {
  3016. @@ -4637,7 +4667,7 @@ static irqreturn_t rtl8169_interrupt(int
  3017. (status & RxFIFOOver) ? (status | RxOverflow) : status);
  3018. status = RTL_R16(IntrStatus);
  3019. }
  3020. -
  3021. +done:
  3022. return IRQ_RETVAL(handled);
  3023. }
  3024.  
  3025. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/tg3.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/tg3.c
  3026. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/tg3.c 2011-04-01 17:56:56.068710689 +0200
  3027. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/tg3.c 2011-04-02 01:37:42.226688354 +0200
  3028. @@ -11165,7 +11165,9 @@ static int tg3_ioctl(struct net_device *
  3029. if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
  3030. break; /* We have no PHY */
  3031.  
  3032. - if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
  3033. + if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) ||
  3034. + ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) &&
  3035. + !netif_running(dev)))
  3036. return -EAGAIN;
  3037.  
  3038. spin_lock_bh(&tp->lock);
  3039. @@ -11181,7 +11183,9 @@ static int tg3_ioctl(struct net_device *
  3040. if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
  3041. break; /* We have no PHY */
  3042.  
  3043. - if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
  3044. + if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) ||
  3045. + ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) &&
  3046. + !netif_running(dev)))
  3047. return -EAGAIN;
  3048.  
  3049. spin_lock_bh(&tp->lock);
  3050. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/ath9k.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/ath9k.h
  3051. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/ath9k.h 2011-04-01 17:56:56.094710689 +0200
  3052. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/ath9k.h 2011-04-02 01:37:42.249688354 +0200
  3053. @@ -21,7 +21,6 @@
  3054. #include <linux/device.h>
  3055. #include <linux/leds.h>
  3056. #include <linux/completion.h>
  3057. -#include <linux/pm_qos_params.h>
  3058.  
  3059. #include "debug.h"
  3060. #include "common.h"
  3061. @@ -647,8 +646,6 @@ struct ath_softc {
  3062. struct ath_descdma txsdma;
  3063.  
  3064. struct ath_ant_comb ant_comb;
  3065. -
  3066. - struct pm_qos_request_list pm_qos_req;
  3067. };
  3068.  
  3069. struct ath_wiphy {
  3070. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/hif_usb.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/hif_usb.c
  3071. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/hif_usb.c 2011-04-01 17:56:56.093710689 +0200
  3072. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/hif_usb.c 2011-04-02 01:37:42.248688354 +0200
  3073. @@ -210,8 +210,9 @@ static int __hif_usb_tx(struct hif_devic
  3074. struct tx_buf *tx_buf = NULL;
  3075. struct sk_buff *nskb = NULL;
  3076. int ret = 0, i;
  3077. - u16 *hdr, tx_skb_cnt = 0;
  3078. + u16 tx_skb_cnt = 0;
  3079. u8 *buf;
  3080. + __le16 *hdr;
  3081.  
  3082. if (hif_dev->tx.tx_skb_cnt == 0)
  3083. return 0;
  3084. @@ -236,9 +237,9 @@ static int __hif_usb_tx(struct hif_devic
  3085.  
  3086. buf = tx_buf->buf;
  3087. buf += tx_buf->offset;
  3088. - hdr = (u16 *)buf;
  3089. - *hdr++ = nskb->len;
  3090. - *hdr++ = ATH_USB_TX_STREAM_MODE_TAG;
  3091. + hdr = (__le16 *)buf;
  3092. + *hdr++ = cpu_to_le16(nskb->len);
  3093. + *hdr++ = cpu_to_le16(ATH_USB_TX_STREAM_MODE_TAG);
  3094. buf += 4;
  3095. memcpy(buf, nskb->data, nskb->len);
  3096. tx_buf->len = nskb->len + 4;
  3097. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/hw.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/hw.c
  3098. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/hw.c 2011-04-01 17:56:56.093710689 +0200
  3099. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/hw.c 2011-04-02 01:37:42.248688354 +0200
  3100. @@ -516,6 +516,17 @@ static int __ath9k_hw_init(struct ath_hw
  3101. if (ah->hw_version.devid == AR5416_AR9100_DEVID)
  3102. ah->hw_version.macVersion = AR_SREV_VERSION_9100;
  3103.  
  3104. + /*
  3105. + * Read back AR_WA into a permanent copy and set bits 14 and 17.
  3106. + * We need to do this to avoid RMW of this register. We cannot
  3107. + * read the reg when chip is asleep.
  3108. + */
  3109. + ah->WARegVal = REG_READ(ah, AR_WA);
  3110. + ah->WARegVal |= (AR_WA_D3_L1_DISABLE |
  3111. + AR_WA_ASPM_TIMER_BASED_DISABLE);
  3112. +
  3113. + ath9k_hw_read_revisions(ah);
  3114. +
  3115. if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) {
  3116. ath_print(common, ATH_DBG_FATAL,
  3117. "Couldn't reset chip\n");
  3118. @@ -574,14 +585,6 @@ static int __ath9k_hw_init(struct ath_hw
  3119.  
  3120. ath9k_hw_init_mode_regs(ah);
  3121.  
  3122. - /*
  3123. - * Read back AR_WA into a permanent copy and set bits 14 and 17.
  3124. - * We need to do this to avoid RMW of this register. We cannot
  3125. - * read the reg when chip is asleep.
  3126. - */
  3127. - ah->WARegVal = REG_READ(ah, AR_WA);
  3128. - ah->WARegVal |= (AR_WA_D3_L1_DISABLE |
  3129. - AR_WA_ASPM_TIMER_BASED_DISABLE);
  3130.  
  3131. if (ah->is_pciexpress)
  3132. ath9k_hw_configpcipowersave(ah, 0, 0);
  3133. @@ -1089,8 +1092,6 @@ static bool ath9k_hw_set_reset_power_on(
  3134. return false;
  3135. }
  3136.  
  3137. - ath9k_hw_read_revisions(ah);
  3138. -
  3139. return ath9k_hw_set_reset(ah, ATH9K_RESET_WARM);
  3140. }
  3141.  
  3142. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/init.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/init.c
  3143. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/init.c 2011-04-01 17:56:56.092710689 +0200
  3144. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/init.c 2011-04-02 01:37:42.248688354 +0200
  3145. @@ -758,9 +758,6 @@ int ath9k_init_device(u16 devid, struct
  3146. ath_init_leds(sc);
  3147. ath_start_rfkill_poll(sc);
  3148.  
  3149. - pm_qos_add_request(&sc->pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
  3150. - PM_QOS_DEFAULT_VALUE);
  3151. -
  3152. return 0;
  3153.  
  3154. error_world:
  3155. @@ -829,7 +826,6 @@ void ath9k_deinit_device(struct ath_soft
  3156. }
  3157.  
  3158. ieee80211_unregister_hw(hw);
  3159. - pm_qos_remove_request(&sc->pm_qos_req);
  3160. ath_rx_cleanup(sc);
  3161. ath_tx_cleanup(sc);
  3162. ath9k_deinit_softc(sc);
  3163. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/main.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/main.c
  3164. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/main.c 2011-04-01 17:56:56.094710689 +0200
  3165. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/main.c 2011-04-02 01:37:42.249688354 +0200
  3166. @@ -1245,8 +1245,6 @@ static int ath9k_start(struct ieee80211_
  3167. ath9k_btcoex_timer_resume(sc);
  3168. }
  3169.  
  3170. - pm_qos_update_request(&sc->pm_qos_req, 55);
  3171. -
  3172. mutex_unlock:
  3173. mutex_unlock(&sc->mutex);
  3174.  
  3175. @@ -1425,8 +1423,6 @@ static void ath9k_stop(struct ieee80211_
  3176.  
  3177. sc->sc_flags |= SC_OP_INVALID;
  3178.  
  3179. - pm_qos_update_request(&sc->pm_qos_req, PM_QOS_DEFAULT_VALUE);
  3180. -
  3181. mutex_unlock(&sc->mutex);
  3182.  
  3183. ath_print(common, ATH_DBG_CONFIG, "Driver halt\n");
  3184. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/recv.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/recv.c
  3185. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/recv.c 2011-04-01 17:56:56.093710689 +0200
  3186. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/ath9k/recv.c 2011-04-02 01:37:42.248688354 +0200
  3187. @@ -439,9 +439,7 @@ u32 ath_calcrxfilter(struct ath_softc *s
  3188. * mode interface or when in monitor mode. AP mode does not need this
  3189. * since it receives all in-BSS frames anyway.
  3190. */
  3191. - if (((sc->sc_ah->opmode != NL80211_IFTYPE_AP) &&
  3192. - (sc->rx.rxfilter & FIF_PROMISC_IN_BSS)) ||
  3193. - (sc->sc_ah->is_monitoring))
  3194. + if (sc->sc_ah->is_monitoring)
  3195. rfilt |= ATH9K_RX_FILTER_PROM;
  3196.  
  3197. if (sc->rx.rxfilter & FIF_CONTROL)
  3198. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/carl9170/usb.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/carl9170/usb.c
  3199. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/carl9170/usb.c 2011-04-01 17:56:56.091710689 +0200
  3200. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/ath/carl9170/usb.c 2011-04-02 01:37:42.247688354 +0200
  3201. @@ -118,6 +118,8 @@ static struct usb_device_id carl9170_usb
  3202. { USB_DEVICE(0x057c, 0x8402) },
  3203. /* Qwest/Actiontec 802AIN Wireless N USB Network Adapter */
  3204. { USB_DEVICE(0x1668, 0x1200) },
  3205. + /* Airlive X.USB a/b/g/n */
  3206. + { USB_DEVICE(0x1b75, 0x9170) },
  3207.  
  3208. /* terminate */
  3209. {}
  3210. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/p54/p54pci.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/p54/p54pci.c
  3211. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/p54/p54pci.c 2011-04-01 17:56:56.096710689 +0200
  3212. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/p54/p54pci.c 2011-04-02 01:37:42.251688354 +0200
  3213. @@ -199,6 +199,7 @@ static void p54p_check_rx_ring(struct ie
  3214. while (i != idx) {
  3215. u16 len;
  3216. struct sk_buff *skb;
  3217. + dma_addr_t dma_addr;
  3218. desc = &ring[i];
  3219. len = le16_to_cpu(desc->len);
  3220. skb = rx_buf[i];
  3221. @@ -216,17 +217,20 @@ static void p54p_check_rx_ring(struct ie
  3222.  
  3223. len = priv->common.rx_mtu;
  3224. }
  3225. + dma_addr = le32_to_cpu(desc->host_addr);
  3226. + pci_dma_sync_single_for_cpu(priv->pdev, dma_addr,
  3227. + priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE);
  3228. skb_put(skb, len);
  3229.  
  3230. if (p54_rx(dev, skb)) {
  3231. - pci_unmap_single(priv->pdev,
  3232. - le32_to_cpu(desc->host_addr),
  3233. - priv->common.rx_mtu + 32,
  3234. - PCI_DMA_FROMDEVICE);
  3235. + pci_unmap_single(priv->pdev, dma_addr,
  3236. + priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE);
  3237. rx_buf[i] = NULL;
  3238. - desc->host_addr = 0;
  3239. + desc->host_addr = cpu_to_le32(0);
  3240. } else {
  3241. skb_trim(skb, 0);
  3242. + pci_dma_sync_single_for_device(priv->pdev, dma_addr,
  3243. + priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE);
  3244. desc->len = cpu_to_le16(priv->common.rx_mtu + 32);
  3245. }
  3246.  
  3247. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/p54/p54usb.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/p54/p54usb.c
  3248. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/p54/p54usb.c 2011-04-01 17:56:56.096710689 +0200
  3249. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/p54/p54usb.c 2011-04-02 01:37:42.251688354 +0200
  3250. @@ -98,6 +98,7 @@ static struct usb_device_id p54u_table[]
  3251. {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */
  3252. {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
  3253. {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */
  3254. + {USB_DEVICE(0x1740, 0x1000)}, /* Senao NUB-350 */
  3255. {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */
  3256. {USB_DEVICE(0x2001, 0x3705)}, /* D-Link DWL-G120 rev C1 */
  3257. {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */
  3258. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/rt2x00/rt2x00dev.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/rt2x00/rt2x00dev.c
  3259. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/rt2x00/rt2x00dev.c 2011-04-01 17:56:56.102710689 +0200
  3260. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/rt2x00/rt2x00dev.c 2011-04-02 01:37:42.257688354 +0200
  3261. @@ -486,6 +486,10 @@ void rt2x00lib_rxdone(struct queue_entry
  3262. unsigned int header_length;
  3263. int rate_idx;
  3264.  
  3265. + if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) ||
  3266. + !test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
  3267. + goto submit_entry;
  3268. +
  3269. if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags))
  3270. goto submit_entry;
  3271.  
  3272. @@ -570,9 +574,13 @@ void rt2x00lib_rxdone(struct queue_entry
  3273. entry->skb = skb;
  3274.  
  3275. submit_entry:
  3276. - rt2x00dev->ops->lib->clear_entry(entry);
  3277. - rt2x00queue_index_inc(entry->queue, Q_INDEX);
  3278. + entry->flags = 0;
  3279. rt2x00queue_index_inc(entry->queue, Q_INDEX_DONE);
  3280. + if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) &&
  3281. + test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) {
  3282. + rt2x00dev->ops->lib->clear_entry(entry);
  3283. + rt2x00queue_index_inc(entry->queue, Q_INDEX);
  3284. + }
  3285. }
  3286. EXPORT_SYMBOL_GPL(rt2x00lib_rxdone);
  3287.  
  3288. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/rt2x00/rt2x00usb.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/rt2x00/rt2x00usb.c
  3289. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/rt2x00/rt2x00usb.c 2011-04-01 17:56:56.101710689 +0200
  3290. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/net/wireless/rt2x00/rt2x00usb.c 2011-04-02 01:37:42.257688354 +0200
  3291. @@ -226,9 +226,7 @@ static void rt2x00usb_interrupt_txdone(s
  3292. * Schedule the delayed work for reading the TX status
  3293. * from the device.
  3294. */
  3295. - if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) &&
  3296. - test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
  3297. - ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->txdone_work);
  3298. + ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->txdone_work);
  3299. }
  3300.  
  3301. static void rt2x00usb_kick_tx_entry(struct queue_entry *entry)
  3302. @@ -237,6 +235,7 @@ static void rt2x00usb_kick_tx_entry(stru
  3303. struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev);
  3304. struct queue_entry_priv_usb *entry_priv = entry->priv_data;
  3305. u32 length;
  3306. + int status;
  3307.  
  3308. if (!test_and_clear_bit(ENTRY_DATA_PENDING, &entry->flags))
  3309. return;
  3310. @@ -253,7 +252,10 @@ static void rt2x00usb_kick_tx_entry(stru
  3311. entry->skb->data, length,
  3312. rt2x00usb_interrupt_txdone, entry);
  3313.  
  3314. - if (usb_submit_urb(entry_priv->urb, GFP_ATOMIC)) {
  3315. + status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
  3316. + if (status) {
  3317. + if (status == -ENODEV)
  3318. + clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
  3319. set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
  3320. rt2x00lib_dmadone(entry);
  3321. }
  3322. @@ -424,9 +426,7 @@ static void rt2x00usb_interrupt_rxdone(s
  3323. * Schedule the delayed work for reading the RX status
  3324. * from the device.
  3325. */
  3326. - if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) &&
  3327. - test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
  3328. - ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->rxdone_work);
  3329. + ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->rxdone_work);
  3330. }
  3331.  
  3332. /*
  3333. @@ -454,6 +454,7 @@ void rt2x00usb_clear_entry(struct queue_
  3334. to_usb_device_intf(entry->queue->rt2x00dev->dev);
  3335. struct queue_entry_priv_usb *entry_priv = entry->priv_data;
  3336. int pipe;
  3337. + int status;
  3338.  
  3339. entry->flags = 0;
  3340.  
  3341. @@ -464,7 +465,12 @@ void rt2x00usb_clear_entry(struct queue_
  3342. rt2x00usb_interrupt_rxdone, entry);
  3343.  
  3344. set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
  3345. - if (usb_submit_urb(entry_priv->urb, GFP_ATOMIC)) {
  3346. +
  3347. + status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
  3348. + if (status) {
  3349. + if (status == -ENODEV)
  3350. + clear_bit(DEVICE_STATE_PRESENT,
  3351. + &entry->queue->rt2x00dev->flags);
  3352. set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
  3353. rt2x00lib_dmadone(entry);
  3354. }
  3355. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/hotplug/acpiphp_glue.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/hotplug/acpiphp_glue.c
  3356. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/hotplug/acpiphp_glue.c 2011-04-01 17:56:56.705710687 +0200
  3357. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/hotplug/acpiphp_glue.c 2011-04-02 01:38:34.971688310 +0200
  3358. @@ -212,6 +212,7 @@ register_slot(acpi_handle handle, u32 lv
  3359.  
  3360. pdev = pci_get_slot(pbus, PCI_DEVFN(device, function));
  3361. if (pdev) {
  3362. + pdev->current_state = PCI_D0;
  3363. slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON);
  3364. pci_dev_put(pdev);
  3365. }
  3366. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/pci-sysfs.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/pci-sysfs.c
  3367. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/pci-sysfs.c 2011-04-01 17:56:56.713710688 +0200
  3368. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/pci-sysfs.c 2011-04-02 01:37:43.084688354 +0200
  3369. @@ -1088,7 +1088,7 @@ static int pci_create_capabilities_sysfs
  3370. attr->write = write_vpd_attr;
  3371. retval = sysfs_create_bin_file(&dev->dev.kobj, attr);
  3372. if (retval) {
  3373. - kfree(dev->vpd->attr);
  3374. + kfree(attr);
  3375. return retval;
  3376. }
  3377. dev->vpd->attr = attr;
  3378. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/quirks.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/quirks.c
  3379. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/quirks.c 2011-04-01 17:56:56.717710687 +0200
  3380. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/pci/quirks.c 2011-04-02 01:37:43.085688354 +0200
  3381. @@ -533,6 +533,17 @@ static void __devinit quirk_piix4_acpi(s
  3382. DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi);
  3383. DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3, quirk_piix4_acpi);
  3384.  
  3385. +#define ICH_PMBASE 0x40
  3386. +#define ICH_ACPI_CNTL 0x44
  3387. +#define ICH4_ACPI_EN 0x10
  3388. +#define ICH6_ACPI_EN 0x80
  3389. +#define ICH4_GPIOBASE 0x58
  3390. +#define ICH4_GPIO_CNTL 0x5c
  3391. +#define ICH4_GPIO_EN 0x10
  3392. +#define ICH6_GPIOBASE 0x48
  3393. +#define ICH6_GPIO_CNTL 0x4c
  3394. +#define ICH6_GPIO_EN 0x10
  3395. +
  3396. /*
  3397. * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at
  3398. * 0x40 (128 bytes of ACPI, GPIO & TCO registers)
  3399. @@ -541,12 +552,33 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
  3400. static void __devinit quirk_ich4_lpc_acpi(struct pci_dev *dev)
  3401. {
  3402. u32 region;
  3403. + u8 enable;
  3404.  
  3405. - pci_read_config_dword(dev, 0x40, &region);
  3406. - quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES, "ICH4 ACPI/GPIO/TCO");
  3407. + /*
  3408. + * The check for PCIBIOS_MIN_IO is to ensure we won't create a conflict
  3409. + * with low legacy (and fixed) ports. We don't know the decoding
  3410. + * priority and can't tell whether the legacy device or the one created
  3411. + * here is really at that address. This happens on boards with broken
  3412. + * BIOSes.
  3413. + */
  3414.  
  3415. - pci_read_config_dword(dev, 0x58, &region);
  3416. - quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH4 GPIO");
  3417. + pci_read_config_byte(dev, ICH_ACPI_CNTL, &enable);
  3418. + if (enable & ICH4_ACPI_EN) {
  3419. + pci_read_config_dword(dev, ICH_PMBASE, &region);
  3420. + region &= PCI_BASE_ADDRESS_IO_MASK;
  3421. + if (region >= PCIBIOS_MIN_IO)
  3422. + quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES,
  3423. + "ICH4 ACPI/GPIO/TCO");
  3424. + }
  3425. +
  3426. + pci_read_config_byte(dev, ICH4_GPIO_CNTL, &enable);
  3427. + if (enable & ICH4_GPIO_EN) {
  3428. + pci_read_config_dword(dev, ICH4_GPIOBASE, &region);
  3429. + region &= PCI_BASE_ADDRESS_IO_MASK;
  3430. + if (region >= PCIBIOS_MIN_IO)
  3431. + quirk_io_region(dev, region, 64,
  3432. + PCI_BRIDGE_RESOURCES + 1, "ICH4 GPIO");
  3433. + }
  3434. }
  3435. DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, quirk_ich4_lpc_acpi);
  3436. DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_0, quirk_ich4_lpc_acpi);
  3437. @@ -562,12 +594,25 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
  3438. static void __devinit ich6_lpc_acpi_gpio(struct pci_dev *dev)
  3439. {
  3440. u32 region;
  3441. + u8 enable;
  3442.  
  3443. - pci_read_config_dword(dev, 0x40, &region);
  3444. - quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES, "ICH6 ACPI/GPIO/TCO");
  3445. + pci_read_config_byte(dev, ICH_ACPI_CNTL, &enable);
  3446. + if (enable & ICH6_ACPI_EN) {
  3447. + pci_read_config_dword(dev, ICH_PMBASE, &region);
  3448. + region &= PCI_BASE_ADDRESS_IO_MASK;
  3449. + if (region >= PCIBIOS_MIN_IO)
  3450. + quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES,
  3451. + "ICH6 ACPI/GPIO/TCO");
  3452. + }
  3453.  
  3454. - pci_read_config_dword(dev, 0x48, &region);
  3455. - quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH6 GPIO");
  3456. + pci_read_config_byte(dev, ICH6_GPIO_CNTL, &enable);
  3457. + if (enable & ICH4_GPIO_EN) {
  3458. + pci_read_config_dword(dev, ICH6_GPIOBASE, &region);
  3459. + region &= PCI_BASE_ADDRESS_IO_MASK;
  3460. + if (region >= PCIBIOS_MIN_IO)
  3461. + quirk_io_region(dev, region, 64,
  3462. + PCI_BRIDGE_RESOURCES + 1, "ICH6 GPIO");
  3463. + }
  3464. }
  3465.  
  3466. static void __devinit ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name, int dynsize)
  3467. @@ -2618,58 +2663,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AT
  3468.  
  3469. #endif /* CONFIG_PCI_MSI */
  3470.  
  3471. -#ifdef CONFIG_PCI_IOV
  3472. -
  3473. -/*
  3474. - * For Intel 82576 SR-IOV NIC, if BIOS doesn't allocate resources for the
  3475. - * SR-IOV BARs, zero the Flash BAR and program the SR-IOV BARs to use the
  3476. - * old Flash Memory Space.
  3477. - */
  3478. -static void __devinit quirk_i82576_sriov(struct pci_dev *dev)
  3479. -{
  3480. - int pos, flags;
  3481. - u32 bar, start, size;
  3482. -
  3483. - if (PAGE_SIZE > 0x10000)
  3484. - return;
  3485. -
  3486. - flags = pci_resource_flags(dev, 0);
  3487. - if ((flags & PCI_BASE_ADDRESS_SPACE) !=
  3488. - PCI_BASE_ADDRESS_SPACE_MEMORY ||
  3489. - (flags & PCI_BASE_ADDRESS_MEM_TYPE_MASK) !=
  3490. - PCI_BASE_ADDRESS_MEM_TYPE_32)
  3491. - return;
  3492. -
  3493. - pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_SRIOV);
  3494. - if (!pos)
  3495. - return;
  3496. -
  3497. - pci_read_config_dword(dev, pos + PCI_SRIOV_BAR, &bar);
  3498. - if (bar & PCI_BASE_ADDRESS_MEM_MASK)
  3499. - return;
  3500. -
  3501. - start = pci_resource_start(dev, 1);
  3502. - size = pci_resource_len(dev, 1);
  3503. - if (!start || size != 0x400000 || start & (size - 1))
  3504. - return;
  3505. -
  3506. - pci_resource_flags(dev, 1) = 0;
  3507. - pci_write_config_dword(dev, PCI_BASE_ADDRESS_1, 0);
  3508. - pci_write_config_dword(dev, pos + PCI_SRIOV_BAR, start);
  3509. - pci_write_config_dword(dev, pos + PCI_SRIOV_BAR + 12, start + size / 2);
  3510. -
  3511. - dev_info(&dev->dev, "use Flash Memory Space for SR-IOV BARs\n");
  3512. -}
  3513. -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x10c9, quirk_i82576_sriov);
  3514. -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x10e6, quirk_i82576_sriov);
  3515. -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x10e7, quirk_i82576_sriov);
  3516. -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x10e8, quirk_i82576_sriov);
  3517. -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x150a, quirk_i82576_sriov);
  3518. -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x150d, quirk_i82576_sriov);
  3519. -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1518, quirk_i82576_sriov);
  3520. -
  3521. -#endif /* CONFIG_PCI_IOV */
  3522. -
  3523. /* Allow manual resource allocation for PCI hotplug bridges
  3524. * via pci=hpmemsize=nnM and pci=hpiosize=nnM parameters. For
  3525. * some PCI-PCI hotplug bridges, like PLX 6254 (former HINT HB6),
  3526. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/rtc/rtc-ds3232.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/rtc/rtc-ds3232.c
  3527. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/rtc/rtc-ds3232.c 2011-04-01 17:56:56.030710689 +0200
  3528. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/rtc/rtc-ds3232.c 2011-04-02 01:37:42.186688354 +0200
  3529. @@ -1,7 +1,7 @@
  3530. /*
  3531. * RTC client/driver for the Maxim/Dallas DS3232 Real-Time Clock over I2C
  3532. *
  3533. - * Copyright (C) 2009-2010 Freescale Semiconductor.
  3534. + * Copyright (C) 2009-2011 Freescale Semiconductor.
  3535. * Author: Jack Lan <jack.lan@freescale.com>
  3536. *
  3537. * This program is free software; you can redistribute it and/or modify it
  3538. @@ -141,9 +141,11 @@ static int ds3232_read_time(struct devic
  3539. time->tm_hour = bcd2bin(hour);
  3540. }
  3541.  
  3542. - time->tm_wday = bcd2bin(week);
  3543. + /* Day of the week in linux range is 0~6 while 1~7 in RTC chip */
  3544. + time->tm_wday = bcd2bin(week) - 1;
  3545. time->tm_mday = bcd2bin(day);
  3546. - time->tm_mon = bcd2bin(month & 0x7F);
  3547. + /* linux tm_mon range:0~11, while month range is 1~12 in RTC chip */
  3548. + time->tm_mon = bcd2bin(month & 0x7F) - 1;
  3549. if (century)
  3550. add_century = 100;
  3551.  
  3552. @@ -162,9 +164,11 @@ static int ds3232_set_time(struct device
  3553. buf[0] = bin2bcd(time->tm_sec);
  3554. buf[1] = bin2bcd(time->tm_min);
  3555. buf[2] = bin2bcd(time->tm_hour);
  3556. - buf[3] = bin2bcd(time->tm_wday); /* Day of the week */
  3557. + /* Day of the week in linux range is 0~6 while 1~7 in RTC chip */
  3558. + buf[3] = bin2bcd(time->tm_wday + 1);
  3559. buf[4] = bin2bcd(time->tm_mday); /* Date */
  3560. - buf[5] = bin2bcd(time->tm_mon);
  3561. + /* linux tm_mon range:0~11, while month range is 1~12 in RTC chip */
  3562. + buf[5] = bin2bcd(time->tm_mon + 1);
  3563. if (time->tm_year >= 100) {
  3564. buf[5] |= 0x80;
  3565. buf[6] = bin2bcd(time->tm_year - 100);
  3566. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/s390/char/keyboard.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/s390/char/keyboard.c
  3567. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/s390/char/keyboard.c 2011-04-01 17:56:56.210710688 +0200
  3568. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/s390/char/keyboard.c 2011-04-02 01:37:42.321688354 +0200
  3569. @@ -460,7 +460,8 @@ kbd_ioctl(struct kbd_data *kbd, struct f
  3570. unsigned int cmd, unsigned long arg)
  3571. {
  3572. void __user *argp;
  3573. - int ct, perm;
  3574. + unsigned int ct;
  3575. + int perm;
  3576.  
  3577. argp = (void __user *)arg;
  3578.  
  3579. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/device_handler/scsi_dh_alua.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/device_handler/scsi_dh_alua.c
  3580. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/device_handler/scsi_dh_alua.c 2011-04-01 17:56:55.998710689 +0200
  3581. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/device_handler/scsi_dh_alua.c 2011-04-02 01:37:42.153688354 +0200
  3582. @@ -285,7 +285,8 @@ static void stpg_endio(struct request *r
  3583. print_alua_state(h->state));
  3584. }
  3585. done:
  3586. - blk_put_request(req);
  3587. + req->end_io_data = NULL;
  3588. + __blk_put_request(req->q, req);
  3589. if (h->callback_fn) {
  3590. h->callback_fn(h->callback_data, err);
  3591. h->callback_fn = h->callback_data = NULL;
  3592. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/scsi_lib.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/scsi_lib.c
  3593. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/scsi_lib.c 2011-04-01 17:56:55.995710689 +0200
  3594. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/scsi_lib.c 2011-04-02 01:37:42.150688354 +0200
  3595. @@ -443,7 +443,7 @@ static void scsi_run_queue(struct reques
  3596. &sdev->request_queue->queue_flags);
  3597. if (flagset)
  3598. queue_flag_set(QUEUE_FLAG_REENTER, sdev->request_queue);
  3599. - __blk_run_queue(sdev->request_queue);
  3600. + __blk_run_queue(sdev->request_queue, false);
  3601. if (flagset)
  3602. queue_flag_clear(QUEUE_FLAG_REENTER, sdev->request_queue);
  3603. spin_unlock(sdev->request_queue->queue_lock);
  3604. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/scsi_transport_fc.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/scsi_transport_fc.c
  3605. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/scsi_transport_fc.c 2011-04-01 17:56:55.994710689 +0200
  3606. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/scsi/scsi_transport_fc.c 2011-04-02 01:37:42.140688354 +0200
  3607. @@ -3829,7 +3829,7 @@ fc_bsg_goose_queue(struct fc_rport *rpor
  3608. !test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags);
  3609. if (flagset)
  3610. queue_flag_set(QUEUE_FLAG_REENTER, rport->rqst_q);
  3611. - __blk_run_queue(rport->rqst_q);
  3612. + __blk_run_queue(rport->rqst_q, false);
  3613. if (flagset)
  3614. queue_flag_clear(QUEUE_FLAG_REENTER, rport->rqst_q);
  3615. spin_unlock_irqrestore(rport->rqst_q->queue_lock, flags);
  3616. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wlc_mac80211.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wlc_mac80211.c
  3617. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wlc_mac80211.c 2011-04-01 17:56:56.527710689 +0200
  3618. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wlc_mac80211.c 2011-04-02 01:37:42.659688352 +0200
  3619. @@ -5336,7 +5336,6 @@ wlc_sendpkt_mac80211(wlc_info_t *wlc, vo
  3620. fifo = prio2fifo[prio];
  3621.  
  3622. ASSERT((uint) PKTHEADROOM(sdu) >= TXOFF);
  3623. - ASSERT(!PKTSHARED(sdu));
  3624. ASSERT(!PKTNEXT(sdu));
  3625. ASSERT(!PKTLINK(sdu));
  3626. ASSERT(fifo < NFIFO);
  3627. @@ -8673,3 +8672,16 @@ static void wlc_txq_free(wlc_info_t *wlc
  3628.  
  3629. kfree(qi);
  3630. }
  3631. +
  3632. +/*
  3633. + * Flag 'scan in progress' to withold dynamic phy calibration
  3634. + */
  3635. +void wlc_scan_start(struct wlc_info *wlc)
  3636. +{
  3637. + wlc_phy_hold_upd(wlc->band->pi, PHY_HOLD_FOR_SCAN, true);
  3638. +}
  3639. +
  3640. +void wlc_scan_stop(struct wlc_info *wlc)
  3641. +{
  3642. + wlc_phy_hold_upd(wlc->band->pi, PHY_HOLD_FOR_SCAN, false);
  3643. +}
  3644. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wlc_pub.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wlc_pub.h
  3645. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wlc_pub.h 2011-04-01 17:56:56.527710689 +0200
  3646. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wlc_pub.h 2011-04-02 01:37:42.659688352 +0200
  3647. @@ -568,6 +568,8 @@ extern void wlc_enable_mac(struct wlc_in
  3648. extern u16 wlc_rate_shm_offset(struct wlc_info *wlc, u8 rate);
  3649. extern u32 wlc_get_rspec_history(struct wlc_bsscfg *cfg);
  3650. extern u32 wlc_get_current_highest_rate(struct wlc_bsscfg *cfg);
  3651. +extern void wlc_scan_start(struct wlc_info *wlc);
  3652. +extern void wlc_scan_stop(struct wlc_info *wlc);
  3653.  
  3654. static inline int wlc_iovar_getuint(struct wlc_info *wlc, const char *name,
  3655. uint *arg)
  3656. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wl_mac80211.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wl_mac80211.c
  3657. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wl_mac80211.c 2011-04-01 17:56:56.527710689 +0200
  3658. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/brcm80211/sys/wl_mac80211.c 2011-04-02 01:37:42.659688352 +0200
  3659. @@ -353,9 +353,7 @@ ieee_set_channel(struct ieee80211_hw *hw
  3660. switch (type) {
  3661. case NL80211_CHAN_HT20:
  3662. case NL80211_CHAN_NO_HT:
  3663. - WL_LOCK(wl);
  3664. err = wlc_set(wl->wlc, WLC_SET_CHANNEL, chan->hw_value);
  3665. - WL_UNLOCK(wl);
  3666. break;
  3667. case NL80211_CHAN_HT40MINUS:
  3668. case NL80211_CHAN_HT40PLUS:
  3669. @@ -376,6 +374,7 @@ static int wl_ops_config(struct ieee8021
  3670. int err = 0;
  3671. int new_int;
  3672.  
  3673. + WL_LOCK(wl);
  3674. if (changed & IEEE80211_CONF_CHANGE_LISTEN_INTERVAL) {
  3675. WL_NONE(("%s: Setting listen interval to %d\n",
  3676. __func__, conf->listen_interval));
  3677. @@ -431,6 +430,7 @@ static int wl_ops_config(struct ieee8021
  3678. }
  3679.  
  3680. config_out:
  3681. + WL_UNLOCK(wl);
  3682. return err;
  3683. }
  3684.  
  3685. @@ -559,14 +559,20 @@ wl_ops_set_tim(struct ieee80211_hw *hw,
  3686.  
  3687. static void wl_ops_sw_scan_start(struct ieee80211_hw *hw)
  3688. {
  3689. + struct wl_info *wl = hw->priv;
  3690. WL_NONE(("Scan Start\n"));
  3691. - return;
  3692. + WL_LOCK(wl);
  3693. + wlc_scan_start(wl->wlc);
  3694. + WL_UNLOCK(wl);
  3695. }
  3696.  
  3697. static void wl_ops_sw_scan_complete(struct ieee80211_hw *hw)
  3698. {
  3699. + struct wl_info *wl = hw->priv;
  3700. WL_NONE(("Scan Complete\n"));
  3701. - return;
  3702. + WL_LOCK(wl);
  3703. + wlc_scan_stop(wl->wlc);
  3704. + WL_UNLOCK(wl);
  3705. }
  3706.  
  3707. static void wl_ops_set_tsf(struct ieee80211_hw *hw, u64 tsf)
  3708. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/mite.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/mite.c
  3709. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/mite.c 2011-04-01 17:56:56.652710687 +0200
  3710. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/mite.c 2011-04-02 01:37:43.002688353 +0200
  3711. @@ -61,8 +61,6 @@
  3712. #define PCI_DAQ_SIZE 4096
  3713. #define PCI_DAQ_SIZE_660X 8192
  3714.  
  3715. -MODULE_LICENSE("GPL");
  3716. -
  3717. struct mite_struct *mite_devices;
  3718. EXPORT_SYMBOL(mite_devices);
  3719.  
  3720. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_6527.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_6527.c
  3721. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_6527.c 2011-04-01 17:56:56.669710687 +0200
  3722. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_6527.c 2011-04-02 01:37:43.017688353 +0200
  3723. @@ -527,3 +527,7 @@ static void __exit driver_ni6527_cleanup
  3724.  
  3725. module_init(driver_ni6527_init_module);
  3726. module_exit(driver_ni6527_cleanup_module);
  3727. +
  3728. +MODULE_AUTHOR("Comedi http://www.comedi.org");
  3729. +MODULE_DESCRIPTION("Comedi low-level driver");
  3730. +MODULE_LICENSE("GPL");
  3731. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_65xx.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_65xx.c
  3732. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_65xx.c 2011-04-01 17:56:56.653710687 +0200
  3733. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_65xx.c 2011-04-02 01:37:43.002688353 +0200
  3734. @@ -871,3 +871,7 @@ static void __exit driver_ni_65xx_cleanu
  3735.  
  3736. module_init(driver_ni_65xx_init_module);
  3737. module_exit(driver_ni_65xx_cleanup_module);
  3738. +
  3739. +MODULE_AUTHOR("Comedi http://www.comedi.org");
  3740. +MODULE_DESCRIPTION("Comedi low-level driver");
  3741. +MODULE_LICENSE("GPL");
  3742. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_660x.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_660x.c
  3743. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_660x.c 2011-04-01 17:56:56.656710687 +0200
  3744. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_660x.c 2011-04-02 01:37:43.002688353 +0200
  3745. @@ -1421,3 +1421,7 @@ static int ni_660x_dio_insn_config(struc
  3746. };
  3747. return 0;
  3748. }
  3749. +
  3750. +MODULE_AUTHOR("Comedi http://www.comedi.org");
  3751. +MODULE_DESCRIPTION("Comedi low-level driver");
  3752. +MODULE_LICENSE("GPL");
  3753. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_670x.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_670x.c
  3754. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_670x.c 2011-04-01 17:56:56.656710687 +0200
  3755. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_670x.c 2011-04-02 01:37:43.002688353 +0200
  3756. @@ -384,3 +384,7 @@ static int ni_670x_find_device(struct co
  3757. mite_list_devices();
  3758. return -EIO;
  3759. }
  3760. +
  3761. +MODULE_AUTHOR("Comedi http://www.comedi.org");
  3762. +MODULE_DESCRIPTION("Comedi low-level driver");
  3763. +MODULE_LICENSE("GPL");
  3764. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_pcidio.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_pcidio.c
  3765. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_pcidio.c 2011-04-01 17:56:56.652710687 +0200
  3766. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_pcidio.c 2011-04-02 01:37:43.001688353 +0200
  3767. @@ -1354,3 +1354,7 @@ static void __exit driver_pcidio_cleanup
  3768.  
  3769. module_init(driver_pcidio_init_module);
  3770. module_exit(driver_pcidio_cleanup_module);
  3771. +
  3772. +MODULE_AUTHOR("Comedi http://www.comedi.org");
  3773. +MODULE_DESCRIPTION("Comedi low-level driver");
  3774. +MODULE_LICENSE("GPL");
  3775. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_pcimio.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_pcimio.c
  3776. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_pcimio.c 2011-04-01 17:56:56.669710687 +0200
  3777. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/comedi/drivers/ni_pcimio.c 2011-04-02 01:37:43.017688353 +0200
  3778. @@ -1853,3 +1853,7 @@ static int pcimio_dio_change(struct come
  3779.  
  3780. return 0;
  3781. }
  3782. +
  3783. +MODULE_AUTHOR("Comedi http://www.comedi.org");
  3784. +MODULE_DESCRIPTION("Comedi low-level driver");
  3785. +MODULE_LICENSE("GPL");
  3786. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/tidspbridge/rmgr/proc.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/tidspbridge/rmgr/proc.c
  3787. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/tidspbridge/rmgr/proc.c 2011-04-01 17:56:56.536710687 +0200
  3788. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/tidspbridge/rmgr/proc.c 2011-04-02 01:37:42.692688353 +0200
  3789. @@ -781,12 +781,14 @@ int proc_begin_dma(void *hprocessor, voi
  3790. (u32)pmpu_addr,
  3791. ul_size, dir);
  3792.  
  3793. + mutex_lock(&proc_lock);
  3794. +
  3795. /* find requested memory are in cached mapping information */
  3796. map_obj = find_containing_mapping(pr_ctxt, (u32) pmpu_addr, ul_size);
  3797. if (!map_obj) {
  3798. pr_err("%s: find_containing_mapping failed\n", __func__);
  3799. status = -EFAULT;
  3800. - goto err_out;
  3801. + goto no_map;
  3802. }
  3803.  
  3804. if (memory_give_ownership(map_obj, (u32) pmpu_addr, ul_size, dir)) {
  3805. @@ -795,6 +797,8 @@ int proc_begin_dma(void *hprocessor, voi
  3806. status = -EFAULT;
  3807. }
  3808.  
  3809. +no_map:
  3810. + mutex_unlock(&proc_lock);
  3811. err_out:
  3812.  
  3813. return status;
  3814. @@ -819,21 +823,24 @@ int proc_end_dma(void *hprocessor, void
  3815. (u32)pmpu_addr,
  3816. ul_size, dir);
  3817.  
  3818. + mutex_lock(&proc_lock);
  3819. +
  3820. /* find requested memory are in cached mapping information */
  3821. map_obj = find_containing_mapping(pr_ctxt, (u32) pmpu_addr, ul_size);
  3822. if (!map_obj) {
  3823. pr_err("%s: find_containing_mapping failed\n", __func__);
  3824. status = -EFAULT;
  3825. - goto err_out;
  3826. + goto no_map;
  3827. }
  3828.  
  3829. if (memory_regain_ownership(map_obj, (u32) pmpu_addr, ul_size, dir)) {
  3830. pr_err("%s: InValid address parameters %p %x\n",
  3831. __func__, pmpu_addr, ul_size);
  3832. status = -EFAULT;
  3833. - goto err_out;
  3834. }
  3835.  
  3836. +no_map:
  3837. + mutex_unlock(&proc_lock);
  3838. err_out:
  3839. return status;
  3840. }
  3841. @@ -1726,9 +1733,8 @@ int proc_un_map(void *hprocessor, void *
  3842. (p_proc_object->hbridge_context, va_align, size_align);
  3843. }
  3844.  
  3845. - mutex_unlock(&proc_lock);
  3846. if (status)
  3847. - goto func_end;
  3848. + goto unmap_failed;
  3849.  
  3850. /*
  3851. * A successful unmap should be followed by removal of map_obj
  3852. @@ -1737,6 +1743,9 @@ int proc_un_map(void *hprocessor, void *
  3853. */
  3854. remove_mapping_information(pr_ctxt, (u32) map_addr, size_align);
  3855.  
  3856. +unmap_failed:
  3857. + mutex_unlock(&proc_lock);
  3858. +
  3859. func_end:
  3860. dev_dbg(bridge, "%s: hprocessor: 0x%p map_addr: 0x%p status: 0x%x\n",
  3861. __func__, hprocessor, map_addr, status);
  3862. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci.h
  3863. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci.h 2011-04-01 17:56:56.562710687 +0200
  3864. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci.h 2011-04-02 01:37:42.852688352 +0200
  3865. @@ -100,9 +100,6 @@ struct vhci_hcd {
  3866. * But, the index of this array begins from 0.
  3867. */
  3868. struct vhci_device vdev[VHCI_NPORTS];
  3869. -
  3870. - /* vhci_device which has not been assiged its address yet */
  3871. - int pending_port;
  3872. };
  3873.  
  3874.  
  3875. @@ -119,6 +116,9 @@ void rh_port_disconnect(int rhport);
  3876. void vhci_rx_loop(struct usbip_task *ut);
  3877. void vhci_tx_loop(struct usbip_task *ut);
  3878.  
  3879. +struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev,
  3880. + __u32 seqnum);
  3881. +
  3882. #define hardware (&the_controller->pdev.dev)
  3883.  
  3884. static inline struct vhci_device *port_to_vdev(__u32 port)
  3885. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci_hcd.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci_hcd.c
  3886. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci_hcd.c 2011-04-01 17:56:56.562710687 +0200
  3887. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci_hcd.c 2011-04-02 01:37:42.852688352 +0200
  3888. @@ -138,8 +138,6 @@ void rh_port_connect(int rhport, enum us
  3889. * the_controller->vdev[rhport].ud.status = VDEV_CONNECT;
  3890. * spin_unlock(&the_controller->vdev[rhport].ud.lock); */
  3891.  
  3892. - the_controller->pending_port = rhport;
  3893. -
  3894. spin_unlock_irqrestore(&the_controller->lock, flags);
  3895.  
  3896. usb_hcd_poll_rh_status(vhci_to_hcd(the_controller));
  3897. @@ -559,6 +557,7 @@ static int vhci_urb_enqueue(struct usb_h
  3898. struct device *dev = &urb->dev->dev;
  3899. int ret = 0;
  3900. unsigned long flags;
  3901. + struct vhci_device *vdev;
  3902.  
  3903. usbip_dbg_vhci_hc("enter, usb_hcd %p urb %p mem_flags %d\n",
  3904. hcd, urb, mem_flags);
  3905. @@ -574,6 +573,18 @@ static int vhci_urb_enqueue(struct usb_h
  3906. return urb->status;
  3907. }
  3908.  
  3909. + vdev = port_to_vdev(urb->dev->portnum-1);
  3910. +
  3911. + /* refuse enqueue for dead connection */
  3912. + spin_lock(&vdev->ud.lock);
  3913. + if (vdev->ud.status == VDEV_ST_NULL || vdev->ud.status == VDEV_ST_ERROR) {
  3914. + usbip_uerr("enqueue for inactive port %d\n", vdev->rhport);
  3915. + spin_unlock(&vdev->ud.lock);
  3916. + spin_unlock_irqrestore(&the_controller->lock, flags);
  3917. + return -ENODEV;
  3918. + }
  3919. + spin_unlock(&vdev->ud.lock);
  3920. +
  3921. ret = usb_hcd_link_urb_to_ep(hcd, urb);
  3922. if (ret)
  3923. goto no_need_unlink;
  3924. @@ -592,8 +603,6 @@ static int vhci_urb_enqueue(struct usb_h
  3925. __u8 type = usb_pipetype(urb->pipe);
  3926. struct usb_ctrlrequest *ctrlreq =
  3927. (struct usb_ctrlrequest *) urb->setup_packet;
  3928. - struct vhci_device *vdev =
  3929. - port_to_vdev(the_controller->pending_port);
  3930.  
  3931. if (type != PIPE_CONTROL || !ctrlreq) {
  3932. dev_err(dev, "invalid request to devnum 0\n");
  3933. @@ -607,7 +616,9 @@ static int vhci_urb_enqueue(struct usb_h
  3934. dev_info(dev, "SetAddress Request (%d) to port %d\n",
  3935. ctrlreq->wValue, vdev->rhport);
  3936.  
  3937. - vdev->udev = urb->dev;
  3938. + if (vdev->udev)
  3939. + usb_put_dev(vdev->udev);
  3940. + vdev->udev = usb_get_dev(urb->dev);
  3941.  
  3942. spin_lock(&vdev->ud.lock);
  3943. vdev->ud.status = VDEV_ST_USED;
  3944. @@ -627,8 +638,9 @@ static int vhci_urb_enqueue(struct usb_h
  3945. "Get_Descriptor to device 0 "
  3946. "(get max pipe size)\n");
  3947.  
  3948. - /* FIXME: reference count? (usb_get_dev()) */
  3949. - vdev->udev = urb->dev;
  3950. + if (vdev->udev)
  3951. + usb_put_dev(vdev->udev);
  3952. + vdev->udev = usb_get_dev(urb->dev);
  3953. goto out;
  3954.  
  3955. default:
  3956. @@ -805,7 +817,6 @@ static int vhci_urb_dequeue(struct usb_h
  3957. return 0;
  3958. }
  3959.  
  3960. -
  3961. static void vhci_device_unlink_cleanup(struct vhci_device *vdev)
  3962. {
  3963. struct vhci_unlink *unlink, *tmp;
  3964. @@ -813,11 +824,34 @@ static void vhci_device_unlink_cleanup(s
  3965. spin_lock(&vdev->priv_lock);
  3966.  
  3967. list_for_each_entry_safe(unlink, tmp, &vdev->unlink_tx, list) {
  3968. + usbip_uinfo("unlink cleanup tx %lu\n", unlink->unlink_seqnum);
  3969. list_del(&unlink->list);
  3970. kfree(unlink);
  3971. }
  3972.  
  3973. list_for_each_entry_safe(unlink, tmp, &vdev->unlink_rx, list) {
  3974. + struct urb *urb;
  3975. +
  3976. + /* give back URB of unanswered unlink request */
  3977. + usbip_uinfo("unlink cleanup rx %lu\n", unlink->unlink_seqnum);
  3978. +
  3979. + urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum);
  3980. + if (!urb) {
  3981. + usbip_uinfo("the urb (seqnum %lu) was already given back\n",
  3982. + unlink->unlink_seqnum);
  3983. + list_del(&unlink->list);
  3984. + kfree(unlink);
  3985. + continue;
  3986. + }
  3987. +
  3988. + urb->status = -ENODEV;
  3989. +
  3990. + spin_lock(&the_controller->lock);
  3991. + usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb);
  3992. + spin_unlock(&the_controller->lock);
  3993. +
  3994. + usb_hcd_giveback_urb(vhci_to_hcd(the_controller), urb, urb->status);
  3995. +
  3996. list_del(&unlink->list);
  3997. kfree(unlink);
  3998. }
  3999. @@ -887,6 +921,10 @@ static void vhci_device_reset(struct usb
  4000. vdev->speed = 0;
  4001. vdev->devid = 0;
  4002.  
  4003. + if (vdev->udev)
  4004. + usb_put_dev(vdev->udev);
  4005. + vdev->udev = NULL;
  4006. +
  4007. ud->tcp_socket = NULL;
  4008.  
  4009. ud->status = VDEV_ST_NULL;
  4010. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci_rx.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci_rx.c
  4011. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci_rx.c 2011-04-01 17:56:56.563710687 +0200
  4012. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/usbip/vhci_rx.c 2011-04-02 01:37:42.852688353 +0200
  4013. @@ -23,16 +23,14 @@
  4014. #include "vhci.h"
  4015.  
  4016.  
  4017. -/* get URB from transmitted urb queue */
  4018. -static struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev,
  4019. +/* get URB from transmitted urb queue. caller must hold vdev->priv_lock */
  4020. +struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev,
  4021. __u32 seqnum)
  4022. {
  4023. struct vhci_priv *priv, *tmp;
  4024. struct urb *urb = NULL;
  4025. int status;
  4026.  
  4027. - spin_lock(&vdev->priv_lock);
  4028. -
  4029. list_for_each_entry_safe(priv, tmp, &vdev->priv_rx, list) {
  4030. if (priv->seqnum == seqnum) {
  4031. urb = priv->urb;
  4032. @@ -63,8 +61,6 @@ static struct urb *pickup_urb_and_free_p
  4033. }
  4034. }
  4035.  
  4036. - spin_unlock(&vdev->priv_lock);
  4037. -
  4038. return urb;
  4039. }
  4040.  
  4041. @@ -74,9 +70,11 @@ static void vhci_recv_ret_submit(struct
  4042. struct usbip_device *ud = &vdev->ud;
  4043. struct urb *urb;
  4044.  
  4045. + spin_lock(&vdev->priv_lock);
  4046.  
  4047. urb = pickup_urb_and_free_priv(vdev, pdu->base.seqnum);
  4048.  
  4049. + spin_unlock(&vdev->priv_lock);
  4050.  
  4051. if (!urb) {
  4052. usbip_uerr("cannot find a urb of seqnum %u\n",
  4053. @@ -161,7 +159,12 @@ static void vhci_recv_ret_unlink(struct
  4054. return;
  4055. }
  4056.  
  4057. + spin_lock(&vdev->priv_lock);
  4058. +
  4059. urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum);
  4060. +
  4061. + spin_unlock(&vdev->priv_lock);
  4062. +
  4063. if (!urb) {
  4064. /*
  4065. * I get the result of a unlink request. But, it seems that I
  4066. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/winbond/core.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/winbond/core.h
  4067. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/winbond/core.h 2011-04-01 17:56:56.575710687 +0200
  4068. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/staging/winbond/core.h 2011-04-02 01:37:42.860688354 +0200
  4069. @@ -3,6 +3,7 @@
  4070.  
  4071. #include <linux/wireless.h>
  4072. #include <linux/types.h>
  4073. +#include <linux/delay.h>
  4074.  
  4075. #include "wbhal_s.h"
  4076. #include "mto.h"
  4077. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/class/cdc-acm.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/class/cdc-acm.c
  4078. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/class/cdc-acm.c 2011-04-01 17:56:56.399710689 +0200
  4079. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/class/cdc-acm.c 2011-04-02 01:38:34.971688310 +0200
  4080. @@ -297,6 +297,8 @@ static void acm_ctrl_irq(struct urb *urb
  4081. if (!ACM_READY(acm))
  4082. goto exit;
  4083.  
  4084. + usb_mark_last_busy(acm->dev);
  4085. +
  4086. data = (unsigned char *)(dr + 1);
  4087. switch (dr->bNotificationType) {
  4088. case USB_CDC_NOTIFY_NETWORK_CONNECTION:
  4089. @@ -336,7 +338,6 @@ static void acm_ctrl_irq(struct urb *urb
  4090. break;
  4091. }
  4092. exit:
  4093. - usb_mark_last_busy(acm->dev);
  4094. retval = usb_submit_urb(urb, GFP_ATOMIC);
  4095. if (retval)
  4096. dev_err(&urb->dev->dev, "%s - usb_submit_urb failed with "
  4097. @@ -533,6 +534,8 @@ static void acm_softint(struct work_stru
  4098. if (!ACM_READY(acm))
  4099. return;
  4100. tty = tty_port_tty_get(&acm->port);
  4101. + if (!tty)
  4102. + return;
  4103. tty_wakeup(tty);
  4104. tty_kref_put(tty);
  4105. }
  4106. @@ -646,8 +649,10 @@ static void acm_port_down(struct acm *ac
  4107. usb_kill_urb(acm->ctrlurb);
  4108. for (i = 0; i < ACM_NW; i++)
  4109. usb_kill_urb(acm->wb[i].urb);
  4110. + tasklet_disable(&acm->urb_task);
  4111. for (i = 0; i < nr; i++)
  4112. usb_kill_urb(acm->ru[i].urb);
  4113. + tasklet_enable(&acm->urb_task);
  4114. acm->control->needs_remote_wakeup = 0;
  4115. usb_autopm_put_interface(acm->control);
  4116. }
  4117. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/class/cdc-wdm.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/class/cdc-wdm.c
  4118. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/class/cdc-wdm.c 2011-04-01 17:56:56.399710689 +0200
  4119. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/class/cdc-wdm.c 2011-04-02 01:38:34.972688310 +0200
  4120. @@ -281,7 +281,7 @@ static void cleanup(struct wdm_device *d
  4121. desc->sbuf,
  4122. desc->validity->transfer_dma);
  4123. usb_free_coherent(interface_to_usbdev(desc->intf),
  4124. - desc->wMaxCommand,
  4125. + desc->bMaxPacketSize0,
  4126. desc->inbuf,
  4127. desc->response->transfer_dma);
  4128. kfree(desc->orq);
  4129. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/devio.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/devio.c
  4130. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/devio.c 2011-04-01 17:56:56.432710688 +0200
  4131. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/devio.c 2011-04-02 01:38:34.972688310 +0200
  4132. @@ -802,7 +802,7 @@ static int proc_control(struct dev_state
  4133. tbuf, ctrl.wLength, tmo);
  4134. usb_lock_device(dev);
  4135. snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE,
  4136. - tbuf, i);
  4137. + tbuf, max(i, 0));
  4138. if ((i > 0) && ctrl.wLength) {
  4139. if (copy_to_user(ctrl.data, tbuf, i)) {
  4140. free_page((unsigned long)tbuf);
  4141. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hcd.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hcd.c
  4142. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hcd.c 2011-04-01 17:56:56.437710687 +0200
  4143. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hcd.c 2011-04-02 01:37:42.503688354 +0200
  4144. @@ -984,7 +984,7 @@ static int register_root_hub(struct usb_
  4145. spin_unlock_irq (&hcd_root_hub_lock);
  4146.  
  4147. /* Did the HC die before the root hub was registered? */
  4148. - if (hcd->state == HC_STATE_HALT)
  4149. + if (HCD_DEAD(hcd) || hcd->state == HC_STATE_HALT)
  4150. usb_hc_died (hcd); /* This time clean up */
  4151. }
  4152.  
  4153. @@ -1090,13 +1090,10 @@ int usb_hcd_link_urb_to_ep(struct usb_hc
  4154. * Check the host controller's state and add the URB to the
  4155. * endpoint's queue.
  4156. */
  4157. - switch (hcd->state) {
  4158. - case HC_STATE_RUNNING:
  4159. - case HC_STATE_RESUMING:
  4160. + if (HCD_RH_RUNNING(hcd)) {
  4161. urb->unlinked = 0;
  4162. list_add_tail(&urb->urb_list, &urb->ep->urb_list);
  4163. - break;
  4164. - default:
  4165. + } else {
  4166. rc = -ESHUTDOWN;
  4167. goto done;
  4168. }
  4169. @@ -1914,7 +1911,7 @@ int usb_hcd_get_frame_number (struct usb
  4170. {
  4171. struct usb_hcd *hcd = bus_to_hcd(udev->bus);
  4172.  
  4173. - if (!HC_IS_RUNNING (hcd->state))
  4174. + if (!HCD_RH_RUNNING(hcd))
  4175. return -ESHUTDOWN;
  4176. return hcd->driver->get_frame_number (hcd);
  4177. }
  4178. @@ -1931,9 +1928,15 @@ int hcd_bus_suspend(struct usb_device *r
  4179.  
  4180. dev_dbg(&rhdev->dev, "bus %s%s\n",
  4181. (msg.event & PM_EVENT_AUTO ? "auto-" : ""), "suspend");
  4182. + if (HCD_DEAD(hcd)) {
  4183. + dev_dbg(&rhdev->dev, "skipped %s of dead bus\n", "suspend");
  4184. + return 0;
  4185. + }
  4186. +
  4187. if (!hcd->driver->bus_suspend) {
  4188. status = -ENOENT;
  4189. } else {
  4190. + clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
  4191. hcd->state = HC_STATE_QUIESCING;
  4192. status = hcd->driver->bus_suspend(hcd);
  4193. }
  4194. @@ -1941,7 +1944,12 @@ int hcd_bus_suspend(struct usb_device *r
  4195. usb_set_device_state(rhdev, USB_STATE_SUSPENDED);
  4196. hcd->state = HC_STATE_SUSPENDED;
  4197. } else {
  4198. - hcd->state = old_state;
  4199. + spin_lock_irq(&hcd_root_hub_lock);
  4200. + if (!HCD_DEAD(hcd)) {
  4201. + set_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
  4202. + hcd->state = old_state;
  4203. + }
  4204. + spin_unlock_irq(&hcd_root_hub_lock);
  4205. dev_dbg(&rhdev->dev, "bus %s fail, err %d\n",
  4206. "suspend", status);
  4207. }
  4208. @@ -1956,9 +1964,13 @@ int hcd_bus_resume(struct usb_device *rh
  4209.  
  4210. dev_dbg(&rhdev->dev, "usb %s%s\n",
  4211. (msg.event & PM_EVENT_AUTO ? "auto-" : ""), "resume");
  4212. + if (HCD_DEAD(hcd)) {
  4213. + dev_dbg(&rhdev->dev, "skipped %s of dead bus\n", "resume");
  4214. + return 0;
  4215. + }
  4216. if (!hcd->driver->bus_resume)
  4217. return -ENOENT;
  4218. - if (hcd->state == HC_STATE_RUNNING)
  4219. + if (HCD_RH_RUNNING(hcd))
  4220. return 0;
  4221.  
  4222. hcd->state = HC_STATE_RESUMING;
  4223. @@ -1967,10 +1979,15 @@ int hcd_bus_resume(struct usb_device *rh
  4224. if (status == 0) {
  4225. /* TRSMRCY = 10 msec */
  4226. msleep(10);
  4227. - usb_set_device_state(rhdev, rhdev->actconfig
  4228. - ? USB_STATE_CONFIGURED
  4229. - : USB_STATE_ADDRESS);
  4230. - hcd->state = HC_STATE_RUNNING;
  4231. + spin_lock_irq(&hcd_root_hub_lock);
  4232. + if (!HCD_DEAD(hcd)) {
  4233. + usb_set_device_state(rhdev, rhdev->actconfig
  4234. + ? USB_STATE_CONFIGURED
  4235. + : USB_STATE_ADDRESS);
  4236. + set_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
  4237. + hcd->state = HC_STATE_RUNNING;
  4238. + }
  4239. + spin_unlock_irq(&hcd_root_hub_lock);
  4240. } else {
  4241. hcd->state = old_state;
  4242. dev_dbg(&rhdev->dev, "bus %s fail, err %d\n",
  4243. @@ -2081,7 +2098,7 @@ irqreturn_t usb_hcd_irq (int irq, void *
  4244. */
  4245. local_irq_save(flags);
  4246.  
  4247. - if (unlikely(hcd->state == HC_STATE_HALT || !HCD_HW_ACCESSIBLE(hcd))) {
  4248. + if (unlikely(HCD_DEAD(hcd) || !HCD_HW_ACCESSIBLE(hcd))) {
  4249. rc = IRQ_NONE;
  4250. } else if (hcd->driver->irq(hcd) == IRQ_NONE) {
  4251. rc = IRQ_NONE;
  4252. @@ -2115,6 +2132,8 @@ void usb_hc_died (struct usb_hcd *hcd)
  4253. dev_err (hcd->self.controller, "HC died; cleaning up\n");
  4254.  
  4255. spin_lock_irqsave (&hcd_root_hub_lock, flags);
  4256. + clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
  4257. + set_bit(HCD_FLAG_DEAD, &hcd->flags);
  4258. if (hcd->rh_registered) {
  4259. clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
  4260.  
  4261. @@ -2257,6 +2276,12 @@ int usb_add_hcd(struct usb_hcd *hcd,
  4262. */
  4263. device_init_wakeup(&rhdev->dev, 1);
  4264.  
  4265. + /* HCD_FLAG_RH_RUNNING doesn't matter until the root hub is
  4266. + * registered. But since the controller can die at any time,
  4267. + * let's initialize the flag before touching the hardware.
  4268. + */
  4269. + set_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
  4270. +
  4271. /* "reset" is misnamed; its role is now one-time init. the controller
  4272. * should already have been reset (and boot firmware kicked off etc).
  4273. */
  4274. @@ -2324,6 +2349,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
  4275. return retval;
  4276.  
  4277. error_create_attr_group:
  4278. + clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
  4279. if (HC_IS_RUNNING(hcd->state))
  4280. hcd->state = HC_STATE_QUIESCING;
  4281. spin_lock_irq(&hcd_root_hub_lock);
  4282. @@ -2376,6 +2402,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
  4283. usb_get_dev(rhdev);
  4284. sysfs_remove_group(&rhdev->dev.kobj, &usb_bus_attr_group);
  4285.  
  4286. + clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
  4287. if (HC_IS_RUNNING (hcd->state))
  4288. hcd->state = HC_STATE_QUIESCING;
  4289.  
  4290. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hcd-pci.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hcd-pci.c
  4291. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hcd-pci.c 2011-04-01 17:56:56.434710687 +0200
  4292. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hcd-pci.c 2011-04-02 01:37:42.503688354 +0200
  4293. @@ -364,8 +364,7 @@ static int check_root_hub_suspended(stru
  4294. struct pci_dev *pci_dev = to_pci_dev(dev);
  4295. struct usb_hcd *hcd = pci_get_drvdata(pci_dev);
  4296.  
  4297. - if (!(hcd->state == HC_STATE_SUSPENDED ||
  4298. - hcd->state == HC_STATE_HALT)) {
  4299. + if (HCD_RH_RUNNING(hcd)) {
  4300. dev_warn(dev, "Root hub is not suspended\n");
  4301. return -EBUSY;
  4302. }
  4303. @@ -387,7 +386,7 @@ static int suspend_common(struct device
  4304. if (retval)
  4305. return retval;
  4306.  
  4307. - if (hcd->driver->pci_suspend) {
  4308. + if (hcd->driver->pci_suspend && !HCD_DEAD(hcd)) {
  4309. /* Optimization: Don't suspend if a root-hub wakeup is
  4310. * pending and it would cause the HCD to wake up anyway.
  4311. */
  4312. @@ -428,7 +427,7 @@ static int resume_common(struct device *
  4313. struct usb_hcd *hcd = pci_get_drvdata(pci_dev);
  4314. int retval;
  4315.  
  4316. - if (hcd->state != HC_STATE_SUSPENDED) {
  4317. + if (HCD_RH_RUNNING(hcd)) {
  4318. dev_dbg(dev, "can't resume, not suspended!\n");
  4319. return 0;
  4320. }
  4321. @@ -443,7 +442,7 @@ static int resume_common(struct device *
  4322.  
  4323. clear_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
  4324.  
  4325. - if (hcd->driver->pci_resume) {
  4326. + if (hcd->driver->pci_resume && !HCD_DEAD(hcd)) {
  4327. if (event != PM_EVENT_AUTO_RESUME)
  4328. wait_for_companions(pci_dev, hcd);
  4329.  
  4330. @@ -476,10 +475,10 @@ static int hcd_pci_suspend_noirq(struct
  4331.  
  4332. pci_save_state(pci_dev);
  4333.  
  4334. - /* If the root hub is HALTed rather than SUSPENDed,
  4335. + /* If the root hub is dead rather than suspended,
  4336. * disallow remote wakeup.
  4337. */
  4338. - if (hcd->state == HC_STATE_HALT)
  4339. + if (HCD_DEAD(hcd))
  4340. device_set_wakeup_enable(dev, 0);
  4341. dev_dbg(dev, "wakeup: %d\n", device_may_wakeup(dev));
  4342.  
  4343. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hub.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hub.c
  4344. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hub.c 2011-04-01 17:56:56.432710688 +0200
  4345. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/hub.c 2011-04-02 01:37:42.499688354 +0200
  4346. @@ -2672,17 +2672,13 @@ hub_port_init (struct usb_hub *hub, stru
  4347.  
  4348. mutex_lock(&usb_address0_mutex);
  4349.  
  4350. - if (!udev->config && oldspeed == USB_SPEED_SUPER) {
  4351. - /* Don't reset USB 3.0 devices during an initial setup */
  4352. - usb_set_device_state(udev, USB_STATE_DEFAULT);
  4353. - } else {
  4354. - /* Reset the device; full speed may morph to high speed */
  4355. - /* FIXME a USB 2.0 device may morph into SuperSpeed on reset. */
  4356. - retval = hub_port_reset(hub, port1, udev, delay);
  4357. - if (retval < 0) /* error or disconnect */
  4358. - goto fail;
  4359. - /* success, speed is known */
  4360. - }
  4361. + /* Reset the device; full speed may morph to high speed */
  4362. + /* FIXME a USB 2.0 device may morph into SuperSpeed on reset. */
  4363. + retval = hub_port_reset(hub, port1, udev, delay);
  4364. + if (retval < 0) /* error or disconnect */
  4365. + goto fail;
  4366. + /* success, speed is known */
  4367. +
  4368. retval = -ENODEV;
  4369.  
  4370. if (oldspeed != USB_SPEED_UNKNOWN && oldspeed != udev->speed) {
  4371. @@ -2744,6 +2740,11 @@ hub_port_init (struct usb_hub *hub, stru
  4372. udev->ttport = hdev->ttport;
  4373. } else if (udev->speed != USB_SPEED_HIGH
  4374. && hdev->speed == USB_SPEED_HIGH) {
  4375. + if (!hub->tt.hub) {
  4376. + dev_err(&udev->dev, "parent hub has no TT\n");
  4377. + retval = -EINVAL;
  4378. + goto fail;
  4379. + }
  4380. udev->tt = &hub->tt;
  4381. udev->ttport = port1;
  4382. }
  4383. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/quirks.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/quirks.c
  4384. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/quirks.c 2011-04-01 17:56:56.437710687 +0200
  4385. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/quirks.c 2011-04-02 01:37:42.503688354 +0200
  4386. @@ -48,6 +48,10 @@ static const struct usb_device_id usb_qu
  4387. { USB_DEVICE(0x04b4, 0x0526), .driver_info =
  4388. USB_QUIRK_CONFIG_INTF_STRINGS },
  4389.  
  4390. + /* Samsung Android phone modem - ID conflict with SPH-I500 */
  4391. + { USB_DEVICE(0x04e8, 0x6601), .driver_info =
  4392. + USB_QUIRK_CONFIG_INTF_STRINGS },
  4393. +
  4394. /* Roland SC-8820 */
  4395. { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
  4396.  
  4397. @@ -68,6 +72,10 @@ static const struct usb_device_id usb_qu
  4398. /* M-Systems Flash Disk Pioneers */
  4399. { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
  4400.  
  4401. + /* Keytouch QWERTY Panel keyboard */
  4402. + { USB_DEVICE(0x0926, 0x3333), .driver_info =
  4403. + USB_QUIRK_CONFIG_INTF_STRINGS },
  4404. +
  4405. /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */
  4406. { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
  4407.  
  4408. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/urb.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/urb.c
  4409. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/urb.c 2011-04-01 17:56:56.434710687 +0200
  4410. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/core/urb.c 2011-04-02 01:37:42.503688354 +0200
  4411. @@ -366,7 +366,16 @@ int usb_submit_urb(struct urb *urb, gfp_
  4412. if (xfertype == USB_ENDPOINT_XFER_ISOC) {
  4413. int n, len;
  4414.  
  4415. - /* FIXME SuperSpeed isoc endpoints have up to 16 bursts */
  4416. + /* SuperSpeed isoc endpoints have up to 16 bursts of up to
  4417. + * 3 packets each
  4418. + */
  4419. + if (dev->speed == USB_SPEED_SUPER) {
  4420. + int burst = 1 + ep->ss_ep_comp.bMaxBurst;
  4421. + int mult = USB_SS_MULT(ep->ss_ep_comp.bmAttributes);
  4422. + max *= burst;
  4423. + max *= mult;
  4424. + }
  4425. +
  4426. /* "high bandwidth" mode, 1-3 packets/uframe? */
  4427. if (dev->speed == USB_SPEED_HIGH) {
  4428. int mult = 1 + ((max >> 11) & 0x03);
  4429. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/ehci-hub.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/ehci-hub.c
  4430. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/ehci-hub.c 2011-04-01 17:56:56.398710689 +0200
  4431. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/ehci-hub.c 2011-04-02 01:37:42.484688353 +0200
  4432. @@ -106,6 +106,27 @@ static void ehci_handover_companion_port
  4433. ehci->owned_ports = 0;
  4434. }
  4435.  
  4436. +static int ehci_port_change(struct ehci_hcd *ehci)
  4437. +{
  4438. + int i = HCS_N_PORTS(ehci->hcs_params);
  4439. +
  4440. + /* First check if the controller indicates a change event */
  4441. +
  4442. + if (ehci_readl(ehci, &ehci->regs->status) & STS_PCD)
  4443. + return 1;
  4444. +
  4445. + /*
  4446. + * Not all controllers appear to update this while going from D3 to D0,
  4447. + * so check the individual port status registers as well
  4448. + */
  4449. +
  4450. + while (i--)
  4451. + if (ehci_readl(ehci, &ehci->regs->port_status[i]) & PORT_CSC)
  4452. + return 1;
  4453. +
  4454. + return 0;
  4455. +}
  4456. +
  4457. static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
  4458. bool suspending, bool do_wakeup)
  4459. {
  4460. @@ -173,7 +194,7 @@ static void ehci_adjust_port_wakeup_flag
  4461. }
  4462.  
  4463. /* Does the root hub have a port wakeup pending? */
  4464. - if (!suspending && (ehci_readl(ehci, &ehci->regs->status) & STS_PCD))
  4465. + if (!suspending && ehci_port_change(ehci))
  4466. usb_hcd_resume_root_hub(ehci_to_hcd(ehci));
  4467.  
  4468. spin_unlock_irqrestore(&ehci->lock, flags);
  4469. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/ehci-q.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/ehci-q.c
  4470. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/ehci-q.c 2011-04-01 17:56:56.391710689 +0200
  4471. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/ehci-q.c 2011-04-02 01:38:34.973688310 +0200
  4472. @@ -315,7 +315,6 @@ qh_completions (struct ehci_hcd *ehci, s
  4473. int stopped;
  4474. unsigned count = 0;
  4475. u8 state;
  4476. - const __le32 halt = HALT_BIT(ehci);
  4477. struct ehci_qh_hw *hw = qh->hw;
  4478.  
  4479. if (unlikely (list_empty (&qh->qtd_list)))
  4480. @@ -422,7 +421,6 @@ qh_completions (struct ehci_hcd *ehci, s
  4481. && !(qtd->hw_alt_next
  4482. & EHCI_LIST_END(ehci))) {
  4483. stopped = 1;
  4484. - goto halt;
  4485. }
  4486.  
  4487. /* stop scanning when we reach qtds the hc is using */
  4488. @@ -456,16 +454,6 @@ qh_completions (struct ehci_hcd *ehci, s
  4489. */
  4490. ehci_clear_tt_buffer(ehci, qh, urb, token);
  4491. }
  4492. -
  4493. - /* force halt for unlinked or blocked qh, so we'll
  4494. - * patch the qh later and so that completions can't
  4495. - * activate it while we "know" it's stopped.
  4496. - */
  4497. - if ((halt & hw->hw_token) == 0) {
  4498. -halt:
  4499. - hw->hw_token |= halt;
  4500. - wmb ();
  4501. - }
  4502. }
  4503.  
  4504. /* unless we already know the urb's status, collect qtd status
  4505. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/isp1760-hcd.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/isp1760-hcd.c
  4506. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/isp1760-hcd.c 2011-04-01 17:56:56.396710689 +0200
  4507. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/isp1760-hcd.c 2011-04-02 01:37:42.482688353 +0200
  4508. @@ -33,6 +33,7 @@ struct isp1760_hcd {
  4509. struct inter_packet_info atl_ints[32];
  4510. struct inter_packet_info int_ints[32];
  4511. struct memory_chunk memory_pool[BLOCKS];
  4512. + u32 atl_queued;
  4513.  
  4514. /* periodic schedule support */
  4515. #define DEFAULT_I_TDPS 1024
  4516. @@ -850,6 +851,11 @@ static void enqueue_an_ATL_packet(struct
  4517. skip_map &= ~queue_entry;
  4518. isp1760_writel(skip_map, hcd->regs + HC_ATL_PTD_SKIPMAP_REG);
  4519.  
  4520. + priv->atl_queued++;
  4521. + if (priv->atl_queued == 2)
  4522. + isp1760_writel(INTERRUPT_ENABLE_SOT_MASK,
  4523. + hcd->regs + HC_INTERRUPT_ENABLE);
  4524. +
  4525. buffstatus = isp1760_readl(hcd->regs + HC_BUFFER_STATUS_REG);
  4526. buffstatus |= ATL_BUFFER;
  4527. isp1760_writel(buffstatus, hcd->regs + HC_BUFFER_STATUS_REG);
  4528. @@ -992,6 +998,7 @@ static void do_atl_int(struct usb_hcd *u
  4529. u32 dw3;
  4530.  
  4531. status = 0;
  4532. + priv->atl_queued--;
  4533.  
  4534. queue_entry = __ffs(done_map);
  4535. done_map &= ~(1 << queue_entry);
  4536. @@ -1054,11 +1061,6 @@ static void do_atl_int(struct usb_hcd *u
  4537. * device is not able to send data fast enough.
  4538. * This happens mostly on slower hardware.
  4539. */
  4540. - printk(KERN_NOTICE "Reloading ptd %p/%p... qh %p read: "
  4541. - "%d of %zu done: %08x cur: %08x\n", qtd,
  4542. - urb, qh, PTD_XFERRED_LENGTH(dw3),
  4543. - qtd->length, done_map,
  4544. - (1 << queue_entry));
  4545.  
  4546. /* RL counter = ERR counter */
  4547. dw3 &= ~(0xf << 19);
  4548. @@ -1086,6 +1088,11 @@ static void do_atl_int(struct usb_hcd *u
  4549. priv_write_copy(priv, (u32 *)&ptd, usb_hcd->regs +
  4550. atl_regs, sizeof(ptd));
  4551.  
  4552. + priv->atl_queued++;
  4553. + if (priv->atl_queued == 2)
  4554. + isp1760_writel(INTERRUPT_ENABLE_SOT_MASK,
  4555. + usb_hcd->regs + HC_INTERRUPT_ENABLE);
  4556. +
  4557. buffstatus = isp1760_readl(usb_hcd->regs +
  4558. HC_BUFFER_STATUS_REG);
  4559. buffstatus |= ATL_BUFFER;
  4560. @@ -1191,6 +1198,9 @@ static void do_atl_int(struct usb_hcd *u
  4561. skip_map = isp1760_readl(usb_hcd->regs +
  4562. HC_ATL_PTD_SKIPMAP_REG);
  4563. }
  4564. + if (priv->atl_queued <= 1)
  4565. + isp1760_writel(INTERRUPT_ENABLE_MASK,
  4566. + usb_hcd->regs + HC_INTERRUPT_ENABLE);
  4567. }
  4568.  
  4569. static void do_intl_int(struct usb_hcd *usb_hcd)
  4570. @@ -1770,7 +1780,7 @@ static irqreturn_t isp1760_irq(struct us
  4571. goto leave;
  4572.  
  4573. isp1760_writel(imask, usb_hcd->regs + HC_INTERRUPT_REG);
  4574. - if (imask & HC_ATL_INT)
  4575. + if (imask & (HC_ATL_INT | HC_SOT_INT))
  4576. do_atl_int(usb_hcd);
  4577.  
  4578. if (imask & HC_INTL_INT)
  4579. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/isp1760-hcd.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/isp1760-hcd.h
  4580. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/isp1760-hcd.h 2011-04-01 17:56:56.391710689 +0200
  4581. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/isp1760-hcd.h 2011-04-02 01:37:42.480688353 +0200
  4582. @@ -69,6 +69,7 @@ void deinit_kmem_cache(void);
  4583.  
  4584. #define HC_INTERRUPT_ENABLE 0x314
  4585. #define INTERRUPT_ENABLE_MASK (HC_INTL_INT | HC_ATL_INT | HC_EOT_INT)
  4586. +#define INTERRUPT_ENABLE_SOT_MASK (HC_INTL_INT | HC_SOT_INT | HC_EOT_INT)
  4587.  
  4588. #define HC_ISO_INT (1 << 9)
  4589. #define HC_ATL_INT (1 << 8)
  4590. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/xhci.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/xhci.h
  4591. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/xhci.h 2011-04-01 17:56:56.391710689 +0200
  4592. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/xhci.h 2011-04-02 01:37:42.479688353 +0200
  4593. @@ -648,6 +648,9 @@ struct xhci_ep_ctx {
  4594. #define AVG_TRB_LENGTH_FOR_EP(p) ((p) & 0xffff)
  4595. #define MAX_ESIT_PAYLOAD_FOR_EP(p) (((p) & 0xffff) << 16)
  4596.  
  4597. +/* deq bitmasks */
  4598. +#define EP_CTX_CYCLE_MASK (1 << 0)
  4599. +
  4600.  
  4601. /**
  4602. * struct xhci_input_control_context
  4603. @@ -750,6 +753,12 @@ struct xhci_virt_ep {
  4604. struct timer_list stop_cmd_timer;
  4605. int stop_cmds_pending;
  4606. struct xhci_hcd *xhci;
  4607. + /* Dequeue pointer and dequeue segment for a submitted Set TR Dequeue
  4608. + * command. We'll need to update the ring's dequeue segment and dequeue
  4609. + * pointer after the command completes.
  4610. + */
  4611. + struct xhci_segment *queued_deq_seg;
  4612. + union xhci_trb *queued_deq_ptr;
  4613. /*
  4614. * Sometimes the xHC can not process isochronous endpoint ring quickly
  4615. * enough, and it will miss some isoc tds on the ring and generate
  4616. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/xhci-ring.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/xhci-ring.c
  4617. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/xhci-ring.c 2011-04-01 17:56:56.390710689 +0200
  4618. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/host/xhci-ring.c 2011-04-02 01:37:42.478688353 +0200
  4619. @@ -479,8 +479,11 @@ void xhci_find_new_dequeue_state(struct
  4620. state->new_deq_seg = find_trb_seg(cur_td->start_seg,
  4621. dev->eps[ep_index].stopped_trb,
  4622. &state->new_cycle_state);
  4623. - if (!state->new_deq_seg)
  4624. - BUG();
  4625. + if (!state->new_deq_seg) {
  4626. + WARN_ON(1);
  4627. + return;
  4628. + }
  4629. +
  4630. /* Dig out the cycle state saved by the xHC during the stop ep cmd */
  4631. xhci_dbg(xhci, "Finding endpoint context\n");
  4632. ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index);
  4633. @@ -491,8 +494,10 @@ void xhci_find_new_dequeue_state(struct
  4634. state->new_deq_seg = find_trb_seg(state->new_deq_seg,
  4635. state->new_deq_ptr,
  4636. &state->new_cycle_state);
  4637. - if (!state->new_deq_seg)
  4638. - BUG();
  4639. + if (!state->new_deq_seg) {
  4640. + WARN_ON(1);
  4641. + return;
  4642. + }
  4643.  
  4644. trb = &state->new_deq_ptr->generic;
  4645. if ((trb->field[3] & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK) &&
  4646. @@ -500,15 +505,26 @@ void xhci_find_new_dequeue_state(struct
  4647. state->new_cycle_state = ~(state->new_cycle_state) & 0x1;
  4648. next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr);
  4649.  
  4650. + /*
  4651. + * If there is only one segment in a ring, find_trb_seg()'s while loop
  4652. + * will not run, and it will return before it has a chance to see if it
  4653. + * needs to toggle the cycle bit. It can't tell if the stalled transfer
  4654. + * ended just before the link TRB on a one-segment ring, or if the TD
  4655. + * wrapped around the top of the ring, because it doesn't have the TD in
  4656. + * question. Look for the one-segment case where stalled TRB's address
  4657. + * is greater than the new dequeue pointer address.
  4658. + */
  4659. + if (ep_ring->first_seg == ep_ring->first_seg->next &&
  4660. + state->new_deq_ptr < dev->eps[ep_index].stopped_trb)
  4661. + state->new_cycle_state ^= 0x1;
  4662. + xhci_dbg(xhci, "Cycle state = 0x%x\n", state->new_cycle_state);
  4663. +
  4664. /* Don't update the ring cycle state for the producer (us). */
  4665. xhci_dbg(xhci, "New dequeue segment = %p (virtual)\n",
  4666. state->new_deq_seg);
  4667. addr = xhci_trb_virt_to_dma(state->new_deq_seg, state->new_deq_ptr);
  4668. xhci_dbg(xhci, "New dequeue pointer = 0x%llx (DMA)\n",
  4669. (unsigned long long) addr);
  4670. - xhci_dbg(xhci, "Setting dequeue pointer in internal ring state.\n");
  4671. - ep_ring->dequeue = state->new_deq_ptr;
  4672. - ep_ring->deq_seg = state->new_deq_seg;
  4673. }
  4674.  
  4675. static void td_to_noop(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
  4676. @@ -951,9 +967,26 @@ static void handle_set_deq_completion(st
  4677. } else {
  4678. xhci_dbg(xhci, "Successful Set TR Deq Ptr cmd, deq = @%08llx\n",
  4679. ep_ctx->deq);
  4680. + if (xhci_trb_virt_to_dma(dev->eps[ep_index].queued_deq_seg,
  4681. + dev->eps[ep_index].queued_deq_ptr) ==
  4682. + (ep_ctx->deq & ~(EP_CTX_CYCLE_MASK))) {
  4683. + /* Update the ring's dequeue segment and dequeue pointer
  4684. + * to reflect the new position.
  4685. + */
  4686. + ep_ring->deq_seg = dev->eps[ep_index].queued_deq_seg;
  4687. + ep_ring->dequeue = dev->eps[ep_index].queued_deq_ptr;
  4688. + } else {
  4689. + xhci_warn(xhci, "Mismatch between completed Set TR Deq "
  4690. + "Ptr command & xHCI internal state.\n");
  4691. + xhci_warn(xhci, "ep deq seg = %p, deq ptr = %p\n",
  4692. + dev->eps[ep_index].queued_deq_seg,
  4693. + dev->eps[ep_index].queued_deq_ptr);
  4694. + }
  4695. }
  4696.  
  4697. dev->eps[ep_index].ep_state &= ~SET_DEQ_PENDING;
  4698. + dev->eps[ep_index].queued_deq_seg = NULL;
  4699. + dev->eps[ep_index].queued_deq_ptr = NULL;
  4700. /* Restart any rings with pending URBs */
  4701. ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
  4702. }
  4703. @@ -2369,12 +2402,13 @@ static unsigned int count_sg_trbs_needed
  4704.  
  4705. /* Scatter gather list entries may cross 64KB boundaries */
  4706. running_total = TRB_MAX_BUFF_SIZE -
  4707. - (sg_dma_address(sg) & ((1 << TRB_MAX_BUFF_SHIFT) - 1));
  4708. + (sg_dma_address(sg) & (TRB_MAX_BUFF_SIZE - 1));
  4709. + running_total &= TRB_MAX_BUFF_SIZE - 1;
  4710. if (running_total != 0)
  4711. num_trbs++;
  4712.  
  4713. /* How many more 64KB chunks to transfer, how many more TRBs? */
  4714. - while (running_total < sg_dma_len(sg)) {
  4715. + while (running_total < sg_dma_len(sg) && running_total < temp) {
  4716. num_trbs++;
  4717. running_total += TRB_MAX_BUFF_SIZE;
  4718. }
  4719. @@ -2399,11 +2433,11 @@ static unsigned int count_sg_trbs_needed
  4720. static void check_trb_math(struct urb *urb, int num_trbs, int running_total)
  4721. {
  4722. if (num_trbs != 0)
  4723. - dev_dbg(&urb->dev->dev, "%s - ep %#x - Miscalculated number of "
  4724. + dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated number of "
  4725. "TRBs, %d left\n", __func__,
  4726. urb->ep->desc.bEndpointAddress, num_trbs);
  4727. if (running_total != urb->transfer_buffer_length)
  4728. - dev_dbg(&urb->dev->dev, "%s - ep %#x - Miscalculated tx length, "
  4729. + dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated tx length, "
  4730. "queued %#x (%d), asked for %#x (%d)\n",
  4731. __func__,
  4732. urb->ep->desc.bEndpointAddress,
  4733. @@ -2535,8 +2569,7 @@ static int queue_bulk_sg_tx(struct xhci_
  4734. sg = urb->sg;
  4735. addr = (u64) sg_dma_address(sg);
  4736. this_sg_len = sg_dma_len(sg);
  4737. - trb_buff_len = TRB_MAX_BUFF_SIZE -
  4738. - (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1));
  4739. + trb_buff_len = TRB_MAX_BUFF_SIZE - (addr & (TRB_MAX_BUFF_SIZE - 1));
  4740. trb_buff_len = min_t(int, trb_buff_len, this_sg_len);
  4741. if (trb_buff_len > urb->transfer_buffer_length)
  4742. trb_buff_len = urb->transfer_buffer_length;
  4743. @@ -2572,7 +2605,7 @@ static int queue_bulk_sg_tx(struct xhci_
  4744. (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1),
  4745. (unsigned int) addr + trb_buff_len);
  4746. if (TRB_MAX_BUFF_SIZE -
  4747. - (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)) < trb_buff_len) {
  4748. + (addr & (TRB_MAX_BUFF_SIZE - 1)) < trb_buff_len) {
  4749. xhci_warn(xhci, "WARN: sg dma xfer crosses 64KB boundaries!\n");
  4750. xhci_dbg(xhci, "Next boundary at %#x, end dma = %#x\n",
  4751. (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1),
  4752. @@ -2616,7 +2649,7 @@ static int queue_bulk_sg_tx(struct xhci_
  4753. }
  4754.  
  4755. trb_buff_len = TRB_MAX_BUFF_SIZE -
  4756. - (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1));
  4757. + (addr & (TRB_MAX_BUFF_SIZE - 1));
  4758. trb_buff_len = min_t(int, trb_buff_len, this_sg_len);
  4759. if (running_total + trb_buff_len > urb->transfer_buffer_length)
  4760. trb_buff_len =
  4761. @@ -2656,7 +2689,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
  4762. num_trbs = 0;
  4763. /* How much data is (potentially) left before the 64KB boundary? */
  4764. running_total = TRB_MAX_BUFF_SIZE -
  4765. - (urb->transfer_dma & ((1 << TRB_MAX_BUFF_SHIFT) - 1));
  4766. + (urb->transfer_dma & (TRB_MAX_BUFF_SIZE - 1));
  4767. + running_total &= TRB_MAX_BUFF_SIZE - 1;
  4768.  
  4769. /* If there's some data on this 64KB chunk, or we have to send a
  4770. * zero-length transfer, we need at least one TRB
  4771. @@ -2699,8 +2733,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
  4772. /* How much data is in the first TRB? */
  4773. addr = (u64) urb->transfer_dma;
  4774. trb_buff_len = TRB_MAX_BUFF_SIZE -
  4775. - (urb->transfer_dma & ((1 << TRB_MAX_BUFF_SHIFT) - 1));
  4776. - if (urb->transfer_buffer_length < trb_buff_len)
  4777. + (urb->transfer_dma & (TRB_MAX_BUFF_SIZE - 1));
  4778. + if (trb_buff_len > urb->transfer_buffer_length)
  4779. trb_buff_len = urb->transfer_buffer_length;
  4780.  
  4781. first_trb = true;
  4782. @@ -2872,8 +2906,8 @@ static int count_isoc_trbs_needed(struct
  4783. addr = (u64) (urb->transfer_dma + urb->iso_frame_desc[i].offset);
  4784. td_len = urb->iso_frame_desc[i].length;
  4785.  
  4786. - running_total = TRB_MAX_BUFF_SIZE -
  4787. - (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1));
  4788. + running_total = TRB_MAX_BUFF_SIZE - (addr & (TRB_MAX_BUFF_SIZE - 1));
  4789. + running_total &= TRB_MAX_BUFF_SIZE - 1;
  4790. if (running_total != 0)
  4791. num_trbs++;
  4792.  
  4793. @@ -3212,6 +3246,7 @@ static int queue_set_tr_deq(struct xhci_
  4794. u32 trb_ep_index = EP_ID_FOR_TRB(ep_index);
  4795. u32 trb_stream_id = STREAM_ID_FOR_TRB(stream_id);
  4796. u32 type = TRB_TYPE(TRB_SET_DEQ);
  4797. + struct xhci_virt_ep *ep;
  4798.  
  4799. addr = xhci_trb_virt_to_dma(deq_seg, deq_ptr);
  4800. if (addr == 0) {
  4801. @@ -3220,6 +3255,14 @@ static int queue_set_tr_deq(struct xhci_
  4802. deq_seg, deq_ptr);
  4803. return 0;
  4804. }
  4805. + ep = &xhci->devs[slot_id]->eps[ep_index];
  4806. + if ((ep->ep_state & SET_DEQ_PENDING)) {
  4807. + xhci_warn(xhci, "WARN Cannot submit Set TR Deq Ptr\n");
  4808. + xhci_warn(xhci, "A Set TR Deq Ptr command is pending.\n");
  4809. + return 0;
  4810. + }
  4811. + ep->queued_deq_seg = deq_seg;
  4812. + ep->queued_deq_ptr = deq_ptr;
  4813. return queue_command(xhci, lower_32_bits(addr) | cycle_state,
  4814. upper_32_bits(addr), trb_stream_id,
  4815. trb_slot_id | trb_ep_index | type, false);
  4816. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/misc/uss720.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/misc/uss720.c
  4817. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/misc/uss720.c 2011-04-01 17:56:56.412710689 +0200
  4818. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/misc/uss720.c 2011-04-02 01:38:34.973688310 +0200
  4819. @@ -177,12 +177,11 @@ static struct uss720_async_request *subm
  4820. spin_lock_irqsave(&priv->asynclock, flags);
  4821. list_add_tail(&rq->asynclist, &priv->asynclist);
  4822. spin_unlock_irqrestore(&priv->asynclock, flags);
  4823. + kref_get(&rq->ref_count);
  4824. ret = usb_submit_urb(rq->urb, mem_flags);
  4825. - if (!ret) {
  4826. - kref_get(&rq->ref_count);
  4827. + if (!ret)
  4828. return rq;
  4829. - }
  4830. - kref_put(&rq->ref_count, destroy_async);
  4831. + destroy_async(&rq->ref_count);
  4832. err("submit_async_request submit_urb failed with %d", ret);
  4833. return NULL;
  4834. }
  4835. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/musb/musb_core.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/musb/musb_core.c
  4836. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/musb/musb_core.c 2011-04-01 17:56:56.426710689 +0200
  4837. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/musb/musb_core.c 2011-04-02 01:37:42.499688353 +0200
  4838. @@ -1880,6 +1880,7 @@ allocate_instance(struct device *dev,
  4839. INIT_LIST_HEAD(&musb->out_bulk);
  4840.  
  4841. hcd->uses_new_polling = 1;
  4842. + hcd->has_tt = 1;
  4843.  
  4844. musb->vbuserr_retry = VBUSERR_RETRY_COUNT;
  4845. musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON;
  4846. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/musb/omap2430.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/musb/omap2430.c
  4847. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/musb/omap2430.c 2011-04-01 17:56:56.426710689 +0200
  4848. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/musb/omap2430.c 2011-04-02 01:37:42.499688353 +0200
  4849. @@ -317,6 +317,7 @@ static int musb_platform_resume(struct m
  4850.  
  4851. int musb_platform_exit(struct musb *musb)
  4852. {
  4853. + del_timer_sync(&musb_idle_timer);
  4854.  
  4855. musb_platform_suspend(musb);
  4856.  
  4857. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/ch341.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/ch341.c
  4858. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/ch341.c 2011-04-01 17:56:56.424710689 +0200
  4859. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/ch341.c 2011-04-02 01:37:42.495688354 +0200
  4860. @@ -75,6 +75,7 @@ static int debug;
  4861. static const struct usb_device_id id_table[] = {
  4862. { USB_DEVICE(0x4348, 0x5523) },
  4863. { USB_DEVICE(0x1a86, 0x7523) },
  4864. + { USB_DEVICE(0x1a86, 0x5523) },
  4865. { },
  4866. };
  4867. MODULE_DEVICE_TABLE(usb, id_table);
  4868. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/kobil_sct.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/kobil_sct.c
  4869. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/kobil_sct.c 2011-04-01 17:56:56.423710689 +0200
  4870. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/kobil_sct.c 2011-04-02 01:37:42.492688354 +0200
  4871. @@ -372,7 +372,7 @@ static void kobil_read_int_callback(stru
  4872. }
  4873.  
  4874. tty = tty_port_tty_get(&port->port);
  4875. - if (urb->actual_length) {
  4876. + if (tty && urb->actual_length) {
  4877.  
  4878. /* BEGIN DEBUG */
  4879. /*
  4880. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/option.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/option.c
  4881. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/option.c 2011-04-01 17:56:56.425710689 +0200
  4882. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/option.c 2011-04-02 01:37:42.496688354 +0200
  4883. @@ -653,7 +653,8 @@ static const struct usb_device_id option
  4884. { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) },
  4885. { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) },
  4886. { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) },
  4887. - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626, 0xff, 0xff, 0xff) },
  4888. + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626, 0xff,
  4889. + 0xff, 0xff), .driver_info = (kernel_ulong_t)&four_g_w14_blacklist },
  4890. { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0032, 0xff, 0xff, 0xff) },
  4891. { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0033, 0xff, 0xff, 0xff) },
  4892. { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0034, 0xff, 0xff, 0xff) },
  4893. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/sierra.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/sierra.c
  4894. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/sierra.c 2011-04-01 17:56:56.425710689 +0200
  4895. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/sierra.c 2011-04-02 01:37:42.495688354 +0200
  4896. @@ -301,6 +301,9 @@ static const struct usb_device_id id_tab
  4897. { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */
  4898. .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
  4899. },
  4900. + { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */
  4901. + .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
  4902. + },
  4903. { USB_DEVICE(0x413C, 0x08133) }, /* Dell Computer Corp. Wireless 5720 VZW Mobile Broadband (EVDO Rev-A) Minicard GPS Port */
  4904.  
  4905. { }
  4906. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/usb-serial.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/usb-serial.c
  4907. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/usb-serial.c 2011-04-01 17:56:56.424710689 +0200
  4908. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/usb-serial.c 2011-04-02 01:37:42.495688354 +0200
  4909. @@ -911,9 +911,8 @@ int usb_serial_probe(struct usb_interfac
  4910. dev_err(&interface->dev, "No free urbs available\n");
  4911. goto probe_error;
  4912. }
  4913. - buffer_size = serial->type->bulk_in_size;
  4914. - if (!buffer_size)
  4915. - buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
  4916. + buffer_size = max_t(int, serial->type->bulk_in_size,
  4917. + le16_to_cpu(endpoint->wMaxPacketSize));
  4918. port->bulk_in_size = buffer_size;
  4919. port->bulk_in_endpointAddress = endpoint->bEndpointAddress;
  4920. port->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
  4921. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/usb_wwan.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/usb_wwan.c
  4922. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/usb_wwan.c 2011-04-01 17:56:56.424710689 +0200
  4923. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/usb_wwan.c 2011-04-02 01:37:42.494688354 +0200
  4924. @@ -216,12 +216,15 @@ static void usb_wwan_indat_callback(stru
  4925. __func__, status, endpoint);
  4926. } else {
  4927. tty = tty_port_tty_get(&port->port);
  4928. - if (urb->actual_length) {
  4929. - tty_insert_flip_string(tty, data, urb->actual_length);
  4930. - tty_flip_buffer_push(tty);
  4931. - } else
  4932. - dbg("%s: empty read urb received", __func__);
  4933. - tty_kref_put(tty);
  4934. + if (tty) {
  4935. + if (urb->actual_length) {
  4936. + tty_insert_flip_string(tty, data,
  4937. + urb->actual_length);
  4938. + tty_flip_buffer_push(tty);
  4939. + } else
  4940. + dbg("%s: empty read urb received", __func__);
  4941. + tty_kref_put(tty);
  4942. + }
  4943.  
  4944. /* Resubmit urb so we continue receiving */
  4945. if (status != -ESHUTDOWN) {
  4946. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/visor.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/visor.c
  4947. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/visor.c 2011-04-01 17:56:56.425710689 +0200
  4948. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/usb/serial/visor.c 2011-04-02 01:37:42.495688354 +0200
  4949. @@ -27,6 +27,7 @@
  4950. #include <linux/uaccess.h>
  4951. #include <linux/usb.h>
  4952. #include <linux/usb/serial.h>
  4953. +#include <linux/usb/cdc.h>
  4954. #include "visor.h"
  4955.  
  4956. /*
  4957. @@ -479,6 +480,17 @@ static int visor_probe(struct usb_serial
  4958.  
  4959. dbg("%s", __func__);
  4960.  
  4961. + /*
  4962. + * some Samsung Android phones in modem mode have the same ID
  4963. + * as SPH-I500, but they are ACM devices, so dont bind to them
  4964. + */
  4965. + if (id->idVendor == SAMSUNG_VENDOR_ID &&
  4966. + id->idProduct == SAMSUNG_SPH_I500_ID &&
  4967. + serial->dev->descriptor.bDeviceClass == USB_CLASS_COMM &&
  4968. + serial->dev->descriptor.bDeviceSubClass ==
  4969. + USB_CDC_SUBCLASS_ACM)
  4970. + return -ENODEV;
  4971. +
  4972. if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
  4973. dev_err(&serial->dev->dev, "active config #%d != 1 ??\n",
  4974. serial->dev->actconfig->desc.bConfigurationValue);
  4975. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/video/console/tileblit.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/video/console/tileblit.c
  4976. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/video/console/tileblit.c 2011-04-01 17:56:56.236710688 +0200
  4977. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//drivers/video/console/tileblit.c 2011-04-02 01:38:34.973688310 +0200
  4978. @@ -83,7 +83,7 @@ static void tile_cursor(struct vc_data *
  4979. int softback_lines, int fg, int bg)
  4980. {
  4981. struct fb_tilecursor cursor;
  4982. - int use_sw = (vc->vc_cursor_type & 0x01);
  4983. + int use_sw = (vc->vc_cursor_type & 0x10);
  4984.  
  4985. cursor.sx = vc->vc_x;
  4986. cursor.sy = vc->vc_y;
  4987. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/aio.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/aio.c
  4988. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/aio.c 2011-04-01 17:56:57.514710687 +0200
  4989. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/aio.c 2011-04-02 01:38:34.973688311 +0200
  4990. @@ -512,7 +512,7 @@ static inline void really_put_req(struct
  4991. ctx->reqs_active--;
  4992.  
  4993. if (unlikely(!ctx->reqs_active && ctx->dead))
  4994. - wake_up(&ctx->wait);
  4995. + wake_up_all(&ctx->wait);
  4996. }
  4997.  
  4998. static void aio_fput_routine(struct work_struct *data)
  4999. @@ -1233,7 +1233,7 @@ static void io_destroy(struct kioctx *io
  5000. * by other CPUs at this point. Right now, we rely on the
  5001. * locking done by the above calls to ensure this consistency.
  5002. */
  5003. - wake_up(&ioctx->wait);
  5004. + wake_up_all(&ioctx->wait);
  5005. put_ioctx(ioctx); /* once for the lookup */
  5006. }
  5007.  
  5008. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/block_dev.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/block_dev.c
  5009. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/block_dev.c 2011-04-01 17:56:57.441710688 +0200
  5010. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/block_dev.c 2011-04-02 01:37:43.656688352 +0200
  5011. @@ -1217,9 +1217,9 @@ EXPORT_SYMBOL(open_by_devnum);
  5012. * when a disk has been changed -- either by a media change or online
  5013. * resize.
  5014. */
  5015. -static void flush_disk(struct block_device *bdev)
  5016. +static void flush_disk(struct block_device *bdev, bool kill_dirty)
  5017. {
  5018. - if (__invalidate_device(bdev)) {
  5019. + if (__invalidate_device(bdev, kill_dirty)) {
  5020. char name[BDEVNAME_SIZE] = "";
  5021.  
  5022. if (bdev->bd_disk)
  5023. @@ -1256,7 +1256,7 @@ void check_disk_size_change(struct gendi
  5024. "%s: detected capacity change from %lld to %lld\n",
  5025. name, bdev_size, disk_size);
  5026. i_size_write(bdev->bd_inode, disk_size);
  5027. - flush_disk(bdev);
  5028. + flush_disk(bdev, false);
  5029. }
  5030. }
  5031. EXPORT_SYMBOL(check_disk_size_change);
  5032. @@ -1308,7 +1308,7 @@ int check_disk_change(struct block_devic
  5033. if (!bdops->media_changed(bdev->bd_disk))
  5034. return 0;
  5035.  
  5036. - flush_disk(bdev);
  5037. + flush_disk(bdev, true);
  5038. if (bdops->revalidate_disk)
  5039. bdops->revalidate_disk(bdev->bd_disk);
  5040. return 1;
  5041. @@ -1776,7 +1776,7 @@ void close_bdev_exclusive(struct block_d
  5042.  
  5043. EXPORT_SYMBOL(close_bdev_exclusive);
  5044.  
  5045. -int __invalidate_device(struct block_device *bdev)
  5046. +int __invalidate_device(struct block_device *bdev, bool kill_dirty)
  5047. {
  5048. struct super_block *sb = get_super(bdev);
  5049. int res = 0;
  5050. @@ -1789,7 +1789,7 @@ int __invalidate_device(struct block_dev
  5051. * hold).
  5052. */
  5053. shrink_dcache_sb(sb);
  5054. - res = invalidate_inodes(sb);
  5055. + res = invalidate_inodes(sb, kill_dirty);
  5056. drop_super(sb);
  5057. }
  5058. invalidate_bdev(bdev);
  5059. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/btrfs/file.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/btrfs/file.c
  5060. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/btrfs/file.c 2011-04-01 17:57:39.341710653 +0200
  5061. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/btrfs/file.c 2011-04-02 01:37:43.697688353 +0200
  5062. @@ -69,6 +69,19 @@ static noinline int btrfs_copy_from_user
  5063.  
  5064. /* Flush processor's dcache for this page */
  5065. flush_dcache_page(page);
  5066. +
  5067. + /*
  5068. + * if we get a partial write, we can end up with
  5069. + * partially up to date pages. These add
  5070. + * a lot of complexity, so make sure they don't
  5071. + * happen by forcing this copy to be retried.
  5072. + *
  5073. + * The rest of the btrfs_file_write code will fall
  5074. + * back to page at a time copies after we return 0.
  5075. + */
  5076. + if (!PageUptodate(page) && copied < count)
  5077. + copied = 0;
  5078. +
  5079. iov_iter_advance(i, copied);
  5080. write_bytes -= copied;
  5081. total_copied += copied;
  5082. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/dcache.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/dcache.c
  5083. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/dcache.c 2011-04-01 17:56:57.442710688 +0200
  5084. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/dcache.c 2011-04-02 01:38:34.974688312 +0200
  5085. @@ -1201,9 +1201,12 @@ struct dentry *d_obtain_alias(struct ino
  5086. spin_unlock(&tmp->d_lock);
  5087.  
  5088. spin_unlock(&dcache_lock);
  5089. + security_d_instantiate(tmp, inode);
  5090. return tmp;
  5091.  
  5092. out_iput:
  5093. + if (res && !IS_ERR(res))
  5094. + security_d_instantiate(res, inode);
  5095. iput(inode);
  5096. return res;
  5097. }
  5098. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/eventpoll.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/eventpoll.c
  5099. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/eventpoll.c 2011-04-01 17:56:57.521710687 +0200
  5100. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/eventpoll.c 2011-04-02 01:37:43.807688352 +0200
  5101. @@ -63,6 +63,13 @@
  5102. * cleanup path and it is also acquired by eventpoll_release_file()
  5103. * if a file has been pushed inside an epoll set and it is then
  5104. * close()d without a previous call toepoll_ctl(EPOLL_CTL_DEL).
  5105. + * It is also acquired when inserting an epoll fd onto another epoll
  5106. + * fd. We do this so that we walk the epoll tree and ensure that this
  5107. + * insertion does not create a cycle of epoll file descriptors, which
  5108. + * could lead to deadlock. We need a global mutex to prevent two
  5109. + * simultaneous inserts (A into B and B into A) from racing and
  5110. + * constructing a cycle without either insert observing that it is
  5111. + * going to.
  5112. * It is possible to drop the "ep->mtx" and to use the global
  5113. * mutex "epmutex" (together with "ep->lock") to have it working,
  5114. * but having "ep->mtx" will make the interface more scalable.
  5115. @@ -224,6 +231,9 @@ static int max_user_watches __read_mostl
  5116. */
  5117. static DEFINE_MUTEX(epmutex);
  5118.  
  5119. +/* Used to check for epoll file descriptor inclusion loops */
  5120. +static struct nested_calls poll_loop_ncalls;
  5121. +
  5122. /* Used for safe wake up implementation */
  5123. static struct nested_calls poll_safewake_ncalls;
  5124.  
  5125. @@ -1195,6 +1205,62 @@ retry:
  5126. return res;
  5127. }
  5128.  
  5129. +/**
  5130. + * ep_loop_check_proc - Callback function to be passed to the @ep_call_nested()
  5131. + * API, to verify that adding an epoll file inside another
  5132. + * epoll structure, does not violate the constraints, in
  5133. + * terms of closed loops, or too deep chains (which can
  5134. + * result in excessive stack usage).
  5135. + *
  5136. + * @priv: Pointer to the epoll file to be currently checked.
  5137. + * @cookie: Original cookie for this call. This is the top-of-the-chain epoll
  5138. + * data structure pointer.
  5139. + * @call_nests: Current dept of the @ep_call_nested() call stack.
  5140. + *
  5141. + * Returns: Returns zero if adding the epoll @file inside current epoll
  5142. + * structure @ep does not violate the constraints, or -1 otherwise.
  5143. + */
  5144. +static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
  5145. +{
  5146. + int error = 0;
  5147. + struct file *file = priv;
  5148. + struct eventpoll *ep = file->private_data;
  5149. + struct rb_node *rbp;
  5150. + struct epitem *epi;
  5151. +
  5152. + mutex_lock(&ep->mtx);
  5153. + for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) {
  5154. + epi = rb_entry(rbp, struct epitem, rbn);
  5155. + if (unlikely(is_file_epoll(epi->ffd.file))) {
  5156. + error = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS,
  5157. + ep_loop_check_proc, epi->ffd.file,
  5158. + epi->ffd.file->private_data, current);
  5159. + if (error != 0)
  5160. + break;
  5161. + }
  5162. + }
  5163. + mutex_unlock(&ep->mtx);
  5164. +
  5165. + return error;
  5166. +}
  5167. +
  5168. +/**
  5169. + * ep_loop_check - Performs a check to verify that adding an epoll file (@file)
  5170. + * another epoll file (represented by @ep) does not create
  5171. + * closed loops or too deep chains.
  5172. + *
  5173. + * @ep: Pointer to the epoll private data structure.
  5174. + * @file: Pointer to the epoll file to be checked.
  5175. + *
  5176. + * Returns: Returns zero if adding the epoll @file inside current epoll
  5177. + * structure @ep does not violate the constraints, or -1 otherwise.
  5178. + */
  5179. +static int ep_loop_check(struct eventpoll *ep, struct file *file)
  5180. +{
  5181. + return ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS,
  5182. + ep_loop_check_proc, file, ep, current);
  5183. +}
  5184. +
  5185. /*
  5186. * Open an eventpoll file descriptor.
  5187. */
  5188. @@ -1243,6 +1309,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, in
  5189. struct epoll_event __user *, event)
  5190. {
  5191. int error;
  5192. + int did_lock_epmutex = 0;
  5193. struct file *file, *tfile;
  5194. struct eventpoll *ep;
  5195. struct epitem *epi;
  5196. @@ -1284,6 +1351,25 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, in
  5197. */
  5198. ep = file->private_data;
  5199.  
  5200. + /*
  5201. + * When we insert an epoll file descriptor, inside another epoll file
  5202. + * descriptor, there is the change of creating closed loops, which are
  5203. + * better be handled here, than in more critical paths.
  5204. + *
  5205. + * We hold epmutex across the loop check and the insert in this case, in
  5206. + * order to prevent two separate inserts from racing and each doing the
  5207. + * insert "at the same time" such that ep_loop_check passes on both
  5208. + * before either one does the insert, thereby creating a cycle.
  5209. + */
  5210. + if (unlikely(is_file_epoll(tfile) && op == EPOLL_CTL_ADD)) {
  5211. + mutex_lock(&epmutex);
  5212. + did_lock_epmutex = 1;
  5213. + error = -ELOOP;
  5214. + if (ep_loop_check(ep, tfile) != 0)
  5215. + goto error_tgt_fput;
  5216. + }
  5217. +
  5218. +
  5219. mutex_lock(&ep->mtx);
  5220.  
  5221. /*
  5222. @@ -1319,6 +1405,9 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, in
  5223. mutex_unlock(&ep->mtx);
  5224.  
  5225. error_tgt_fput:
  5226. + if (unlikely(did_lock_epmutex))
  5227. + mutex_unlock(&epmutex);
  5228. +
  5229. fput(tfile);
  5230. error_fput:
  5231. fput(file);
  5232. @@ -1437,6 +1526,12 @@ static int __init eventpoll_init(void)
  5233. max_user_watches = (((si.totalram - si.totalhigh) / 25) << PAGE_SHIFT) /
  5234. EP_ITEM_COST;
  5235.  
  5236. + /*
  5237. + * Initialize the structure used to perform epoll file descriptor
  5238. + * inclusion loops checks.
  5239. + */
  5240. + ep_nested_calls_init(&poll_loop_ncalls);
  5241. +
  5242. /* Initialize the structure used to perform safe poll wait head wake ups */
  5243. ep_nested_calls_init(&poll_safewake_ncalls);
  5244.  
  5245. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext2/namei.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext2/namei.c
  5246. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext2/namei.c 2011-04-01 17:57:39.347710653 +0200
  5247. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext2/namei.c 2011-04-02 01:37:43.714688353 +0200
  5248. @@ -344,7 +344,6 @@ static int ext2_rename (struct inode * o
  5249. new_de = ext2_find_entry (new_dir, &new_dentry->d_name, &new_page);
  5250. if (!new_de)
  5251. goto out_dir;
  5252. - inode_inc_link_count(old_inode);
  5253. ext2_set_link(new_dir, new_de, new_page, old_inode, 1);
  5254. new_inode->i_ctime = CURRENT_TIME_SEC;
  5255. if (dir_de)
  5256. @@ -356,12 +355,9 @@ static int ext2_rename (struct inode * o
  5257. if (new_dir->i_nlink >= EXT2_LINK_MAX)
  5258. goto out_dir;
  5259. }
  5260. - inode_inc_link_count(old_inode);
  5261. err = ext2_add_link(new_dentry, old_inode);
  5262. - if (err) {
  5263. - inode_dec_link_count(old_inode);
  5264. + if (err)
  5265. goto out_dir;
  5266. - }
  5267. if (dir_de)
  5268. inode_inc_link_count(new_dir);
  5269. }
  5270. @@ -369,12 +365,11 @@ static int ext2_rename (struct inode * o
  5271. /*
  5272. * Like most other Unix systems, set the ctime for inodes on a
  5273. * rename.
  5274. - * inode_dec_link_count() will mark the inode dirty.
  5275. */
  5276. old_inode->i_ctime = CURRENT_TIME_SEC;
  5277. + mark_inode_dirty(old_inode);
  5278.  
  5279. ext2_delete_entry (old_de, old_page);
  5280. - inode_dec_link_count(old_inode);
  5281.  
  5282. if (dir_de) {
  5283. if (old_dir != new_dir)
  5284. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext3/namei.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext3/namei.c
  5285. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext3/namei.c 2011-04-01 17:57:39.348710653 +0200
  5286. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext3/namei.c 2011-04-02 01:37:43.666688352 +0200
  5287. @@ -1549,8 +1549,8 @@ static int ext3_dx_add_entry(handle_t *h
  5288. goto cleanup;
  5289. node2 = (struct dx_node *)(bh2->b_data);
  5290. entries2 = node2->entries;
  5291. + memset(&node2->fake, 0, sizeof(struct fake_dirent));
  5292. node2->fake.rec_len = ext3_rec_len_to_disk(sb->s_blocksize);
  5293. - node2->fake.inode = 0;
  5294. BUFFER_TRACE(frame->bh, "get_write_access");
  5295. err = ext3_journal_get_write_access(handle, frame->bh);
  5296. if (err)
  5297. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext3/super.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext3/super.c
  5298. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext3/super.c 2011-04-01 17:57:39.349710653 +0200
  5299. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext3/super.c 2011-04-02 01:38:34.974688312 +0200
  5300. @@ -1442,6 +1442,13 @@ static void ext3_orphan_cleanup (struct
  5301. return;
  5302. }
  5303.  
  5304. + /* Check if feature set allows readwrite operations */
  5305. + if (EXT3_HAS_RO_COMPAT_FEATURE(sb, ~EXT3_FEATURE_RO_COMPAT_SUPP)) {
  5306. + ext3_msg(sb, KERN_INFO, "Skipping orphan cleanup due to "
  5307. + "unknown ROCOMPAT features");
  5308. + return;
  5309. + }
  5310. +
  5311. if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) {
  5312. if (es->s_last_orphan)
  5313. jbd_debug(1, "Errors on filesystem, "
  5314. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext4/super.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext4/super.c
  5315. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext4/super.c 2011-04-01 17:57:39.361710653 +0200
  5316. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ext4/super.c 2011-04-02 01:38:34.975688312 +0200
  5317. @@ -76,6 +76,7 @@ static void ext4_write_super(struct supe
  5318. static int ext4_freeze(struct super_block *sb);
  5319. static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
  5320. const char *dev_name, void *data);
  5321. +static int ext4_feature_set_ok(struct super_block *sb, int readonly);
  5322. static void ext4_destroy_lazyinit_thread(void);
  5323. static void ext4_unregister_li_request(struct super_block *sb);
  5324. static void ext4_clear_request_list(void);
  5325. @@ -2124,6 +2125,13 @@ static void ext4_orphan_cleanup(struct s
  5326. return;
  5327. }
  5328.  
  5329. + /* Check if feature set would not allow a r/w mount */
  5330. + if (!ext4_feature_set_ok(sb, 0)) {
  5331. + ext4_msg(sb, KERN_INFO, "Skipping orphan cleanup due to "
  5332. + "unknown ROCOMPAT features");
  5333. + return;
  5334. + }
  5335. +
  5336. if (EXT4_SB(sb)->s_mount_state & EXT4_ERROR_FS) {
  5337. if (es->s_last_orphan)
  5338. jbd_debug(1, "Errors on filesystem, "
  5339. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/fuse/file.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/fuse/file.c
  5340. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/fuse/file.c 2011-04-01 17:56:57.485710688 +0200
  5341. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/fuse/file.c 2011-04-02 01:37:43.712688353 +0200
  5342. @@ -86,18 +86,52 @@ struct fuse_file *fuse_file_get(struct f
  5343. return ff;
  5344. }
  5345.  
  5346. +static void fuse_release_async(struct work_struct *work)
  5347. +{
  5348. + struct fuse_req *req;
  5349. + struct fuse_conn *fc;
  5350. + struct path path;
  5351. +
  5352. + req = container_of(work, struct fuse_req, misc.release.work);
  5353. + path = req->misc.release.path;
  5354. + fc = get_fuse_conn(path.dentry->d_inode);
  5355. +
  5356. + fuse_put_request(fc, req);
  5357. + path_put(&path);
  5358. +}
  5359. +
  5360. static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req)
  5361. {
  5362. - path_put(&req->misc.release.path);
  5363. + if (fc->destroy_req) {
  5364. + /*
  5365. + * If this is a fuseblk mount, then it's possible that
  5366. + * releasing the path will result in releasing the
  5367. + * super block and sending the DESTROY request. If
  5368. + * the server is single threaded, this would hang.
  5369. + * For this reason do the path_put() in a separate
  5370. + * thread.
  5371. + */
  5372. + atomic_inc(&req->count);
  5373. + INIT_WORK(&req->misc.release.work, fuse_release_async);
  5374. + schedule_work(&req->misc.release.work);
  5375. + } else {
  5376. + path_put(&req->misc.release.path);
  5377. + }
  5378. }
  5379.  
  5380. -static void fuse_file_put(struct fuse_file *ff)
  5381. +static void fuse_file_put(struct fuse_file *ff, bool sync)
  5382. {
  5383. if (atomic_dec_and_test(&ff->count)) {
  5384. struct fuse_req *req = ff->reserved_req;
  5385.  
  5386. - req->end = fuse_release_end;
  5387. - fuse_request_send_background(ff->fc, req);
  5388. + if (sync) {
  5389. + fuse_request_send(ff->fc, req);
  5390. + path_put(&req->misc.release.path);
  5391. + fuse_put_request(ff->fc, req);
  5392. + } else {
  5393. + req->end = fuse_release_end;
  5394. + fuse_request_send_background(ff->fc, req);
  5395. + }
  5396. kfree(ff);
  5397. }
  5398. }
  5399. @@ -219,8 +253,12 @@ void fuse_release_common(struct file *fi
  5400. * Normally this will send the RELEASE request, however if
  5401. * some asynchronous READ or WRITE requests are outstanding,
  5402. * the sending will be delayed.
  5403. + *
  5404. + * Make the release synchronous if this is a fuseblk mount,
  5405. + * synchronous RELEASE is allowed (and desirable) in this case
  5406. + * because the server can be trusted not to screw up.
  5407. */
  5408. - fuse_file_put(ff);
  5409. + fuse_file_put(ff, ff->fc->destroy_req != NULL);
  5410. }
  5411.  
  5412. static int fuse_open(struct inode *inode, struct file *file)
  5413. @@ -558,7 +596,7 @@ static void fuse_readpages_end(struct fu
  5414. page_cache_release(page);
  5415. }
  5416. if (req->ff)
  5417. - fuse_file_put(req->ff);
  5418. + fuse_file_put(req->ff, false);
  5419. }
  5420.  
  5421. static void fuse_send_readpages(struct fuse_req *req, struct file *file)
  5422. @@ -1137,7 +1175,7 @@ static ssize_t fuse_direct_write(struct
  5423. static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req)
  5424. {
  5425. __free_page(req->pages[0]);
  5426. - fuse_file_put(req->ff);
  5427. + fuse_file_put(req->ff, false);
  5428. }
  5429.  
  5430. static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)
  5431. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/fuse/fuse_i.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/fuse/fuse_i.h
  5432. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/fuse/fuse_i.h 2011-04-01 17:56:57.485710688 +0200
  5433. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/fuse/fuse_i.h 2011-04-02 01:37:43.712688353 +0200
  5434. @@ -21,6 +21,7 @@
  5435. #include <linux/rwsem.h>
  5436. #include <linux/rbtree.h>
  5437. #include <linux/poll.h>
  5438. +#include <linux/workqueue.h>
  5439.  
  5440. /** Max number of pages that can be used in a single read request */
  5441. #define FUSE_MAX_PAGES_PER_REQ 32
  5442. @@ -257,7 +258,10 @@ struct fuse_req {
  5443. union {
  5444. struct fuse_forget_in forget_in;
  5445. struct {
  5446. - struct fuse_release_in in;
  5447. + union {
  5448. + struct fuse_release_in in;
  5449. + struct work_struct work;
  5450. + };
  5451. struct path path;
  5452. } release;
  5453. struct fuse_init_in init_in;
  5454. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/inode.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/inode.c
  5455. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/inode.c 2011-04-01 18:06:10.777710241 +0200
  5456. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/inode.c 2011-04-02 01:37:43.656688352 +0200
  5457. @@ -525,11 +525,14 @@ void evict_inodes(struct super_block *sb
  5458. /**
  5459. * invalidate_inodes - attempt to free all inodes on a superblock
  5460. * @sb: superblock to operate on
  5461. + * @kill_dirty: flag to guide handling of dirty inodes
  5462. *
  5463. * Attempts to free all inodes for a given superblock. If there were any
  5464. * busy inodes return a non-zero value, else zero.
  5465. + * If @kill_dirty is set, discard dirty inodes too, otherwise treat
  5466. + * them as busy.
  5467. */
  5468. -int invalidate_inodes(struct super_block *sb)
  5469. +int invalidate_inodes(struct super_block *sb, bool kill_dirty)
  5470. {
  5471. int busy = 0;
  5472. struct inode *inode, *next;
  5473. @@ -541,6 +544,10 @@ int invalidate_inodes(struct super_block
  5474. list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) {
  5475. if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE))
  5476. continue;
  5477. + if (inode->i_state & I_DIRTY && !kill_dirty) {
  5478. + busy = 1;
  5479. + continue;
  5480. + }
  5481. if (atomic_read(&inode->i_count)) {
  5482. busy = 1;
  5483. continue;
  5484. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/internal.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/internal.h
  5485. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/internal.h 2011-04-01 17:57:39.364710653 +0200
  5486. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/internal.h 2011-04-02 01:37:43.655688352 +0200
  5487. @@ -107,7 +107,7 @@ extern void release_open_intent(struct n
  5488. */
  5489. extern int get_nr_dirty_inodes(void);
  5490. extern void evict_inodes(struct super_block *);
  5491. -extern int invalidate_inodes(struct super_block *);
  5492. +extern int invalidate_inodes(struct super_block *, bool);
  5493.  
  5494. /*
  5495. * fs-writeback.c
  5496. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs2xdr.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs2xdr.c
  5497. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs2xdr.c 2011-04-01 17:56:57.502710688 +0200
  5498. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs2xdr.c 2011-04-02 01:37:43.744688352 +0200
  5499. @@ -477,11 +477,13 @@ nfs_decode_dirent(struct xdr_stream *xdr
  5500. entry->ino = ntohl(*p++);
  5501. entry->len = ntohl(*p++);
  5502.  
  5503. - p = xdr_inline_decode(xdr, entry->len + 4);
  5504. + p = xdr_inline_decode(xdr, entry->len);
  5505. if (unlikely(!p))
  5506. goto out_overflow;
  5507. entry->name = (const char *) p;
  5508. - p += XDR_QUADLEN(entry->len);
  5509. + p = xdr_inline_decode(xdr, 4);
  5510. + if (unlikely(!p))
  5511. + goto out_overflow;
  5512. entry->prev_cookie = entry->cookie;
  5513. entry->cookie = ntohl(*p++);
  5514.  
  5515. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs3xdr.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs3xdr.c
  5516. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs3xdr.c 2011-04-01 17:56:57.502710688 +0200
  5517. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs3xdr.c 2011-04-02 01:37:43.744688353 +0200
  5518. @@ -614,11 +614,13 @@ nfs3_decode_dirent(struct xdr_stream *xd
  5519. p = xdr_decode_hyper(p, &entry->ino);
  5520. entry->len = ntohl(*p++);
  5521.  
  5522. - p = xdr_inline_decode(xdr, entry->len + 8);
  5523. + p = xdr_inline_decode(xdr, entry->len);
  5524. if (unlikely(!p))
  5525. goto out_overflow;
  5526. entry->name = (const char *) p;
  5527. - p += XDR_QUADLEN(entry->len);
  5528. + p = xdr_inline_decode(xdr, 8);
  5529. + if (unlikely(!p))
  5530. + goto out_overflow;
  5531. entry->prev_cookie = entry->cookie;
  5532. p = xdr_decode_hyper(p, &entry->cookie);
  5533.  
  5534. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs4proc.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs4proc.c
  5535. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs4proc.c 2011-04-01 17:56:57.502710688 +0200
  5536. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs4proc.c 2011-04-02 01:37:43.734688352 +0200
  5537. @@ -49,6 +49,7 @@
  5538. #include <linux/mount.h>
  5539. #include <linux/module.h>
  5540. #include <linux/sunrpc/bc_xprt.h>
  5541. +#include <linux/mm.h>
  5542.  
  5543. #include "nfs4_fs.h"
  5544. #include "delegation.h"
  5545. @@ -3216,6 +3217,35 @@ static void buf_to_pages(const void *buf
  5546. }
  5547. }
  5548.  
  5549. +static int buf_to_pages_noslab(const void *buf, size_t buflen,
  5550. + struct page **pages, unsigned int *pgbase)
  5551. +{
  5552. + struct page *newpage, **spages;
  5553. + int rc = 0;
  5554. + size_t len;
  5555. + spages = pages;
  5556. +
  5557. + do {
  5558. + len = min_t(size_t, PAGE_CACHE_SIZE, buflen);
  5559. + newpage = alloc_page(GFP_KERNEL);
  5560. +
  5561. + if (newpage == NULL)
  5562. + goto unwind;
  5563. + memcpy(page_address(newpage), buf, len);
  5564. + buf += len;
  5565. + buflen -= len;
  5566. + *pages++ = newpage;
  5567. + rc++;
  5568. + } while (buflen != 0);
  5569. +
  5570. + return rc;
  5571. +
  5572. +unwind:
  5573. + for(; rc > 0; rc--)
  5574. + __free_page(spages[rc-1]);
  5575. + return -ENOMEM;
  5576. +}
  5577. +
  5578. struct nfs4_cached_acl {
  5579. int cached;
  5580. size_t len;
  5581. @@ -3384,13 +3414,23 @@ static int __nfs4_proc_set_acl(struct in
  5582. .rpc_argp = &arg,
  5583. .rpc_resp = &res,
  5584. };
  5585. - int ret;
  5586. + int ret, i;
  5587.  
  5588. if (!nfs4_server_supports_acls(server))
  5589. return -EOPNOTSUPP;
  5590. + i = buf_to_pages_noslab(buf, buflen, arg.acl_pages, &arg.acl_pgbase);
  5591. + if (i < 0)
  5592. + return i;
  5593. nfs_inode_return_delegation(inode);
  5594. - buf_to_pages(buf, buflen, arg.acl_pages, &arg.acl_pgbase);
  5595. ret = nfs4_call_sync(server, &msg, &arg, &res, 1);
  5596. +
  5597. + /*
  5598. + * Free each page after tx, so the only ref left is
  5599. + * held by the network stack
  5600. + */
  5601. + for (; i > 0; i--)
  5602. + put_page(pages[i-1]);
  5603. +
  5604. /*
  5605. * Acl update can result in inode attribute update.
  5606. * so mark the attribute cache invalid.
  5607. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs4xdr.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs4xdr.c
  5608. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs4xdr.c 2011-04-01 17:56:57.503710688 +0200
  5609. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfs4xdr.c 2011-04-02 01:37:43.744688353 +0200
  5610. @@ -6212,9 +6212,6 @@ __be32 *nfs4_decode_dirent(struct xdr_st
  5611. if (entry->fattr->valid & NFS_ATTR_FATTR_TYPE)
  5612. entry->d_type = nfs_umode_to_dtype(entry->fattr->mode);
  5613.  
  5614. - if (verify_attr_len(xdr, p, len) < 0)
  5615. - goto out_overflow;
  5616. -
  5617. return p;
  5618.  
  5619. out_overflow:
  5620. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfsroot.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfsroot.c
  5621. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfsroot.c 2011-04-01 17:56:57.503710688 +0200
  5622. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/nfsroot.c 2011-04-02 01:37:43.744688353 +0200
  5623. @@ -86,11 +86,14 @@
  5624. /* Default path we try to mount. "%s" gets replaced by our IP address */
  5625. #define NFS_ROOT "/tftpboot/%s"
  5626.  
  5627. +/* Default NFSROOT mount options. */
  5628. +#define NFS_DEF_OPTIONS "udp"
  5629. +
  5630. /* Parameters passed from the kernel command line */
  5631. static char nfs_root_parms[256] __initdata = "";
  5632.  
  5633. /* Text-based mount options passed to super.c */
  5634. -static char nfs_root_options[256] __initdata = "";
  5635. +static char nfs_root_options[256] __initdata = NFS_DEF_OPTIONS;
  5636.  
  5637. /* Address of NFS server */
  5638. static __be32 servaddr __initdata = htonl(INADDR_NONE);
  5639. @@ -160,8 +163,14 @@ static int __init root_nfs_copy(char *de
  5640. }
  5641.  
  5642. static int __init root_nfs_cat(char *dest, const char *src,
  5643. - const size_t destlen)
  5644. + const size_t destlen)
  5645. {
  5646. + size_t len = strlen(dest);
  5647. +
  5648. + if (len && dest[len - 1] != ',')
  5649. + if (strlcat(dest, ",", destlen) > destlen)
  5650. + return -1;
  5651. +
  5652. if (strlcat(dest, src, destlen) > destlen)
  5653. return -1;
  5654. return 0;
  5655. @@ -194,16 +203,6 @@ static int __init root_nfs_parse_options
  5656. if (root_nfs_cat(nfs_root_options, incoming,
  5657. sizeof(nfs_root_options)))
  5658. return -1;
  5659. -
  5660. - /*
  5661. - * Possibly prepare for more options to be appended
  5662. - */
  5663. - if (nfs_root_options[0] != '\0' &&
  5664. - nfs_root_options[strlen(nfs_root_options)] != ',')
  5665. - if (root_nfs_cat(nfs_root_options, ",",
  5666. - sizeof(nfs_root_options)))
  5667. - return -1;
  5668. -
  5669. return 0;
  5670. }
  5671.  
  5672. @@ -217,7 +216,7 @@ static int __init root_nfs_parse_options
  5673. */
  5674. static int __init root_nfs_data(char *cmdline)
  5675. {
  5676. - char addr_option[sizeof("nolock,addr=") + INET_ADDRSTRLEN + 1];
  5677. + char mand_options[sizeof("nolock,addr=") + INET_ADDRSTRLEN + 1];
  5678. int len, retval = -1;
  5679. char *tmp = NULL;
  5680. const size_t tmplen = sizeof(nfs_export_path);
  5681. @@ -244,9 +243,9 @@ static int __init root_nfs_data(char *cm
  5682. * Append mandatory options for nfsroot so they override
  5683. * what has come before
  5684. */
  5685. - snprintf(addr_option, sizeof(addr_option), "nolock,addr=%pI4",
  5686. + snprintf(mand_options, sizeof(mand_options), "nolock,addr=%pI4",
  5687. &servaddr);
  5688. - if (root_nfs_cat(nfs_root_options, addr_option,
  5689. + if (root_nfs_cat(nfs_root_options, mand_options,
  5690. sizeof(nfs_root_options)))
  5691. goto out_optionstoolong;
  5692.  
  5693. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/write.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/write.c
  5694. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/write.c 2011-04-01 17:57:39.370710653 +0200
  5695. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfs/write.c 2011-04-02 01:38:34.975688312 +0200
  5696. @@ -1277,13 +1277,17 @@ int nfs_writeback_done(struct rpc_task *
  5697. #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
  5698. static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait)
  5699. {
  5700. + int ret;
  5701. +
  5702. if (!test_and_set_bit(NFS_INO_COMMIT, &nfsi->flags))
  5703. return 1;
  5704. - if (may_wait && !out_of_line_wait_on_bit_lock(&nfsi->flags,
  5705. - NFS_INO_COMMIT, nfs_wait_bit_killable,
  5706. - TASK_KILLABLE))
  5707. - return 1;
  5708. - return 0;
  5709. + if (!may_wait)
  5710. + return 0;
  5711. + ret = out_of_line_wait_on_bit_lock(&nfsi->flags,
  5712. + NFS_INO_COMMIT,
  5713. + nfs_wait_bit_killable,
  5714. + TASK_KILLABLE);
  5715. + return (ret < 0) ? ret : 1;
  5716. }
  5717.  
  5718. static void nfs_commit_clear_lock(struct nfs_inode *nfsi)
  5719. @@ -1463,9 +1467,10 @@ int nfs_commit_inode(struct inode *inode
  5720. pgoff_t first_index;
  5721. pgoff_t last_index;
  5722. int may_wait = how & FLUSH_SYNC;
  5723. - int res = 0;
  5724. + int res;
  5725.  
  5726. - if (!nfs_commit_set_lock(NFS_I(inode), may_wait))
  5727. + res = nfs_commit_set_lock(NFS_I(inode), may_wait);
  5728. + if (res <= 0)
  5729. goto out_mark_dirty;
  5730. spin_lock(&inode->i_lock);
  5731. res = nfs_scan_commit(inode, &head, 0, 0);
  5732. @@ -1479,12 +1484,14 @@ int nfs_commit_inode(struct inode *inode
  5733. last_index - first_index + 1);
  5734. if (error < 0)
  5735. return error;
  5736. - if (may_wait)
  5737. - wait_on_bit(&NFS_I(inode)->flags, NFS_INO_COMMIT,
  5738. - nfs_wait_bit_killable,
  5739. - TASK_KILLABLE);
  5740. - else
  5741. + if (!may_wait)
  5742. goto out_mark_dirty;
  5743. + error = wait_on_bit(&NFS_I(inode)->flags,
  5744. + NFS_INO_COMMIT,
  5745. + nfs_wait_bit_killable,
  5746. + TASK_KILLABLE);
  5747. + if (error < 0)
  5748. + return error;
  5749. } else
  5750. nfs_commit_clear_lock(NFS_I(inode));
  5751. return res;
  5752. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4proc.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4proc.c
  5753. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4proc.c 2011-04-01 17:56:57.483710688 +0200
  5754. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4proc.c 2011-04-02 01:38:34.976688311 +0200
  5755. @@ -954,8 +954,8 @@ typedef __be32(*nfsd4op_func)(struct svc
  5756. void *);
  5757. enum nfsd4_op_flags {
  5758. ALLOWED_WITHOUT_FH = 1 << 0, /* No current filehandle required */
  5759. - ALLOWED_ON_ABSENT_FS = 2 << 0, /* ops processed on absent fs */
  5760. - ALLOWED_AS_FIRST_OP = 3 << 0, /* ops reqired first in compound */
  5761. + ALLOWED_ON_ABSENT_FS = 1 << 1, /* ops processed on absent fs */
  5762. + ALLOWED_AS_FIRST_OP = 1 << 2, /* ops reqired first in compound */
  5763. };
  5764.  
  5765. struct nfsd4_operation {
  5766. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4state.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4state.c
  5767. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4state.c 2011-04-01 17:56:57.483710688 +0200
  5768. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4state.c 2011-04-02 01:38:34.978688310 +0200
  5769. @@ -327,64 +327,6 @@ static struct list_head unconf_id_hashtb
  5770. static struct list_head client_lru;
  5771. static struct list_head close_lru;
  5772.  
  5773. -static void unhash_generic_stateid(struct nfs4_stateid *stp)
  5774. -{
  5775. - list_del(&stp->st_hash);
  5776. - list_del(&stp->st_perfile);
  5777. - list_del(&stp->st_perstateowner);
  5778. -}
  5779. -
  5780. -static void free_generic_stateid(struct nfs4_stateid *stp)
  5781. -{
  5782. - put_nfs4_file(stp->st_file);
  5783. - kmem_cache_free(stateid_slab, stp);
  5784. -}
  5785. -
  5786. -static void release_lock_stateid(struct nfs4_stateid *stp)
  5787. -{
  5788. - struct file *file;
  5789. -
  5790. - unhash_generic_stateid(stp);
  5791. - file = find_any_file(stp->st_file);
  5792. - if (file)
  5793. - locks_remove_posix(file, (fl_owner_t)stp->st_stateowner);
  5794. - free_generic_stateid(stp);
  5795. -}
  5796. -
  5797. -static void unhash_lockowner(struct nfs4_stateowner *sop)
  5798. -{
  5799. - struct nfs4_stateid *stp;
  5800. -
  5801. - list_del(&sop->so_idhash);
  5802. - list_del(&sop->so_strhash);
  5803. - list_del(&sop->so_perstateid);
  5804. - while (!list_empty(&sop->so_stateids)) {
  5805. - stp = list_first_entry(&sop->so_stateids,
  5806. - struct nfs4_stateid, st_perstateowner);
  5807. - release_lock_stateid(stp);
  5808. - }
  5809. -}
  5810. -
  5811. -static void release_lockowner(struct nfs4_stateowner *sop)
  5812. -{
  5813. - unhash_lockowner(sop);
  5814. - nfs4_put_stateowner(sop);
  5815. -}
  5816. -
  5817. -static void
  5818. -release_stateid_lockowners(struct nfs4_stateid *open_stp)
  5819. -{
  5820. - struct nfs4_stateowner *lock_sop;
  5821. -
  5822. - while (!list_empty(&open_stp->st_lockowners)) {
  5823. - lock_sop = list_entry(open_stp->st_lockowners.next,
  5824. - struct nfs4_stateowner, so_perstateid);
  5825. - /* list_del(&open_stp->st_lockowners); */
  5826. - BUG_ON(lock_sop->so_is_open_owner);
  5827. - release_lockowner(lock_sop);
  5828. - }
  5829. -}
  5830. -
  5831. /*
  5832. * We store the NONE, READ, WRITE, and BOTH bits separately in the
  5833. * st_{access,deny}_bmap field of the stateid, in order to track not
  5834. @@ -457,13 +399,71 @@ static int nfs4_access_bmap_to_omode(str
  5835. return nfs4_access_to_omode(access);
  5836. }
  5837.  
  5838. -static void release_open_stateid(struct nfs4_stateid *stp)
  5839. +static void unhash_generic_stateid(struct nfs4_stateid *stp)
  5840. +{
  5841. + list_del(&stp->st_hash);
  5842. + list_del(&stp->st_perfile);
  5843. + list_del(&stp->st_perstateowner);
  5844. +}
  5845. +
  5846. +static void free_generic_stateid(struct nfs4_stateid *stp)
  5847. {
  5848. int oflag = nfs4_access_bmap_to_omode(stp);
  5849.  
  5850. + nfs4_file_put_access(stp->st_file, oflag);
  5851. + put_nfs4_file(stp->st_file);
  5852. + kmem_cache_free(stateid_slab, stp);
  5853. +}
  5854. +
  5855. +static void release_lock_stateid(struct nfs4_stateid *stp)
  5856. +{
  5857. + struct file *file;
  5858. +
  5859. + unhash_generic_stateid(stp);
  5860. + file = find_any_file(stp->st_file);
  5861. + if (file)
  5862. + locks_remove_posix(file, (fl_owner_t)stp->st_stateowner);
  5863. + free_generic_stateid(stp);
  5864. +}
  5865. +
  5866. +static void unhash_lockowner(struct nfs4_stateowner *sop)
  5867. +{
  5868. + struct nfs4_stateid *stp;
  5869. +
  5870. + list_del(&sop->so_idhash);
  5871. + list_del(&sop->so_strhash);
  5872. + list_del(&sop->so_perstateid);
  5873. + while (!list_empty(&sop->so_stateids)) {
  5874. + stp = list_first_entry(&sop->so_stateids,
  5875. + struct nfs4_stateid, st_perstateowner);
  5876. + release_lock_stateid(stp);
  5877. + }
  5878. +}
  5879. +
  5880. +static void release_lockowner(struct nfs4_stateowner *sop)
  5881. +{
  5882. + unhash_lockowner(sop);
  5883. + nfs4_put_stateowner(sop);
  5884. +}
  5885. +
  5886. +static void
  5887. +release_stateid_lockowners(struct nfs4_stateid *open_stp)
  5888. +{
  5889. + struct nfs4_stateowner *lock_sop;
  5890. +
  5891. + while (!list_empty(&open_stp->st_lockowners)) {
  5892. + lock_sop = list_entry(open_stp->st_lockowners.next,
  5893. + struct nfs4_stateowner, so_perstateid);
  5894. + /* list_del(&open_stp->st_lockowners); */
  5895. + BUG_ON(lock_sop->so_is_open_owner);
  5896. + release_lockowner(lock_sop);
  5897. + }
  5898. +}
  5899. +
  5900. +static void release_open_stateid(struct nfs4_stateid *stp)
  5901. +{
  5902. unhash_generic_stateid(stp);
  5903. release_stateid_lockowners(stp);
  5904. - nfs4_file_put_access(stp->st_file, oflag);
  5905. free_generic_stateid(stp);
  5906. }
  5907.  
  5908. @@ -3661,6 +3661,7 @@ alloc_init_lock_stateid(struct nfs4_stat
  5909. stp->st_stateid.si_stateownerid = sop->so_id;
  5910. stp->st_stateid.si_fileid = fp->fi_id;
  5911. stp->st_stateid.si_generation = 0;
  5912. + stp->st_access_bmap = 0;
  5913. stp->st_deny_bmap = open_stp->st_deny_bmap;
  5914. stp->st_openstp = open_stp;
  5915.  
  5916. @@ -3675,6 +3676,17 @@ check_lock_length(u64 offset, u64 length
  5917. LOFF_OVERFLOW(offset, length)));
  5918. }
  5919.  
  5920. +static void get_lock_access(struct nfs4_stateid *lock_stp, u32 access)
  5921. +{
  5922. + struct nfs4_file *fp = lock_stp->st_file;
  5923. + int oflag = nfs4_access_to_omode(access);
  5924. +
  5925. + if (test_bit(access, &lock_stp->st_access_bmap))
  5926. + return;
  5927. + nfs4_file_get_access(fp, oflag);
  5928. + __set_bit(access, &lock_stp->st_access_bmap);
  5929. +}
  5930. +
  5931. /*
  5932. * LOCK operation
  5933. */
  5934. @@ -3691,7 +3703,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struc
  5935. struct file_lock conflock;
  5936. __be32 status = 0;
  5937. unsigned int strhashval;
  5938. - unsigned int cmd;
  5939. int err;
  5940.  
  5941. dprintk("NFSD: nfsd4_lock: start=%Ld length=%Ld\n",
  5942. @@ -3773,22 +3784,18 @@ nfsd4_lock(struct svc_rqst *rqstp, struc
  5943. switch (lock->lk_type) {
  5944. case NFS4_READ_LT:
  5945. case NFS4_READW_LT:
  5946. - if (find_readable_file(lock_stp->st_file)) {
  5947. - nfs4_get_vfs_file(rqstp, fp, &cstate->current_fh, NFS4_SHARE_ACCESS_READ);
  5948. - filp = find_readable_file(lock_stp->st_file);
  5949. - }
  5950. + filp = find_readable_file(lock_stp->st_file);
  5951. + if (filp)
  5952. + get_lock_access(lock_stp, NFS4_SHARE_ACCESS_READ);
  5953. file_lock.fl_type = F_RDLCK;
  5954. - cmd = F_SETLK;
  5955. - break;
  5956. + break;
  5957. case NFS4_WRITE_LT:
  5958. case NFS4_WRITEW_LT:
  5959. - if (find_writeable_file(lock_stp->st_file)) {
  5960. - nfs4_get_vfs_file(rqstp, fp, &cstate->current_fh, NFS4_SHARE_ACCESS_WRITE);
  5961. - filp = find_writeable_file(lock_stp->st_file);
  5962. - }
  5963. + filp = find_writeable_file(lock_stp->st_file);
  5964. + if (filp)
  5965. + get_lock_access(lock_stp, NFS4_SHARE_ACCESS_WRITE);
  5966. file_lock.fl_type = F_WRLCK;
  5967. - cmd = F_SETLK;
  5968. - break;
  5969. + break;
  5970. default:
  5971. status = nfserr_inval;
  5972. goto out;
  5973. @@ -3812,7 +3819,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struc
  5974. * Note: locks.c uses the BKL to protect the inode's lock list.
  5975. */
  5976.  
  5977. - err = vfs_lock_file(filp, cmd, &file_lock, &conflock);
  5978. + err = vfs_lock_file(filp, F_SETLK, &file_lock, &conflock);
  5979. switch (-err) {
  5980. case 0: /* success! */
  5981. update_stateid(&lock_stp->st_stateid);
  5982. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4xdr.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4xdr.c
  5983. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4xdr.c 2011-04-01 17:56:57.484710688 +0200
  5984. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nfsd/nfs4xdr.c 2011-04-02 01:38:34.978688311 +0200
  5985. @@ -1180,8 +1180,6 @@ nfsd4_decode_create_session(struct nfsd4
  5986. READ_BUF(4);
  5987. READ32(dummy);
  5988. READ_BUF(dummy * 4);
  5989. - for (i = 0; i < dummy; ++i)
  5990. - READ32(dummy);
  5991. break;
  5992. case RPC_AUTH_GSS:
  5993. dprintk("RPC_AUTH_GSS callback secflavor "
  5994. @@ -1197,7 +1195,6 @@ nfsd4_decode_create_session(struct nfsd4
  5995. READ_BUF(4);
  5996. READ32(dummy);
  5997. READ_BUF(dummy);
  5998. - p += XDR_QUADLEN(dummy);
  5999. break;
  6000. default:
  6001. dprintk("Illegal callback secflavor\n");
  6002. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nilfs2/segment.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nilfs2/segment.c
  6003. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nilfs2/segment.c 2011-04-01 17:56:57.485710688 +0200
  6004. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/nilfs2/segment.c 2011-04-02 01:37:43.713688353 +0200
  6005. @@ -430,7 +430,8 @@ static void nilfs_segctor_begin_finfo(st
  6006. nilfs_segctor_map_segsum_entry(
  6007. sci, &sci->sc_binfo_ptr, sizeof(struct nilfs_finfo));
  6008.  
  6009. - if (inode->i_sb && !test_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags))
  6010. + if (NILFS_I(inode)->i_root &&
  6011. + !test_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags))
  6012. set_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags);
  6013. /* skip finfo */
  6014. }
  6015. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ocfs2/refcounttree.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ocfs2/refcounttree.c
  6016. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ocfs2/refcounttree.c 2011-04-01 17:56:57.431710687 +0200
  6017. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ocfs2/refcounttree.c 2011-04-02 01:37:43.649688352 +0200
  6018. @@ -3228,7 +3228,7 @@ static int ocfs2_make_clusters_writable(
  6019. u32 num_clusters, unsigned int e_flags)
  6020. {
  6021. int ret, delete, index, credits = 0;
  6022. - u32 new_bit, new_len;
  6023. + u32 new_bit, new_len, orig_num_clusters;
  6024. unsigned int set_len;
  6025. struct ocfs2_super *osb = OCFS2_SB(sb);
  6026. handle_t *handle;
  6027. @@ -3261,6 +3261,8 @@ static int ocfs2_make_clusters_writable(
  6028. goto out;
  6029. }
  6030.  
  6031. + orig_num_clusters = num_clusters;
  6032. +
  6033. while (num_clusters) {
  6034. ret = ocfs2_get_refcount_rec(ref_ci, context->ref_root_bh,
  6035. p_cluster, num_clusters,
  6036. @@ -3348,7 +3350,8 @@ static int ocfs2_make_clusters_writable(
  6037. * in write-back mode.
  6038. */
  6039. if (context->get_clusters == ocfs2_di_get_clusters) {
  6040. - ret = ocfs2_cow_sync_writeback(sb, context, cpos, num_clusters);
  6041. + ret = ocfs2_cow_sync_writeback(sb, context, cpos,
  6042. + orig_num_clusters);
  6043. if (ret)
  6044. mlog_errno(ret);
  6045. }
  6046. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ocfs2/super.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ocfs2/super.c
  6047. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ocfs2/super.c 2011-04-01 17:57:39.372710653 +0200
  6048. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/ocfs2/super.c 2011-04-02 01:37:43.650688352 +0200
  6049. @@ -1311,7 +1311,7 @@ static int ocfs2_parse_options(struct su
  6050. struct mount_options *mopt,
  6051. int is_remount)
  6052. {
  6053. - int status;
  6054. + int status, user_stack = 0;
  6055. char *p;
  6056. u32 tmp;
  6057.  
  6058. @@ -1454,6 +1454,15 @@ static int ocfs2_parse_options(struct su
  6059. memcpy(mopt->cluster_stack, args[0].from,
  6060. OCFS2_STACK_LABEL_LEN);
  6061. mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0';
  6062. + /*
  6063. + * Open code the memcmp here as we don't have
  6064. + * an osb to pass to
  6065. + * ocfs2_userspace_stack().
  6066. + */
  6067. + if (memcmp(mopt->cluster_stack,
  6068. + OCFS2_CLASSIC_CLUSTER_STACK,
  6069. + OCFS2_STACK_LABEL_LEN))
  6070. + user_stack = 1;
  6071. break;
  6072. case Opt_inode64:
  6073. mopt->mount_opt |= OCFS2_MOUNT_INODE64;
  6074. @@ -1509,13 +1518,16 @@ static int ocfs2_parse_options(struct su
  6075. }
  6076. }
  6077.  
  6078. - /* Ensure only one heartbeat mode */
  6079. - tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL | OCFS2_MOUNT_HB_GLOBAL |
  6080. - OCFS2_MOUNT_HB_NONE);
  6081. - if (hweight32(tmp) != 1) {
  6082. - mlog(ML_ERROR, "Invalid heartbeat mount options\n");
  6083. - status = 0;
  6084. - goto bail;
  6085. + if (user_stack == 0) {
  6086. + /* Ensure only one heartbeat mode */
  6087. + tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL |
  6088. + OCFS2_MOUNT_HB_GLOBAL |
  6089. + OCFS2_MOUNT_HB_NONE);
  6090. + if (hweight32(tmp) != 1) {
  6091. + mlog(ML_ERROR, "Invalid heartbeat mount options\n");
  6092. + status = 0;
  6093. + goto bail;
  6094. + }
  6095. }
  6096.  
  6097. status = 1;
  6098. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/partitions/ldm.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/partitions/ldm.c
  6099. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/partitions/ldm.c 2011-04-01 17:56:57.504710688 +0200
  6100. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/partitions/ldm.c 2011-04-02 01:37:43.748688353 +0200
  6101. @@ -251,6 +251,11 @@ static bool ldm_parse_vmdb (const u8 *da
  6102. }
  6103.  
  6104. vm->vblk_size = get_unaligned_be32(data + 0x08);
  6105. + if (vm->vblk_size == 0) {
  6106. + ldm_error ("Illegal VBLK size");
  6107. + return false;
  6108. + }
  6109. +
  6110. vm->vblk_offset = get_unaligned_be32(data + 0x0C);
  6111. vm->last_vblk_seq = get_unaligned_be32(data + 0x04);
  6112.  
  6113. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/partitions/osf.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/partitions/osf.c
  6114. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/partitions/osf.c 2011-04-01 17:56:57.504710688 +0200
  6115. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/partitions/osf.c 2011-04-02 01:37:43.748688353 +0200
  6116. @@ -10,10 +10,13 @@
  6117. #include "check.h"
  6118. #include "osf.h"
  6119.  
  6120. +#define MAX_OSF_PARTITIONS 18
  6121. +
  6122. int osf_partition(struct parsed_partitions *state)
  6123. {
  6124. int i;
  6125. int slot = 1;
  6126. + unsigned int npartitions;
  6127. Sector sect;
  6128. unsigned char *data;
  6129. struct disklabel {
  6130. @@ -45,7 +48,7 @@ int osf_partition(struct parsed_partitio
  6131. u8 p_fstype;
  6132. u8 p_frag;
  6133. __le16 p_cpg;
  6134. - } d_partitions[8];
  6135. + } d_partitions[MAX_OSF_PARTITIONS];
  6136. } * label;
  6137. struct d_partition * partition;
  6138.  
  6139. @@ -63,7 +66,12 @@ int osf_partition(struct parsed_partitio
  6140. put_dev_sector(sect);
  6141. return 0;
  6142. }
  6143. - for (i = 0 ; i < le16_to_cpu(label->d_npartitions); i++, partition++) {
  6144. + npartitions = le16_to_cpu(label->d_npartitions);
  6145. + if (npartitions > MAX_OSF_PARTITIONS) {
  6146. + put_dev_sector(sect);
  6147. + return 0;
  6148. + }
  6149. + for (i = 0 ; i < npartitions; i++, partition++) {
  6150. if (slot == state->limit)
  6151. break;
  6152. if (le32_to_cpu(partition->p_size))
  6153. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/proc/array.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/proc/array.c
  6154. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/proc/array.c 2011-04-01 17:56:57.453710688 +0200
  6155. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/proc/array.c 2011-04-02 01:38:34.978688311 +0200
  6156. @@ -489,8 +489,8 @@ static int do_task_stat(struct seq_file
  6157. vsize,
  6158. mm ? get_mm_rss(mm) : 0,
  6159. rsslim,
  6160. - mm ? mm->start_code : 0,
  6161. - mm ? mm->end_code : 0,
  6162. + mm ? (permitted ? mm->start_code : 1) : 0,
  6163. + mm ? (permitted ? mm->end_code : 1) : 0,
  6164. (permitted && mm) ? mm->start_stack : 0,
  6165. esp,
  6166. eip,
  6167. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/proc/task_mmu.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/proc/task_mmu.c
  6168. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/proc/task_mmu.c 2011-04-01 17:56:57.448710688 +0200
  6169. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/proc/task_mmu.c 2011-04-02 01:38:34.979688312 +0200
  6170. @@ -248,8 +248,8 @@ static void show_map_vma(struct seq_file
  6171. const char *name = arch_vma_name(vma);
  6172. if (!name) {
  6173. if (mm) {
  6174. - if (vma->vm_start <= mm->start_brk &&
  6175. - vma->vm_end >= mm->brk) {
  6176. + if (vma->vm_start <= mm->brk &&
  6177. + vma->vm_end >= mm->start_brk) {
  6178. name = "[heap]";
  6179. } else if (vma->vm_start <= mm->start_stack &&
  6180. vma->vm_end >= mm->start_stack) {
  6181. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/super.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/super.c
  6182. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/super.c 2011-04-01 17:57:39.433710654 +0200
  6183. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/super.c 2011-04-02 01:38:34.979688312 +0200
  6184. @@ -71,6 +71,7 @@ static struct super_block *alloc_super(s
  6185. #else
  6186. INIT_LIST_HEAD(&s->s_files);
  6187. #endif
  6188. + s->s_bdi = &default_backing_dev_info;
  6189. INIT_LIST_HEAD(&s->s_instances);
  6190. INIT_HLIST_HEAD(&s->s_anon);
  6191. INIT_LIST_HEAD(&s->s_inodes);
  6192. @@ -999,6 +1000,7 @@ vfs_kern_mount(struct file_system_type *
  6193. }
  6194. BUG_ON(!mnt->mnt_sb);
  6195. WARN_ON(!mnt->mnt_sb->s_bdi);
  6196. + WARN_ON(mnt->mnt_sb->s_bdi == &default_backing_dev_info);
  6197. mnt->mnt_sb->s_flags |= MS_BORN;
  6198.  
  6199. error = security_sb_kern_mount(mnt->mnt_sb, flags, secdata);
  6200. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/sync.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/sync.c
  6201. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/sync.c 2011-04-01 17:57:39.434710654 +0200
  6202. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//fs/sync.c 2011-04-02 01:38:34.979688312 +0200
  6203. @@ -33,7 +33,7 @@ static int __sync_filesystem(struct supe
  6204. * This should be safe, as we require bdi backing to actually
  6205. * write out data in the first place
  6206. */
  6207. - if (!sb->s_bdi || sb->s_bdi == &noop_backing_dev_info)
  6208. + if (sb->s_bdi == &noop_backing_dev_info)
  6209. return 0;
  6210.  
  6211. if (sb->s_qcop && sb->s_qcop->quota_sync)
  6212. @@ -79,7 +79,7 @@ EXPORT_SYMBOL_GPL(sync_filesystem);
  6213.  
  6214. static void sync_one_sb(struct super_block *sb, void *arg)
  6215. {
  6216. - if (!(sb->s_flags & MS_RDONLY) && sb->s_bdi)
  6217. + if (!(sb->s_flags & MS_RDONLY))
  6218. __sync_filesystem(sb, *(int *)arg);
  6219. }
  6220. /*
  6221. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/drm/drmP.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/drm/drmP.h
  6222. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/drm/drmP.h 2011-04-01 17:56:57.240710686 +0200
  6223. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/drm/drmP.h 2011-04-02 01:37:43.256688354 +0200
  6224. @@ -1022,7 +1022,7 @@ struct drm_device {
  6225. struct platform_device *platformdev; /**< Platform device struture */
  6226.  
  6227. struct drm_sg_mem *sg; /**< Scatter gather memory */
  6228. - int num_crtcs; /**< Number of CRTCs on this device */
  6229. + unsigned int num_crtcs; /**< Number of CRTCs on this device */
  6230. void *dev_private; /**< device private data */
  6231. void *mm_private;
  6232. struct address_space *dev_mapping;
  6233. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/keys/rxrpc-type.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/keys/rxrpc-type.h
  6234. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/keys/rxrpc-type.h 2011-04-01 17:56:57.241710686 +0200
  6235. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/keys/rxrpc-type.h 2011-04-02 01:37:43.261688354 +0200
  6236. @@ -99,7 +99,6 @@ struct rxrpc_key_token {
  6237. * structure of raw payloads passed to add_key() or instantiate key
  6238. */
  6239. struct rxrpc_key_data_v1 {
  6240. - u32 kif_version; /* 1 */
  6241. u16 security_index;
  6242. u16 ticket_length;
  6243. u32 expiry; /* time_t */
  6244. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/blkdev.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/blkdev.h
  6245. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/blkdev.h 2011-04-01 17:56:57.278710688 +0200
  6246. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/blkdev.h 2011-04-02 01:37:43.370688353 +0200
  6247. @@ -700,7 +700,7 @@ extern void blk_start_queue(struct reque
  6248. extern void blk_stop_queue(struct request_queue *q);
  6249. extern void blk_sync_queue(struct request_queue *q);
  6250. extern void __blk_stop_queue(struct request_queue *q);
  6251. -extern void __blk_run_queue(struct request_queue *);
  6252. +extern void __blk_run_queue(struct request_queue *q, bool force_kblockd);
  6253. extern void blk_run_queue(struct request_queue *);
  6254. extern int blk_rq_map_user(struct request_queue *, struct request *,
  6255. struct rq_map_data *, void __user *, unsigned long,
  6256. @@ -1089,7 +1089,6 @@ static inline void put_dev_sector(Sector
  6257.  
  6258. struct work_struct;
  6259. int kblockd_schedule_work(struct request_queue *q, struct work_struct *work);
  6260. -int kblockd_schedule_delayed_work(struct request_queue *q, struct delayed_work *dwork, unsigned long delay);
  6261.  
  6262. #ifdef CONFIG_BLK_CGROUP
  6263. /*
  6264. @@ -1137,7 +1136,6 @@ static inline uint64_t rq_io_start_time_
  6265. extern int blk_throtl_init(struct request_queue *q);
  6266. extern void blk_throtl_exit(struct request_queue *q);
  6267. extern int blk_throtl_bio(struct request_queue *q, struct bio **bio);
  6268. -extern void throtl_schedule_delayed_work(struct request_queue *q, unsigned long delay);
  6269. extern void throtl_shutdown_timer_wq(struct request_queue *q);
  6270. #else /* CONFIG_BLK_DEV_THROTTLING */
  6271. static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio)
  6272. @@ -1147,7 +1145,6 @@ static inline int blk_throtl_bio(struct
  6273.  
  6274. static inline int blk_throtl_init(struct request_queue *q) { return 0; }
  6275. static inline int blk_throtl_exit(struct request_queue *q) { return 0; }
  6276. -static inline void throtl_schedule_delayed_work(struct request_queue *q, unsigned long delay) {}
  6277. static inline void throtl_shutdown_timer_wq(struct request_queue *q) {}
  6278. #endif /* CONFIG_BLK_DEV_THROTTLING */
  6279.  
  6280. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/ethtool.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/ethtool.h
  6281. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/ethtool.h 2011-04-01 17:56:57.276710688 +0200
  6282. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/ethtool.h 2011-04-02 01:38:34.980688312 +0200
  6283. @@ -13,6 +13,9 @@
  6284. #ifndef _LINUX_ETHTOOL_H
  6285. #define _LINUX_ETHTOOL_H
  6286.  
  6287. +#ifdef __KERNEL__
  6288. +#include <linux/compat.h>
  6289. +#endif
  6290. #include <linux/types.h>
  6291. #include <linux/if_ether.h>
  6292.  
  6293. @@ -449,6 +452,37 @@ struct ethtool_rxnfc {
  6294. __u32 rule_locs[0];
  6295. };
  6296.  
  6297. +#ifdef __KERNEL__
  6298. +#ifdef CONFIG_COMPAT
  6299. +
  6300. +struct compat_ethtool_rx_flow_spec {
  6301. + u32 flow_type;
  6302. + union {
  6303. + struct ethtool_tcpip4_spec tcp_ip4_spec;
  6304. + struct ethtool_tcpip4_spec udp_ip4_spec;
  6305. + struct ethtool_tcpip4_spec sctp_ip4_spec;
  6306. + struct ethtool_ah_espip4_spec ah_ip4_spec;
  6307. + struct ethtool_ah_espip4_spec esp_ip4_spec;
  6308. + struct ethtool_usrip4_spec usr_ip4_spec;
  6309. + struct ethhdr ether_spec;
  6310. + u8 hdata[72];
  6311. + } h_u, m_u;
  6312. + compat_u64 ring_cookie;
  6313. + u32 location;
  6314. +};
  6315. +
  6316. +struct compat_ethtool_rxnfc {
  6317. + u32 cmd;
  6318. + u32 flow_type;
  6319. + compat_u64 data;
  6320. + struct compat_ethtool_rx_flow_spec fs;
  6321. + u32 rule_cnt;
  6322. + u32 rule_locs[0];
  6323. +};
  6324. +
  6325. +#endif /* CONFIG_COMPAT */
  6326. +#endif /* __KERNEL__ */
  6327. +
  6328. /**
  6329. * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
  6330. * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
  6331. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/fs.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/fs.h
  6332. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/fs.h 2011-04-01 17:57:39.439710654 +0200
  6333. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/fs.h 2011-04-02 01:37:43.368688353 +0200
  6334. @@ -2142,7 +2142,7 @@ extern void check_disk_size_change(struc
  6335. struct block_device *bdev);
  6336. extern int revalidate_disk(struct gendisk *);
  6337. extern int check_disk_change(struct block_device *);
  6338. -extern int __invalidate_device(struct block_device *);
  6339. +extern int __invalidate_device(struct block_device *, bool);
  6340. extern int invalidate_partition(struct gendisk *, int);
  6341. #endif
  6342. unsigned long invalidate_mapping_pages(struct address_space *mapping,
  6343. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/ftrace.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/ftrace.h
  6344. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/ftrace.h 2011-04-01 17:56:57.282710688 +0200
  6345. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/ftrace.h 2011-04-02 01:37:43.376688352 +0200
  6346. @@ -428,6 +428,7 @@ extern void unregister_ftrace_graph(void
  6347.  
  6348. extern void ftrace_graph_init_task(struct task_struct *t);
  6349. extern void ftrace_graph_exit_task(struct task_struct *t);
  6350. +extern void ftrace_graph_init_idle_task(struct task_struct *t, int cpu);
  6351.  
  6352. static inline int task_curr_ret_stack(struct task_struct *t)
  6353. {
  6354. @@ -451,6 +452,7 @@ static inline void unpause_graph_tracing
  6355.  
  6356. static inline void ftrace_graph_init_task(struct task_struct *t) { }
  6357. static inline void ftrace_graph_exit_task(struct task_struct *t) { }
  6358. +static inline void ftrace_graph_init_idle_task(struct task_struct *t, int cpu) { }
  6359.  
  6360. static inline int register_ftrace_graph(trace_func_graph_ret_t retfunc,
  6361. trace_func_graph_ent_t entryfunc)
  6362. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/netdevice.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/netdevice.h
  6363. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/netdevice.h 2011-04-01 17:56:57.245710686 +0200
  6364. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/netdevice.h 2011-04-02 01:37:43.267688354 +0200
  6365. @@ -2336,6 +2336,9 @@ extern int netdev_notice(const struct ne
  6366. extern int netdev_info(const struct net_device *dev, const char *format, ...)
  6367. __attribute__ ((format (printf, 2, 3)));
  6368.  
  6369. +#define MODULE_ALIAS_NETDEV(device) \
  6370. + MODULE_ALIAS("netdev-" device)
  6371. +
  6372. #if defined(DEBUG)
  6373. #define netdev_dbg(__dev, format, args...) \
  6374. netdev_printk(KERN_DEBUG, __dev, format, ##args)
  6375. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/pm.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/pm.h
  6376. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/pm.h 2011-04-01 17:56:57.268710688 +0200
  6377. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/pm.h 2011-04-02 01:37:43.304688352 +0200
  6378. @@ -470,6 +470,8 @@ struct dev_pm_info {
  6379. struct list_head entry;
  6380. struct completion completion;
  6381. struct wakeup_source *wakeup;
  6382. +#else
  6383. + unsigned int should_wakeup:1;
  6384. #endif
  6385. #ifdef CONFIG_PM_RUNTIME
  6386. struct timer_list suspend_timer;
  6387. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/pm_wakeup.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/pm_wakeup.h
  6388. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/pm_wakeup.h 2011-04-01 17:56:57.282710688 +0200
  6389. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/pm_wakeup.h 2011-04-02 01:37:43.377688352 +0200
  6390. @@ -109,11 +109,6 @@ static inline bool device_can_wakeup(str
  6391. return dev->power.can_wakeup;
  6392. }
  6393.  
  6394. -static inline bool device_may_wakeup(struct device *dev)
  6395. -{
  6396. - return false;
  6397. -}
  6398. -
  6399. static inline struct wakeup_source *wakeup_source_create(const char *name)
  6400. {
  6401. return NULL;
  6402. @@ -134,24 +129,32 @@ static inline void wakeup_source_unregis
  6403.  
  6404. static inline int device_wakeup_enable(struct device *dev)
  6405. {
  6406. - return -EINVAL;
  6407. + dev->power.should_wakeup = true;
  6408. + return 0;
  6409. }
  6410.  
  6411. static inline int device_wakeup_disable(struct device *dev)
  6412. {
  6413. + dev->power.should_wakeup = false;
  6414. return 0;
  6415. }
  6416.  
  6417. -static inline int device_init_wakeup(struct device *dev, bool val)
  6418. +static inline int device_set_wakeup_enable(struct device *dev, bool enable)
  6419. {
  6420. - dev->power.can_wakeup = val;
  6421. - return val ? -EINVAL : 0;
  6422. + dev->power.should_wakeup = enable;
  6423. + return 0;
  6424. }
  6425.  
  6426. +static inline int device_init_wakeup(struct device *dev, bool val)
  6427. +{
  6428. + device_set_wakeup_capable(dev, val);
  6429. + device_set_wakeup_enable(dev, val);
  6430. + return 0;
  6431. +}
  6432.  
  6433. -static inline int device_set_wakeup_enable(struct device *dev, bool enable)
  6434. +static inline bool device_may_wakeup(struct device *dev)
  6435. {
  6436. - return -EINVAL;
  6437. + return dev->power.can_wakeup && dev->power.should_wakeup;
  6438. }
  6439.  
  6440. static inline void __pm_stay_awake(struct wakeup_source *ws) {}
  6441. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/ch9.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/ch9.h
  6442. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/ch9.h 2011-04-01 17:56:57.272710688 +0200
  6443. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/ch9.h 2011-04-02 01:37:43.320688354 +0200
  6444. @@ -575,6 +575,8 @@ struct usb_ss_ep_comp_descriptor {
  6445. #define USB_DT_SS_EP_COMP_SIZE 6
  6446. /* Bits 4:0 of bmAttributes if this is a bulk endpoint */
  6447. #define USB_SS_MAX_STREAMS(p) (1 << (p & 0x1f))
  6448. +/* Bits 1:0 of bmAttributes if this is an isoc endpoint */
  6449. +#define USB_SS_MULT(p) (1 + ((p) & 0x3))
  6450.  
  6451. /*-------------------------------------------------------------------------*/
  6452.  
  6453. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/hcd.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/hcd.h
  6454. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/hcd.h 2011-04-01 17:56:57.273710688 +0200
  6455. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/hcd.h 2011-04-02 01:37:43.365688353 +0200
  6456. @@ -99,6 +99,8 @@ struct usb_hcd {
  6457. #define HCD_FLAG_POLL_RH 2 /* poll for rh status? */
  6458. #define HCD_FLAG_POLL_PENDING 3 /* status has changed? */
  6459. #define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */
  6460. +#define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */
  6461. +#define HCD_FLAG_DEAD 6 /* controller has died? */
  6462.  
  6463. /* The flags can be tested using these macros; they are likely to
  6464. * be slightly faster than test_bit().
  6465. @@ -108,6 +110,8 @@ struct usb_hcd {
  6466. #define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH))
  6467. #define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING))
  6468. #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING))
  6469. +#define HCD_RH_RUNNING(hcd) ((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING))
  6470. +#define HCD_DEAD(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEAD))
  6471.  
  6472. /* Flags that get set only during HCD registration or removal. */
  6473. unsigned rh_registered:1;/* is root hub registered? */
  6474. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/serial.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/serial.h
  6475. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/serial.h 2011-04-01 17:56:57.273710688 +0200
  6476. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//include/linux/usb/serial.h 2011-04-02 01:37:43.320688354 +0200
  6477. @@ -191,7 +191,8 @@ static inline void usb_set_serial_data(s
  6478. * @id_table: pointer to a list of usb_device_id structures that define all
  6479. * of the devices this structure can support.
  6480. * @num_ports: the number of different ports this device will have.
  6481. - * @bulk_in_size: bytes to allocate for bulk-in buffer (0 = end-point size)
  6482. + * @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer
  6483. + * (0 = end-point size)
  6484. * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size)
  6485. * @calc_num_ports: pointer to a function to determine how many ports this
  6486. * device has dynamically. It will be called after the probe()
  6487. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/cgroup.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/cgroup.c
  6488. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/cgroup.c 2011-04-01 17:56:58.891710687 +0200
  6489. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/cgroup.c 2011-04-02 01:38:34.981688311 +0200
  6490. @@ -1791,10 +1791,8 @@ int cgroup_attach_task(struct cgroup *cg
  6491.  
  6492. /* Update the css_set linked lists if we're using them */
  6493. write_lock(&css_set_lock);
  6494. - if (!list_empty(&tsk->cg_list)) {
  6495. - list_del(&tsk->cg_list);
  6496. - list_add(&tsk->cg_list, &newcg->tasks);
  6497. - }
  6498. + if (!list_empty(&tsk->cg_list))
  6499. + list_move(&tsk->cg_list, &newcg->tasks);
  6500. write_unlock(&css_set_lock);
  6501.  
  6502. for_each_subsys(root, ss) {
  6503. @@ -3630,12 +3628,12 @@ again:
  6504. spin_lock(&release_list_lock);
  6505. set_bit(CGRP_REMOVED, &cgrp->flags);
  6506. if (!list_empty(&cgrp->release_list))
  6507. - list_del(&cgrp->release_list);
  6508. + list_del_init(&cgrp->release_list);
  6509. spin_unlock(&release_list_lock);
  6510.  
  6511. cgroup_lock_hierarchy(cgrp->root);
  6512. /* delete this cgroup from parent->children */
  6513. - list_del(&cgrp->sibling);
  6514. + list_del_init(&cgrp->sibling);
  6515. cgroup_unlock_hierarchy(cgrp->root);
  6516.  
  6517. spin_lock(&cgrp->dentry->d_lock);
  6518. @@ -3856,7 +3854,7 @@ void cgroup_unload_subsys(struct cgroup_
  6519. subsys[ss->subsys_id] = NULL;
  6520.  
  6521. /* remove subsystem from rootnode's list of subsystems */
  6522. - list_del(&ss->sibling);
  6523. + list_del_init(&ss->sibling);
  6524.  
  6525. /*
  6526. * disentangle the css from all css_sets attached to the dummytop. as
  6527. @@ -4230,7 +4228,7 @@ void cgroup_exit(struct task_struct *tsk
  6528. if (!list_empty(&tsk->cg_list)) {
  6529. write_lock(&css_set_lock);
  6530. if (!list_empty(&tsk->cg_list))
  6531. - list_del(&tsk->cg_list);
  6532. + list_del_init(&tsk->cg_list);
  6533. write_unlock(&css_set_lock);
  6534. }
  6535.  
  6536. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/cpuset.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/cpuset.c
  6537. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/cpuset.c 2011-04-01 17:56:58.893710687 +0200
  6538. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/cpuset.c 2011-04-02 01:37:46.875688349 +0200
  6539. @@ -1575,8 +1575,10 @@ static int cpuset_write_resmask(struct c
  6540. return -ENODEV;
  6541.  
  6542. trialcs = alloc_trial_cpuset(cs);
  6543. - if (!trialcs)
  6544. - return -ENOMEM;
  6545. + if (!trialcs) {
  6546. + retval = -ENOMEM;
  6547. + goto out;
  6548. + }
  6549.  
  6550. switch (cft->private) {
  6551. case FILE_CPULIST:
  6552. @@ -1591,6 +1593,7 @@ static int cpuset_write_resmask(struct c
  6553. }
  6554.  
  6555. free_trial_cpuset(trialcs);
  6556. +out:
  6557. cgroup_unlock();
  6558. return retval;
  6559. }
  6560. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/perf_event.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/perf_event.c
  6561. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/perf_event.c 2011-04-01 17:56:58.929710687 +0200
  6562. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/perf_event.c 2011-04-02 01:38:34.984688310 +0200
  6563. @@ -4414,7 +4414,7 @@ static int perf_exclude_event(struct per
  6564. struct pt_regs *regs)
  6565. {
  6566. if (event->hw.state & PERF_HES_STOPPED)
  6567. - return 0;
  6568. + return 1;
  6569.  
  6570. if (regs) {
  6571. if (event->attr.exclude_user && user_mode(regs))
  6572. @@ -4770,6 +4770,8 @@ static int perf_tp_event_match(struct pe
  6573. struct perf_sample_data *data,
  6574. struct pt_regs *regs)
  6575. {
  6576. + if (event->hw.state & PERF_HES_STOPPED)
  6577. + return 0;
  6578. /*
  6579. * All tracepoints are from kernel-space.
  6580. */
  6581. @@ -5861,17 +5863,20 @@ __perf_event_exit_task(struct perf_event
  6582. struct perf_event_context *child_ctx,
  6583. struct task_struct *child)
  6584. {
  6585. - struct perf_event *parent_event;
  6586. + if (child_event->parent) {
  6587. + raw_spin_lock_irq(&child_ctx->lock);
  6588. + perf_group_detach(child_event);
  6589. + raw_spin_unlock_irq(&child_ctx->lock);
  6590. + }
  6591.  
  6592. perf_event_remove_from_context(child_event);
  6593.  
  6594. - parent_event = child_event->parent;
  6595. /*
  6596. - * It can happen that parent exits first, and has events
  6597. + * It can happen that the parent exits first, and has events
  6598. * that are still around due to the child reference. These
  6599. - * events need to be zapped - but otherwise linger.
  6600. + * events need to be zapped.
  6601. */
  6602. - if (parent_event) {
  6603. + if (child_event->parent) {
  6604. sync_child_event(child_event, child);
  6605. free_event(child_event);
  6606. }
  6607. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sched.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sched.c
  6608. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sched.c 2011-04-01 17:57:39.458710654 +0200
  6609. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sched.c 2011-04-02 01:37:46.303688349 +0200
  6610. @@ -5762,7 +5762,7 @@ void __cpuinit init_idle(struct task_str
  6611. * The idle tasks have their own, simple scheduling class:
  6612. */
  6613. idle->sched_class = &idle_sched_class;
  6614. - ftrace_graph_init_task(idle);
  6615. + ftrace_graph_init_idle_task(idle, cpu);
  6616. }
  6617.  
  6618. /*
  6619. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sched_rt.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sched_rt.c
  6620. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sched_rt.c 2011-04-01 17:57:39.462710654 +0200
  6621. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sched_rt.c 2011-04-02 01:37:46.880688351 +0200
  6622. @@ -210,11 +210,12 @@ static void dequeue_rt_entity(struct sch
  6623.  
  6624. static void sched_rt_rq_enqueue(struct rt_rq *rt_rq)
  6625. {
  6626. - int this_cpu = smp_processor_id();
  6627. struct task_struct *curr = rq_of_rt_rq(rt_rq)->curr;
  6628. struct sched_rt_entity *rt_se;
  6629.  
  6630. - rt_se = rt_rq->tg->rt_se[this_cpu];
  6631. + int cpu = cpu_of(rq_of_rt_rq(rt_rq));
  6632. +
  6633. + rt_se = rt_rq->tg->rt_se[cpu];
  6634.  
  6635. if (rt_rq->rt_nr_running) {
  6636. if (rt_se && !on_rt_rq(rt_se))
  6637. @@ -226,10 +227,10 @@ static void sched_rt_rq_enqueue(struct r
  6638.  
  6639. static void sched_rt_rq_dequeue(struct rt_rq *rt_rq)
  6640. {
  6641. - int this_cpu = smp_processor_id();
  6642. struct sched_rt_entity *rt_se;
  6643. + int cpu = cpu_of(rq_of_rt_rq(rt_rq));
  6644.  
  6645. - rt_se = rt_rq->tg->rt_se[this_cpu];
  6646. + rt_se = rt_rq->tg->rt_se[cpu];
  6647.  
  6648. if (rt_se && on_rt_rq(rt_se))
  6649. dequeue_rt_entity(rt_se);
  6650. @@ -565,8 +566,11 @@ static int do_sched_rt_period_timer(stru
  6651. if (rt_rq->rt_time || rt_rq->rt_nr_running)
  6652. idle = 0;
  6653. raw_spin_unlock(&rt_rq->rt_runtime_lock);
  6654. - } else if (rt_rq->rt_nr_running)
  6655. + } else if (rt_rq->rt_nr_running) {
  6656. idle = 0;
  6657. + if (!rt_rq_throttled(rt_rq))
  6658. + enqueue = 1;
  6659. + }
  6660.  
  6661. if (enqueue)
  6662. sched_rt_rq_enqueue(rt_rq);
  6663. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/signal.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/signal.c
  6664. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/signal.c 2011-04-01 17:56:58.892710687 +0200
  6665. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/signal.c 2011-04-02 01:38:34.984688311 +0200
  6666. @@ -2421,9 +2421,13 @@ SYSCALL_DEFINE3(rt_sigqueueinfo, pid_t,
  6667. return -EFAULT;
  6668.  
  6669. /* Not even root can pretend to send signals from the kernel.
  6670. - Nor can they impersonate a kill(), which adds source info. */
  6671. - if (info.si_code >= 0)
  6672. + * Nor can they impersonate a kill()/tgkill(), which adds source info.
  6673. + */
  6674. + if (info.si_code != SI_QUEUE) {
  6675. + /* We used to allow any < 0 si_code */
  6676. + WARN_ON_ONCE(info.si_code < 0);
  6677. return -EPERM;
  6678. + }
  6679. info.si_signo = sig;
  6680.  
  6681. /* POSIX.1b doesn't mention process groups. */
  6682. @@ -2437,9 +2441,13 @@ long do_rt_tgsigqueueinfo(pid_t tgid, pi
  6683. return -EINVAL;
  6684.  
  6685. /* Not even root can pretend to send signals from the kernel.
  6686. - Nor can they impersonate a kill(), which adds source info. */
  6687. - if (info->si_code >= 0)
  6688. + * Nor can they impersonate a kill()/tgkill(), which adds source info.
  6689. + */
  6690. + if (info->si_code != SI_QUEUE) {
  6691. + /* We used to allow any < 0 si_code */
  6692. + WARN_ON_ONCE(info->si_code < 0);
  6693. return -EPERM;
  6694. + }
  6695. info->si_signo = sig;
  6696.  
  6697. return do_send_specific(tgid, pid, sig, info);
  6698. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/smp.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/smp.c
  6699. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/smp.c 2011-04-01 17:57:39.462710654 +0200
  6700. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/smp.c 2011-04-02 01:37:46.880688351 +0200
  6701. @@ -449,7 +449,7 @@ void smp_call_function_many(const struct
  6702. {
  6703. struct call_function_data *data;
  6704. unsigned long flags;
  6705. - int cpu, next_cpu, this_cpu = smp_processor_id();
  6706. + int refs, cpu, next_cpu, this_cpu = smp_processor_id();
  6707.  
  6708. /*
  6709. * Can deadlock when called with interrupts disabled.
  6710. @@ -460,7 +460,7 @@ void smp_call_function_many(const struct
  6711. WARN_ON_ONCE(cpu_online(this_cpu) && irqs_disabled()
  6712. && !oops_in_progress);
  6713.  
  6714. - /* So, what's a CPU they want? Ignoring this one. */
  6715. + /* Try to fastpath. So, what's a CPU they want? Ignoring this one. */
  6716. cpu = cpumask_first_and(mask, cpu_online_mask);
  6717. if (cpu == this_cpu)
  6718. cpu = cpumask_next_and(cpu, mask, cpu_online_mask);
  6719. @@ -482,22 +482,49 @@ void smp_call_function_many(const struct
  6720.  
  6721. data = &__get_cpu_var(cfd_data);
  6722. csd_lock(&data->csd);
  6723. +
  6724. + /* This BUG_ON verifies our reuse assertions and can be removed */
  6725. BUG_ON(atomic_read(&data->refs) || !cpumask_empty(data->cpumask));
  6726.  
  6727. + /*
  6728. + * The global call function queue list add and delete are protected
  6729. + * by a lock, but the list is traversed without any lock, relying
  6730. + * on the rcu list add and delete to allow safe concurrent traversal.
  6731. + * We reuse the call function data without waiting for any grace
  6732. + * period after some other cpu removes it from the global queue.
  6733. + * This means a cpu might find our data block as it is being
  6734. + * filled out.
  6735. + *
  6736. + * We hold off the interrupt handler on the other cpu by
  6737. + * ordering our writes to the cpu mask vs our setting of the
  6738. + * refs counter. We assert only the cpu owning the data block
  6739. + * will set a bit in cpumask, and each bit will only be cleared
  6740. + * by the subject cpu. Each cpu must first find its bit is
  6741. + * set and then check that refs is set indicating the element is
  6742. + * ready to be processed, otherwise it must skip the entry.
  6743. + *
  6744. + * On the previous iteration refs was set to 0 by another cpu.
  6745. + * To avoid the use of transitivity, set the counter to 0 here
  6746. + * so the wmb will pair with the rmb in the interrupt handler.
  6747. + */
  6748. + atomic_set(&data->refs, 0); /* convert 3rd to 1st party write */
  6749. +
  6750. data->csd.func = func;
  6751. data->csd.info = info;
  6752. - cpumask_and(data->cpumask, mask, cpu_online_mask);
  6753. - cpumask_clear_cpu(this_cpu, data->cpumask);
  6754.  
  6755. - /*
  6756. - * To ensure the interrupt handler gets an complete view
  6757. - * we order the cpumask and refs writes and order the read
  6758. - * of them in the interrupt handler. In addition we may
  6759. - * only clear our own cpu bit from the mask.
  6760. - */
  6761. + /* Ensure 0 refs is visible before mask. Also orders func and info */
  6762. smp_wmb();
  6763.  
  6764. - atomic_set(&data->refs, cpumask_weight(data->cpumask));
  6765. + /* We rely on the "and" being processed before the store */
  6766. + cpumask_and(data->cpumask, mask, cpu_online_mask);
  6767. + cpumask_clear_cpu(this_cpu, data->cpumask);
  6768. + refs = cpumask_weight(data->cpumask);
  6769. +
  6770. + /* Some callers race with other cpus changing the passed mask */
  6771. + if (unlikely(!refs)) {
  6772. + csd_unlock(&data->csd);
  6773. + return;
  6774. + }
  6775.  
  6776. raw_spin_lock_irqsave(&call_function.lock, flags);
  6777. /*
  6778. @@ -506,6 +533,12 @@ void smp_call_function_many(const struct
  6779. * will not miss any other list entries:
  6780. */
  6781. list_add_rcu(&data->csd.list, &call_function.queue);
  6782. + /*
  6783. + * We rely on the wmb() in list_add_rcu to complete our writes
  6784. + * to the cpumask before this write to refs, which indicates
  6785. + * data is on the list and is ready to be processed.
  6786. + */
  6787. + atomic_set(&data->refs, refs);
  6788. raw_spin_unlock_irqrestore(&call_function.lock, flags);
  6789.  
  6790. /*
  6791. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sysctl.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sysctl.c
  6792. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sysctl.c 2011-04-01 17:57:39.464710654 +0200
  6793. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/sysctl.c 2011-04-02 01:38:34.985688312 +0200
  6794. @@ -172,6 +172,11 @@ static int proc_taint(struct ctl_table *
  6795. void __user *buffer, size_t *lenp, loff_t *ppos);
  6796. #endif
  6797.  
  6798. +#ifdef CONFIG_PRINTK
  6799. +static int proc_dmesg_restrict(struct ctl_table *table, int write,
  6800. + void __user *buffer, size_t *lenp, loff_t *ppos);
  6801. +#endif
  6802. +
  6803. #ifdef CONFIG_MAGIC_SYSRQ
  6804. /* Note: sysrq code uses it's own private copy */
  6805. static int __sysrq_enabled = SYSRQ_DEFAULT_ENABLE;
  6806. @@ -1475,7 +1480,7 @@ static struct ctl_table fs_table[] = {
  6807. .data = &suid_dumpable,
  6808. .maxlen = sizeof(int),
  6809. .mode = 0644,
  6810. - .proc_handler = proc_dointvec_minmax,
  6811. + .proc_handler = proc_dmesg_restrict,
  6812. .extra1 = &zero,
  6813. .extra2 = &two,
  6814. },
  6815. @@ -2406,6 +2411,17 @@ static int proc_taint(struct ctl_table *
  6816. return err;
  6817. }
  6818.  
  6819. +#ifdef CONFIG_PRINTK
  6820. +static int proc_dmesg_restrict(struct ctl_table *table, int write,
  6821. + void __user *buffer, size_t *lenp, loff_t *ppos)
  6822. +{
  6823. + if (write && !capable(CAP_SYS_ADMIN))
  6824. + return -EPERM;
  6825. +
  6826. + return proc_dointvec_minmax(table, write, buffer, lenp, ppos);
  6827. +}
  6828. +#endif
  6829. +
  6830. struct do_proc_dointvec_minmax_conv_param {
  6831. int *min;
  6832. int *max;
  6833. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-broadcast.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-broadcast.c
  6834. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-broadcast.c 2011-04-01 17:56:58.892710687 +0200
  6835. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-broadcast.c 2011-04-02 01:37:46.874688351 +0200
  6836. @@ -600,4 +600,14 @@ int tick_broadcast_oneshot_active(void)
  6837. return tick_broadcast_device.mode == TICKDEV_MODE_ONESHOT;
  6838. }
  6839.  
  6840. +/*
  6841. + * Check whether the broadcast device supports oneshot.
  6842. + */
  6843. +bool tick_broadcast_oneshot_available(void)
  6844. +{
  6845. + struct clock_event_device *bc = tick_broadcast_device.evtdev;
  6846. +
  6847. + return bc ? bc->features & CLOCK_EVT_FEAT_ONESHOT : false;
  6848. +}
  6849. +
  6850. #endif
  6851. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-common.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-common.c
  6852. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-common.c 2011-04-01 17:56:58.892710687 +0200
  6853. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-common.c 2011-04-02 01:37:46.874688351 +0200
  6854. @@ -51,7 +51,11 @@ int tick_is_oneshot_available(void)
  6855. {
  6856. struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;
  6857.  
  6858. - return dev && (dev->features & CLOCK_EVT_FEAT_ONESHOT);
  6859. + if (!dev || !(dev->features & CLOCK_EVT_FEAT_ONESHOT))
  6860. + return 0;
  6861. + if (!(dev->features & CLOCK_EVT_FEAT_C3STOP))
  6862. + return 1;
  6863. + return tick_broadcast_oneshot_available();
  6864. }
  6865.  
  6866. /*
  6867. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-internal.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-internal.h
  6868. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-internal.h 2011-04-01 17:56:58.892710687 +0200
  6869. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/time/tick-internal.h 2011-04-02 01:37:46.874688351 +0200
  6870. @@ -36,6 +36,7 @@ extern void tick_shutdown_broadcast_ones
  6871. extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc);
  6872. extern int tick_broadcast_oneshot_active(void);
  6873. extern void tick_check_oneshot_broadcast(int cpu);
  6874. +bool tick_broadcast_oneshot_available(void);
  6875. # else /* BROADCAST */
  6876. static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
  6877. {
  6878. @@ -46,6 +47,7 @@ static inline void tick_broadcast_switch
  6879. static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { }
  6880. static inline int tick_broadcast_oneshot_active(void) { return 0; }
  6881. static inline void tick_check_oneshot_broadcast(int cpu) { }
  6882. +static inline bool tick_broadcast_oneshot_available(void) { return true; }
  6883. # endif /* !BROADCAST */
  6884.  
  6885. #else /* !ONESHOT */
  6886. @@ -76,6 +78,7 @@ static inline int tick_resume_broadcast_
  6887. return 0;
  6888. }
  6889. static inline int tick_broadcast_oneshot_active(void) { return 0; }
  6890. +static inline bool tick_broadcast_oneshot_available(void) { return false; }
  6891. #endif /* !TICK_ONESHOT */
  6892.  
  6893. /*
  6894. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/trace/ftrace.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/trace/ftrace.c
  6895. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/trace/ftrace.c 2011-04-01 17:56:58.903710687 +0200
  6896. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//kernel/trace/ftrace.c 2011-04-02 01:37:46.875688349 +0200
  6897. @@ -3328,7 +3328,7 @@ static int start_graph_tracing(void)
  6898. /* The cpu_boot init_task->ret_stack will never be freed */
  6899. for_each_online_cpu(cpu) {
  6900. if (!idle_task(cpu)->ret_stack)
  6901. - ftrace_graph_init_task(idle_task(cpu));
  6902. + ftrace_graph_init_idle_task(idle_task(cpu), cpu);
  6903. }
  6904.  
  6905. do {
  6906. @@ -3418,6 +3418,49 @@ void unregister_ftrace_graph(void)
  6907. mutex_unlock(&ftrace_lock);
  6908. }
  6909.  
  6910. +static DEFINE_PER_CPU(struct ftrace_ret_stack *, idle_ret_stack);
  6911. +
  6912. +static void
  6913. +graph_init_task(struct task_struct *t, struct ftrace_ret_stack *ret_stack)
  6914. +{
  6915. + atomic_set(&t->tracing_graph_pause, 0);
  6916. + atomic_set(&t->trace_overrun, 0);
  6917. + t->ftrace_timestamp = 0;
  6918. + /* make curr_ret_stack visable before we add the ret_stack */
  6919. + smp_wmb();
  6920. + t->ret_stack = ret_stack;
  6921. +}
  6922. +
  6923. +/*
  6924. + * Allocate a return stack for the idle task. May be the first
  6925. + * time through, or it may be done by CPU hotplug online.
  6926. + */
  6927. +void ftrace_graph_init_idle_task(struct task_struct *t, int cpu)
  6928. +{
  6929. + t->curr_ret_stack = -1;
  6930. + /*
  6931. + * The idle task has no parent, it either has its own
  6932. + * stack or no stack at all.
  6933. + */
  6934. + if (t->ret_stack)
  6935. + WARN_ON(t->ret_stack != per_cpu(idle_ret_stack, cpu));
  6936. +
  6937. + if (ftrace_graph_active) {
  6938. + struct ftrace_ret_stack *ret_stack;
  6939. +
  6940. + ret_stack = per_cpu(idle_ret_stack, cpu);
  6941. + if (!ret_stack) {
  6942. + ret_stack = kmalloc(FTRACE_RETFUNC_DEPTH
  6943. + * sizeof(struct ftrace_ret_stack),
  6944. + GFP_KERNEL);
  6945. + if (!ret_stack)
  6946. + return;
  6947. + per_cpu(idle_ret_stack, cpu) = ret_stack;
  6948. + }
  6949. + graph_init_task(t, ret_stack);
  6950. + }
  6951. +}
  6952. +
  6953. /* Allocate a return stack for newly created task */
  6954. void ftrace_graph_init_task(struct task_struct *t)
  6955. {
  6956. @@ -3433,12 +3476,7 @@ void ftrace_graph_init_task(struct task_
  6957. GFP_KERNEL);
  6958. if (!ret_stack)
  6959. return;
  6960. - atomic_set(&t->tracing_graph_pause, 0);
  6961. - atomic_set(&t->trace_overrun, 0);
  6962. - t->ftrace_timestamp = 0;
  6963. - /* make curr_ret_stack visable before we add the ret_stack */
  6964. - smp_wmb();
  6965. - t->ret_stack = ret_stack;
  6966. + graph_init_task(t, ret_stack);
  6967. }
  6968. }
  6969.  
  6970. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//lib/swiotlb.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//lib/swiotlb.c
  6971. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//lib/swiotlb.c 2011-04-01 17:56:56.742710687 +0200
  6972. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//lib/swiotlb.c 2011-04-02 01:37:43.111688352 +0200
  6973. @@ -686,8 +686,10 @@ dma_addr_t swiotlb_map_page(struct devic
  6974. /*
  6975. * Ensure that the address returned is DMA'ble
  6976. */
  6977. - if (!dma_capable(dev, dev_addr, size))
  6978. - panic("map_single: bounce buffer is not DMA'ble");
  6979. + if (!dma_capable(dev, dev_addr, size)) {
  6980. + swiotlb_tbl_unmap_single(dev, map, size, dir);
  6981. + dev_addr = swiotlb_virt_to_bus(dev, io_tlb_overflow_buffer);
  6982. + }
  6983.  
  6984. return dev_addr;
  6985. }
  6986. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//Makefile linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//Makefile
  6987. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//Makefile 2011-04-01 17:57:39.469710654 +0200
  6988. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//Makefile 2011-04-02 01:38:34.985688312 +0200
  6989. @@ -1,7 +1,7 @@
  6990. VERSION = 2
  6991. PATCHLEVEL = 6
  6992. SUBLEVEL = 37
  6993. -EXTRAVERSION = .2
  6994. +EXTRAVERSION = .6
  6995. NAME = Flesh-Eating Bats with Fangs
  6996.  
  6997. # *DOCUMENTATION*
  6998. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/backing-dev.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/backing-dev.c
  6999. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/backing-dev.c 2011-04-01 17:57:39.469710654 +0200
  7000. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/backing-dev.c 2011-04-02 01:38:34.986688312 +0200
  7001. @@ -608,7 +608,7 @@ static void bdi_prune_sb(struct backing_
  7002. spin_lock(&sb_lock);
  7003. list_for_each_entry(sb, &super_blocks, s_list) {
  7004. if (sb->s_bdi == bdi)
  7005. - sb->s_bdi = NULL;
  7006. + sb->s_bdi = &default_backing_dev_info;
  7007. }
  7008. spin_unlock(&sb_lock);
  7009. }
  7010. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/mremap.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/mremap.c
  7011. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/mremap.c 2011-04-01 17:57:39.481710654 +0200
  7012. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/mremap.c 2011-04-02 01:37:46.299688353 +0200
  7013. @@ -91,9 +91,7 @@ static void move_ptes(struct vm_area_str
  7014. */
  7015. mapping = vma->vm_file->f_mapping;
  7016. mutex_lock(&mapping->i_mmap_lock);
  7017. - if (new_vma->vm_truncate_count &&
  7018. - new_vma->vm_truncate_count != vma->vm_truncate_count)
  7019. - new_vma->vm_truncate_count = 0;
  7020. + new_vma->vm_truncate_count = 0;
  7021. }
  7022.  
  7023. /*
  7024. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/oom_kill.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/oom_kill.c
  7025. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/oom_kill.c 2011-04-01 17:56:58.874710687 +0200
  7026. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/oom_kill.c 2011-04-02 01:38:34.986688312 +0200
  7027. @@ -31,6 +31,7 @@
  7028. #include <linux/memcontrol.h>
  7029. #include <linux/mempolicy.h>
  7030. #include <linux/security.h>
  7031. +#include <linux/ptrace.h>
  7032.  
  7033. int sysctl_panic_on_oom;
  7034. int sysctl_oom_kill_allocating_task;
  7035. @@ -292,13 +293,15 @@ static struct task_struct *select_bad_pr
  7036. unsigned long totalpages, struct mem_cgroup *mem,
  7037. const nodemask_t *nodemask)
  7038. {
  7039. - struct task_struct *p;
  7040. + struct task_struct *g, *p;
  7041. struct task_struct *chosen = NULL;
  7042. *ppoints = 0;
  7043.  
  7044. - for_each_process(p) {
  7045. + do_each_thread(g, p) {
  7046. unsigned int points;
  7047.  
  7048. + if (!p->mm)
  7049. + continue;
  7050. if (oom_unkillable_task(p, mem, nodemask))
  7051. continue;
  7052.  
  7053. @@ -314,22 +317,29 @@ static struct task_struct *select_bad_pr
  7054. if (test_tsk_thread_flag(p, TIF_MEMDIE))
  7055. return ERR_PTR(-1UL);
  7056.  
  7057. - /*
  7058. - * This is in the process of releasing memory so wait for it
  7059. - * to finish before killing some other task by mistake.
  7060. - *
  7061. - * However, if p is the current task, we allow the 'kill' to
  7062. - * go ahead if it is exiting: this will simply set TIF_MEMDIE,
  7063. - * which will allow it to gain access to memory reserves in
  7064. - * the process of exiting and releasing its resources.
  7065. - * Otherwise we could get an easy OOM deadlock.
  7066. - */
  7067. - if (thread_group_empty(p) && (p->flags & PF_EXITING) && p->mm) {
  7068. - if (p != current)
  7069. - return ERR_PTR(-1UL);
  7070. -
  7071. - chosen = p;
  7072. - *ppoints = 1000;
  7073. + if (p->flags & PF_EXITING) {
  7074. + /*
  7075. + * If p is the current task and is in the process of
  7076. + * releasing memory, we allow the "kill" to set
  7077. + * TIF_MEMDIE, which will allow it to gain access to
  7078. + * memory reserves. Otherwise, it may stall forever.
  7079. + *
  7080. + * The loop isn't broken here, however, in case other
  7081. + * threads are found to have already been oom killed.
  7082. + */
  7083. + if (p == current) {
  7084. + chosen = p;
  7085. + *ppoints = 1000;
  7086. + } else {
  7087. + /*
  7088. + * If this task is not being ptraced on exit,
  7089. + * then wait for it to finish before killing
  7090. + * some other task unnecessarily.
  7091. + */
  7092. + if (!(task_ptrace(p->group_leader) &
  7093. + PT_TRACE_EXIT))
  7094. + return ERR_PTR(-1UL);
  7095. + }
  7096. }
  7097.  
  7098. points = oom_badness(p, mem, nodemask, totalpages);
  7099. @@ -337,7 +347,7 @@ static struct task_struct *select_bad_pr
  7100. chosen = p;
  7101. *ppoints = points;
  7102. }
  7103. - }
  7104. + } while_each_thread(g, p);
  7105.  
  7106. return chosen;
  7107. }
  7108. @@ -491,6 +501,8 @@ static int oom_kill_process(struct task_
  7109. list_for_each_entry(child, &t->children, sibling) {
  7110. unsigned int child_points;
  7111.  
  7112. + if (child->mm == p->mm)
  7113. + continue;
  7114. /*
  7115. * oom_badness() returns 0 if the thread is unkillable
  7116. */
  7117. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/page_alloc.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/page_alloc.c
  7118. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/page_alloc.c 2011-04-01 17:57:39.484710653 +0200
  7119. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/page_alloc.c 2011-04-02 01:37:46.301688350 +0200
  7120. @@ -5353,10 +5353,9 @@ __count_immobile_pages(struct zone *zone
  7121. for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) {
  7122. unsigned long check = pfn + iter;
  7123.  
  7124. - if (!pfn_valid_within(check)) {
  7125. - iter++;
  7126. + if (!pfn_valid_within(check))
  7127. continue;
  7128. - }
  7129. +
  7130. page = pfn_to_page(check);
  7131. if (!page_count(page)) {
  7132. if (PageBuddy(page))
  7133. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/shmem.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/shmem.c
  7134. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/shmem.c 2011-04-01 17:56:58.882710687 +0200
  7135. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/shmem.c 2011-04-02 01:38:34.987688311 +0200
  7136. @@ -2784,5 +2784,6 @@ int shmem_zero_setup(struct vm_area_stru
  7137. fput(vma->vm_file);
  7138. vma->vm_file = file;
  7139. vma->vm_ops = &shmem_vm_ops;
  7140. + vma->vm_flags |= VM_CAN_NONLINEAR;
  7141. return 0;
  7142. }
  7143. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/slab.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/slab.c
  7144. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/slab.c 2011-04-01 17:56:58.882710687 +0200
  7145. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/slab.c 2011-04-02 01:38:34.988688311 +0200
  7146. @@ -2288,8 +2288,8 @@ kmem_cache_create (const char *name, siz
  7147. if (ralign < align) {
  7148. ralign = align;
  7149. }
  7150. - /* disable debug if not aligning with REDZONE_ALIGN */
  7151. - if (ralign & (__alignof__(unsigned long long) - 1))
  7152. + /* disable debug if necessary */
  7153. + if (ralign > __alignof__(unsigned long long))
  7154. flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER);
  7155. /*
  7156. * 4) Store it.
  7157. @@ -2315,8 +2315,8 @@ kmem_cache_create (const char *name, siz
  7158. */
  7159. if (flags & SLAB_RED_ZONE) {
  7160. /* add space for red zone words */
  7161. - cachep->obj_offset += align;
  7162. - size += align + sizeof(unsigned long long);
  7163. + cachep->obj_offset += sizeof(unsigned long long);
  7164. + size += 2 * sizeof(unsigned long long);
  7165. }
  7166. if (flags & SLAB_STORE_USER) {
  7167. /* user store requires one word storage behind the end of
  7168. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/swapfile.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/swapfile.c
  7169. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/swapfile.c 2011-04-01 17:57:39.488710653 +0200
  7170. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//mm/swapfile.c 2011-04-02 01:38:34.989688310 +0200
  7171. @@ -2175,8 +2175,13 @@ bad_swap_2:
  7172. p->flags = 0;
  7173. spin_unlock(&swap_lock);
  7174. vfree(swap_map);
  7175. - if (swap_file)
  7176. + if (swap_file) {
  7177. + if (did_down) {
  7178. + mutex_unlock(&inode->i_mutex);
  7179. + did_down = 0;
  7180. + }
  7181. filp_close(swap_file, NULL);
  7182. + }
  7183. out:
  7184. if (page && !IS_ERR(page)) {
  7185. kunmap(page);
  7186. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/core/dev.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/core/dev.c
  7187. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/core/dev.c 2011-04-01 17:56:57.235710686 +0200
  7188. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/core/dev.c 2011-04-02 01:37:43.235688354 +0200
  7189. @@ -1116,13 +1116,21 @@ EXPORT_SYMBOL(netdev_bonding_change);
  7190. void dev_load(struct net *net, const char *name)
  7191. {
  7192. struct net_device *dev;
  7193. + int no_module;
  7194.  
  7195. rcu_read_lock();
  7196. dev = dev_get_by_name_rcu(net, name);
  7197. rcu_read_unlock();
  7198.  
  7199. - if (!dev && capable(CAP_NET_ADMIN))
  7200. - request_module("%s", name);
  7201. + no_module = !dev;
  7202. + if (no_module && capable(CAP_NET_ADMIN))
  7203. + no_module = request_module("netdev-%s", name);
  7204. + if (no_module && capable(CAP_SYS_MODULE)) {
  7205. + if (!request_module("%s", name))
  7206. + pr_err("Loading kernel module for a network device "
  7207. +"with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s "
  7208. +"instead\n", name);
  7209. + }
  7210. }
  7211. EXPORT_SYMBOL(dev_load);
  7212.  
  7213. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/dccp/input.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/dccp/input.c
  7214. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/dccp/input.c 2011-04-01 17:56:56.797710688 +0200
  7215. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/dccp/input.c 2011-04-02 01:37:43.193688353 +0200
  7216. @@ -621,6 +621,9 @@ int dccp_rcv_state_process(struct sock *
  7217. /* Caller (dccp_v4_do_rcv) will send Reset */
  7218. dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION;
  7219. return 1;
  7220. + } else if (sk->sk_state == DCCP_CLOSED) {
  7221. + dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION;
  7222. + return 1;
  7223. }
  7224.  
  7225. if (sk->sk_state != DCCP_REQUESTING && sk->sk_state != DCCP_RESPOND) {
  7226. @@ -683,10 +686,6 @@ int dccp_rcv_state_process(struct sock *
  7227. }
  7228.  
  7229. switch (sk->sk_state) {
  7230. - case DCCP_CLOSED:
  7231. - dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION;
  7232. - return 1;
  7233. -
  7234. case DCCP_REQUESTING:
  7235. queued = dccp_rcv_request_sent_state_process(sk, skb, dh, len);
  7236. if (queued >= 0)
  7237. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/dns_resolver/dns_key.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/dns_resolver/dns_key.c
  7238. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/dns_resolver/dns_key.c 2011-04-01 17:56:56.749710687 +0200
  7239. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/dns_resolver/dns_key.c 2011-04-02 01:37:43.120688353 +0200
  7240. @@ -67,8 +67,9 @@ dns_resolver_instantiate(struct key *key
  7241. size_t result_len = 0;
  7242. const char *data = _data, *end, *opt;
  7243.  
  7244. - kenter("%%%d,%s,'%s',%zu",
  7245. - key->serial, key->description, data, datalen);
  7246. + kenter("%%%d,%s,'%*.*s',%zu",
  7247. + key->serial, key->description,
  7248. + (int)datalen, (int)datalen, data, datalen);
  7249.  
  7250. if (datalen <= 1 || !data || data[datalen - 1] != '\0')
  7251. return -EINVAL;
  7252. @@ -217,6 +218,19 @@ static void dns_resolver_describe(const
  7253. seq_printf(m, ": %u", key->datalen);
  7254. }
  7255.  
  7256. +/*
  7257. + * read the DNS data
  7258. + * - the key's semaphore is read-locked
  7259. + */
  7260. +static long dns_resolver_read(const struct key *key,
  7261. + char __user *buffer, size_t buflen)
  7262. +{
  7263. + if (key->type_data.x[0])
  7264. + return key->type_data.x[0];
  7265. +
  7266. + return user_read(key, buffer, buflen);
  7267. +}
  7268. +
  7269. struct key_type key_type_dns_resolver = {
  7270. .name = "dns_resolver",
  7271. .instantiate = dns_resolver_instantiate,
  7272. @@ -224,7 +238,7 @@ struct key_type key_type_dns_resolver =
  7273. .revoke = user_revoke,
  7274. .destroy = user_destroy,
  7275. .describe = dns_resolver_describe,
  7276. - .read = user_read,
  7277. + .read = dns_resolver_read,
  7278. };
  7279.  
  7280. static int __init init_dns_resolver(void)
  7281. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/devinet.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/devinet.c
  7282. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/devinet.c 2011-04-01 17:56:56.756710687 +0200
  7283. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/devinet.c 2011-04-02 01:37:43.138688353 +0200
  7284. @@ -1030,6 +1030,21 @@ static inline bool inetdev_valid_mtu(uns
  7285. return mtu >= 68;
  7286. }
  7287.  
  7288. +static void inetdev_send_gratuitous_arp(struct net_device *dev,
  7289. + struct in_device *in_dev)
  7290. +
  7291. +{
  7292. + struct in_ifaddr *ifa = in_dev->ifa_list;
  7293. +
  7294. + if (!ifa)
  7295. + return;
  7296. +
  7297. + arp_send(ARPOP_REQUEST, ETH_P_ARP,
  7298. + ifa->ifa_address, dev,
  7299. + ifa->ifa_address, NULL,
  7300. + dev->dev_addr, NULL);
  7301. +}
  7302. +
  7303. /* Called only under RTNL semaphore */
  7304.  
  7305. static int inetdev_event(struct notifier_block *this, unsigned long event,
  7306. @@ -1082,18 +1097,13 @@ static int inetdev_event(struct notifier
  7307. }
  7308. ip_mc_up(in_dev);
  7309. /* fall through */
  7310. - case NETDEV_NOTIFY_PEERS:
  7311. case NETDEV_CHANGEADDR:
  7312. + if (!IN_DEV_ARP_NOTIFY(in_dev))
  7313. + break;
  7314. + /* fall through */
  7315. + case NETDEV_NOTIFY_PEERS:
  7316. /* Send gratuitous ARP to notify of link change */
  7317. - if (IN_DEV_ARP_NOTIFY(in_dev)) {
  7318. - struct in_ifaddr *ifa = in_dev->ifa_list;
  7319. -
  7320. - if (ifa)
  7321. - arp_send(ARPOP_REQUEST, ETH_P_ARP,
  7322. - ifa->ifa_address, dev,
  7323. - ifa->ifa_address, NULL,
  7324. - dev->dev_addr, NULL);
  7325. - }
  7326. + inetdev_send_gratuitous_arp(dev, in_dev);
  7327. break;
  7328. case NETDEV_DOWN:
  7329. ip_mc_down(in_dev);
  7330. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/inet_timewait_sock.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/inet_timewait_sock.c
  7331. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/inet_timewait_sock.c 2011-04-01 17:56:56.752710687 +0200
  7332. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/inet_timewait_sock.c 2011-04-02 01:37:43.127688354 +0200
  7333. @@ -505,7 +505,9 @@ restart:
  7334. }
  7335.  
  7336. rcu_read_unlock();
  7337. + local_bh_disable();
  7338. inet_twsk_deschedule(tw, twdr);
  7339. + local_bh_enable();
  7340. inet_twsk_put(tw);
  7341. goto restart_rcu;
  7342. }
  7343. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/ip_gre.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/ip_gre.c
  7344. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/ip_gre.c 2011-04-01 17:56:56.756710687 +0200
  7345. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/ip_gre.c 2011-04-02 01:37:43.138688353 +0200
  7346. @@ -1775,3 +1775,4 @@ module_exit(ipgre_fini);
  7347. MODULE_LICENSE("GPL");
  7348. MODULE_ALIAS_RTNL_LINK("gre");
  7349. MODULE_ALIAS_RTNL_LINK("gretap");
  7350. +MODULE_ALIAS_NETDEV("gre0");
  7351. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/ipip.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/ipip.c
  7352. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/ipip.c 2011-04-01 17:56:56.756710687 +0200
  7353. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/ipip.c 2011-04-02 01:37:43.131688354 +0200
  7354. @@ -921,3 +921,4 @@ static void __exit ipip_fini(void)
  7355. module_init(ipip_init);
  7356. module_exit(ipip_fini);
  7357. MODULE_LICENSE("GPL");
  7358. +MODULE_ALIAS_NETDEV("tunl0");
  7359. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/netfilter/arpt_mangle.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/netfilter/arpt_mangle.c
  7360. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/netfilter/arpt_mangle.c 2011-04-01 17:56:56.755710687 +0200
  7361. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/netfilter/arpt_mangle.c 2011-04-02 01:37:43.131688353 +0200
  7362. @@ -60,12 +60,12 @@ static int checkentry(const struct xt_tg
  7363.  
  7364. if (mangle->flags & ~ARPT_MANGLE_MASK ||
  7365. !(mangle->flags & ARPT_MANGLE_MASK))
  7366. - return false;
  7367. + return -EINVAL;
  7368.  
  7369. if (mangle->target != NF_DROP && mangle->target != NF_ACCEPT &&
  7370. mangle->target != XT_CONTINUE)
  7371. - return false;
  7372. - return true;
  7373. + return -EINVAL;
  7374. + return 0;
  7375. }
  7376.  
  7377. static struct xt_target arpt_mangle_reg __read_mostly = {
  7378. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
  7379. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c 2011-04-01 17:56:56.755710687 +0200
  7380. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c 2011-04-02 01:37:43.131688353 +0200
  7381. @@ -97,7 +97,7 @@ static int ct_show_secctx(struct seq_fil
  7382.  
  7383. ret = security_secid_to_secctx(ct->secmark, &secctx, &len);
  7384. if (ret)
  7385. - return ret;
  7386. + return 0;
  7387.  
  7388. ret = seq_printf(s, "secctx=%s ", secctx);
  7389.  
  7390. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv6/ip6_tunnel.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv6/ip6_tunnel.c
  7391. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv6/ip6_tunnel.c 2011-04-01 17:56:56.803710688 +0200
  7392. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv6/ip6_tunnel.c 2011-04-02 01:37:43.210688354 +0200
  7393. @@ -57,6 +57,7 @@
  7394. MODULE_AUTHOR("Ville Nuorvala");
  7395. MODULE_DESCRIPTION("IPv6 tunneling device");
  7396. MODULE_LICENSE("GPL");
  7397. +MODULE_ALIAS_NETDEV("ip6tnl0");
  7398.  
  7399. #define IPV6_TLV_TEL_DST_SIZE 8
  7400.  
  7401. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv6/sit.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv6/sit.c
  7402. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv6/sit.c 2011-04-01 17:56:57.227710676 +0200
  7403. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/ipv6/sit.c 2011-04-02 01:37:43.212688353 +0200
  7404. @@ -1292,4 +1292,4 @@ static int __init sit_init(void)
  7405. module_init(sit_init);
  7406. module_exit(sit_cleanup);
  7407. MODULE_LICENSE("GPL");
  7408. -MODULE_ALIAS("sit0");
  7409. +MODULE_ALIAS_NETDEV("sit0");
  7410. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/ipvs/ip_vs_ctl.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/ipvs/ip_vs_ctl.c
  7411. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/ipvs/ip_vs_ctl.c 2011-04-01 17:56:56.768710688 +0200
  7412. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/ipvs/ip_vs_ctl.c 2011-04-02 01:37:43.157688354 +0200
  7413. @@ -810,9 +810,9 @@ __ip_vs_update_dest(struct ip_vs_service
  7414. dest->u_threshold = udest->u_threshold;
  7415. dest->l_threshold = udest->l_threshold;
  7416.  
  7417. - spin_lock(&dest->dst_lock);
  7418. + spin_lock_bh(&dest->dst_lock);
  7419. ip_vs_dst_reset(dest);
  7420. - spin_unlock(&dest->dst_lock);
  7421. + spin_unlock_bh(&dest->dst_lock);
  7422.  
  7423. if (add)
  7424. ip_vs_new_estimator(&dest->stats);
  7425. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_conntrack_netlink.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_conntrack_netlink.c
  7426. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_conntrack_netlink.c 2011-04-01 17:56:56.767710688 +0200
  7427. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_conntrack_netlink.c 2011-04-02 01:37:43.151688353 +0200
  7428. @@ -254,7 +254,7 @@ ctnetlink_dump_secctx(struct sk_buff *sk
  7429.  
  7430. ret = security_secid_to_secctx(ct->secmark, &secctx, &len);
  7431. if (ret)
  7432. - return ret;
  7433. + return 0;
  7434.  
  7435. ret = -1;
  7436. nest_secctx = nla_nest_start(skb, CTA_SECCTX | NLA_F_NESTED);
  7437. @@ -453,16 +453,22 @@ ctnetlink_counters_size(const struct nf_
  7438. ;
  7439. }
  7440.  
  7441. -#ifdef CONFIG_NF_CONNTRACK_SECMARK
  7442. -static int ctnetlink_nlmsg_secctx_size(const struct nf_conn *ct)
  7443. +static inline int
  7444. +ctnetlink_secctx_size(const struct nf_conn *ct)
  7445. {
  7446. - int len;
  7447. +#ifdef CONFIG_NF_CONNTRACK_SECMARK
  7448. + int len, ret;
  7449.  
  7450. - security_secid_to_secctx(ct->secmark, NULL, &len);
  7451. + ret = security_secid_to_secctx(ct->secmark, NULL, &len);
  7452. + if (ret)
  7453. + return 0;
  7454.  
  7455. - return sizeof(char) * len;
  7456. -}
  7457. + return nla_total_size(0) /* CTA_SECCTX */
  7458. + + nla_total_size(sizeof(char) * len); /* CTA_SECCTX_NAME */
  7459. +#else
  7460. + return 0;
  7461. #endif
  7462. +}
  7463.  
  7464. static inline size_t
  7465. ctnetlink_nlmsg_size(const struct nf_conn *ct)
  7466. @@ -479,10 +485,7 @@ ctnetlink_nlmsg_size(const struct nf_con
  7467. + nla_total_size(0) /* CTA_PROTOINFO */
  7468. + nla_total_size(0) /* CTA_HELP */
  7469. + nla_total_size(NF_CT_HELPER_NAME_LEN) /* CTA_HELP_NAME */
  7470. -#ifdef CONFIG_NF_CONNTRACK_SECMARK
  7471. - + nla_total_size(0) /* CTA_SECCTX */
  7472. - + nla_total_size(ctnetlink_nlmsg_secctx_size(ct)) /* CTA_SECCTX_NAME */
  7473. -#endif
  7474. + + ctnetlink_secctx_size(ct)
  7475. #ifdef CONFIG_NF_NAT_NEEDED
  7476. + 2 * nla_total_size(0) /* CTA_NAT_SEQ_ADJ_ORIG|REPL */
  7477. + 6 * nla_total_size(sizeof(u_int32_t)) /* CTA_NAT_SEQ_OFFSET */
  7478. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_conntrack_standalone.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_conntrack_standalone.c
  7479. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_conntrack_standalone.c 2011-04-01 17:56:56.768710688 +0200
  7480. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_conntrack_standalone.c 2011-04-02 01:37:43.157688354 +0200
  7481. @@ -118,7 +118,7 @@ static int ct_show_secctx(struct seq_fil
  7482.  
  7483. ret = security_secid_to_secctx(ct->secmark, &secctx, &len);
  7484. if (ret)
  7485. - return ret;
  7486. + return 0;
  7487.  
  7488. ret = seq_printf(s, "secctx=%s ", secctx);
  7489.  
  7490. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_log.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_log.c
  7491. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_log.c 2011-04-01 17:56:56.769710688 +0200
  7492. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/netfilter/nf_log.c 2011-04-02 01:37:43.158688354 +0200
  7493. @@ -85,6 +85,8 @@ EXPORT_SYMBOL(nf_log_unregister);
  7494.  
  7495. int nf_log_bind_pf(u_int8_t pf, const struct nf_logger *logger)
  7496. {
  7497. + if (pf >= ARRAY_SIZE(nf_loggers))
  7498. + return -EINVAL;
  7499. mutex_lock(&nf_log_mutex);
  7500. if (__find_logger(pf, logger->name) == NULL) {
  7501. mutex_unlock(&nf_log_mutex);
  7502. @@ -98,6 +100,8 @@ EXPORT_SYMBOL(nf_log_bind_pf);
  7503.  
  7504. void nf_log_unbind_pf(u_int8_t pf)
  7505. {
  7506. + if (pf >= ARRAY_SIZE(nf_loggers))
  7507. + return;
  7508. mutex_lock(&nf_log_mutex);
  7509. rcu_assign_pointer(nf_loggers[pf], NULL);
  7510. mutex_unlock(&nf_log_mutex);
  7511. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/socket.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/socket.c
  7512. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/socket.c 2011-04-01 17:56:56.784710688 +0200
  7513. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/socket.c 2011-04-02 01:38:34.990688310 +0200
  7514. @@ -2566,23 +2566,123 @@ static int dev_ifconf(struct net *net, s
  7515.  
  7516. static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
  7517. {
  7518. + struct compat_ethtool_rxnfc __user *compat_rxnfc;
  7519. + bool convert_in = false, convert_out = false;
  7520. + size_t buf_size = ALIGN(sizeof(struct ifreq), 8);
  7521. + struct ethtool_rxnfc __user *rxnfc;
  7522. struct ifreq __user *ifr;
  7523. + u32 rule_cnt = 0, actual_rule_cnt;
  7524. + u32 ethcmd;
  7525. u32 data;
  7526. - void __user *datap;
  7527. + int ret;
  7528.  
  7529. - ifr = compat_alloc_user_space(sizeof(*ifr));
  7530. + if (get_user(data, &ifr32->ifr_ifru.ifru_data))
  7531. + return -EFAULT;
  7532.  
  7533. - if (copy_in_user(&ifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ))
  7534. + compat_rxnfc = compat_ptr(data);
  7535. +
  7536. + if (get_user(ethcmd, &compat_rxnfc->cmd))
  7537. return -EFAULT;
  7538.  
  7539. - if (get_user(data, &ifr32->ifr_ifru.ifru_data))
  7540. + /* Most ethtool structures are defined without padding.
  7541. + * Unfortunately struct ethtool_rxnfc is an exception.
  7542. + */
  7543. + switch (ethcmd) {
  7544. + default:
  7545. + break;
  7546. + case ETHTOOL_GRXCLSRLALL:
  7547. + /* Buffer size is variable */
  7548. + if (get_user(rule_cnt, &compat_rxnfc->rule_cnt))
  7549. + return -EFAULT;
  7550. + if (rule_cnt > KMALLOC_MAX_SIZE / sizeof(u32))
  7551. + return -ENOMEM;
  7552. + buf_size += rule_cnt * sizeof(u32);
  7553. + /* fall through */
  7554. + case ETHTOOL_GRXRINGS:
  7555. + case ETHTOOL_GRXCLSRLCNT:
  7556. + case ETHTOOL_GRXCLSRULE:
  7557. + convert_out = true;
  7558. + /* fall through */
  7559. + case ETHTOOL_SRXCLSRLDEL:
  7560. + case ETHTOOL_SRXCLSRLINS:
  7561. + buf_size += sizeof(struct ethtool_rxnfc);
  7562. + convert_in = true;
  7563. + break;
  7564. + }
  7565. +
  7566. + ifr = compat_alloc_user_space(buf_size);
  7567. + rxnfc = (void *)ifr + ALIGN(sizeof(struct ifreq), 8);
  7568. +
  7569. + if (copy_in_user(&ifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ))
  7570. return -EFAULT;
  7571.  
  7572. - datap = compat_ptr(data);
  7573. - if (put_user(datap, &ifr->ifr_ifru.ifru_data))
  7574. + if (put_user(convert_in ? rxnfc : compat_ptr(data),
  7575. + &ifr->ifr_ifru.ifru_data))
  7576. return -EFAULT;
  7577.  
  7578. - return dev_ioctl(net, SIOCETHTOOL, ifr);
  7579. + if (convert_in) {
  7580. + /* We expect there to be holes between fs.m_u and
  7581. + * fs.ring_cookie and at the end of fs, but nowhere else.
  7582. + */
  7583. + BUILD_BUG_ON(offsetof(struct compat_ethtool_rxnfc, fs.m_u) +
  7584. + sizeof(compat_rxnfc->fs.m_u) !=
  7585. + offsetof(struct ethtool_rxnfc, fs.m_u) +
  7586. + sizeof(rxnfc->fs.m_u));
  7587. + BUILD_BUG_ON(
  7588. + offsetof(struct compat_ethtool_rxnfc, fs.location) -
  7589. + offsetof(struct compat_ethtool_rxnfc, fs.ring_cookie) !=
  7590. + offsetof(struct ethtool_rxnfc, fs.location) -
  7591. + offsetof(struct ethtool_rxnfc, fs.ring_cookie));
  7592. +
  7593. + if (copy_in_user(rxnfc, compat_rxnfc,
  7594. + (void *)(&rxnfc->fs.m_u + 1) -
  7595. + (void *)rxnfc) ||
  7596. + copy_in_user(&rxnfc->fs.ring_cookie,
  7597. + &compat_rxnfc->fs.ring_cookie,
  7598. + (void *)(&rxnfc->fs.location + 1) -
  7599. + (void *)&rxnfc->fs.ring_cookie) ||
  7600. + copy_in_user(&rxnfc->rule_cnt, &compat_rxnfc->rule_cnt,
  7601. + sizeof(rxnfc->rule_cnt)))
  7602. + return -EFAULT;
  7603. + }
  7604. +
  7605. + ret = dev_ioctl(net, SIOCETHTOOL, ifr);
  7606. + if (ret)
  7607. + return ret;
  7608. +
  7609. + if (convert_out) {
  7610. + if (copy_in_user(compat_rxnfc, rxnfc,
  7611. + (const void *)(&rxnfc->fs.m_u + 1) -
  7612. + (const void *)rxnfc) ||
  7613. + copy_in_user(&compat_rxnfc->fs.ring_cookie,
  7614. + &rxnfc->fs.ring_cookie,
  7615. + (const void *)(&rxnfc->fs.location + 1) -
  7616. + (const void *)&rxnfc->fs.ring_cookie) ||
  7617. + copy_in_user(&compat_rxnfc->rule_cnt, &rxnfc->rule_cnt,
  7618. + sizeof(rxnfc->rule_cnt)))
  7619. + return -EFAULT;
  7620. +
  7621. + if (ethcmd == ETHTOOL_GRXCLSRLALL) {
  7622. + /* As an optimisation, we only copy the actual
  7623. + * number of rules that the underlying
  7624. + * function returned. Since Mallory might
  7625. + * change the rule count in user memory, we
  7626. + * check that it is less than the rule count
  7627. + * originally given (as the user buffer size),
  7628. + * which has been range-checked.
  7629. + */
  7630. + if (get_user(actual_rule_cnt, &rxnfc->rule_cnt))
  7631. + return -EFAULT;
  7632. + if (actual_rule_cnt < rule_cnt)
  7633. + rule_cnt = actual_rule_cnt;
  7634. + if (copy_in_user(&compat_rxnfc->rule_locs[0],
  7635. + &rxnfc->rule_locs[0],
  7636. + rule_cnt * sizeof(u32)))
  7637. + return -EFAULT;
  7638. + }
  7639. + }
  7640. +
  7641. + return 0;
  7642. }
  7643.  
  7644. static int compat_siocwandev(struct net *net, struct compat_ifreq __user *uifr32)
  7645. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/clnt.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/clnt.c
  7646. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/clnt.c 2011-04-01 17:56:56.788710688 +0200
  7647. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/clnt.c 2011-04-02 01:37:43.179688354 +0200
  7648. @@ -436,7 +436,9 @@ void rpc_killall_tasks(struct rpc_clnt *
  7649. if (!(rovr->tk_flags & RPC_TASK_KILLED)) {
  7650. rovr->tk_flags |= RPC_TASK_KILLED;
  7651. rpc_exit(rovr, -EIO);
  7652. - rpc_wake_up_queued_task(rovr->tk_waitqueue, rovr);
  7653. + if (RPC_IS_QUEUED(rovr))
  7654. + rpc_wake_up_queued_task(rovr->tk_waitqueue,
  7655. + rovr);
  7656. }
  7657. }
  7658. spin_unlock(&clnt->cl_lock);
  7659. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/sched.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/sched.c
  7660. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/sched.c 2011-04-01 17:56:56.784710688 +0200
  7661. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/sched.c 2011-04-02 01:37:43.177688353 +0200
  7662. @@ -623,14 +623,12 @@ static void __rpc_execute(struct rpc_tas
  7663. save_callback = task->tk_callback;
  7664. task->tk_callback = NULL;
  7665. save_callback(task);
  7666. - }
  7667. -
  7668. - /*
  7669. - * Perform the next FSM step.
  7670. - * tk_action may be NULL when the task has been killed
  7671. - * by someone else.
  7672. - */
  7673. - if (!RPC_IS_QUEUED(task)) {
  7674. + } else {
  7675. + /*
  7676. + * Perform the next FSM step.
  7677. + * tk_action may be NULL when the task has been killed
  7678. + * by someone else.
  7679. + */
  7680. if (task->tk_action == NULL)
  7681. break;
  7682. task->tk_action(task);
  7683. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/xprtsock.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/xprtsock.c
  7684. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/xprtsock.c 2011-04-01 17:56:56.784710688 +0200
  7685. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/sunrpc/xprtsock.c 2011-04-02 01:38:34.991688310 +0200
  7686. @@ -710,6 +710,8 @@ static void xs_reset_transport(struct so
  7687. if (sk == NULL)
  7688. return;
  7689.  
  7690. + transport->srcport = 0;
  7691. +
  7692. write_lock_bh(&sk->sk_callback_lock);
  7693. transport->inet = NULL;
  7694. transport->sock = NULL;
  7695. @@ -1631,7 +1633,8 @@ static struct socket *xs_create_sock(str
  7696. }
  7697. xs_reclassify_socket(family, sock);
  7698.  
  7699. - if (xs_bind(transport, sock)) {
  7700. + err = xs_bind(transport, sock);
  7701. + if (err) {
  7702. sock_release(sock);
  7703. goto out;
  7704. }
  7705. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/wireless/wext-compat.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/wireless/wext-compat.c
  7706. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//net/wireless/wext-compat.c 2011-04-01 17:56:56.789710688 +0200
  7707. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//net/wireless/wext-compat.c 2011-04-02 01:37:43.183688354 +0200
  7708. @@ -802,11 +802,11 @@ int cfg80211_wext_siwfreq(struct net_dev
  7709. return freq;
  7710. if (freq == 0)
  7711. return -EINVAL;
  7712. - wdev_lock(wdev);
  7713. mutex_lock(&rdev->devlist_mtx);
  7714. + wdev_lock(wdev);
  7715. err = cfg80211_set_freq(rdev, wdev, freq, NL80211_CHAN_NO_HT);
  7716. - mutex_unlock(&rdev->devlist_mtx);
  7717. wdev_unlock(wdev);
  7718. + mutex_unlock(&rdev->devlist_mtx);
  7719. return err;
  7720. default:
  7721. return -EOPNOTSUPP;
  7722. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//security/tomoyo/file.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//security/tomoyo/file.c
  7723. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//security/tomoyo/file.c 2011-04-01 17:56:56.726710687 +0200
  7724. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//security/tomoyo/file.c 2011-04-02 01:37:43.092688353 +0200
  7725. @@ -927,7 +927,7 @@ int tomoyo_check_open_permission(struct
  7726. struct path *path, const int flag)
  7727. {
  7728. const u8 acc_mode = ACC_MODE(flag);
  7729. - int error = -ENOMEM;
  7730. + int error = 0;
  7731. struct tomoyo_path_info buf;
  7732. struct tomoyo_request_info r;
  7733. int idx;
  7734. @@ -938,9 +938,6 @@ int tomoyo_check_open_permission(struct
  7735. buf.name = NULL;
  7736. r.mode = TOMOYO_CONFIG_DISABLED;
  7737. idx = tomoyo_read_lock();
  7738. - if (!tomoyo_get_realpath(&buf, path))
  7739. - goto out;
  7740. - error = 0;
  7741. /*
  7742. * If the filename is specified by "deny_rewrite" keyword,
  7743. * we need to check "allow_rewrite" permission when the filename is not
  7744. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/drivers/aloop.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/drivers/aloop.c
  7745. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/drivers/aloop.c 2011-04-01 17:56:57.325710687 +0200
  7746. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/drivers/aloop.c 2011-04-02 01:37:43.414688352 +0200
  7747. @@ -482,8 +482,9 @@ static unsigned int loopback_pos_update(
  7748. cable->streams[SNDRV_PCM_STREAM_CAPTURE];
  7749. unsigned long delta_play = 0, delta_capt = 0;
  7750. unsigned int running;
  7751. + unsigned long flags;
  7752.  
  7753. - spin_lock(&cable->lock);
  7754. + spin_lock_irqsave(&cable->lock, flags);
  7755. running = cable->running ^ cable->pause;
  7756. if (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) {
  7757. delta_play = jiffies - dpcm_play->last_jiffies;
  7758. @@ -495,10 +496,8 @@ static unsigned int loopback_pos_update(
  7759. dpcm_capt->last_jiffies += delta_capt;
  7760. }
  7761.  
  7762. - if (delta_play == 0 && delta_capt == 0) {
  7763. - spin_unlock(&cable->lock);
  7764. - return running;
  7765. - }
  7766. + if (delta_play == 0 && delta_capt == 0)
  7767. + goto unlock;
  7768.  
  7769. if (delta_play > delta_capt) {
  7770. loopback_bytepos_update(dpcm_play, delta_play - delta_capt,
  7771. @@ -510,14 +509,14 @@ static unsigned int loopback_pos_update(
  7772. delta_capt = delta_play;
  7773. }
  7774.  
  7775. - if (delta_play == 0 && delta_capt == 0) {
  7776. - spin_unlock(&cable->lock);
  7777. - return running;
  7778. - }
  7779. + if (delta_play == 0 && delta_capt == 0)
  7780. + goto unlock;
  7781. +
  7782. /* note delta_capt == delta_play at this moment */
  7783. loopback_bytepos_update(dpcm_capt, delta_capt, BYTEPOS_UPDATE_COPY);
  7784. loopback_bytepos_update(dpcm_play, delta_play, BYTEPOS_UPDATE_POSONLY);
  7785. - spin_unlock(&cable->lock);
  7786. + unlock:
  7787. + spin_unlock_irqrestore(&cable->lock, flags);
  7788. return running;
  7789. }
  7790.  
  7791. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/asihpi/hpioctl.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/asihpi/hpioctl.c
  7792. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/asihpi/hpioctl.c 2011-04-01 17:56:57.376710687 +0200
  7793. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/asihpi/hpioctl.c 2011-04-02 01:37:43.570688353 +0200
  7794. @@ -155,6 +155,11 @@ long asihpi_hpi_ioctl(struct file *file,
  7795. goto out;
  7796. }
  7797.  
  7798. + if (hm->h.adapter_index >= HPI_MAX_ADAPTERS) {
  7799. + err = -EINVAL;
  7800. + goto out;
  7801. + }
  7802. +
  7803. pa = &adapters[hm->h.adapter_index];
  7804. hr->h.size = 0;
  7805. if (hm->h.object == HPI_OBJ_SUBSYSTEM) {
  7806. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctatc.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctatc.c
  7807. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctatc.c 2011-04-01 17:56:57.389710688 +0200
  7808. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctatc.c 2011-04-02 01:37:43.575688353 +0200
  7809. @@ -869,7 +869,7 @@ spdif_passthru_playback_setup(struct ct_
  7810. mutex_lock(&atc->atc_mutex);
  7811. dao->ops->get_spos(dao, &status);
  7812. if (((status >> 24) & IEC958_AES3_CON_FS) != iec958_con_fs) {
  7813. - status &= ((~IEC958_AES3_CON_FS) << 24);
  7814. + status &= ~(IEC958_AES3_CON_FS << 24);
  7815. status |= (iec958_con_fs << 24);
  7816. dao->ops->set_spos(dao, status);
  7817. dao->ops->commit_write(dao);
  7818. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctdaio.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctdaio.c
  7819. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctdaio.c 2011-04-01 17:56:57.388710688 +0200
  7820. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctdaio.c 2011-04-02 01:37:43.574688353 +0200
  7821. @@ -176,6 +176,7 @@ static int dao_set_left_input(struct dao
  7822. if (!entry)
  7823. return -ENOMEM;
  7824.  
  7825. + dao->ops->clear_left_input(dao);
  7826. /* Program master and conjugate resources */
  7827. input->ops->master(input);
  7828. daio->rscl.ops->master(&daio->rscl);
  7829. @@ -204,6 +205,7 @@ static int dao_set_right_input(struct da
  7830. if (!entry)
  7831. return -ENOMEM;
  7832.  
  7833. + dao->ops->clear_right_input(dao);
  7834. /* Program master and conjugate resources */
  7835. input->ops->master(input);
  7836. daio->rscr.ops->master(&daio->rscr);
  7837. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctmixer.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctmixer.c
  7838. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctmixer.c 2011-04-01 17:56:57.389710688 +0200
  7839. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/ctxfi/ctmixer.c 2011-04-02 01:37:43.575688353 +0200
  7840. @@ -566,19 +566,6 @@ static int ct_spdif_get_mask(struct snd_
  7841. return 0;
  7842. }
  7843.  
  7844. -static int ct_spdif_default_get(struct snd_kcontrol *kcontrol,
  7845. - struct snd_ctl_elem_value *ucontrol)
  7846. -{
  7847. - unsigned int status = SNDRV_PCM_DEFAULT_CON_SPDIF;
  7848. -
  7849. - ucontrol->value.iec958.status[0] = (status >> 0) & 0xff;
  7850. - ucontrol->value.iec958.status[1] = (status >> 8) & 0xff;
  7851. - ucontrol->value.iec958.status[2] = (status >> 16) & 0xff;
  7852. - ucontrol->value.iec958.status[3] = (status >> 24) & 0xff;
  7853. -
  7854. - return 0;
  7855. -}
  7856. -
  7857. static int ct_spdif_get(struct snd_kcontrol *kcontrol,
  7858. struct snd_ctl_elem_value *ucontrol)
  7859. {
  7860. @@ -586,6 +573,10 @@ static int ct_spdif_get(struct snd_kcont
  7861. unsigned int status;
  7862.  
  7863. atc->spdif_out_get_status(atc, &status);
  7864. +
  7865. + if (status == 0)
  7866. + status = SNDRV_PCM_DEFAULT_CON_SPDIF;
  7867. +
  7868. ucontrol->value.iec958.status[0] = (status >> 0) & 0xff;
  7869. ucontrol->value.iec958.status[1] = (status >> 8) & 0xff;
  7870. ucontrol->value.iec958.status[2] = (status >> 16) & 0xff;
  7871. @@ -629,7 +620,7 @@ static struct snd_kcontrol_new iec958_de
  7872. .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT),
  7873. .count = 1,
  7874. .info = ct_spdif_info,
  7875. - .get = ct_spdif_default_get,
  7876. + .get = ct_spdif_get,
  7877. .put = ct_spdif_put,
  7878. .private_value = MIXER_IEC958_DEFAULT
  7879. };
  7880. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_cirrus.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_cirrus.c
  7881. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_cirrus.c 2011-04-01 17:56:57.369710688 +0200
  7882. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_cirrus.c 2011-04-02 01:37:43.559688353 +0200
  7883. @@ -1039,9 +1039,11 @@ static struct hda_verb cs_errata_init_ve
  7884. {0x11, AC_VERB_SET_PROC_COEF, 0x0008},
  7885. {0x11, AC_VERB_SET_PROC_STATE, 0x00},
  7886.  
  7887. +#if 0 /* Don't to set to D3 as we are in power-up sequence */
  7888. {0x07, AC_VERB_SET_POWER_STATE, 0x03}, /* S/PDIF Rx: D3 */
  7889. {0x08, AC_VERB_SET_POWER_STATE, 0x03}, /* S/PDIF Tx: D3 */
  7890. /*{0x01, AC_VERB_SET_POWER_STATE, 0x03},*/ /* AFG: D3 This is already handled */
  7891. +#endif
  7892.  
  7893. {} /* terminator */
  7894. };
  7895. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_conexant.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_conexant.c
  7896. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_conexant.c 2011-04-01 17:56:57.368710688 +0200
  7897. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_conexant.c 2011-04-02 01:37:43.559688353 +0200
  7898. @@ -3106,6 +3106,8 @@ static struct snd_pci_quirk cxt5066_cfg_
  7899. SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO),
  7900. SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO),
  7901. SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
  7902. + SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD),
  7903. + SND_PCI_QUIRK(0x1028, 0x0510, "Dell Vostro", CXT5066_IDEAPAD),
  7904. SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP),
  7905. SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_HP_LAPTOP),
  7906. SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD),
  7907. @@ -3890,6 +3892,8 @@ static struct hda_codec_preset snd_hda_p
  7908. .patch = patch_cxt5066 },
  7909. { .id = 0x14f15069, .name = "CX20585",
  7910. .patch = patch_cxt5066 },
  7911. + { .id = 0x14f1506e, .name = "CX20590",
  7912. + .patch = patch_cxt5066 },
  7913. { .id = 0x14f15097, .name = "CX20631",
  7914. .patch = patch_conexant_auto },
  7915. { .id = 0x14f15098, .name = "CX20632",
  7916. @@ -3916,6 +3920,7 @@ MODULE_ALIAS("snd-hda-codec-id:14f15066"
  7917. MODULE_ALIAS("snd-hda-codec-id:14f15067");
  7918. MODULE_ALIAS("snd-hda-codec-id:14f15068");
  7919. MODULE_ALIAS("snd-hda-codec-id:14f15069");
  7920. +MODULE_ALIAS("snd-hda-codec-id:14f1506e");
  7921. MODULE_ALIAS("snd-hda-codec-id:14f15097");
  7922. MODULE_ALIAS("snd-hda-codec-id:14f15098");
  7923. MODULE_ALIAS("snd-hda-codec-id:14f150a1");
  7924. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_realtek.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_realtek.c
  7925. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_realtek.c 2011-04-01 17:56:57.369710688 +0200
  7926. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_realtek.c 2011-04-02 01:37:43.560688353 +0200
  7927. @@ -393,6 +393,7 @@ struct alc_spec {
  7928. /* other flags */
  7929. unsigned int no_analog :1; /* digital I/O only */
  7930. unsigned int dual_adc_switch:1; /* switch ADCs (for ALC275) */
  7931. + unsigned int single_input_src:1;
  7932. int init_amp;
  7933. int codec_variant; /* flag for other variants */
  7934.  
  7935. @@ -1127,11 +1128,8 @@ static void alc_automute_speaker(struct
  7936. nid = spec->autocfg.hp_pins[i];
  7937. if (!nid)
  7938. break;
  7939. - if (snd_hda_jack_detect(codec, nid)) {
  7940. - spec->jack_present = 1;
  7941. - break;
  7942. - }
  7943. - alc_report_jack(codec, spec->autocfg.hp_pins[i]);
  7944. + alc_report_jack(codec, nid);
  7945. + spec->jack_present |= snd_hda_jack_detect(codec, nid);
  7946. }
  7947.  
  7948. mute = spec->jack_present ? HDA_AMP_MUTE : 0;
  7949. @@ -3801,6 +3799,8 @@ static struct hda_amp_list alc880_lg_loo
  7950. * Common callbacks
  7951. */
  7952.  
  7953. +static void alc_init_special_input_src(struct hda_codec *codec);
  7954. +
  7955. static int alc_init(struct hda_codec *codec)
  7956. {
  7957. struct alc_spec *spec = codec->spec;
  7958. @@ -3811,6 +3811,7 @@ static int alc_init(struct hda_codec *co
  7959.  
  7960. for (i = 0; i < spec->num_init_verbs; i++)
  7961. snd_hda_sequence_write(codec, spec->init_verbs[i]);
  7962. + alc_init_special_input_src(codec);
  7963.  
  7964. if (spec->init_hook)
  7965. spec->init_hook(codec);
  7966. @@ -5444,6 +5445,7 @@ static void fixup_single_adc(struct hda_
  7967. spec->capsrc_nids += i;
  7968. spec->adc_nids += i;
  7969. spec->num_adc_nids = 1;
  7970. + spec->single_input_src = 1;
  7971. }
  7972. }
  7973.  
  7974. @@ -5455,6 +5457,16 @@ static void fixup_dual_adc_switch(struct
  7975. init_capsrc_for_pin(codec, spec->int_mic.pin);
  7976. }
  7977.  
  7978. +/* initialize some special cases for input sources */
  7979. +static void alc_init_special_input_src(struct hda_codec *codec)
  7980. +{
  7981. + struct alc_spec *spec = codec->spec;
  7982. + if (spec->dual_adc_switch)
  7983. + fixup_dual_adc_switch(codec);
  7984. + else if (spec->single_input_src)
  7985. + init_capsrc_for_pin(codec, spec->autocfg.inputs[0].pin);
  7986. +}
  7987. +
  7988. static void set_capture_mixer(struct hda_codec *codec)
  7989. {
  7990. struct alc_spec *spec = codec->spec;
  7991. @@ -5470,7 +5482,7 @@ static void set_capture_mixer(struct hda
  7992. int mux = 0;
  7993. int num_adcs = spec->num_adc_nids;
  7994. if (spec->dual_adc_switch)
  7995. - fixup_dual_adc_switch(codec);
  7996. + num_adcs = 1;
  7997. else if (spec->auto_mic)
  7998. fixup_automic_adc(codec);
  7999. else if (spec->input_mux) {
  8000. @@ -5479,8 +5491,6 @@ static void set_capture_mixer(struct hda
  8001. else if (spec->input_mux->num_items == 1)
  8002. fixup_single_adc(codec);
  8003. }
  8004. - if (spec->dual_adc_switch)
  8005. - num_adcs = 1;
  8006. spec->cap_mixer = caps[mux][num_adcs - 1];
  8007. }
  8008. }
  8009. @@ -10739,23 +10749,28 @@ static void alc882_auto_init_hp_out(stru
  8010. hda_nid_t pin, dac;
  8011. int i;
  8012.  
  8013. - for (i = 0; i < ARRAY_SIZE(spec->autocfg.hp_pins); i++) {
  8014. - pin = spec->autocfg.hp_pins[i];
  8015. - if (!pin)
  8016. - break;
  8017. - dac = spec->multiout.hp_nid;
  8018. - if (!dac)
  8019. - dac = spec->multiout.dac_nids[0]; /* to front */
  8020. - alc882_auto_set_output_and_unmute(codec, pin, PIN_HP, dac);
  8021. + if (spec->autocfg.line_out_type != AUTO_PIN_HP_OUT) {
  8022. + for (i = 0; i < ARRAY_SIZE(spec->autocfg.hp_pins); i++) {
  8023. + pin = spec->autocfg.hp_pins[i];
  8024. + if (!pin)
  8025. + break;
  8026. + dac = spec->multiout.hp_nid;
  8027. + if (!dac)
  8028. + dac = spec->multiout.dac_nids[0]; /* to front */
  8029. + alc882_auto_set_output_and_unmute(codec, pin, PIN_HP, dac);
  8030. + }
  8031. }
  8032. - for (i = 0; i < ARRAY_SIZE(spec->autocfg.speaker_pins); i++) {
  8033. - pin = spec->autocfg.speaker_pins[i];
  8034. - if (!pin)
  8035. - break;
  8036. - dac = spec->multiout.extra_out_nid[0];
  8037. - if (!dac)
  8038. - dac = spec->multiout.dac_nids[0]; /* to front */
  8039. - alc882_auto_set_output_and_unmute(codec, pin, PIN_OUT, dac);
  8040. +
  8041. + if (spec->autocfg.line_out_type != AUTO_PIN_SPEAKER_OUT) {
  8042. + for (i = 0; i < ARRAY_SIZE(spec->autocfg.speaker_pins); i++) {
  8043. + pin = spec->autocfg.speaker_pins[i];
  8044. + if (!pin)
  8045. + break;
  8046. + dac = spec->multiout.extra_out_nid[0];
  8047. + if (!dac)
  8048. + dac = spec->multiout.dac_nids[0]; /* to front */
  8049. + alc882_auto_set_output_and_unmute(codec, pin, PIN_OUT, dac);
  8050. + }
  8051. }
  8052. }
  8053.  
  8054. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_sigmatel.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_sigmatel.c
  8055. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_sigmatel.c 2011-04-01 17:56:57.369710688 +0200
  8056. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_sigmatel.c 2011-04-02 01:38:34.992688310 +0200
  8057. @@ -94,6 +94,7 @@ enum {
  8058. STAC_92HD83XXX_REF,
  8059. STAC_92HD83XXX_PWR_REF,
  8060. STAC_DELL_S14,
  8061. + STAC_DELL_E5520M,
  8062. STAC_92HD83XXX_HP,
  8063. STAC_HP_DV7_4000,
  8064. STAC_92HD83XXX_MODELS
  8065. @@ -749,7 +750,7 @@ static int stac92xx_mux_enum_put(struct
  8066. struct sigmatel_spec *spec = codec->spec;
  8067. unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  8068. const struct hda_input_mux *imux = spec->input_mux;
  8069. - unsigned int idx, prev_idx;
  8070. + unsigned int idx, prev_idx, didx;
  8071.  
  8072. idx = ucontrol->value.enumerated.item[0];
  8073. if (idx >= imux->num_items)
  8074. @@ -761,7 +762,8 @@ static int stac92xx_mux_enum_put(struct
  8075. snd_hda_codec_write_cache(codec, spec->mux_nids[adc_idx], 0,
  8076. AC_VERB_SET_CONNECT_SEL,
  8077. imux->items[idx].index);
  8078. - if (prev_idx >= spec->num_analog_muxes) {
  8079. + if (prev_idx >= spec->num_analog_muxes &&
  8080. + spec->mux_nids[adc_idx] != spec->dmux_nids[adc_idx]) {
  8081. imux = spec->dinput_mux;
  8082. /* 0 = analog */
  8083. snd_hda_codec_write_cache(codec,
  8084. @@ -771,9 +773,13 @@ static int stac92xx_mux_enum_put(struct
  8085. }
  8086. } else {
  8087. imux = spec->dinput_mux;
  8088. + /* first dimux item is hardcoded to select analog imux,
  8089. + * so lets skip it
  8090. + */
  8091. + didx = idx - spec->num_analog_muxes + 1;
  8092. snd_hda_codec_write_cache(codec, spec->dmux_nids[adc_idx], 0,
  8093. AC_VERB_SET_CONNECT_SEL,
  8094. - imux->items[idx - 1].index);
  8095. + imux->items[didx].index);
  8096. }
  8097. spec->cur_mux[adc_idx] = idx;
  8098. return 1;
  8099. @@ -1644,6 +1650,13 @@ static unsigned int dell_s14_pin_configs
  8100. 0x40f000f0, 0x40f000f0,
  8101. };
  8102.  
  8103. +/* Switch int mic from 0x20 to 0x11 */
  8104. +static unsigned int dell_e5520m_pin_configs[10] = {
  8105. + 0x04a11020, 0x0421101f, 0x400000f0, 0x90170110,
  8106. + 0x23011050, 0x23a1102e, 0x400000f3, 0xd5a30130,
  8107. + 0x400000f0, 0x40f000f0,
  8108. +};
  8109. +
  8110. static unsigned int hp_dv7_4000_pin_configs[10] = {
  8111. 0x03a12050, 0x0321201f, 0x40f000f0, 0x90170110,
  8112. 0x40f000f0, 0x40f000f0, 0x90170110, 0xd5a30140,
  8113. @@ -1654,6 +1667,7 @@ static unsigned int *stac92hd83xxx_brd_t
  8114. [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs,
  8115. [STAC_92HD83XXX_PWR_REF] = ref92hd83xxx_pin_configs,
  8116. [STAC_DELL_S14] = dell_s14_pin_configs,
  8117. + [STAC_DELL_E5520M] = dell_e5520m_pin_configs,
  8118. [STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs,
  8119. };
  8120.  
  8121. @@ -1662,6 +1676,7 @@ static const char *stac92hd83xxx_models[
  8122. [STAC_92HD83XXX_REF] = "ref",
  8123. [STAC_92HD83XXX_PWR_REF] = "mic-ref",
  8124. [STAC_DELL_S14] = "dell-s14",
  8125. + [STAC_DELL_E5520M] = "dell-e5520m",
  8126. [STAC_92HD83XXX_HP] = "hp",
  8127. [STAC_HP_DV7_4000] = "hp-dv7-4000",
  8128. };
  8129. @@ -1674,6 +1689,14 @@ static struct snd_pci_quirk stac92hd83xx
  8130. "DFI LanParty", STAC_92HD83XXX_REF),
  8131. SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ba,
  8132. "unknown Dell", STAC_DELL_S14),
  8133. + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x049a,
  8134. + "Dell E5520", STAC_DELL_E5520M),
  8135. + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x049b,
  8136. + "Dell E5420", STAC_DELL_E5520M),
  8137. + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x04eb,
  8138. + "Dell E5420m", STAC_DELL_E5520M),
  8139. + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x04ec,
  8140. + "Dell E5520m", STAC_DELL_E5520M),
  8141. SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x3600,
  8142. "HP", STAC_92HD83XXX_HP),
  8143. {} /* terminator */
  8144. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_via.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_via.c
  8145. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_via.c 2011-04-01 17:56:57.369710688 +0200
  8146. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/pci/hda/patch_via.c 2011-04-02 01:38:34.994688310 +0200
  8147. @@ -159,6 +159,7 @@ struct via_spec {
  8148. #endif
  8149. };
  8150.  
  8151. +static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec);
  8152. static struct via_spec * via_new_spec(struct hda_codec *codec)
  8153. {
  8154. struct via_spec *spec;
  8155. @@ -169,6 +170,10 @@ static struct via_spec * via_new_spec(st
  8156.  
  8157. codec->spec = spec;
  8158. spec->codec = codec;
  8159. + spec->codec_type = get_codec_type(codec);
  8160. + /* VT1708BCE & VT1708S are almost same */
  8161. + if (spec->codec_type == VT1708BCE)
  8162. + spec->codec_type = VT1708S;
  8163. return spec;
  8164. }
  8165.  
  8166. @@ -568,7 +573,7 @@ static void via_auto_init_analog_input(s
  8167. hda_nid_t nid = cfg->inputs[i].pin;
  8168. if (spec->smart51_enabled && is_smart51_pins(spec, nid))
  8169. ctl = PIN_OUT;
  8170. - else if (i == AUTO_PIN_MIC)
  8171. + else if (cfg->inputs[i].type == AUTO_PIN_MIC)
  8172. ctl = PIN_VREF50;
  8173. else
  8174. ctl = PIN_IN;
  8175. @@ -1102,6 +1107,7 @@ static int via_mux_enum_put(struct snd_k
  8176. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  8177. struct via_spec *spec = codec->spec;
  8178. unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  8179. + int ret;
  8180.  
  8181. if (!spec->mux_nids[adc_idx])
  8182. return -EINVAL;
  8183. @@ -1110,12 +1116,14 @@ static int via_mux_enum_put(struct snd_k
  8184. AC_VERB_GET_POWER_STATE, 0x00) != AC_PWRST_D0)
  8185. snd_hda_codec_write(codec, spec->mux_nids[adc_idx], 0,
  8186. AC_VERB_SET_POWER_STATE, AC_PWRST_D0);
  8187. - /* update jack power state */
  8188. - set_jack_power_state(codec);
  8189.  
  8190. - return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
  8191. + ret = snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
  8192. spec->mux_nids[adc_idx],
  8193. &spec->cur_mux[adc_idx]);
  8194. + /* update jack power state */
  8195. + set_jack_power_state(codec);
  8196. +
  8197. + return ret;
  8198. }
  8199.  
  8200. static int via_independent_hp_info(struct snd_kcontrol *kcontrol,
  8201. @@ -1189,8 +1197,16 @@ static int via_independent_hp_put(struct
  8202. /* Get Independent Mode index of headphone pin widget */
  8203. spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel
  8204. ? 1 : 0;
  8205. - snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, pinsel);
  8206. + if (spec->codec_type == VT1718S)
  8207. + snd_hda_codec_write(codec, nid, 0,
  8208. + AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0);
  8209. + else
  8210. + snd_hda_codec_write(codec, nid, 0,
  8211. + AC_VERB_SET_CONNECT_SEL, pinsel);
  8212.  
  8213. + if (spec->codec_type == VT1812)
  8214. + snd_hda_codec_write(codec, 0x35, 0,
  8215. + AC_VERB_SET_CONNECT_SEL, pinsel);
  8216. if (spec->multiout.hp_nid && spec->multiout.hp_nid
  8217. != spec->multiout.dac_nids[HDA_FRONT])
  8218. snd_hda_codec_setup_stream(codec, spec->multiout.hp_nid,
  8219. @@ -1209,6 +1225,8 @@ static int via_independent_hp_put(struct
  8220. activate_ctl(codec, "Headphone Playback Switch",
  8221. spec->hp_independent_mode);
  8222. }
  8223. + /* update jack power state */
  8224. + set_jack_power_state(codec);
  8225. return 0;
  8226. }
  8227.  
  8228. @@ -1249,9 +1267,12 @@ static int via_hp_build(struct hda_codec
  8229. break;
  8230. }
  8231.  
  8232. - nums = snd_hda_get_connections(codec, nid, conn, HDA_MAX_CONNECTIONS);
  8233. - if (nums <= 1)
  8234. - return 0;
  8235. + if (spec->codec_type != VT1708) {
  8236. + nums = snd_hda_get_connections(codec, nid,
  8237. + conn, HDA_MAX_CONNECTIONS);
  8238. + if (nums <= 1)
  8239. + return 0;
  8240. + }
  8241.  
  8242. knew = via_clone_control(spec, &via_hp_mixer[0]);
  8243. if (knew == NULL)
  8244. @@ -1311,6 +1332,11 @@ static void mute_aa_path(struct hda_code
  8245. start_idx = 2;
  8246. end_idx = 4;
  8247. break;
  8248. + case VT1718S:
  8249. + nid_mixer = 0x21;
  8250. + start_idx = 1;
  8251. + end_idx = 3;
  8252. + break;
  8253. default:
  8254. return;
  8255. }
  8256. @@ -2186,10 +2212,6 @@ static int via_init(struct hda_codec *co
  8257. for (i = 0; i < spec->num_iverbs; i++)
  8258. snd_hda_sequence_write(codec, spec->init_verbs[i]);
  8259.  
  8260. - spec->codec_type = get_codec_type(codec);
  8261. - if (spec->codec_type == VT1708BCE)
  8262. - spec->codec_type = VT1708S; /* VT1708BCE & VT1708S are almost
  8263. - same */
  8264. /* Lydia Add for EAPD enable */
  8265. if (!spec->dig_in_nid) { /* No Digital In connection */
  8266. if (spec->dig_in_pin) {
  8267. @@ -2437,7 +2459,14 @@ static int vt_auto_create_analog_input_c
  8268. else
  8269. type_idx = 0;
  8270. label = hda_get_autocfg_input_label(codec, cfg, i);
  8271. - err = via_new_analog_input(spec, label, type_idx, idx, cap_nid);
  8272. + if (spec->codec_type == VT1708S ||
  8273. + spec->codec_type == VT1702 ||
  8274. + spec->codec_type == VT1716S)
  8275. + err = via_new_analog_input(spec, label, type_idx,
  8276. + idx+1, cap_nid);
  8277. + else
  8278. + err = via_new_analog_input(spec, label, type_idx,
  8279. + idx, cap_nid);
  8280. if (err < 0)
  8281. return err;
  8282. snd_hda_add_imux_item(imux, label, idx, NULL);
  8283. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/codecs/wm8978.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/codecs/wm8978.c
  8284. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/codecs/wm8978.c 2011-04-01 17:56:57.335710687 +0200
  8285. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/codecs/wm8978.c 2011-04-02 01:37:43.433688351 +0200
  8286. @@ -147,18 +147,18 @@ static const struct snd_kcontrol_new wm8
  8287. SOC_SINGLE("DAC Playback Limiter Threshold",
  8288. WM8978_DAC_LIMITER_2, 4, 7, 0),
  8289. SOC_SINGLE("DAC Playback Limiter Boost",
  8290. - WM8978_DAC_LIMITER_2, 0, 15, 0),
  8291. + WM8978_DAC_LIMITER_2, 0, 12, 0),
  8292.  
  8293. SOC_ENUM("ALC Enable Switch", alc1),
  8294. SOC_SINGLE("ALC Capture Min Gain", WM8978_ALC_CONTROL_1, 0, 7, 0),
  8295. SOC_SINGLE("ALC Capture Max Gain", WM8978_ALC_CONTROL_1, 3, 7, 0),
  8296.  
  8297. - SOC_SINGLE("ALC Capture Hold", WM8978_ALC_CONTROL_2, 4, 7, 0),
  8298. + SOC_SINGLE("ALC Capture Hold", WM8978_ALC_CONTROL_2, 4, 10, 0),
  8299. SOC_SINGLE("ALC Capture Target", WM8978_ALC_CONTROL_2, 0, 15, 0),
  8300.  
  8301. SOC_ENUM("ALC Capture Mode", alc3),
  8302. - SOC_SINGLE("ALC Capture Decay", WM8978_ALC_CONTROL_3, 4, 15, 0),
  8303. - SOC_SINGLE("ALC Capture Attack", WM8978_ALC_CONTROL_3, 0, 15, 0),
  8304. + SOC_SINGLE("ALC Capture Decay", WM8978_ALC_CONTROL_3, 4, 10, 0),
  8305. + SOC_SINGLE("ALC Capture Attack", WM8978_ALC_CONTROL_3, 0, 10, 0),
  8306.  
  8307. SOC_SINGLE("ALC Capture Noise Gate Switch", WM8978_NOISE_GATE, 3, 1, 0),
  8308. SOC_SINGLE("ALC Capture Noise Gate Threshold",
  8309. @@ -213,8 +213,10 @@ static const struct snd_kcontrol_new wm8
  8310. WM8978_LOUT2_SPK_CONTROL, WM8978_ROUT2_SPK_CONTROL, 6, 1, 1),
  8311.  
  8312. /* DAC / ADC oversampling */
  8313. - SOC_SINGLE("DAC 128x Oversampling Switch", WM8978_DAC_CONTROL, 8, 1, 0),
  8314. - SOC_SINGLE("ADC 128x Oversampling Switch", WM8978_ADC_CONTROL, 8, 1, 0),
  8315. + SOC_SINGLE("DAC 128x Oversampling Switch", WM8978_DAC_CONTROL,
  8316. + 5, 1, 0),
  8317. + SOC_SINGLE("ADC 128x Oversampling Switch", WM8978_ADC_CONTROL,
  8318. + 5, 1, 0),
  8319. };
  8320.  
  8321. /* Mixer #1: Output (OUT1, OUT2) Mixer: mix AUX, Input mixer output and DAC */
  8322. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/codecs/wm9081.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/codecs/wm9081.c
  8323. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/codecs/wm9081.c 2011-04-01 17:56:57.335710687 +0200
  8324. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/codecs/wm9081.c 2011-04-02 01:37:43.435688353 +0200
  8325. @@ -15,6 +15,7 @@
  8326. #include <linux/moduleparam.h>
  8327. #include <linux/init.h>
  8328. #include <linux/delay.h>
  8329. +#include <linux/device.h>
  8330. #include <linux/pm.h>
  8331. #include <linux/i2c.h>
  8332. #include <linux/platform_device.h>
  8333. @@ -1338,6 +1339,10 @@ static __devinit int wm9081_i2c_probe(st
  8334. wm9081->control_type = SND_SOC_I2C;
  8335. wm9081->control_data = i2c;
  8336.  
  8337. + if (dev_get_platdata(&i2c->dev))
  8338. + memcpy(&wm9081->retune, dev_get_platdata(&i2c->dev),
  8339. + sizeof(wm9081->retune));
  8340. +
  8341. ret = snd_soc_register_codec(&i2c->dev,
  8342. &soc_codec_dev_wm9081, &wm9081_dai, 1);
  8343. if (ret < 0)
  8344. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/imx/eukrea-tlv320.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/imx/eukrea-tlv320.c
  8345. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/imx/eukrea-tlv320.c 2011-04-01 17:56:57.330710687 +0200
  8346. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/imx/eukrea-tlv320.c 2011-04-02 01:37:43.417688353 +0200
  8347. @@ -80,7 +80,7 @@ static struct snd_soc_dai_link eukrea_tl
  8348. .name = "tlv320aic23",
  8349. .stream_name = "TLV320AIC23",
  8350. .codec_dai_name = "tlv320aic23-hifi",
  8351. - .platform_name = "imx-pcm-audio.0",
  8352. + .platform_name = "imx-fiq-pcm-audio.0",
  8353. .codec_name = "tlv320aic23-codec.0-001a",
  8354. .cpu_dai_name = "imx-ssi.0",
  8355. .ops = &eukrea_tlv320_snd_ops,
  8356. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e740_wm9705.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e740_wm9705.c
  8357. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e740_wm9705.c 2011-04-01 17:56:57.332710687 +0200
  8358. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e740_wm9705.c 2011-04-02 01:37:43.421688351 +0200
  8359. @@ -117,7 +117,7 @@ static struct snd_soc_dai_link e740_dai[
  8360. {
  8361. .name = "AC97",
  8362. .stream_name = "AC97 HiFi",
  8363. - .cpu_dai_name = "pxa-ac97.0",
  8364. + .cpu_dai_name = "pxa2xx-ac97",
  8365. .codec_dai_name = "wm9705-hifi",
  8366. .platform_name = "pxa-pcm-audio",
  8367. .codec_name = "wm9705-codec",
  8368. @@ -126,7 +126,7 @@ static struct snd_soc_dai_link e740_dai[
  8369. {
  8370. .name = "AC97 Aux",
  8371. .stream_name = "AC97 Aux",
  8372. - .cpu_dai_name = "pxa-ac97.1",
  8373. + .cpu_dai_name = "pxa2xx-ac97-aux",
  8374. .codec_dai_name = "wm9705-aux",
  8375. .platform_name = "pxa-pcm-audio",
  8376. .codec_name = "wm9705-codec",
  8377. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e750_wm9705.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e750_wm9705.c
  8378. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e750_wm9705.c 2011-04-01 17:56:57.332710687 +0200
  8379. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e750_wm9705.c 2011-04-02 01:37:43.421688351 +0200
  8380. @@ -99,7 +99,7 @@ static struct snd_soc_dai_link e750_dai[
  8381. {
  8382. .name = "AC97",
  8383. .stream_name = "AC97 HiFi",
  8384. - .cpu_dai_name = "pxa-ac97.0",
  8385. + .cpu_dai_name = "pxa2xx-ac97",
  8386. .codec_dai_name = "wm9705-hifi",
  8387. .platform_name = "pxa-pcm-audio",
  8388. .codec_name = "wm9705-codec",
  8389. @@ -109,7 +109,7 @@ static struct snd_soc_dai_link e750_dai[
  8390. {
  8391. .name = "AC97 Aux",
  8392. .stream_name = "AC97 Aux",
  8393. - .cpu_dai_name = "pxa-ac97.1",
  8394. + .cpu_dai_name = "pxa2xx-ac97-aux",
  8395. .codec_dai_name ="wm9705-aux",
  8396. .platform_name = "pxa-pcm-audio",
  8397. .codec_name = "wm9705-codec",
  8398. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e800_wm9712.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e800_wm9712.c
  8399. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e800_wm9712.c 2011-04-01 17:56:57.332710687 +0200
  8400. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/e800_wm9712.c 2011-04-02 01:37:43.422688351 +0200
  8401. @@ -89,7 +89,7 @@ static struct snd_soc_dai_link e800_dai[
  8402. {
  8403. .name = "AC97",
  8404. .stream_name = "AC97 HiFi",
  8405. - .cpu_dai_name = "pxa-ac97.0",
  8406. + .cpu_dai_name = "pxa2xx-ac97",
  8407. .codec_dai_name = "wm9712-hifi",
  8408. .platform_name = "pxa-pcm-audio",
  8409. .codec_name = "wm9712-codec",
  8410. @@ -98,7 +98,7 @@ static struct snd_soc_dai_link e800_dai[
  8411. {
  8412. .name = "AC97 Aux",
  8413. .stream_name = "AC97 Aux",
  8414. - .cpu_dai_name = "pxa-ac97.1",
  8415. + .cpu_dai_name = "pxa2xx-ac97-aux",
  8416. .codec_dai_name ="wm9712-aux",
  8417. .platform_name = "pxa-pcm-audio",
  8418. .codec_name = "wm9712-codec",
  8419. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/em-x270.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/em-x270.c
  8420. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/em-x270.c 2011-04-01 17:56:57.331710687 +0200
  8421. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/em-x270.c 2011-04-02 01:37:43.421688351 +0200
  8422. @@ -38,7 +38,7 @@ static struct snd_soc_dai_link em_x270_d
  8423. {
  8424. .name = "AC97",
  8425. .stream_name = "AC97 HiFi",
  8426. - .cpu_dai_name = "pxa-ac97.0",
  8427. + .cpu_dai_name = "pxa2xx-ac97",
  8428. .codec_dai_name = "wm9712-hifi",
  8429. .platform_name = "pxa-pcm-audio",
  8430. .codec_name = "wm9712-codec",
  8431. @@ -46,7 +46,7 @@ static struct snd_soc_dai_link em_x270_d
  8432. {
  8433. .name = "AC97 Aux",
  8434. .stream_name = "AC97 Aux",
  8435. - .cpu_dai_name = "pxa-ac97.1",
  8436. + .cpu_dai_name = "pxa2xx-ac97-aux",
  8437. .codec_dai_name ="wm9712-aux",
  8438. .platform_name = "pxa-pcm-audio",
  8439. .codec_name = "wm9712-codec",
  8440. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/mioa701_wm9713.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/mioa701_wm9713.c
  8441. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/mioa701_wm9713.c 2011-04-01 17:56:57.332710687 +0200
  8442. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/mioa701_wm9713.c 2011-04-02 01:37:43.422688351 +0200
  8443. @@ -162,7 +162,7 @@ static struct snd_soc_dai_link mioa701_d
  8444. {
  8445. .name = "AC97",
  8446. .stream_name = "AC97 HiFi",
  8447. - .cpu_dai_name = "pxa-ac97.0",
  8448. + .cpu_dai_name = "pxa2xx-ac97",
  8449. .codec_dai_name = "wm9713-hifi",
  8450. .codec_name = "wm9713-codec",
  8451. .init = mioa701_wm9713_init,
  8452. @@ -172,7 +172,7 @@ static struct snd_soc_dai_link mioa701_d
  8453. {
  8454. .name = "AC97 Aux",
  8455. .stream_name = "AC97 Aux",
  8456. - .cpu_dai_name = "pxa-ac97.1",
  8457. + .cpu_dai_name = "pxa2xx-ac97-aux",
  8458. .codec_dai_name ="wm9713-aux",
  8459. .codec_name = "wm9713-codec",
  8460. .platform_name = "pxa-pcm-audio",
  8461. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/palm27x.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/palm27x.c
  8462. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/palm27x.c 2011-04-01 17:56:57.332710687 +0200
  8463. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/palm27x.c 2011-04-02 01:37:43.422688351 +0200
  8464. @@ -132,7 +132,7 @@ static struct snd_soc_dai_link palm27x_d
  8465. {
  8466. .name = "AC97 HiFi",
  8467. .stream_name = "AC97 HiFi",
  8468. - .cpu_dai_name = "pxa-ac97.0",
  8469. + .cpu_dai_name = "pxa2xx-ac97",
  8470. .codec_dai_name = "wm9712-hifi",
  8471. .codec_name = "wm9712-codec",
  8472. .platform_name = "pxa-pcm-audio",
  8473. @@ -141,7 +141,7 @@ static struct snd_soc_dai_link palm27x_d
  8474. {
  8475. .name = "AC97 Aux",
  8476. .stream_name = "AC97 Aux",
  8477. - .cpu_dai_name = "pxa-ac97.1",
  8478. + .cpu_dai_name = "pxa2xx-ac97-aux",
  8479. .codec_dai_name = "wm9712-aux",
  8480. .codec_name = "wm9712-codec",
  8481. .platform_name = "pxa-pcm-audio",
  8482. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/tosa.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/tosa.c
  8483. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/tosa.c 2011-04-01 17:56:57.332710687 +0200
  8484. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/tosa.c 2011-04-02 01:37:43.421688351 +0200
  8485. @@ -217,7 +217,7 @@ static struct snd_soc_dai_link tosa_dai[
  8486. {
  8487. .name = "AC97",
  8488. .stream_name = "AC97 HiFi",
  8489. - .cpu_dai_name = "pxa-ac97.0",
  8490. + .cpu_dai_name = "pxa2xx-ac97",
  8491. .codec_dai_name = "wm9712-hifi",
  8492. .platform_name = "pxa-pcm-audio",
  8493. .codec_name = "wm9712-codec",
  8494. @@ -227,7 +227,7 @@ static struct snd_soc_dai_link tosa_dai[
  8495. {
  8496. .name = "AC97 Aux",
  8497. .stream_name = "AC97 Aux",
  8498. - .cpu_dai_name = "pxa-ac97.1",
  8499. + .cpu_dai_name = "pxa2xx-ac97-aux",
  8500. .codec_dai_name = "wm9712-aux",
  8501. .platform_name = "pxa-pcm-audio",
  8502. .codec_name = "wm9712-codec",
  8503. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/zylonite.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/zylonite.c
  8504. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/zylonite.c 2011-04-01 17:56:57.332710687 +0200
  8505. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/soc/pxa/zylonite.c 2011-04-02 01:37:43.422688351 +0200
  8506. @@ -166,7 +166,7 @@ static struct snd_soc_dai_link zylonite_
  8507. .stream_name = "AC97 HiFi",
  8508. .codec_name = "wm9713-codec",
  8509. .platform_name = "pxa-pcm-audio",
  8510. - .cpu_dai_name = "pxa-ac97.0",
  8511. + .cpu_dai_name = "pxa2xx-ac97",
  8512. .codec_name = "wm9713-hifi",
  8513. .init = zylonite_wm9713_init,
  8514. },
  8515. @@ -175,7 +175,7 @@ static struct snd_soc_dai_link zylonite_
  8516. .stream_name = "AC97 Aux",
  8517. .codec_name = "wm9713-codec",
  8518. .platform_name = "pxa-pcm-audio",
  8519. - .cpu_dai_name = "pxa-ac97.1",
  8520. + .cpu_dai_name = "pxa2xx-ac97-aux",
  8521. .codec_name = "wm9713-aux",
  8522. },
  8523. {
  8524. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/card.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/card.c
  8525. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/card.c 2011-04-01 17:56:57.340710688 +0200
  8526. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/card.c 2011-04-02 01:37:43.444688353 +0200
  8527. @@ -323,6 +323,7 @@ static int snd_usb_audio_create(struct u
  8528. return -ENOMEM;
  8529. }
  8530.  
  8531. + mutex_init(&chip->shutdown_mutex);
  8532. chip->index = idx;
  8533. chip->dev = dev;
  8534. chip->card = card;
  8535. @@ -531,6 +532,7 @@ static void snd_usb_audio_disconnect(str
  8536. chip = ptr;
  8537. card = chip->card;
  8538. mutex_lock(&register_mutex);
  8539. + mutex_lock(&chip->shutdown_mutex);
  8540. chip->shutdown = 1;
  8541. chip->num_interfaces--;
  8542. if (chip->num_interfaces <= 0) {
  8543. @@ -548,9 +550,11 @@ static void snd_usb_audio_disconnect(str
  8544. snd_usb_mixer_disconnect(p);
  8545. }
  8546. usb_chip[chip->index] = NULL;
  8547. + mutex_unlock(&chip->shutdown_mutex);
  8548. mutex_unlock(&register_mutex);
  8549. snd_card_free_when_closed(card);
  8550. } else {
  8551. + mutex_unlock(&chip->shutdown_mutex);
  8552. mutex_unlock(&register_mutex);
  8553. }
  8554. }
  8555. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/pcm.c linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/pcm.c
  8556. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/pcm.c 2011-04-01 17:56:57.341710688 +0200
  8557. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/pcm.c 2011-04-02 01:37:43.444688353 +0200
  8558. @@ -361,6 +361,7 @@ static int snd_usb_hw_params(struct snd_
  8559. }
  8560.  
  8561. if (changed) {
  8562. + mutex_lock(&subs->stream->chip->shutdown_mutex);
  8563. /* format changed */
  8564. snd_usb_release_substream_urbs(subs, 0);
  8565. /* influenced: period_bytes, channels, rate, format, */
  8566. @@ -368,6 +369,7 @@ static int snd_usb_hw_params(struct snd_
  8567. params_rate(hw_params),
  8568. snd_pcm_format_physical_width(params_format(hw_params)) *
  8569. params_channels(hw_params));
  8570. + mutex_unlock(&subs->stream->chip->shutdown_mutex);
  8571. }
  8572.  
  8573. return ret;
  8574. @@ -385,8 +387,9 @@ static int snd_usb_hw_free(struct snd_pc
  8575. subs->cur_audiofmt = NULL;
  8576. subs->cur_rate = 0;
  8577. subs->period_bytes = 0;
  8578. - if (!subs->stream->chip->shutdown)
  8579. - snd_usb_release_substream_urbs(subs, 0);
  8580. + mutex_lock(&subs->stream->chip->shutdown_mutex);
  8581. + snd_usb_release_substream_urbs(subs, 0);
  8582. + mutex_unlock(&subs->stream->chip->shutdown_mutex);
  8583. return snd_pcm_lib_free_vmalloc_buffer(substream);
  8584. }
  8585.  
  8586. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/usbaudio.h linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/usbaudio.h
  8587. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/usbaudio.h 2011-04-01 17:56:57.341710688 +0200
  8588. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//sound/usb/usbaudio.h 2011-04-02 01:37:43.445688353 +0200
  8589. @@ -36,6 +36,7 @@ struct snd_usb_audio {
  8590. struct snd_card *card;
  8591. u32 usb_id;
  8592. int shutdown;
  8593. + struct mutex shutdown_mutex;
  8594. unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */
  8595. int num_interfaces;
  8596. int num_suspended_intf;
  8597. diff -Nrupad linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//tools/perf/util/PERF-VERSION-GEN linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//tools/perf/util/PERF-VERSION-GEN
  8598. --- linux-2.6.37.2_plus_v1_CFS_compaction_zcache_no-2.6.38//tools/perf/util/PERF-VERSION-GEN 2011-04-01 17:56:57.399710688 +0200
  8599. +++ linux-2.6.37.6_plus_v1_CFS_compaction_zcache_no-2.6.38//tools/perf/util/PERF-VERSION-GEN 2011-04-02 01:37:43.600688353 +0200
  8600. @@ -23,10 +23,10 @@ if test -d ../../.git -o -f ../../.git &
  8601. then
  8602. VN=$(echo "$VN" | sed -e 's/-/./g');
  8603. else
  8604. - eval `grep '^VERSION\s*=' ../../Makefile|tr -d ' '`
  8605. - eval `grep '^PATCHLEVEL\s*=' ../../Makefile|tr -d ' '`
  8606. - eval `grep '^SUBLEVEL\s*=' ../../Makefile|tr -d ' '`
  8607. - eval `grep '^EXTRAVERSION\s*=' ../../Makefile|tr -d ' '`
  8608. + eval $(grep '^VERSION[[:space:]]*=' ../../Makefile|tr -d ' ')
  8609. + eval $(grep '^PATCHLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ')
  8610. + eval $(grep '^SUBLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ')
  8611. + eval $(grep '^EXTRAVERSION[[:space:]]*=' ../../Makefile|tr -d ' ')
  8612.  
  8613. VN="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}"
  8614. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement