History

Merge branch 'perf/urgent' into perf/core, to pick up fixes

Ingo Molnar committed 11 years ago

Commit 02b643b2 parents d1ee8bc 4c09e0d124 files · +855 −1087Browse files

Unified · Split

124 files
  1. .get_maintainer.ignore +1 −0
  2. MAINTAINERS +1 −0
  3. Makefile +1 −1
  4. arch/arm/Makefile +3 −0
  5. arch/arm/lib/uaccess_with_memcpy.c +1 −1
  6. arch/arm/mach-omap2/omap-wakeupgen.c +1 −0
  7. arch/arm64/kvm/inject_fault.c +6 −6
  8. arch/mips/kernel/genex.S +1 −1
  9. arch/powerpc/kernel/pci_of_scan.c +3 −0
  10. arch/x86/include/asm/switch_to.h +4 −8
  11. arch/x86/kernel/apic/apic.c +7 −7
  12. arch/x86/kernel/apic/vector.c +1 −1
  13. arch/x86/kernel/fpu/core.c +1 −1
  14. arch/x86/kernel/fpu/init.c +6 −1
  15. arch/x86/kernel/process.c +2 −0
  16. arch/x86/xen/Kconfig +2 −2
  17. drivers/acpi/nfit.c +12 −12
  18. drivers/acpi/video_detect.c +13 −3
  19. drivers/ata/libata-core.c +2 −0
  20. drivers/block/mtip32xx/mtip32xx.c +8 −0
  21. drivers/clocksource/timer-imx-gpt.c +1 −0
  22. drivers/cpufreq/exynos-cpufreq.c +4 −2
  23. drivers/firmware/broadcom/bcm47xx_nvram.c +1 −1
  24. drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1 −1
  25. drivers/gpu/drm/i915/intel_bios.c +4 −23
  26. drivers/gpu/drm/i915/intel_dp.c +22 −13
  27. drivers/gpu/drm/i915/intel_lrc.c +2 −0
  28. drivers/gpu/drm/radeon/radeon_irq_kms.c +5 −0
  29. drivers/input/keyboard/gpio_keys_polled.c +1 −1
  30. drivers/irqchip/irq-crossbar.c +3 −1
  31. drivers/media/dvb-frontends/Kconfig +1 −1
  32. drivers/media/pci/cobalt/Kconfig +1 −0
  33. drivers/media/pci/cobalt/cobalt-irq.c +1 −1
  34. drivers/media/pci/mantis/mantis_dma.c +3 −2
  35. drivers/media/rc/ir-rc5-decoder.c +0 −116
  36. drivers/media/rc/ir-rc6-decoder.c +0 −122
  37. drivers/media/rc/nuvoton-cir.c +0 −127
  38. drivers/media/rc/nuvoton-cir.h +0 −1
  39. drivers/media/rc/rc-core-priv.h +0 −36
  40. drivers/media/rc/rc-ir-raw.c +0 −139
  41. drivers/media/rc/rc-loopback.c +0 −36
  42. drivers/media/rc/rc-main.c +1 −6
  43. drivers/media/v4l2-core/videobuf2-core.c +25 −15
  44. drivers/net/can/usb/peak_usb/pcan_usb.c +13 −11
  45. drivers/net/can/usb/peak_usb/pcan_usb_core.c +2 −2
  46. drivers/net/can/usb/peak_usb/pcan_usb_core.h +2 −2
  47. drivers/net/can/usb/peak_usb/pcan_usb_fd.c +52 −44
  48. drivers/net/can/usb/peak_usb/pcan_usb_pro.c +13 −11
  49. drivers/net/ethernet/Makefile +1 −1
  50. drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +3 −0
  51. drivers/net/ethernet/apm/xgene/xgene_enet_main.c +3 −2
  52. drivers/net/ethernet/broadcom/genet/bcmgenet.c +16 −4
  53. drivers/net/ethernet/emulex/benet/be_main.c +2 −2
  54. drivers/net/ethernet/freescale/fec_main.c +2 −2
  55. drivers/net/ethernet/freescale/gianfar.c +5 −0
  56. drivers/net/ethernet/intel/fm10k/fm10k_main.c +1 −1
  57. drivers/net/ethernet/intel/igb/igb_main.c +1 −1
  58. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +1 −1
  59. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +1 −1
  60. drivers/net/ethernet/micrel/ks8842.c +2 −3
  61. drivers/net/ethernet/sfc/ef10.c +26 −1
  62. drivers/net/phy/fixed_phy.c +9 −0
  63. drivers/net/phy/phy.c +24 −8
  64. drivers/net/phy/phy_device.c +1 −1
  65. drivers/net/phy/smsc.c +19 −12
  66. drivers/net/ppp/ppp_generic.c +42 −36
  67. drivers/net/usb/qmi_wwan.c +1 −0
  68. drivers/net/usb/usbnet.c +4 −3
  69. drivers/net/vxlan.c +2 −0
  70. drivers/pci/Kconfig +1 −1
  71. drivers/pci/probe.c +7 −2
  72. drivers/scsi/fnic/fnic.h +1 −1
  73. drivers/scsi/fnic/fnic_scsi.c +3 −1
  74. drivers/scsi/scsi_pm.c +11 −11
  75. drivers/target/iscsi/iscsi_target.c +2 −2
  76. drivers/target/target_core_configfs.c +8 −1
  77. drivers/target/target_core_hba.c +9 −1
  78. drivers/target/target_core_spc.c +25 −19
  79. drivers/thermal/cpu_cooling.c +44 −29
  80. drivers/thermal/power_allocator.c +5 −6
  81. fs/fs-writeback.c +13 −9
  82. include/drm/drm_edid.h +19 −0
  83. include/linux/irq.h +1 −0
  84. include/linux/mm.h +28 −0
  85. include/linux/mm_types.h +0 −9
  86. include/linux/pci.h +1 −0
  87. include/linux/skbuff.h +5 −9
  88. include/media/rc-core.h +0 −7
  89. include/media/videobuf2-core.h +2 −0
  90. include/sound/soc-topology.h +12 −0
  91. include/uapi/sound/asoc.h +6 −0
  92. kernel/irq/chip.c +18 −1
  93. kernel/time/timer.c +2 −2
  94. mm/page_alloc.c +6 −3
  95. mm/slab.c +2 −2
  96. mm/slub.c +1 −1
  97. net/9p/client.c +2 −0
  98. net/batman-adv/translation-table.c +4 −1
  99. net/bridge/br_multicast.c +2 −2
  100. net/core/skbuff.c +19 −20
  101. net/ipv4/fib_trie.c +1 −1
  102. net/ipv4/igmp.c +18 −15
  103. net/ipv4/inet_connection_sock.c +1 −1
  104. net/ipv4/sysctl_net_ipv4.c +4 −6
  105. net/ipv6/ip6_fib.c +2 −0
  106. net/ipv6/ip6_gre.c +1 −0
  107. net/ipv6/mcast_snoop.c +18 −15
  108. net/ipv6/route.c +55 −24
  109. net/key/af_key.c +23 −23
  110. net/mac80211/rc80211_minstrel.c +6 −5
  111. net/netlink/af_netlink.c +1 −1
  112. net/sched/cls_u32.c +13 −0
  113. net/sctp/sm_make_chunk.c +7 −0
  114. net/sctp/sm_sideeffect.c +1 −1
  115. security/security.c +6 −5
  116. sound/pci/hda/hda_codec.c +1 −1
  117. sound/pci/hda/hda_generic.c +4 −7
  118. sound/pci/hda/patch_conexant.c +22 −1
  119. sound/pci/hda/patch_realtek.c +2 −0
  120. sound/soc/Kconfig +3 −0
  121. sound/soc/Makefile +3 −0
  122. sound/usb/card.c +1 −1
  123. sound/usb/quirks.c +1 −0
  124. tools/perf/builtin-stat.c +2 −3
.get_maintainer.ignore+1−0
@@ -0,0 +1 @@
1+Christoph Hellwig <hch@lst.de>
MAINTAINERS+1−0
@@ -5849,6 +5849,7 @@ S: Odd Fixes · 5848 unmodified lines
58495849
58505850 KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
58515851 M: "J. Bruce Fields" <bfields@fieldses.org>
5852+M: Jeff Layton <jlayton@poochiereds.net>
58525853 L: linux-nfs@vger.kernel.org
58535854 W: http://nfs.sourceforge.net/
58545855 S: Supported
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 4
22 PATCHLEVEL = 2
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc7
4+EXTRAVERSION =
55 NAME = Hurr durr I'ma sheep
66
77 # *DOCUMENTATION*
arch/arm/Makefile+3−0
@@ -312,6 +312,9 @@ INSTALL_TARGETS = zinstall uinstall install · 311 unmodified lines
312312
313313 PHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)
314314
315+bootpImage uImage: zImage
316+zImage: Image
317+
315318 $(BOOT_TARGETS): vmlinux
316319 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
317320
arch/arm/lib/uaccess_with_memcpy.c+1−1
@@ -96,7 +96,7 @@ __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n) · 95 unmodified lines
9696 }
9797
9898 /* the mmap semaphore is taken only if not in an atomic context */
99− atomic = in_atomic();
99+ atomic = faulthandler_disabled();
100100
101101 if (!atomic)
102102 down_read(&current->mm->mmap_sem);
arch/arm/mach-omap2/omap-wakeupgen.c+1−0
@@ -392,6 +392,7 @@ static struct irq_chip wakeupgen_chip = { · 391 unmodified lines
392392 .irq_mask = wakeupgen_mask,
393393 .irq_unmask = wakeupgen_unmask,
394394 .irq_retrigger = irq_chip_retrigger_hierarchy,
395+ .irq_set_type = irq_chip_set_type_parent,
395396 .flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND,
396397 #ifdef CONFIG_SMP
397398 .irq_set_affinity = irq_chip_set_affinity_parent,
arch/arm64/kvm/inject_fault.c+6−6
@@ -168,8 +168,8 @@ void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr) · 167 unmodified lines
168168 {
169169 if (!(vcpu->arch.hcr_el2 & HCR_RW))
170170 inject_abt32(vcpu, false, addr);
171−
172− inject_abt64(vcpu, false, addr);
171+ else
172+ inject_abt64(vcpu, false, addr);
173173 }
174174
175175 /**
@@ -184,8 +184,8 @@ void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr) · 8 unmodified lines
184184 {
185185 if (!(vcpu->arch.hcr_el2 & HCR_RW))
186186 inject_abt32(vcpu, true, addr);
187−
188− inject_abt64(vcpu, true, addr);
187+ else
188+ inject_abt64(vcpu, true, addr);
189189 }
190190
191191 /**
@@ -198,6 +198,6 @@ void kvm_inject_undefined(struct kvm_vcpu *vcpu) · 6 unmodified lines
198198 {
199199 if (!(vcpu->arch.hcr_el2 & HCR_RW))
200200 inject_undef32(vcpu);
201−
202− inject_undef64(vcpu);
201+ else
202+ inject_undef64(vcpu);
203203 }
arch/mips/kernel/genex.S+1−1
@@ -407,7 +407,7 @@ NESTED(nmi_handler, PT_SIZE, sp) · 406 unmodified lines
407407 .set noat
408408 SAVE_ALL
409409 FEXPORT(handle_\exception\ext)
410− __BUILD_clear_\clear
410+ __build_clear_\clear
411411 .set at
412412 __BUILD_\verbose \exception
413413 move a0, sp
arch/powerpc/kernel/pci_of_scan.c+3−0
@@ -191,6 +191,9 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, · 190 unmodified lines
191191
192192 pci_device_add(dev, bus);
193193
194+ /* Setup MSI caps & disable MSI/MSI-X interrupts */
195+ pci_msi_setup_pci_dev(dev);
196+
194197 return dev;
195198 }
196199 EXPORT_SYMBOL(of_create_pci_dev);
arch/x86/include/asm/switch_to.h+4−8
@@ -79,12 +79,12 @@ do { \ · 78 unmodified lines
7979 #else /* CONFIG_X86_32 */
8080
8181 /* frame pointer must be last for get_wchan */
82−#define SAVE_CONTEXT "pushq %%rbp ; movq %%rsi,%%rbp\n\t"
83−#define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp\t"
82+#define SAVE_CONTEXT "pushf ; pushq %%rbp ; movq %%rsi,%%rbp\n\t"
83+#define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp ; popf\t"
8484
8585 #define __EXTRA_CLOBBER \
8686 , "rcx", "rbx", "rdx", "r8", "r9", "r10", "r11", \
87− "r12", "r13", "r14", "r15", "flags"
87+ "r12", "r13", "r14", "r15"
8888
8989 #ifdef CONFIG_CC_STACKPROTECTOR
9090 #define __switch_canary \
@@ -100,11 +100,7 @@ do { \ · 9 unmodified lines
100100 #define __switch_canary_iparam
101101 #endif /* CC_STACKPROTECTOR */
102102
103−/*
104− * There is no need to save or restore flags, because flags are always
105− * clean in kernel mode, with the possible exception of IOPL. Kernel IOPL
106− * has no effect.
107− */
103+/* Save restore flags to clear handle leaking NT */
108104 #define switch_to(prev, next, last) \
109105 asm volatile(SAVE_CONTEXT \
110106 "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \
arch/x86/kernel/apic/apic.c+7−7
@@ -1424,7 +1424,7 @@ static inline void __x2apic_disable(void) · 1423 unmodified lines
14241424 {
14251425 u64 msr;
14261426
1427− if (cpu_has_apic)
1427+ if (!cpu_has_apic)
14281428 return;
14291429
14301430 rdmsrl(MSR_IA32_APICBASE, msr);
@@ -1483,10 +1483,13 @@ void x2apic_setup(void) · 52 unmodified lines
14831483
14841484 static __init void x2apic_disable(void)
14851485 {
1486− u32 x2apic_id;
1486+ u32 x2apic_id, state = x2apic_state;
14871487
1488− if (x2apic_state != X2APIC_ON)
1489− goto out;
1488+ x2apic_mode = 0;
1489+ x2apic_state = X2APIC_DISABLED;
1490+
1491+ if (state != X2APIC_ON)
1492+ return;
14901493
14911494 x2apic_id = read_apic_id();
14921495 if (x2apic_id >= 255)
@@ -1494,9 +1497,6 @@ static __init void x2apic_disable(void) · 1 unmodified line
14941497
14951498 __x2apic_disable();
14961499 register_lapic_address(mp_lapic_addr);
1497−out:
1498− x2apic_state = X2APIC_DISABLED;
1499− x2apic_mode = 0;
15001500 }
15011501
15021502 static __init void x2apic_enable(void)
arch/x86/kernel/apic/vector.c+1−1
@@ -322,7 +322,7 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq, · 321 unmodified lines
322322 irq_data->chip = &lapic_controller;
323323 irq_data->chip_data = data;
324324 irq_data->hwirq = virq + i;
325− err = assign_irq_vector_policy(virq, irq_data->node, data,
325+ err = assign_irq_vector_policy(virq + i, irq_data->node, data,
326326 info);
327327 if (err)
328328 goto error;
arch/x86/kernel/fpu/core.c+1−1
@@ -270,7 +270,7 @@ int fpu__copy(struct fpu *dst_fpu, struct fpu *src_fpu) · 269 unmodified lines
270270 dst_fpu->fpregs_active = 0;
271271 dst_fpu->last_cpu = -1;
272272
273− if (src_fpu->fpstate_active)
273+ if (src_fpu->fpstate_active && cpu_has_fpu)
274274 fpu_copy(dst_fpu, src_fpu);
275275
276276 return 0;
arch/x86/kernel/fpu/init.c+6−1
@@ -40,7 +40,12 @@ static void fpu__init_cpu_generic(void) · 39 unmodified lines
4040 write_cr0(cr0);
4141
4242 /* Flush out any pending x87 state: */
43− asm volatile ("fninit");
43+#ifdef CONFIG_MATH_EMULATION
44+ if (!cpu_has_fpu)
45+ fpstate_init_soft(&current->thread.fpu.state.soft);
46+ else
47+#endif
48+ asm volatile ("fninit");
4449 }
4550
4651 /*
arch/x86/kernel/process.c+2−0
@@ -408,6 +408,7 @@ static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c) · 407 unmodified lines
408408 static void mwait_idle(void)
409409 {
410410 if (!current_set_polling_and_test()) {
411+ trace_cpu_idle_rcuidle(1, smp_processor_id());
411412 if (this_cpu_has(X86_BUG_CLFLUSH_MONITOR)) {
412413 smp_mb(); /* quirk */
413414 clflush((void *)&current_thread_info()->flags);
@@ -419,6 +420,7 @@ static void mwait_idle(void) · 5 unmodified lines
419420 __sti_mwait(0, 0);
420421 else
421422 local_irq_enable();
423+ trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
422424 } else {
423425 local_irq_enable();
424426 }
arch/x86/xen/Kconfig+2−2
@@ -8,7 +8,7 @@ config XEN · 7 unmodified lines
88 select PARAVIRT_CLOCK
99 select XEN_HAVE_PVMMU
1010 depends on X86_64 || (X86_32 && X86_PAE)
11− depends on X86_TSC
11+ depends on X86_LOCAL_APIC && X86_TSC
1212 help
1313 This is the Linux Xen port. Enabling this will allow the
1414 kernel to boot in a paravirtualized environment under the
@@ -17,7 +17,7 @@ config XEN · 2 unmodified lines
1717 config XEN_DOM0
1818 def_bool y
1919 depends on XEN && PCI_XEN && SWIOTLB_XEN
20− depends on X86_LOCAL_APIC && X86_IO_APIC && ACPI && PCI
20+ depends on X86_IO_APIC && ACPI && PCI
2121
2222 config XEN_PVHVM
2323 def_bool y
drivers/acpi/nfit.c+12−12
@@ -702,11 +702,11 @@ static ssize_t flags_show(struct device *dev, · 701 unmodified lines
702702 u16 flags = to_nfit_memdev(dev)->flags;
703703
704704 return sprintf(buf, "%s%s%s%s%s\n",
705− flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save " : "",
706− flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore " : "",
707− flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush " : "",
708− flags & ACPI_NFIT_MEM_ARMED ? "arm " : "",
709− flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart " : "");
705+ flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save_fail " : "",
706+ flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore_fail " : "",
707+ flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush_fail " : "",
708+ flags & ACPI_NFIT_MEM_ARMED ? "not_armed " : "",
709+ flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart_event " : "");
710710 }
711711 static DEVICE_ATTR_RO(flags);
712712
@@ -849,12 +849,12 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc) · 136 unmodified lines
849849 if ((mem_flags & ACPI_NFIT_MEM_FAILED_MASK) == 0)
850850 continue;
851851
852− dev_info(acpi_desc->dev, "%s: failed: %s%s%s%s\n",
852+ dev_info(acpi_desc->dev, "%s flags:%s%s%s%s\n",
853853 nvdimm_name(nvdimm),
854− mem_flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save " : "",
855− mem_flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore " : "",
856− mem_flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush " : "",
857− mem_flags & ACPI_NFIT_MEM_ARMED ? "arm " : "");
854+ mem_flags & ACPI_NFIT_MEM_SAVE_FAILED ? " save_fail" : "",
855+ mem_flags & ACPI_NFIT_MEM_RESTORE_FAILED ? " restore_fail":"",
856+ mem_flags & ACPI_NFIT_MEM_FLUSH_FAILED ? " flush_fail" : "",
857+ mem_flags & ACPI_NFIT_MEM_ARMED ? " not_armed" : "");
858858
859859 }
860860
@@ -1024,7 +1024,7 @@ static void wmb_blk(struct nfit_blk *nfit_blk) · 163 unmodified lines
10241024 wmb_pmem();
10251025 }
10261026
1027−static u64 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
1027+static u32 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
10281028 {
10291029 struct nfit_blk_mmio *mmio = &nfit_blk->mmio[DCR];
10301030 u64 offset = nfit_blk->stat_offset + mmio->size * bw;
@@ -1032,7 +1032,7 @@ static u64 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw) · 1 unmodified line
10321032 if (mmio->num_lines)
10331033 offset = to_interleave_offset(offset, mmio);
10341034
1035− return readq(mmio->base + offset);
1035+ return readl(mmio->base + offset);
10361036 }
10371037
10381038 static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
drivers/acpi/video_detect.c+13−3
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <linux/module.h>
3333 #include <linux/pci.h>
3434 #include <linux/types.h>
35+#include <linux/workqueue.h>
3536 #include <acpi/video.h>
3637
3738 ACPI_MODULE_NAME("video");
@@ -41,6 +42,7 @@ void acpi_video_unregister_backlight(void); · 3 unmodified lines
4142
4243 static bool backlight_notifier_registered;
4344 static struct notifier_block backlight_nb;
45+static struct work_struct backlight_notify_work;
4446
4547 static enum acpi_backlight_type acpi_backlight_cmdline = acpi_backlight_undef;
4648 static enum acpi_backlight_type acpi_backlight_dmi = acpi_backlight_undef;
@@ -262,6 +264,13 @@ static const struct dmi_system_id video_detect_dmi_table[] = { · 215 unmodified lines
262264 { },
263265 };
264266
267+/* This uses a workqueue to avoid various locking ordering issues */
268+static void acpi_video_backlight_notify_work(struct work_struct *work)
269+{
270+ if (acpi_video_get_backlight_type() != acpi_backlight_video)
271+ acpi_video_unregister_backlight();
272+}
273+
265274 static int acpi_video_backlight_notify(struct notifier_block *nb,
266275 unsigned long val, void *bd)
267276 {
@@ -269,9 +278,8 @@ static int acpi_video_backlight_notify(struct notifier_block *nb, · 1 unmodified line
269278
270279 /* A raw bl registering may change video -> native */
271280 if (backlight->props.type == BACKLIGHT_RAW &&
272− val == BACKLIGHT_REGISTERED &&
273− acpi_video_get_backlight_type() != acpi_backlight_video)
274− acpi_video_unregister_backlight();
281+ val == BACKLIGHT_REGISTERED)
282+ schedule_work(&backlight_notify_work);
275283
276284 return NOTIFY_OK;
277285 }
@@ -304,6 +312,8 @@ enum acpi_backlight_type acpi_video_get_backlight_type(void) · 26 unmodified lines
304312 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
305313 ACPI_UINT32_MAX, find_video, NULL,
306314 &video_caps, NULL);
315+ INIT_WORK(&backlight_notify_work,
316+ acpi_video_backlight_notify_work);
307317 backlight_nb.notifier_call = acpi_video_backlight_notify;
308318 backlight_nb.priority = 0;
309319 if (backlight_register_notifier(&backlight_nb) == 0)
drivers/ata/libata-core.c+2−0
@@ -4230,6 +4230,8 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { · 4229 unmodified lines
42304230 ATA_HORKAGE_ZERO_AFTER_TRIM, },
42314231 { "Samsung SSD 8*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
42324232 ATA_HORKAGE_ZERO_AFTER_TRIM, },
4233+ { "FCCT*M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
4234+ ATA_HORKAGE_ZERO_AFTER_TRIM, },
42334235
42344236 /* devices that don't properly handle TRIM commands */
42354237 { "SuperSSpeed S238*", NULL, ATA_HORKAGE_NOTRIM, },
drivers/block/mtip32xx/mtip32xx.c+8−0
@@ -3756,6 +3756,14 @@ static int mtip_init_cmd(void *data, struct request *rq, unsigned int hctx_idx, · 3755 unmodified lines
37563756 struct mtip_cmd *cmd = blk_mq_rq_to_pdu(rq);
37573757 u32 host_cap_64 = readl(dd->mmio + HOST_CAP) & HOST_CAP_64;
37583758
3759+ /*
3760+ * For flush requests, request_idx starts at the end of the
3761+ * tag space. Since we don't support FLUSH/FUA, simply return
3762+ * 0 as there's nothing to be done.
3763+ */
3764+ if (request_idx >= MTIP_MAX_COMMAND_SLOTS)
3765+ return 0;
3766+
37593767 cmd->command = dmam_alloc_coherent(&dd->pdev->dev, CMD_DMA_ALLOC_SZ,
37603768 &cmd->command_dma, GFP_KERNEL);
37613769 if (!cmd->command)
drivers/clocksource/timer-imx-gpt.c+1−0
@@ -462,6 +462,7 @@ void __init mxc_timer_init(unsigned long pbase, int irq, enum imx_gpt_type type) · 461 unmodified lines
462462 BUG_ON(!imxtm->base);
463463
464464 imxtm->type = type;
465+ imxtm->irq = irq;
465466
466467 _mxc_timer_init(imxtm);
467468 }
drivers/cpufreq/exynos-cpufreq.c+4−2
@@ -180,7 +180,7 @@ static int exynos_cpufreq_probe(struct platform_device *pdev) · 179 unmodified lines
180180 ret = exynos5250_cpufreq_init(exynos_info);
181181 } else {
182182 pr_err("%s: Unknown SoC type\n", __func__);
183− return -ENODEV;
183+ ret = -ENODEV;
184184 }
185185
186186 if (ret)
@@ -188,12 +188,14 @@ static int exynos_cpufreq_probe(struct platform_device *pdev) · 1 unmodified line
188188
189189 if (exynos_info->set_freq == NULL) {
190190 dev_err(&pdev->dev, "No set_freq function (ERR)\n");
191+ ret = -EINVAL;
191192 goto err_vdd_arm;
192193 }
193194
194195 arm_regulator = regulator_get(NULL, "vdd_arm");
195196 if (IS_ERR(arm_regulator)) {
196197 dev_err(&pdev->dev, "failed to get resource vdd_arm\n");
198+ ret = -EINVAL;
197199 goto err_vdd_arm;
198200 }
199201
@@ -225,7 +227,7 @@ err_cpufreq_reg: · 25 unmodified lines
225227 regulator_put(arm_regulator);
226228 err_vdd_arm:
227229 kfree(exynos_info);
228− return -EINVAL;
230+ return ret;
229231 }
230232
231233 static struct platform_driver exynos_cpufreq_platdrv = {
drivers/firmware/broadcom/bcm47xx_nvram.c+1−1
@@ -245,4 +245,4 @@ char *bcm47xx_nvram_get_contents(size_t *nvram_size) · 244 unmodified lines
245245 }
246246 EXPORT_SYMBOL(bcm47xx_nvram_get_contents);
247247
248−MODULE_LICENSE("GPLv2");
248+MODULE_LICENSE("GPL v2");
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c+1−1
@@ -559,7 +559,7 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev) · 558 unmodified lines
559559 return 0;
560560 }
561561
562−#ifdef CONFIG_PM
562+#ifdef CONFIG_PM_SLEEP
563563 static int atmel_hlcdc_dc_drm_suspend(struct device *dev)
564564 {
565565 struct drm_device *drm_dev = dev_get_drvdata(dev);
drivers/gpu/drm/i915/intel_bios.c+4−23
@@ -1075,34 +1075,15 @@ parse_device_mapping(struct drm_i915_private *dev_priv, · 1074 unmodified lines
10751075 const union child_device_config *p_child;
10761076 union child_device_config *child_dev_ptr;
10771077 int i, child_device_num, count;
1078− u8 expected_size;
1079− u16 block_size;
1078+ u16 block_size;
10801079
10811080 p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
10821081 if (!p_defs) {
10831082 DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n");
10841083 return;
10851084 }
1086− if (bdb->version < 195) {
1087− expected_size = 33;
1088− } else if (bdb->version == 195) {
1089− expected_size = 37;
1090− } else if (bdb->version <= 197) {
1091− expected_size = 38;
1092− } else {
1093− expected_size = 38;
1094− DRM_DEBUG_DRIVER("Expected child_device_config size for BDB version %u not known; assuming %u\n",
1095− expected_size, bdb->version);
1096− }
1097−
1098− if (expected_size > sizeof(*p_child)) {
1099− DRM_ERROR("child_device_config cannot fit in p_child\n");
1100− return;
1101− }
1102−
1103− if (p_defs->child_dev_size != expected_size) {
1104− DRM_ERROR("Size mismatch; child_device_config size=%u (expected %u); bdb->version: %u\n",
1105− p_defs->child_dev_size, expected_size, bdb->version);
1085+ if (p_defs->child_dev_size < sizeof(*p_child)) {
1086+ DRM_ERROR("General definiton block child device size is too small.\n");
11061087 return;
11071088 }
11081089 /* get the block size of general definitions */
@@ -1149,7 +1130,7 @@ parse_device_mapping(struct drm_i915_private *dev_priv, · 40 unmodified lines
11491130
11501131 child_dev_ptr = dev_priv->vbt.child_dev + count;
11511132 count++;
1152− memcpy(child_dev_ptr, p_child, p_defs->child_dev_size);
1133+ memcpy(child_dev_ptr, p_child, sizeof(*p_child));
11531134 }
11541135 return;
11551136 }
drivers/gpu/drm/i915/intel_dp.c+22−13
@@ -93,9 +93,6 @@ static const struct dp_link_dpll chv_dpll[] = { · 92 unmodified lines
9393
9494 static const int skl_rates[] = { 162000, 216000, 270000,
9595 324000, 432000, 540000 };
96−static const int chv_rates[] = { 162000, 202500, 210000, 216000,
97− 243000, 270000, 324000, 405000,
98− 420000, 432000, 540000 };
9996 static const int default_rates[] = { 162000, 270000, 540000 };
10097
10198 /**
@@ -1169,24 +1166,31 @@ intel_dp_sink_rates(struct intel_dp *intel_dp, const int **sink_rates) · 1067 unmodified lines
11691166 return (intel_dp_max_link_bw(intel_dp) >> 3) + 1;
11701167 }
11711168
1169+static bool intel_dp_source_supports_hbr2(struct drm_device *dev)
1170+{
1171+ /* WaDisableHBR2:skl */
1172+ if (IS_SKYLAKE(dev) && INTEL_REVID(dev) <= SKL_REVID_B0)
1173+ return false;
1174+
1175+ if ((IS_HASWELL(dev) && !IS_HSW_ULX(dev)) || IS_BROADWELL(dev) ||
1176+ (INTEL_INFO(dev)->gen >= 9))
1177+ return true;
1178+ else
1179+ return false;
1180+}
1181+
11721182 static int
11731183 intel_dp_source_rates(struct drm_device *dev, const int **source_rates)
11741184 {
11751185 if (IS_SKYLAKE(dev)) {
11761186 *source_rates = skl_rates;
11771187 return ARRAY_SIZE(skl_rates);
1178− } else if (IS_CHERRYVIEW(dev)) {
1179− *source_rates = chv_rates;
1180− return ARRAY_SIZE(chv_rates);
11811188 }
11821189
11831190 *source_rates = default_rates;
11841191
1185− if (IS_SKYLAKE(dev) && INTEL_REVID(dev) <= SKL_REVID_B0)
1186− /* WaDisableHBR2:skl */
1187− return (DP_LINK_BW_2_7 >> 3) + 1;
1188− else if (INTEL_INFO(dev)->gen >= 8 ||
1189− (IS_HASWELL(dev) && !IS_HSW_ULX(dev)))
1192+ /* This depends on the fact that 5.4 is last value in the array */
1193+ if (intel_dp_source_supports_hbr2(dev))
11901194 return (DP_LINK_BW_5_4 >> 3) + 1;
11911195 else
11921196 return (DP_LINK_BW_2_7 >> 3) + 1;
@@ -3941,10 +3945,15 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) · 2748 unmodified lines
39413945 }
39423946 }
39433947
3944− /* Training Pattern 3 support, both source and sink */
3948+ /* Training Pattern 3 support, Intel platforms that support HBR2 alone
3949+ * have support for TP3 hence that check is used along with dpcd check
3950+ * to ensure TP3 can be enabled.
3951+ * SKL < B0: due it's WaDisableHBR2 is the only exception where TP3 is
3952+ * supported but still not enabled.
3953+ */
39453954 if (intel_dp->dpcd[DP_DPCD_REV] >= 0x12 &&
39463955 intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_TPS3_SUPPORTED &&
3947− (IS_HASWELL(dev_priv) || INTEL_INFO(dev_priv)->gen >= 8)) {
3956+ intel_dp_source_supports_hbr2(dev)) {
39483957 intel_dp->use_tps3 = true;
39493958 DRM_DEBUG_KMS("Displayport TPS3 supported\n");
39503959 } else
drivers/gpu/drm/i915/intel_lrc.c+2−0
@@ -1012,6 +1012,8 @@ static int intel_lr_context_pin(struct intel_engine_cs *ring, · 1011 unmodified lines
10121012 ret = intel_pin_and_map_ringbuffer_obj(ring->dev, ringbuf);
10131013 if (ret)
10141014 goto unpin_ctx_obj;
1015+
1016+ ctx_obj->dirty = true;
10151017 }
10161018
10171019 return ret;
drivers/gpu/drm/radeon/radeon_irq_kms.c+5−0
@@ -79,6 +79,11 @@ static void radeon_hotplug_work_func(struct work_struct *work) · 78 unmodified lines
7979 struct drm_mode_config *mode_config = &dev->mode_config;
8080 struct drm_connector *connector;
8181
82+ /* we can race here at startup, some boards seem to trigger
83+ * hotplug irqs when they shouldn't. */
84+ if (!rdev->mode_info.mode_config_initialized)
85+ return;
86+
8287 mutex_lock(&mode_config->mutex);
8388 if (mode_config->num_connector) {
8489 list_for_each_entry(connector, &mode_config->connector_list, head)
drivers/input/keyboard/gpio_keys_polled.c+1−1
@@ -246,7 +246,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) · 245 unmodified lines
246246 * convert it to descriptor.
247247 */
248248 if (!button->gpiod && gpio_is_valid(button->gpio)) {
249− unsigned flags = 0;
249+ unsigned flags = GPIOF_IN;
250250
251251 if (button->active_low)
252252 flags |= GPIOF_ACTIVE_LOW;
drivers/irqchip/irq-crossbar.c+3−1
@@ -68,7 +68,9 @@ static struct irq_chip crossbar_chip = { · 67 unmodified lines
6868 .irq_mask = irq_chip_mask_parent,
6969 .irq_unmask = irq_chip_unmask_parent,
7070 .irq_retrigger = irq_chip_retrigger_hierarchy,
71− .irq_set_wake = irq_chip_set_wake_parent,
71+ .irq_set_type = irq_chip_set_type_parent,
72+ .flags = IRQCHIP_MASK_ON_SUSPEND |
73+ IRQCHIP_SKIP_SET_WAKE,
7274 #ifdef CONFIG_SMP
7375 .irq_set_affinity = irq_chip_set_affinity_parent,
7476 #endif
drivers/media/dvb-frontends/Kconfig+1−1
@@ -240,7 +240,7 @@ config DVB_SI21XX · 239 unmodified lines
240240
241241 config DVB_TS2020
242242 tristate "Montage Tehnology TS2020 based tuners"
243− depends on DVB_CORE
243+ depends on DVB_CORE && I2C
244244 select REGMAP_I2C
245245 default m if !MEDIA_SUBDRV_AUTOSELECT
246246 help
drivers/media/pci/cobalt/Kconfig+1−0
@@ -2,6 +2,7 @@ config VIDEO_COBALT · 1 unmodified line
22 tristate "Cisco Cobalt support"
33 depends on VIDEO_V4L2 && I2C && MEDIA_CONTROLLER
44 depends on PCI_MSI && MTD_COMPLEX_MAPPINGS && GPIOLIB
5+ depends on SND
56 select I2C_ALGOBIT
67 select VIDEO_ADV7604
78 select VIDEO_ADV7511
drivers/media/pci/cobalt/cobalt-irq.c+1−1
@@ -139,7 +139,7 @@ done: · 138 unmodified lines
139139 also know about dropped frames. */
140140 cb->vb.v4l2_buf.sequence = s->sequence++;
141141 vb2_buffer_done(&cb->vb, (skip || s->unstable_frame) ?
142− VB2_BUF_STATE_QUEUED : VB2_BUF_STATE_DONE);
142+ VB2_BUF_STATE_REQUEUEING : VB2_BUF_STATE_DONE);
143143 }
144144
145145 irqreturn_t cobalt_irq_handler(int irq, void *dev_id)
drivers/media/pci/mantis/mantis_dma.c+3−2
@@ -130,10 +130,11 @@ err: · 129 unmodified lines
130130
131131 int mantis_dma_init(struct mantis_pci *mantis)
132132 {
133− int err = 0;
133+ int err;
134134
135135 dprintk(MANTIS_DEBUG, 1, "Mantis DMA init");
136− if (mantis_alloc_buffers(mantis) < 0) {
136+ err = mantis_alloc_buffers(mantis);
137+ if (err < 0) {
137138 dprintk(MANTIS_ERROR, 1, "Error allocating DMA buffer");
138139
139140 /* Stop RISC Engine */
drivers/media/rc/ir-rc5-decoder.c+0−116
@@ -184,125 +184,9 @@ out: · 183 unmodified lines
184184 return -EINVAL;
185185 }
186186
187−static struct ir_raw_timings_manchester ir_rc5_timings = {
188− .leader = RC5_UNIT,
189− .pulse_space_start = 0,
190− .clock = RC5_UNIT,
191− .trailer_space = RC5_UNIT * 10,
192−};
193−
194−static struct ir_raw_timings_manchester ir_rc5x_timings[2] = {
195− {
196− .leader = RC5_UNIT,
197− .pulse_space_start = 0,
198− .clock = RC5_UNIT,
199− .trailer_space = RC5X_SPACE,
200− },
201− {
202− .clock = RC5_UNIT,
203− .trailer_space = RC5_UNIT * 10,
204− },
205−};
206−
207−static struct ir_raw_timings_manchester ir_rc5_sz_timings = {
208− .leader = RC5_UNIT,
209− .pulse_space_start = 0,
210− .clock = RC5_UNIT,
211− .trailer_space = RC5_UNIT * 10,
212−};
213−
214−static int ir_rc5_validate_filter(const struct rc_scancode_filter *scancode,
215− unsigned int important_bits)
216−{
217− /* all important bits of scancode should be set in mask */
218− if (~scancode->mask & important_bits)
219− return -EINVAL;
220− /* extra bits in mask should be zero in data */
221− if (scancode->mask & scancode->data & ~important_bits)
222− return -EINVAL;
223− return 0;
224−}
225−
226−/**
227− * ir_rc5_encode() - Encode a scancode as a stream of raw events
228− *
229− * @protocols: allowed protocols
230− * @scancode: scancode filter describing scancode (helps distinguish between
231− * protocol subtypes when scancode is ambiguous)
232− * @events: array of raw ir events to write into
233− * @max: maximum size of @events
234− *
235− * Returns: The number of events written.
236− * -ENOBUFS if there isn't enough space in the array to fit the
237− * encoding. In this case all @max events will have been written.
238− * -EINVAL if the scancode is ambiguous or invalid.
239− */
240−static int ir_rc5_encode(u64 protocols,
241− const struct rc_scancode_filter *scancode,
242− struct ir_raw_event *events, unsigned int max)
243−{
244− int ret;
245− struct ir_raw_event *e = events;
246− unsigned int data, xdata, command, commandx, system;
247−
248− /* Detect protocol and convert scancode to raw data */
249− if (protocols & RC_BIT_RC5 &&
250− !ir_rc5_validate_filter(scancode, 0x1f7f)) {
251− /* decode scancode */
252− command = (scancode->data & 0x003f) >> 0;
253− commandx = (scancode->data & 0x0040) >> 6;
254− system = (scancode->data & 0x1f00) >> 8;
255− /* encode data */
256− data = !commandx << 12 | system << 6 | command;
257−
258− /* Modulate the data */
259− ret = ir_raw_gen_manchester(&e, max, &ir_rc5_timings, RC5_NBITS,
260− data);
261− if (ret < 0)
262− return ret;
263− } else if (protocols & RC_BIT_RC5X &&
264− !ir_rc5_validate_filter(scancode, 0x1f7f3f)) {
265− /* decode scancode */
266− xdata = (scancode->data & 0x00003f) >> 0;
267− command = (scancode->data & 0x003f00) >> 8;
268− commandx = (scancode->data & 0x004000) >> 14;
269− system = (scancode->data & 0x1f0000) >> 16;
270− /* commandx and system overlap, bits must match when encoded */
271− if (commandx == (system & 0x1))
272− return -EINVAL;
273− /* encode data */
274− data = 1 << 18 | system << 12 | command << 6 | xdata;
275−
276− /* Modulate the data */
277− ret = ir_raw_gen_manchester(&e, max, &ir_rc5x_timings[0],
278− CHECK_RC5X_NBITS,
279− data >> (RC5X_NBITS-CHECK_RC5X_NBITS));
280− if (ret < 0)
281− return ret;
282− ret = ir_raw_gen_manchester(&e, max - (e - events),
283− &ir_rc5x_timings[1],
284− RC5X_NBITS - CHECK_RC5X_NBITS,
285− data);
286− if (ret < 0)
287− return ret;
288− } else if (protocols & RC_BIT_RC5_SZ &&
289− !ir_rc5_validate_filter(scancode, 0x2fff)) {
290− /* RC5-SZ scancode is raw enough for Manchester as it is */
291− ret = ir_raw_gen_manchester(&e, max, &ir_rc5_sz_timings,
292− RC5_SZ_NBITS, scancode->data & 0x2fff);
293− if (ret < 0)
294− return ret;
295− } else {
296− return -EINVAL;
297− }
298−
299− return e - events;
300−}
301−
302187 static struct ir_raw_handler rc5_handler = {
303188 .protocols = RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ,
304189 .decode = ir_rc5_decode,
305− .encode = ir_rc5_encode,
306190 };
307191
308192 static int __init ir_rc5_decode_init(void)
drivers/media/rc/ir-rc6-decoder.c+0−122
@@ -291,133 +291,11 @@ out: · 290 unmodified lines
291291 return -EINVAL;
292292 }
293293
294−static struct ir_raw_timings_manchester ir_rc6_timings[4] = {
295− {
296− .leader = RC6_PREFIX_PULSE,
297− .pulse_space_start = 0,
298− .clock = RC6_UNIT,
299− .invert = 1,
300− .trailer_space = RC6_PREFIX_SPACE,
301− },
302− {
303− .clock = RC6_UNIT,
304− .invert = 1,
305− },
306− {
307− .clock = RC6_UNIT * 2,
308− .invert = 1,
309− },
310− {
311− .clock = RC6_UNIT,
312− .invert = 1,
313− .trailer_space = RC6_SUFFIX_SPACE,
314− },
315−};
316−
317−static int ir_rc6_validate_filter(const struct rc_scancode_filter *scancode,
318− unsigned int important_bits)
319−{
320− /* all important bits of scancode should be set in mask */
321− if (~scancode->mask & important_bits)
322− return -EINVAL;
323− /* extra bits in mask should be zero in data */
324− if (scancode->mask & scancode->data & ~important_bits)
325− return -EINVAL;
326− return 0;
327−}
328−
329−/**
330− * ir_rc6_encode() - Encode a scancode as a stream of raw events
331− *
332− * @protocols: allowed protocols
333− * @scancode: scancode filter describing scancode (helps distinguish between
334− * protocol subtypes when scancode is ambiguous)
335− * @events: array of raw ir events to write into
336− * @max: maximum size of @events
337− *
338− * Returns: The number of events written.
339− * -ENOBUFS if there isn't enough space in the array to fit the
340− * encoding. In this case all @max events will have been written.
341− * -EINVAL if the scancode is ambiguous or invalid.
342− */
343−static int ir_rc6_encode(u64 protocols,
344− const struct rc_scancode_filter *scancode,
345− struct ir_raw_event *events, unsigned int max)
346−{
347− int ret;
348− struct ir_raw_event *e = events;
349−
350− if (protocols & RC_BIT_RC6_0 &&
351− !ir_rc6_validate_filter(scancode, 0xffff)) {
352−
353− /* Modulate the preamble */
354− ret = ir_raw_gen_manchester(&e, max, &ir_rc6_timings[0], 0, 0);
355− if (ret < 0)
356− return ret;
357−
358− /* Modulate the header (Start Bit & Mode-0) */
359− ret = ir_raw_gen_manchester(&e, max - (e - events),
360− &ir_rc6_timings[1],
361− RC6_HEADER_NBITS, (1 << 3));
362− if (ret < 0)
363− return ret;
364−
365− /* Modulate Trailer Bit */
366− ret = ir_raw_gen_manchester(&e, max - (e - events),
367− &ir_rc6_timings[2], 1, 0);
368− if (ret < 0)
369− return ret;
370−
371− /* Modulate rest of the data */
372− ret = ir_raw_gen_manchester(&e, max - (e - events),
373− &ir_rc6_timings[3], RC6_0_NBITS,
374− scancode->data);
375− if (ret < 0)
376− return ret;
377−
378− } else if (protocols & (RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 |
379− RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE) &&
380− !ir_rc6_validate_filter(scancode, 0x8fffffff)) {
381−
382− /* Modulate the preamble */
383− ret = ir_raw_gen_manchester(&e, max, &ir_rc6_timings[0], 0, 0);
384− if (ret < 0)
385− return ret;
386−
387− /* Modulate the header (Start Bit & Header-version 6 */
388− ret = ir_raw_gen_manchester(&e, max - (e - events),
389− &ir_rc6_timings[1],
390− RC6_HEADER_NBITS, (1 << 3 | 6));
391− if (ret < 0)
392− return ret;
393−
394− /* Modulate Trailer Bit */
395− ret = ir_raw_gen_manchester(&e, max - (e - events),
396− &ir_rc6_timings[2], 1, 0);
397− if (ret < 0)
398− return ret;
399−
400− /* Modulate rest of the data */
401− ret = ir_raw_gen_manchester(&e, max - (e - events),
402− &ir_rc6_timings[3],
403− fls(scancode->mask),
404− scancode->data);
405− if (ret < 0)
406− return ret;
407−
408− } else {
409− return -EINVAL;
410− }
411−
412− return e - events;
413−}
414−
415294 static struct ir_raw_handler rc6_handler = {
416295 .protocols = RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 |
417296 RC_BIT_RC6_6A_24 | RC_BIT_RC6_6A_32 |
418297 RC_BIT_RC6_MCE,
419298 .decode = ir_rc6_decode,
420− .encode = ir_rc6_encode,
421299 };
422300
423301 static int __init ir_rc6_decode_init(void)
drivers/media/rc/nuvoton-cir.c+0−127
@@ -526,130 +526,6 @@ static int nvt_set_tx_carrier(struct rc_dev *dev, u32 carrier) · 525 unmodified lines
526526 return 0;
527527 }
528528
529−static int nvt_write_wakeup_codes(struct rc_dev *dev,
530− const u8 *wakeup_sample_buf, int count)
531−{
532− int i = 0;
533− u8 reg, reg_learn_mode;
534− unsigned long flags;
535− struct nvt_dev *nvt = dev->priv;
536−
537− nvt_dbg_wake("writing wakeup samples");
538−
539− reg = nvt_cir_wake_reg_read(nvt, CIR_WAKE_IRCON);
540− reg_learn_mode = reg & ~CIR_WAKE_IRCON_MODE0;
541− reg_learn_mode |= CIR_WAKE_IRCON_MODE1;
542−
543− /* Lock the learn area to prevent racing with wake-isr */
544− spin_lock_irqsave(&nvt->nvt_lock, flags);
545−
546− /* Enable fifo writes */
547− nvt_cir_wake_reg_write(nvt, reg_learn_mode, CIR_WAKE_IRCON);
548−
549− /* Clear cir wake rx fifo */
550− nvt_clear_cir_wake_fifo(nvt);
551−
552− if (count > WAKE_FIFO_LEN) {
553− nvt_dbg_wake("HW FIFO too small for all wake samples");
554− count = WAKE_FIFO_LEN;
555− }
556−
557− if (count)
558− pr_info("Wake samples (%d) =", count);
559− else
560− pr_info("Wake sample fifo cleared");
561−
562− /* Write wake samples to fifo */
563− for (i = 0; i < count; i++) {
564− pr_cont(" %02x", wakeup_sample_buf[i]);
565− nvt_cir_wake_reg_write(nvt, wakeup_sample_buf[i],
566− CIR_WAKE_WR_FIFO_DATA);
567− }
568− pr_cont("\n");
569−
570− /* Switch cir to wakeup mode and disable fifo writing */
571− nvt_cir_wake_reg_write(nvt, reg, CIR_WAKE_IRCON);
572−
573− /* Set number of bytes needed for wake */
574− nvt_cir_wake_reg_write(nvt, count ? count :
575− CIR_WAKE_FIFO_CMP_BYTES,
576− CIR_WAKE_FIFO_CMP_DEEP);
577−
578− spin_unlock_irqrestore(&nvt->nvt_lock, flags);
579−
580− return 0;
581−}
582−
583−static int nvt_ir_raw_set_wakeup_filter(struct rc_dev *dev,
584− struct rc_scancode_filter *sc_filter)
585−{
586− u8 *reg_buf;
587− u8 buf_val;
588− int i, ret, count;
589− unsigned int val;
590− struct ir_raw_event *raw;
591− bool complete;
592−
593− /* Require both mask and data to be set before actually committing */
594− if (!sc_filter->mask || !sc_filter->data)
595− return 0;
596−
597− raw = kmalloc_array(WAKE_FIFO_LEN, sizeof(*raw), GFP_KERNEL);
598− if (!raw)
599− return -ENOMEM;
600−
601− ret = ir_raw_encode_scancode(dev->enabled_wakeup_protocols, sc_filter,
602− raw, WAKE_FIFO_LEN);
603− complete = (ret != -ENOBUFS);
604− if (!complete)
605− ret = WAKE_FIFO_LEN;
606− else if (ret < 0)
607− goto out_raw;
608−
609− reg_buf = kmalloc_array(WAKE_FIFO_LEN, sizeof(*reg_buf), GFP_KERNEL);
610− if (!reg_buf) {
611− ret = -ENOMEM;
612− goto out_raw;
613− }
614−
615− /* Inspect the ir samples */
616− for (i = 0, count = 0; i < ret && count < WAKE_FIFO_LEN; ++i) {
617− val = NS_TO_US((raw[i]).duration) / SAMPLE_PERIOD;
618−
619− /* Split too large values into several smaller ones */
620− while (val > 0 && count < WAKE_FIFO_LEN) {
621−
622− /* Skip last value for better comparison tolerance */
623− if (complete && i == ret - 1 && val < BUF_LEN_MASK)
624− break;
625−
626− /* Clamp values to BUF_LEN_MASK at most */
627− buf_val = (val > BUF_LEN_MASK) ? BUF_LEN_MASK : val;
628−
629− reg_buf[count] = buf_val;
630− val -= buf_val;
631− if ((raw[i]).pulse)
632− reg_buf[count] |= BUF_PULSE_BIT;
633− count++;
634− }
635− }
636−
637− ret = nvt_write_wakeup_codes(dev, reg_buf, count);
638−
639− kfree(reg_buf);
640−out_raw:
641− kfree(raw);
642−
643− return ret;
644−}
645−
646−/* Dummy implementation. nuvoton is agnostic to the protocol used */
647−static int nvt_ir_raw_change_wakeup_protocol(struct rc_dev *dev,
648− u64 *rc_type)
649−{
650− return 0;
651−}
652−
653529 /*
654530 * nvt_tx_ir
655531 *
@@ -1167,14 +1043,11 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) · 511 unmodified lines
11671043 /* Set up the rc device */
11681044 rdev->priv = nvt;
11691045 rdev->driver_type = RC_DRIVER_IR_RAW;
1170− rdev->encode_wakeup = true;
11711046 rdev->allowed_protocols = RC_BIT_ALL;
11721047 rdev->open = nvt_open;
11731048 rdev->close = nvt_close;
11741049 rdev->tx_ir = nvt_tx_ir;
11751050 rdev->s_tx_carrier = nvt_set_tx_carrier;
1176− rdev->s_wakeup_filter = nvt_ir_raw_set_wakeup_filter;
1177− rdev->change_wakeup_protocol = nvt_ir_raw_change_wakeup_protocol;
11781051 rdev->input_name = "Nuvoton w836x7hg Infrared Remote Transceiver";
11791052 rdev->input_phys = "nuvoton/cir0";
11801053 rdev->input_id.bustype = BUS_HOST;
drivers/media/rc/nuvoton-cir.h+0−1
@@ -63,7 +63,6 @@ static int debug; · 62 unmodified lines
6363 */
6464 #define TX_BUF_LEN 256
6565 #define RX_BUF_LEN 32
66−#define WAKE_FIFO_LEN 67
6766
6867 struct nvt_dev {
6968 struct pnp_dev *pdev;
drivers/media/rc/rc-core-priv.h+0−36
@@ -25,8 +25,6 @@ struct ir_raw_handler { · 24 unmodified lines
2525
2626 u64 protocols; /* which are handled by this handler */
2727 int (*decode)(struct rc_dev *dev, struct ir_raw_event event);
28− int (*encode)(u64 protocols, const struct rc_scancode_filter *scancode,
29− struct ir_raw_event *events, unsigned int max);
3028
3129 /* These two should only be used by the lirc decoder */
3230 int (*raw_register)(struct rc_dev *dev);
@@ -152,44 +150,10 @@ static inline bool is_timing_event(struct ir_raw_event ev) · 119 unmodified lines
152150 #define TO_US(duration) DIV_ROUND_CLOSEST((duration), 1000)
153151 #define TO_STR(is_pulse) ((is_pulse) ? "pulse" : "space")
154152
155−/* functions for IR encoders */
156−
157−static inline void init_ir_raw_event_duration(struct ir_raw_event *ev,
158− unsigned int pulse,
159− u32 duration)
160−{
161− init_ir_raw_event(ev);
162− ev->duration = duration;
163− ev->pulse = pulse;
164−}
165−
166−/**
167− * struct ir_raw_timings_manchester - Manchester coding timings
168− * @leader: duration of leader pulse (if any) 0 if continuing
169− * existing signal (see @pulse_space_start)
170− * @pulse_space_start: 1 for starting with pulse (0 for starting with space)
171− * @clock: duration of each pulse/space in ns
172− * @invert: if set clock logic is inverted
173− * (0 = space + pulse, 1 = pulse + space)
174− * @trailer_space: duration of trailer space in ns
175− */
176−struct ir_raw_timings_manchester {
177− unsigned int leader;
178− unsigned int pulse_space_start:1;
179− unsigned int clock;
180− unsigned int invert:1;
181− unsigned int trailer_space;
182−};
183−
184−int ir_raw_gen_manchester(struct ir_raw_event **ev, unsigned int max,
185− const struct ir_raw_timings_manchester *timings,
186− unsigned int n, unsigned int data);
187−
188153 /*
189154 * Routines from rc-raw.c to be used internally and by decoders
190155 */
191156 u64 ir_raw_get_allowed_protocols(void);
192−u64 ir_raw_get_encode_protocols(void);
193157 int ir_raw_event_register(struct rc_dev *dev);
194158 void ir_raw_event_unregister(struct rc_dev *dev);
195159 int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler);
drivers/media/rc/rc-ir-raw.c+0−139
@@ -30,7 +30,6 @@ static LIST_HEAD(ir_raw_client_list); · 29 unmodified lines
3030 static DEFINE_MUTEX(ir_raw_handler_lock);
3131 static LIST_HEAD(ir_raw_handler_list);
3232 static u64 available_protocols;
33−static u64 encode_protocols;
3433
3534 static int ir_raw_event_thread(void *data)
3635 {
@@ -241,146 +240,12 @@ ir_raw_get_allowed_protocols(void) · 204 unmodified lines
241240 return protocols;
242241 }
243242
244−/* used internally by the sysfs interface */
245−u64
246−ir_raw_get_encode_protocols(void)
247−{
248− u64 protocols;
249−
250− mutex_lock(&ir_raw_handler_lock);
251− protocols = encode_protocols;
252− mutex_unlock(&ir_raw_handler_lock);
253− return protocols;
254−}
255−
256243 static int change_protocol(struct rc_dev *dev, u64 *rc_type)
257244 {
258245 /* the caller will update dev->enabled_protocols */
259246 return 0;
260247 }
261248
262−/**
263− * ir_raw_gen_manchester() - Encode data with Manchester (bi-phase) modulation.
264− * @ev: Pointer to pointer to next free event. *@ev is incremented for
265− * each raw event filled.
266− * @max: Maximum number of raw events to fill.
267− * @timings: Manchester modulation timings.
268− * @n: Number of bits of data.
269− * @data: Data bits to encode.
270− *
271− * Encodes the @n least significant bits of @data using Manchester (bi-phase)
272− * modulation with the timing characteristics described by @timings, writing up
273− * to @max raw IR events using the *@ev pointer.
274− *
275− * Returns: 0 on success.
276− * -ENOBUFS if there isn't enough space in the array to fit the
277− * full encoded data. In this case all @max events will have been
278− * written.
279− */
280−int ir_raw_gen_manchester(struct ir_raw_event **ev, unsigned int max,
281− const struct ir_raw_timings_manchester *timings,
282− unsigned int n, unsigned int data)
283−{
284− bool need_pulse;
285− unsigned int i;
286− int ret = -ENOBUFS;
287−
288− i = 1 << (n - 1);
289−
290− if (timings->leader) {
291− if (!max--)
292− return ret;
293− if (timings->pulse_space_start) {
294− init_ir_raw_event_duration((*ev)++, 1, timings->leader);
295−
296− if (!max--)
297− return ret;
298− init_ir_raw_event_duration((*ev), 0, timings->leader);
299− } else {
300− init_ir_raw_event_duration((*ev), 1, timings->leader);
301− }
302− i >>= 1;
303− } else {
304− /* continue existing signal */
305− --(*ev);
306− }
307− /* from here on *ev will point to the last event rather than the next */
308−
309− while (n && i > 0) {
310− need_pulse = !(data & i);
311− if (timings->invert)
312− need_pulse = !need_pulse;
313− if (need_pulse == !!(*ev)->pulse) {
314− (*ev)->duration += timings->clock;
315− } else {
316− if (!max--)
317− goto nobufs;
318− init_ir_raw_event_duration(++(*ev), need_pulse,
319− timings->clock);
320− }
321−
322− if (!max--)
323− goto nobufs;
324− init_ir_raw_event_duration(++(*ev), !need_pulse,
325− timings->clock);
326− i >>= 1;
327− }
328−
329− if (timings->trailer_space) {
330− if (!(*ev)->pulse)
331− (*ev)->duration += timings->trailer_space;
332− else if (!max--)
333− goto nobufs;
334− else
335− init_ir_raw_event_duration(++(*ev), 0,
336− timings->trailer_space);
337− }
338−
339− ret = 0;
340−nobufs:
341− /* point to the next event rather than last event before returning */
342− ++(*ev);
343− return ret;
344−}
345−EXPORT_SYMBOL(ir_raw_gen_manchester);
346−
347−/**
348− * ir_raw_encode_scancode() - Encode a scancode as raw events
349− *
350− * @protocols: permitted protocols
351− * @scancode: scancode filter describing a single scancode
352− * @events: array of raw events to write into
353− * @max: max number of raw events
354− *
355− * Attempts to encode the scancode as raw events.
356− *
357− * Returns: The number of events written.
358− * -ENOBUFS if there isn't enough space in the array to fit the
359− * encoding. In this case all @max events will have been written.
360− * -EINVAL if the scancode is ambiguous or invalid, or if no
361− * compatible encoder was found.
362− */
363−int ir_raw_encode_scancode(u64 protocols,
364− const struct rc_scancode_filter *scancode,
365− struct ir_raw_event *events, unsigned int max)
366−{
367− struct ir_raw_handler *handler;
368− int ret = -EINVAL;
369−
370− mutex_lock(&ir_raw_handler_lock);
371− list_for_each_entry(handler, &ir_raw_handler_list, list) {
372− if (handler->protocols & protocols && handler->encode) {
373− ret = handler->encode(protocols, scancode, events, max);
374− if (ret >= 0 || ret == -ENOBUFS)
375− break;
376− }
377− }
378− mutex_unlock(&ir_raw_handler_lock);
379−
380− return ret;
381−}
382−EXPORT_SYMBOL(ir_raw_encode_scancode);
383−
384249 /*
385250 * Used to (un)register raw event clients
386251 */
@@ -463,8 +328,6 @@ int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler) · 76 unmodified lines
463328 list_for_each_entry(raw, &ir_raw_client_list, list)
464329 ir_raw_handler->raw_register(raw->dev);
465330 available_protocols |= ir_raw_handler->protocols;
466− if (ir_raw_handler->encode)
467− encode_protocols |= ir_raw_handler->protocols;
468331 mutex_unlock(&ir_raw_handler_lock);
469332
470333 return 0;
@@ -481,8 +344,6 @@ void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler) · 10 unmodified lines
481344 list_for_each_entry(raw, &ir_raw_client_list, list)
482345 ir_raw_handler->raw_unregister(raw->dev);
483346 available_protocols &= ~ir_raw_handler->protocols;
484− if (ir_raw_handler->encode)
485− encode_protocols &= ~ir_raw_handler->protocols;
486347 mutex_unlock(&ir_raw_handler_lock);
487348 }
488349 EXPORT_SYMBOL(ir_raw_handler_unregister);
drivers/media/rc/rc-loopback.c+0−36
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include <linux/device.h>
2727 #include <linux/module.h>
2828 #include <linux/sched.h>
29−#include <linux/slab.h>
3029 #include <media/rc-core.h>
3130
3231 #define DRIVER_NAME "rc-loopback"
@@ -177,39 +176,6 @@ static int loop_set_carrier_report(struct rc_dev *dev, int enable) · 144 unmodified lines
177176 return 0;
178177 }
179178
180−static int loop_set_wakeup_filter(struct rc_dev *dev,
181− struct rc_scancode_filter *sc_filter)
182−{
183− static const unsigned int max = 512;
184− struct ir_raw_event *raw;
185− int ret;
186− int i;
187−
188− /* fine to disable filter */
189− if (!sc_filter->mask)
190− return 0;
191−
192− /* encode the specified filter and loop it back */
193− raw = kmalloc_array(max, sizeof(*raw), GFP_KERNEL);
194− ret = ir_raw_encode_scancode(dev->enabled_wakeup_protocols, sc_filter,
195− raw, max);
196− /* still loop back the partial raw IR even if it's incomplete */
197− if (ret == -ENOBUFS)
198− ret = max;
199− if (ret >= 0) {
200− /* do the loopback */
201− for (i = 0; i < ret; ++i)
202− ir_raw_event_store(dev, &raw[i]);
203− ir_raw_event_handle(dev);
204−
205− ret = 0;
206− }
207−
208− kfree(raw);
209−
210− return ret;
211−}
212−
213179 static int __init loop_init(void)
214180 {
215181 struct rc_dev *rc;
@@ -229,7 +195,6 @@ static int __init loop_init(void) · 13 unmodified lines
229195 rc->map_name = RC_MAP_EMPTY;
230196 rc->priv = &loopdev;
231197 rc->driver_type = RC_DRIVER_IR_RAW;
232− rc->encode_wakeup = true;
233198 rc->allowed_protocols = RC_BIT_ALL;
234199 rc->timeout = 100 * 1000 * 1000; /* 100 ms */
235200 rc->min_timeout = 1;
@@ -244,7 +209,6 @@ static int __init loop_init(void) · 8 unmodified lines
244209 rc->s_idle = loop_set_idle;
245210 rc->s_learning_mode = loop_set_learning_mode;
246211 rc->s_carrier_report = loop_set_carrier_report;
247− rc->s_wakeup_filter = loop_set_wakeup_filter;
248212
249213 loopdev.txmask = RXMASK_REGULAR;
250214 loopdev.txcarrier = 36000;
drivers/media/rc/rc-main.c+1−6
@@ -865,8 +865,6 @@ static ssize_t show_protocols(struct device *device, · 864 unmodified lines
865865 } else {
866866 enabled = dev->enabled_wakeup_protocols;
867867 allowed = dev->allowed_wakeup_protocols;
868− if (dev->encode_wakeup && !allowed)
869− allowed = ir_raw_get_encode_protocols();
870868 }
871869
872870 mutex_unlock(&dev->lock);
@@ -1408,16 +1406,13 @@ int rc_register_device(struct rc_dev *dev) · 535 unmodified lines
14081406 path ? path : "N/A");
14091407 kfree(path);
14101408
1411− if (dev->driver_type == RC_DRIVER_IR_RAW || dev->encode_wakeup) {
1409+ if (dev->driver_type == RC_DRIVER_IR_RAW) {
14121410 /* Load raw decoders, if they aren't already */
14131411 if (!raw_init) {
14141412 IR_dprintk(1, "Loading raw decoders\n");
14151413 ir_raw_init();
14161414 raw_init = true;
14171415 }
1418− }
1419−
1420− if (dev->driver_type == RC_DRIVER_IR_RAW) {
14211416 /* calls ir_register_device so unlock mutex here*/
14221417 mutex_unlock(&dev->lock);
14231418 rc = ir_raw_event_register(dev);
drivers/media/v4l2-core/videobuf2-core.c+25−15
@@ -715,6 +715,7 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b) · 714 unmodified lines
715715 break;
716716 case VB2_BUF_STATE_PREPARING:
717717 case VB2_BUF_STATE_DEQUEUED:
718+ case VB2_BUF_STATE_REQUEUEING:
718719 /* nothing */
719720 break;
720721 }
@@ -1182,7 +1183,8 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) · 461 unmodified lines
11821183
11831184 if (WARN_ON(state != VB2_BUF_STATE_DONE &&
11841185 state != VB2_BUF_STATE_ERROR &&
1185− state != VB2_BUF_STATE_QUEUED))
1186+ state != VB2_BUF_STATE_QUEUED &&
1187+ state != VB2_BUF_STATE_REQUEUEING))
11861188 state = VB2_BUF_STATE_ERROR;
11871189
11881190 #ifdef CONFIG_VIDEO_ADV_DEBUG
@@ -1199,22 +1201,30 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) · 10 unmodified lines
11991201 for (plane = 0; plane < vb->num_planes; ++plane)
12001202 call_void_memop(vb, finish, vb->planes[plane].mem_priv);
12011203
1202− /* Add the buffer to the done buffers list */
12031204 spin_lock_irqsave(&q->done_lock, flags);
1204− vb->state = state;
1205− if (state != VB2_BUF_STATE_QUEUED)
1205+ if (state == VB2_BUF_STATE_QUEUED ||
1206+ state == VB2_BUF_STATE_REQUEUEING) {
1207+ vb->state = VB2_BUF_STATE_QUEUED;
1208+ } else {
1209+ /* Add the buffer to the done buffers list */
12061210 list_add_tail(&vb->done_entry, &q->done_list);
1211+ vb->state = state;
1212+ }
12071213 atomic_dec(&q->owned_by_drv_count);
12081214 spin_unlock_irqrestore(&q->done_lock, flags);
12091215
1210− if (state == VB2_BUF_STATE_QUEUED) {
1216+ switch (state) {
1217+ case VB2_BUF_STATE_QUEUED:
1218+ return;
1219+ case VB2_BUF_STATE_REQUEUEING:
12111220 if (q->start_streaming_called)
12121221 __enqueue_in_driver(vb);
12131222 return;
1223+ default:
1224+ /* Inform any processes that may be waiting for buffers */
1225+ wake_up(&q->done_wq);
1226+ break;
12141227 }
1215−
1216− /* Inform any processes that may be waiting for buffers */
1217− wake_up(&q->done_wq);
12181228 }
12191229 EXPORT_SYMBOL_GPL(vb2_buffer_done);
12201230
@@ -1244,19 +1254,19 @@ EXPORT_SYMBOL_GPL(vb2_discard_done); · 23 unmodified lines
12441254
12451255 static void vb2_warn_zero_bytesused(struct vb2_buffer *vb)
12461256 {
1247− static bool __check_once __read_mostly;
1257+ static bool check_once;
12481258
1249− if (__check_once)
1259+ if (check_once)
12501260 return;
12511261
1252− __check_once = true;
1253− __WARN();
1262+ check_once = true;
1263+ WARN_ON(1);
12541264
1255− pr_warn_once("use of bytesused == 0 is deprecated and will be removed in the future,\n");
1265+ pr_warn("use of bytesused == 0 is deprecated and will be removed in the future,\n");
12561266 if (vb->vb2_queue->allow_zero_bytesused)
1257− pr_warn_once("use VIDIOC_DECODER_CMD(V4L2_DEC_CMD_STOP) instead.\n");
1267+ pr_warn("use VIDIOC_DECODER_CMD(V4L2_DEC_CMD_STOP) instead.\n");
12581268 else
1259− pr_warn_once("use the actual size instead.\n");
1269+ pr_warn("use the actual size instead.\n");
12601270 }
12611271
12621272 /**
drivers/net/can/usb/peak_usb/pcan_usb.c+13−11
@@ -854,6 +854,18 @@ static int pcan_usb_probe(struct usb_interface *intf) · 853 unmodified lines
854854 /*
855855 * describe the PCAN-USB adapter
856856 */
857+static const struct can_bittiming_const pcan_usb_const = {
858+ .name = "pcan_usb",
859+ .tseg1_min = 1,
860+ .tseg1_max = 16,
861+ .tseg2_min = 1,
862+ .tseg2_max = 8,
863+ .sjw_max = 4,
864+ .brp_min = 1,
865+ .brp_max = 64,
866+ .brp_inc = 1,
867+};
868+
857869 const struct peak_usb_adapter pcan_usb = {
858870 .name = "PCAN-USB",
859871 .device_id = PCAN_USB_PRODUCT_ID,
@@ -862,17 +874,7 @@ const struct peak_usb_adapter pcan_usb = { · 2 unmodified lines
862874 .clock = {
863875 .freq = PCAN_USB_CRYSTAL_HZ / 2 ,
864876 },
865− .bittiming_const = {
866− .name = "pcan_usb",
867− .tseg1_min = 1,
868− .tseg1_max = 16,
869− .tseg2_min = 1,
870− .tseg2_max = 8,
871− .sjw_max = 4,
872− .brp_min = 1,
873− .brp_max = 64,
874− .brp_inc = 1,
875− },
877+ .bittiming_const = &pcan_usb_const,
876878
877879 /* size of device private data */
878880 .sizeof_dev_private = sizeof(struct pcan_usb),
drivers/net/can/usb/peak_usb/pcan_usb_core.c+2−2
@@ -792,9 +792,9 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter, · 791 unmodified lines
792792 dev->ep_msg_out = peak_usb_adapter->ep_msg_out[ctrl_idx];
793793
794794 dev->can.clock = peak_usb_adapter->clock;
795− dev->can.bittiming_const = &peak_usb_adapter->bittiming_const;
795+ dev->can.bittiming_const = peak_usb_adapter->bittiming_const;
796796 dev->can.do_set_bittiming = peak_usb_set_bittiming;
797− dev->can.data_bittiming_const = &peak_usb_adapter->data_bittiming_const;
797+ dev->can.data_bittiming_const = peak_usb_adapter->data_bittiming_const;
798798 dev->can.do_set_data_bittiming = peak_usb_set_data_bittiming;
799799 dev->can.do_set_mode = peak_usb_set_mode;
800800 dev->can.do_get_berr_counter = peak_usb_adapter->do_get_berr_counter;
drivers/net/can/usb/peak_usb/pcan_usb_core.h+2−2
@@ -48,8 +48,8 @@ struct peak_usb_adapter { · 47 unmodified lines
4848 u32 device_id;
4949 u32 ctrlmode_supported;
5050 struct can_clock clock;
51− const struct can_bittiming_const bittiming_const;
52− const struct can_bittiming_const data_bittiming_const;
51+ const struct can_bittiming_const * const bittiming_const;
52+ const struct can_bittiming_const * const data_bittiming_const;
5353 unsigned int ctrl_count;
5454
5555 int (*intf_probe)(struct usb_interface *intf);
drivers/net/can/usb/peak_usb/pcan_usb_fd.c+52−44
@@ -990,6 +990,30 @@ static void pcan_usb_fd_free(struct peak_usb_device *dev) · 989 unmodified lines
990990 }
991991
992992 /* describes the PCAN-USB FD adapter */
993+static const struct can_bittiming_const pcan_usb_fd_const = {
994+ .name = "pcan_usb_fd",
995+ .tseg1_min = 1,
996+ .tseg1_max = 64,
997+ .tseg2_min = 1,
998+ .tseg2_max = 16,
999+ .sjw_max = 16,
1000+ .brp_min = 1,
1001+ .brp_max = 1024,
1002+ .brp_inc = 1,
1003+};
1004+
1005+static const struct can_bittiming_const pcan_usb_fd_data_const = {
1006+ .name = "pcan_usb_fd",
1007+ .tseg1_min = 1,
1008+ .tseg1_max = 16,
1009+ .tseg2_min = 1,
1010+ .tseg2_max = 8,
1011+ .sjw_max = 4,
1012+ .brp_min = 1,
1013+ .brp_max = 1024,
1014+ .brp_inc = 1,
1015+};
1016+
9931017 const struct peak_usb_adapter pcan_usb_fd = {
9941018 .name = "PCAN-USB FD",
9951019 .device_id = PCAN_USBFD_PRODUCT_ID,
@@ -999,28 +1023,8 @@ const struct peak_usb_adapter pcan_usb_fd = { · 3 unmodified lines
9991023 .clock = {
10001024 .freq = PCAN_UFD_CRYSTAL_HZ,
10011025 },
1002− .bittiming_const = {
1003− .name = "pcan_usb_fd",
1004− .tseg1_min = 1,
1005− .tseg1_max = 64,
1006− .tseg2_min = 1,
1007− .tseg2_max = 16,
1008− .sjw_max = 16,
1009− .brp_min = 1,
1010− .brp_max = 1024,
1011− .brp_inc = 1,
1012− },
1013− .data_bittiming_const = {
1014− .name = "pcan_usb_fd",
1015− .tseg1_min = 1,
1016− .tseg1_max = 16,
1017− .tseg2_min = 1,
1018− .tseg2_max = 8,
1019− .sjw_max = 4,
1020− .brp_min = 1,
1021− .brp_max = 1024,
1022− .brp_inc = 1,
1023− },
1026+ .bittiming_const = &pcan_usb_fd_const,
1027+ .data_bittiming_const = &pcan_usb_fd_data_const,
10241028
10251029 /* size of device private data */
10261030 .sizeof_dev_private = sizeof(struct pcan_usb_fd_device),
@@ -1058,6 +1062,30 @@ const struct peak_usb_adapter pcan_usb_fd = { · 31 unmodified lines
10581062 };
10591063
10601064 /* describes the PCAN-USB Pro FD adapter */
1065+static const struct can_bittiming_const pcan_usb_pro_fd_const = {
1066+ .name = "pcan_usb_pro_fd",
1067+ .tseg1_min = 1,
1068+ .tseg1_max = 64,
1069+ .tseg2_min = 1,
1070+ .tseg2_max = 16,
1071+ .sjw_max = 16,
1072+ .brp_min = 1,
1073+ .brp_max = 1024,
1074+ .brp_inc = 1,
1075+};
1076+
1077+static const struct can_bittiming_const pcan_usb_pro_fd_data_const = {
1078+ .name = "pcan_usb_pro_fd",
1079+ .tseg1_min = 1,
1080+ .tseg1_max = 16,
1081+ .tseg2_min = 1,
1082+ .tseg2_max = 8,
1083+ .sjw_max = 4,
1084+ .brp_min = 1,
1085+ .brp_max = 1024,
1086+ .brp_inc = 1,
1087+};
1088+
10611089 const struct peak_usb_adapter pcan_usb_pro_fd = {
10621090 .name = "PCAN-USB Pro FD",
10631091 .device_id = PCAN_USBPROFD_PRODUCT_ID,
@@ -1067,28 +1095,8 @@ const struct peak_usb_adapter pcan_usb_pro_fd = { · 3 unmodified lines
10671095 .clock = {
10681096 .freq = PCAN_UFD_CRYSTAL_HZ,
10691097 },
1070− .bittiming_const = {
1071− .name = "pcan_usb_pro_fd",
1072− .tseg1_min = 1,
1073− .tseg1_max = 64,
1074− .tseg2_min = 1,
1075− .tseg2_max = 16,
1076− .sjw_max = 16,
1077− .brp_min = 1,
1078− .brp_max = 1024,
1079− .brp_inc = 1,
1080− },
1081− .data_bittiming_const = {
1082− .name = "pcan_usb_pro_fd",
1083− .tseg1_min = 1,
1084− .tseg1_max = 16,
1085− .tseg2_min = 1,
1086− .tseg2_max = 8,
1087− .sjw_max = 4,
1088− .brp_min = 1,
1089− .brp_max = 1024,
1090− .brp_inc = 1,
1091− },
1098+ .bittiming_const = &pcan_usb_pro_fd_const,
1099+ .data_bittiming_const = &pcan_usb_pro_fd_data_const,
10921100
10931101 /* size of device private data */
10941102 .sizeof_dev_private = sizeof(struct pcan_usb_fd_device),
drivers/net/can/usb/peak_usb/pcan_usb_pro.c+13−11
@@ -1004,6 +1004,18 @@ int pcan_usb_pro_probe(struct usb_interface *intf) · 1003 unmodified lines
10041004 /*
10051005 * describe the PCAN-USB Pro adapter
10061006 */
1007+static const struct can_bittiming_const pcan_usb_pro_const = {
1008+ .name = "pcan_usb_pro",
1009+ .tseg1_min = 1,
1010+ .tseg1_max = 16,
1011+ .tseg2_min = 1,
1012+ .tseg2_max = 8,
1013+ .sjw_max = 4,
1014+ .brp_min = 1,
1015+ .brp_max = 1024,
1016+ .brp_inc = 1,
1017+};
1018+
10071019 const struct peak_usb_adapter pcan_usb_pro = {
10081020 .name = "PCAN-USB Pro",
10091021 .device_id = PCAN_USBPRO_PRODUCT_ID,
@@ -1012,17 +1024,7 @@ const struct peak_usb_adapter pcan_usb_pro = { · 2 unmodified lines
10121024 .clock = {
10131025 .freq = PCAN_USBPRO_CRYSTAL_HZ,
10141026 },
1015− .bittiming_const = {
1016− .name = "pcan_usb_pro",
1017− .tseg1_min = 1,
1018− .tseg1_max = 16,
1019− .tseg2_min = 1,
1020− .tseg2_max = 8,
1021− .sjw_max = 4,
1022− .brp_min = 1,
1023− .brp_max = 1024,
1024− .brp_inc = 1,
1025− },
1027+ .bittiming_const = &pcan_usb_pro_const,
10261028
10271029 /* size of device private data */
10281030 .sizeof_dev_private = sizeof(struct pcan_usb_pro_device),
drivers/net/ethernet/Makefile+1−1
@@ -65,7 +65,7 @@ obj-$(CONFIG_NET_VENDOR_PASEMI) += pasemi/ · 64 unmodified lines
6565 obj-$(CONFIG_NET_VENDOR_QLOGIC) += qlogic/
6666 obj-$(CONFIG_NET_VENDOR_QUALCOMM) += qualcomm/
6767 obj-$(CONFIG_NET_VENDOR_REALTEK) += realtek/
68−obj-$(CONFIG_SH_ETH) += renesas/
68+obj-$(CONFIG_NET_VENDOR_RENESAS) += renesas/
6969 obj-$(CONFIG_NET_VENDOR_RDC) += rdc/
7070 obj-$(CONFIG_NET_VENDOR_ROCKER) += rocker/
7171 obj-$(CONFIG_NET_VENDOR_SAMSUNG) += samsung/
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c+3−0
@@ -801,6 +801,9 @@ int xgene_enet_mdio_config(struct xgene_enet_pdata *pdata) · 800 unmodified lines
801801
802802 void xgene_enet_mdio_remove(struct xgene_enet_pdata *pdata)
803803 {
804+ if (pdata->phy_dev)
805+ phy_disconnect(pdata->phy_dev);
806+
804807 mdiobus_unregister(pdata->mdio_bus);
805808 mdiobus_free(pdata->mdio_bus);
806809 pdata->mdio_bus = NULL;
drivers/net/ethernet/apm/xgene/xgene_enet_main.c+3−2
@@ -1277,9 +1277,10 @@ static int xgene_enet_remove(struct platform_device *pdev) · 1276 unmodified lines
12771277 mac_ops->tx_disable(pdata);
12781278
12791279 xgene_enet_napi_del(pdata);
1280− xgene_enet_mdio_remove(pdata);
1281− xgene_enet_delete_desc_rings(pdata);
1280+ if (pdata->phy_mode == PHY_INTERFACE_MODE_RGMII)
1281+ xgene_enet_mdio_remove(pdata);
12821282 unregister_netdev(ndev);
1283+ xgene_enet_delete_desc_rings(pdata);
12831284 pdata->port_ops->shutdown(pdata);
12841285 free_netdev(ndev);
12851286
drivers/net/ethernet/broadcom/genet/bcmgenet.c+16−4
@@ -2126,6 +2126,8 @@ static int bcmgenet_dma_teardown(struct bcmgenet_priv *priv) · 2125 unmodified lines
21262126 int ret = 0;
21272127 int timeout = 0;
21282128 u32 reg;
2129+ u32 dma_ctrl;
2130+ int i;
21292131
21302132 /* Disable TDMA to stop add more frames in TX DMA */
21312133 reg = bcmgenet_tdma_readl(priv, DMA_CTRL);
@@ -2169,6 +2171,20 @@ static int bcmgenet_dma_teardown(struct bcmgenet_priv *priv) · 37 unmodified lines
21692171 ret = -ETIMEDOUT;
21702172 }
21712173
2174+ dma_ctrl = 0;
2175+ for (i = 0; i < priv->hw_params->rx_queues; i++)
2176+ dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
2177+ reg = bcmgenet_rdma_readl(priv, DMA_CTRL);
2178+ reg &= ~dma_ctrl;
2179+ bcmgenet_rdma_writel(priv, reg, DMA_CTRL);
2180+
2181+ dma_ctrl = 0;
2182+ for (i = 0; i < priv->hw_params->tx_queues; i++)
2183+ dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
2184+ reg = bcmgenet_tdma_readl(priv, DMA_CTRL);
2185+ reg &= ~dma_ctrl;
2186+ bcmgenet_tdma_writel(priv, reg, DMA_CTRL);
2187+
21722188 return ret;
21732189 }
21742190
@@ -2820,8 +2836,6 @@ static void bcmgenet_timeout(struct net_device *dev) · 645 unmodified lines
28202836
28212837 netif_dbg(priv, tx_err, dev, "bcmgenet_timeout\n");
28222838
2823− bcmgenet_disable_tx_napi(priv);
2824−
28252839 for (q = 0; q < priv->hw_params->tx_queues; q++)
28262840 bcmgenet_dump_tx_queue(&priv->tx_rings[q]);
28272841 bcmgenet_dump_tx_queue(&priv->tx_rings[DESC_INDEX]);
@@ -2837,8 +2851,6 @@ static void bcmgenet_timeout(struct net_device *dev) · 9 unmodified lines
28372851 bcmgenet_intrl2_0_writel(priv, int0_enable, INTRL2_CPU_MASK_CLEAR);
28382852 bcmgenet_intrl2_1_writel(priv, int1_enable, INTRL2_CPU_MASK_CLEAR);
28392853
2840− bcmgenet_enable_tx_napi(priv);
2841−
28422854 dev->trans_start = jiffies;
28432855
28442856 dev->stats.tx_errors++;
drivers/net/ethernet/emulex/benet/be_main.c+2−2
@@ -5174,7 +5174,7 @@ static void be_add_vxlan_port(struct net_device *netdev, sa_family_t sa_family, · 5173 unmodified lines
51745174 struct device *dev = &adapter->pdev->dev;
51755175 int status;
51765176
5177− if (lancer_chip(adapter) || BEx_chip(adapter))
5177+ if (lancer_chip(adapter) || BEx_chip(adapter) || be_is_mc(adapter))
51785178 return;
51795179
51805180 if (adapter->flags & BE_FLAGS_VXLAN_OFFLOADS) {
@@ -5221,7 +5221,7 @@ static void be_del_vxlan_port(struct net_device *netdev, sa_family_t sa_family, · 40 unmodified lines
52215221 {
52225222 struct be_adapter *adapter = netdev_priv(netdev);
52235223
5224− if (lancer_chip(adapter) || BEx_chip(adapter))
5224+ if (lancer_chip(adapter) || BEx_chip(adapter) || be_is_mc(adapter))
52255225 return;
52265226
52275227 if (adapter->vxlan_port != port)
drivers/net/ethernet/freescale/fec_main.c+2−2
@@ -1778,7 +1778,7 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum) · 1777 unmodified lines
17781778 return ret;
17791779
17801780 fep->mii_timeout = 0;
1781− init_completion(&fep->mdio_done);
1781+ reinit_completion(&fep->mdio_done);
17821782
17831783 /* start a read op */
17841784 writel(FEC_MMFR_ST | FEC_MMFR_OP_READ |
@@ -1817,7 +1817,7 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum, · 32 unmodified lines
18171817 return ret;
18181818
18191819 fep->mii_timeout = 0;
1820− init_completion(&fep->mdio_done);
1820+ reinit_completion(&fep->mdio_done);
18211821
18221822 /* start a write op */
18231823 writel(FEC_MMFR_ST | FEC_MMFR_OP_WRITE |
drivers/net/ethernet/freescale/gianfar.c+5−0
@@ -2102,6 +2102,11 @@ int startup_gfar(struct net_device *ndev) · 2101 unmodified lines
21022102 /* Start Rx/Tx DMA and enable the interrupts */
21032103 gfar_start(priv);
21042104
2105+ /* force link state update after mac reset */
2106+ priv->oldlink = 0;
2107+ priv->oldspeed = 0;
2108+ priv->oldduplex = -1;
2109+
21052110 phy_start(priv->phydev);
21062111
21072112 enable_napi(priv);
drivers/net/ethernet/intel/fm10k/fm10k_main.c+1−1
@@ -216,7 +216,7 @@ static void fm10k_reuse_rx_page(struct fm10k_ring *rx_ring, · 215 unmodified lines
216216
217217 static inline bool fm10k_page_is_reserved(struct page *page)
218218 {
219− return (page_to_nid(page) != numa_mem_id()) || page->pfmemalloc;
219+ return (page_to_nid(page) != numa_mem_id()) || page_is_pfmemalloc(page);
220220 }
221221
222222 static bool fm10k_can_reuse_rx_page(struct fm10k_rx_buffer *rx_buffer,
drivers/net/ethernet/intel/igb/igb_main.c+1−1
@@ -6566,7 +6566,7 @@ static void igb_reuse_rx_page(struct igb_ring *rx_ring, · 6565 unmodified lines
65666566
65676567 static inline bool igb_page_is_reserved(struct page *page)
65686568 {
6569− return (page_to_nid(page) != numa_mem_id()) || page->pfmemalloc;
6569+ return (page_to_nid(page) != numa_mem_id()) || page_is_pfmemalloc(page);
65706570 }
65716571
65726572 static bool igb_can_reuse_rx_page(struct igb_rx_buffer *rx_buffer,
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+1−1
@@ -1832,7 +1832,7 @@ static void ixgbe_reuse_rx_page(struct ixgbe_ring *rx_ring, · 1831 unmodified lines
18321832
18331833 static inline bool ixgbe_page_is_reserved(struct page *page)
18341834 {
1835− return (page_to_nid(page) != numa_mem_id()) || page->pfmemalloc;
1835+ return (page_to_nid(page) != numa_mem_id()) || page_is_pfmemalloc(page);
18361836 }
18371837
18381838 /**
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+1−1
@@ -765,7 +765,7 @@ static void ixgbevf_reuse_rx_page(struct ixgbevf_ring *rx_ring, · 764 unmodified lines
765765
766766 static inline bool ixgbevf_page_is_reserved(struct page *page)
767767 {
768− return (page_to_nid(page) != numa_mem_id()) || page->pfmemalloc;
768+ return (page_to_nid(page) != numa_mem_id()) || page_is_pfmemalloc(page);
769769 }
770770
771771 /**
drivers/net/ethernet/micrel/ks8842.c+2−3
@@ -952,9 +952,8 @@ static int ks8842_alloc_dma_bufs(struct net_device *netdev) · 951 unmodified lines
952952
953953 sg_dma_address(&tx_ctl->sg) = dma_map_single(adapter->dev,
954954 tx_ctl->buf, DMA_BUFFER_SIZE, DMA_TO_DEVICE);
955− err = dma_mapping_error(adapter->dev,
956− sg_dma_address(&tx_ctl->sg));
957− if (err) {
955+ if (dma_mapping_error(adapter->dev, sg_dma_address(&tx_ctl->sg))) {
956+ err = -ENOMEM;
958957 sg_dma_address(&tx_ctl->sg) = 0;
959958 goto err;
960959 }
drivers/net/ethernet/sfc/ef10.c+26−1
@@ -1282,7 +1282,12 @@ static size_t efx_ef10_update_stats_common(struct efx_nic *efx, u64 *full_stats, · 1281 unmodified lines
12821282 }
12831283 }
12841284
1285− if (core_stats) {
1285+ if (!core_stats)
1286+ return stats_count;
1287+
1288+ if (nic_data->datapath_caps &
1289+ 1 << MC_CMD_GET_CAPABILITIES_OUT_EVB_LBN) {
1290+ /* Use vadaptor stats. */
12861291 core_stats->rx_packets = stats[EF10_STAT_rx_unicast] +
12871292 stats[EF10_STAT_rx_multicast] +
12881293 stats[EF10_STAT_rx_broadcast];
@@ -1302,6 +1307,26 @@ static size_t efx_ef10_update_stats_common(struct efx_nic *efx, u64 *full_stats, · 13 unmodified lines
13021307 core_stats->rx_fifo_errors = stats[EF10_STAT_rx_overflow];
13031308 core_stats->rx_errors = core_stats->rx_crc_errors;
13041309 core_stats->tx_errors = stats[EF10_STAT_tx_bad];
1310+ } else {
1311+ /* Use port stats. */
1312+ core_stats->rx_packets = stats[EF10_STAT_port_rx_packets];
1313+ core_stats->tx_packets = stats[EF10_STAT_port_tx_packets];
1314+ core_stats->rx_bytes = stats[EF10_STAT_port_rx_bytes];
1315+ core_stats->tx_bytes = stats[EF10_STAT_port_tx_bytes];
1316+ core_stats->rx_dropped = stats[EF10_STAT_port_rx_nodesc_drops] +
1317+ stats[GENERIC_STAT_rx_nodesc_trunc] +
1318+ stats[GENERIC_STAT_rx_noskb_drops];
1319+ core_stats->multicast = stats[EF10_STAT_port_rx_multicast];
1320+ core_stats->rx_length_errors =
1321+ stats[EF10_STAT_port_rx_gtjumbo] +
1322+ stats[EF10_STAT_port_rx_length_error];
1323+ core_stats->rx_crc_errors = stats[EF10_STAT_port_rx_bad];
1324+ core_stats->rx_frame_errors =
1325+ stats[EF10_STAT_port_rx_align_error];
1326+ core_stats->rx_fifo_errors = stats[EF10_STAT_port_rx_overflow];
1327+ core_stats->rx_errors = (core_stats->rx_length_errors +
1328+ core_stats->rx_crc_errors +
1329+ core_stats->rx_frame_errors);
13051330 }
13061331
13071332 return stats_count;
drivers/net/phy/fixed_phy.c+9−0
@@ -290,6 +290,15 @@ struct phy_device *fixed_phy_register(unsigned int irq, · 289 unmodified lines
290290 return ERR_PTR(-EINVAL);
291291 }
292292
293+ /* propagate the fixed link values to struct phy_device */
294+ phy->link = status->link;
295+ if (status->link) {
296+ phy->speed = status->speed;
297+ phy->duplex = status->duplex;
298+ phy->pause = status->pause;
299+ phy->asym_pause = status->asym_pause;
300+ }
301+
293302 of_node_get(np);
294303 phy->dev.of_node = np;
295304
drivers/net/phy/phy.c+24−8
@@ -811,6 +811,7 @@ void phy_state_machine(struct work_struct *work) · 810 unmodified lines
811811 bool needs_aneg = false, do_suspend = false;
812812 enum phy_state old_state;
813813 int err = 0;
814+ int old_link;
814815
815816 mutex_lock(&phydev->lock);
816817
@@ -896,11 +897,18 @@ void phy_state_machine(struct work_struct *work) · 79 unmodified lines
896897 phydev->adjust_link(phydev->attached_dev);
897898 break;
898899 case PHY_RUNNING:
899− /* Only register a CHANGE if we are
900− * polling or ignoring interrupts
900+ /* Only register a CHANGE if we are polling or ignoring
901+ * interrupts and link changed since latest checking.
901902 */
902− if (!phy_interrupt_is_valid(phydev))
903− phydev->state = PHY_CHANGELINK;
903+ if (!phy_interrupt_is_valid(phydev)) {
904+ old_link = phydev->link;
905+ err = phy_read_status(phydev);
906+ if (err)
907+ break;
908+
909+ if (old_link != phydev->link)
910+ phydev->state = PHY_CHANGELINK;
911+ }
904912 break;
905913 case PHY_CHANGELINK:
906914 err = phy_read_status(phydev);
@@ -1030,10 +1038,14 @@ int phy_read_mmd_indirect(struct phy_device *phydev, int prtad, · 123 unmodified lines
10301038 int value = -1;
10311039
10321040 if (phydrv->read_mmd_indirect == NULL) {
1033− mmd_phy_indirect(phydev->bus, prtad, devad, addr);
1041+ struct mii_bus *bus = phydev->bus;
1042+
1043+ mutex_lock(&bus->mdio_lock);
1044+ mmd_phy_indirect(bus, prtad, devad, addr);
10341045
10351046 /* Read the content of the MMD's selected register */
1036− value = phydev->bus->read(phydev->bus, addr, MII_MMD_DATA);
1047+ value = bus->read(bus, addr, MII_MMD_DATA);
1048+ mutex_unlock(&bus->mdio_lock);
10371049 } else {
10381050 value = phydrv->read_mmd_indirect(phydev, prtad, devad, addr);
10391051 }
@@ -1063,10 +1075,14 @@ void phy_write_mmd_indirect(struct phy_device *phydev, int prtad, · 23 unmodified lines
10631075 struct phy_driver *phydrv = phydev->drv;
10641076
10651077 if (phydrv->write_mmd_indirect == NULL) {
1066− mmd_phy_indirect(phydev->bus, prtad, devad, addr);
1078+ struct mii_bus *bus = phydev->bus;
1079+
1080+ mutex_lock(&bus->mdio_lock);
1081+ mmd_phy_indirect(bus, prtad, devad, addr);
10671082
10681083 /* Write the data into MMD's selected register */
1069− phydev->bus->write(phydev->bus, addr, MII_MMD_DATA, data);
1084+ bus->write(bus, addr, MII_MMD_DATA, data);
1085+ mutex_unlock(&bus->mdio_lock);
10701086 } else {
10711087 phydrv->write_mmd_indirect(phydev, prtad, devad, addr, data);
10721088 }
drivers/net/phy/phy_device.c+1−1
@@ -176,7 +176,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, · 175 unmodified lines
176176 if (c45_ids)
177177 dev->c45_ids = *c45_ids;
178178 dev->bus = bus;
179− dev->dev.parent = bus->parent;
179+ dev->dev.parent = &bus->dev;
180180 dev->dev.bus = &mdio_bus_type;
181181 dev->irq = bus->irq != NULL ? bus->irq[addr] : PHY_POLL;
182182 dev_set_name(&dev->dev, PHY_ID_FMT, bus->id, addr);
drivers/net/phy/smsc.c+19−12
@@ -91,19 +91,18 @@ static int lan911x_config_init(struct phy_device *phydev) · 90 unmodified lines
9191 }
9292
9393 /*
94− * The LAN8710/LAN8720 requires a minimum of 2 link pulses within 64ms of each
95− * other in order to set the ENERGYON bit and exit EDPD mode. If a link partner
96− * does send the pulses within this interval, the PHY will remained powered
97− * down.
98− *
99− * This workaround will manually toggle the PHY on/off upon calls to read_status
100− * in order to generate link test pulses if the link is down. If a link partner
101− * is present, it will respond to the pulses, which will cause the ENERGYON bit
102− * to be set and will cause the EDPD mode to be exited.
94+ * The LAN87xx suffers from rare absence of the ENERGYON-bit when Ethernet cable
95+ * plugs in while LAN87xx is in Energy Detect Power-Down mode. This leads to
96+ * unstable detection of plugging in Ethernet cable.
97+ * This workaround disables Energy Detect Power-Down mode and waiting for
98+ * response on link pulses to detect presence of plugged Ethernet cable.
99+ * The Energy Detect Power-Down mode is enabled again in the end of procedure to
100+ * save approximately 220 mW of power if cable is unplugged.
103101 */
104102 static int lan87xx_read_status(struct phy_device *phydev)
105103 {
106104 int err = genphy_read_status(phydev);
105+ int i;
107106
108107 if (!phydev->link) {
109108 /* Disable EDPD to wake up PHY */
@@ -116,8 +115,16 @@ static int lan87xx_read_status(struct phy_device *phydev) · 6 unmodified lines
116115 if (rc < 0)
117116 return rc;
118117
119− /* Sleep 64 ms to allow ~5 link test pulses to be sent */
120− msleep(64);
118+ /* Wait max 640 ms to detect energy */
119+ for (i = 0; i < 64; i++) {
120+ /* Sleep to allow link test pulses to be sent */
121+ msleep(10);
122+ rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
123+ if (rc < 0)
124+ return rc;
125+ if (rc & MII_LAN83C185_ENERGYON)
126+ break;
127+ }
121128
122129 /* Re-enable EDPD */
123130 rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
@@ -191,7 +198,7 @@ static struct phy_driver smsc_phy_driver[] = { · 67 unmodified lines
191198
192199 /* basic functions */
193200 .config_aneg = genphy_config_aneg,
194− .read_status = genphy_read_status,
201+ .read_status = lan87xx_read_status,
195202 .config_init = smsc_phy_config_init,
196203 .soft_reset = smsc_phy_reset,
197204
drivers/net/ppp/ppp_generic.c+42−36
@@ -269,9 +269,9 @@ static void ppp_ccp_peek(struct ppp *ppp, struct sk_buff *skb, int inbound); · 268 unmodified lines
269269 static void ppp_ccp_closed(struct ppp *ppp);
270270 static struct compressor *find_compressor(int type);
271271 static void ppp_get_stats(struct ppp *ppp, struct ppp_stats *st);
272−static struct ppp *ppp_create_interface(struct net *net, int unit, int *retp);
272+static struct ppp *ppp_create_interface(struct net *net, int unit,
273+ struct file *file, int *retp);
273274 static void init_ppp_file(struct ppp_file *pf, int kind);
274−static void ppp_shutdown_interface(struct ppp *ppp);
275275 static void ppp_destroy_interface(struct ppp *ppp);
276276 static struct ppp *ppp_find_unit(struct ppp_net *pn, int unit);
277277 static struct channel *ppp_find_channel(struct ppp_net *pn, int unit);
@@ -392,8 +392,10 @@ static int ppp_release(struct inode *unused, struct file *file) · 114 unmodified lines
392392 file->private_data = NULL;
393393 if (pf->kind == INTERFACE) {
394394 ppp = PF_TO_PPP(pf);
395+ rtnl_lock();
395396 if (file == ppp->owner)
396− ppp_shutdown_interface(ppp);
397+ unregister_netdevice(ppp->dev);
398+ rtnl_unlock();
397399 }
398400 if (atomic_dec_and_test(&pf->refcnt)) {
399401 switch (pf->kind) {
@@ -593,8 +595,10 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 193 unmodified lines
593595 mutex_lock(&ppp_mutex);
594596 if (pf->kind == INTERFACE) {
595597 ppp = PF_TO_PPP(pf);
598+ rtnl_lock();
596599 if (file == ppp->owner)
597− ppp_shutdown_interface(ppp);
600+ unregister_netdevice(ppp->dev);
601+ rtnl_unlock();
598602 }
599603 if (atomic_long_read(&file->f_count) < 2) {
600604 ppp_release(NULL, file);
@@ -838,11 +842,10 @@ static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf, · 237 unmodified lines
838842 /* Create a new ppp unit */
839843 if (get_user(unit, p))
840844 break;
841− ppp = ppp_create_interface(net, unit, &err);
845+ ppp = ppp_create_interface(net, unit, file, &err);
842846 if (!ppp)
843847 break;
844848 file->private_data = &ppp->file;
845− ppp->owner = file;
846849 err = -EFAULT;
847850 if (put_user(ppp->file.index, p))
848851 break;
@@ -916,6 +919,16 @@ static __net_init int ppp_init_net(struct net *net) · 67 unmodified lines
916919 static __net_exit void ppp_exit_net(struct net *net)
917920 {
918921 struct ppp_net *pn = net_generic(net, ppp_net_id);
922+ struct ppp *ppp;
923+ LIST_HEAD(list);
924+ int id;
925+
926+ rtnl_lock();
927+ idr_for_each_entry(&pn->units_idr, ppp, id)
928+ unregister_netdevice_queue(ppp->dev, &list);
929+
930+ unregister_netdevice_many(&list);
931+ rtnl_unlock();
919932
920933 idr_destroy(&pn->units_idr);
921934 }
@@ -1088,8 +1101,28 @@ static int ppp_dev_init(struct net_device *dev) · 166 unmodified lines
10881101 return 0;
10891102 }
10901103
1104+static void ppp_dev_uninit(struct net_device *dev)
1105+{
1106+ struct ppp *ppp = netdev_priv(dev);
1107+ struct ppp_net *pn = ppp_pernet(ppp->ppp_net);
1108+
1109+ ppp_lock(ppp);
1110+ ppp->closing = 1;
1111+ ppp_unlock(ppp);
1112+
1113+ mutex_lock(&pn->all_ppp_mutex);
1114+ unit_put(&pn->units_idr, ppp->file.index);
1115+ mutex_unlock(&pn->all_ppp_mutex);
1116+
1117+ ppp->owner = NULL;
1118+
1119+ ppp->file.dead = 1;
1120+ wake_up_interruptible(&ppp->file.rwait);
1121+}
1122+
10911123 static const struct net_device_ops ppp_netdev_ops = {
10921124 .ndo_init = ppp_dev_init,
1125+ .ndo_uninit = ppp_dev_uninit,
10931126 .ndo_start_xmit = ppp_start_xmit,
10941127 .ndo_do_ioctl = ppp_net_ioctl,
10951128 .ndo_get_stats64 = ppp_get_stats64,
@@ -2667,8 +2700,8 @@ ppp_get_stats(struct ppp *ppp, struct ppp_stats *st) · 1571 unmodified lines
26672700 * or if there is already a unit with the requested number.
26682701 * unit == -1 means allocate a new number.
26692702 */
2670−static struct ppp *
2671−ppp_create_interface(struct net *net, int unit, int *retp)
2703+static struct ppp *ppp_create_interface(struct net *net, int unit,
2704+ struct file *file, int *retp)
26722705 {
26732706 struct ppp *ppp;
26742707 struct ppp_net *pn;
@@ -2688,6 +2721,7 @@ ppp_create_interface(struct net *net, int unit, int *retp) · 13 unmodified lines
26882721 ppp->mru = PPP_MRU;
26892722 init_ppp_file(&ppp->file, INTERFACE);
26902723 ppp->file.hdrlen = PPP_HDRLEN - 2; /* don't count proto bytes */
2724+ ppp->owner = file;
26912725 for (i = 0; i < NUM_NP; ++i)
26922726 ppp->npmode[i] = NPMODE_PASS;
26932727 INIT_LIST_HEAD(&ppp->channels);
@@ -2775,34 +2809,6 @@ init_ppp_file(struct ppp_file *pf, int kind) · 81 unmodified lines
27752809 init_waitqueue_head(&pf->rwait);
27762810 }
27772811
2778−/*
2779− * Take down a ppp interface unit - called when the owning file
2780− * (the one that created the unit) is closed or detached.
2781− */
2782−static void ppp_shutdown_interface(struct ppp *ppp)
2783−{
2784− struct ppp_net *pn;
2785−
2786− pn = ppp_pernet(ppp->ppp_net);
2787− mutex_lock(&pn->all_ppp_mutex);
2788−
2789− /* This will call dev_close() for us. */
2790− ppp_lock(ppp);
2791− if (!ppp->closing) {
2792− ppp->closing = 1;
2793− ppp_unlock(ppp);
2794− unregister_netdev(ppp->dev);
2795− unit_put(&pn->units_idr, ppp->file.index);
2796− } else
2797− ppp_unlock(ppp);
2798−
2799− ppp->file.dead = 1;
2800− ppp->owner = NULL;
2801− wake_up_interruptible(&ppp->file.rwait);
2802−
2803− mutex_unlock(&pn->all_ppp_mutex);
2804−}
2805−
28062812 /*
28072813 * Free the memory used by a ppp unit. This is only called once
28082814 * there are no channels connected to the unit and no file structs
drivers/net/usb/qmi_wwan.c+1−0
@@ -785,6 +785,7 @@ static const struct usb_device_id products[] = { · 784 unmodified lines
785785 {QMI_FIXED_INTF(0x413c, 0x81a4, 8)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
786786 {QMI_FIXED_INTF(0x413c, 0x81a8, 8)}, /* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card */
787787 {QMI_FIXED_INTF(0x413c, 0x81a9, 8)}, /* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card */
788+ {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */
788789 {QMI_FIXED_INTF(0x03f0, 0x581d, 4)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Module (Huawei me906e) */
789790
790791 /* 4. Gobi 1000 devices */
drivers/net/usb/usbnet.c+4−3
@@ -778,7 +778,7 @@ int usbnet_stop (struct net_device *net) · 777 unmodified lines
778778 {
779779 struct usbnet *dev = netdev_priv(net);
780780 struct driver_info *info = dev->driver_info;
781− int retval, pm;
781+ int retval, pm, mpn;
782782
783783 clear_bit(EVENT_DEV_OPEN, &dev->flags);
784784 netif_stop_queue (net);
@@ -809,6 +809,8 @@ int usbnet_stop (struct net_device *net) · 24 unmodified lines
809809
810810 usbnet_purge_paused_rxq(dev);
811811
812+ mpn = !test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags);
813+
812814 /* deferred work (task, timer, softirq) must also stop.
813815 * can't flush_scheduled_work() until we drop rtnl (later),
814816 * else workers could deadlock; so make workers a NOP.
@@ -819,8 +821,7 @@ int usbnet_stop (struct net_device *net) · 4 unmodified lines
819821 if (!pm)
820822 usb_autopm_put_interface(dev->intf);
821823
822− if (info->manage_power &&
823− !test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags))
824+ if (info->manage_power && mpn)
824825 info->manage_power(dev, 0);
825826 else
826827 usb_autopm_put_interface(dev->intf);
drivers/net/vxlan.c+2−0
@@ -2216,6 +2216,8 @@ static int vxlan_open(struct net_device *dev) · 2215 unmodified lines
22162216
22172217 if (vxlan_addr_multicast(&vxlan->default_dst.remote_ip)) {
22182218 ret = vxlan_igmp_join(vxlan);
2219+ if (ret == -EADDRINUSE)
2220+ ret = 0;
22192221 if (ret) {
22202222 vxlan_sock_release(vs);
22212223 return ret;
drivers/pci/Kconfig+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 # PCI configuration
33 #
44 config PCI_BUS_ADDR_T_64BIT
5− def_bool y if (ARCH_DMA_ADDR_T_64BIT || 64BIT)
5+ def_bool y if (ARCH_DMA_ADDR_T_64BIT || (64BIT && !PARISC))
66 depends on PCI
77
88 config PCI_MSI
drivers/pci/probe.c+7−2
@@ -997,7 +997,12 @@ void set_pcie_port_type(struct pci_dev *pdev) · 996 unmodified lines
997997 else if (type == PCI_EXP_TYPE_UPSTREAM ||
998998 type == PCI_EXP_TYPE_DOWNSTREAM) {
999999 parent = pci_upstream_bridge(pdev);
1000− if (!parent->has_secondary_link)
1000+
1001+ /*
1002+ * Usually there's an upstream device (Root Port or Switch
1003+ * Downstream Port), but we can't assume one exists.
1004+ */
1005+ if (parent && !parent->has_secondary_link)
10011006 pdev->has_secondary_link = 1;
10021007 }
10031008 }
@@ -1103,7 +1108,7 @@ int pci_cfg_space_size(struct pci_dev *dev) · 99 unmodified lines
11031108
11041109 #define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED)
11051110
1106−static void pci_msi_setup_pci_dev(struct pci_dev *dev)
1111+void pci_msi_setup_pci_dev(struct pci_dev *dev)
11071112 {
11081113 /*
11091114 * Disable the MSI hardware to avoid screaming interrupts
drivers/scsi/fnic/fnic.h+1−1
@@ -39,7 +39,7 @@ · 38 unmodified lines
3939
4040 #define DRV_NAME "fnic"
4141 #define DRV_DESCRIPTION "Cisco FCoE HBA Driver"
42−#define DRV_VERSION "1.6.0.17"
42+#define DRV_VERSION "1.6.0.17a"
4343 #define PFX DRV_NAME ": "
4444 #define DFX DRV_NAME "%d: "
4545
drivers/scsi/fnic/fnic_scsi.c+3−1
@@ -425,6 +425,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ · 424 unmodified lines
425425 unsigned long ptr;
426426 struct fc_rport_priv *rdata;
427427 spinlock_t *io_lock = NULL;
428+ int io_lock_acquired = 0;
428429
429430 if (unlikely(fnic_chk_state_flags_locked(fnic, FNIC_FLAGS_IO_BLOCKED)))
430431 return SCSI_MLQUEUE_HOST_BUSY;
@@ -518,6 +519,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ · 87 unmodified lines
518519 spin_lock_irqsave(io_lock, flags);
519520
520521 /* initialize rest of io_req */
522+ io_lock_acquired = 1;
521523 io_req->port_id = rport->port_id;
522524 io_req->start_time = jiffies;
523525 CMD_STATE(sc) = FNIC_IOREQ_CMD_PENDING;
@@ -571,7 +573,7 @@ out: · 47 unmodified lines
571573 (((u64)CMD_FLAGS(sc) >> 32) | CMD_STATE(sc)));
572574
573575 /* if only we issued IO, will we have the io lock */
574− if (CMD_FLAGS(sc) & FNIC_IO_INITIALIZED)
576+ if (io_lock_acquired)
575577 spin_unlock_irqrestore(io_lock, flags);
576578
577579 atomic_dec(&fnic->in_flight);
drivers/scsi/scsi_pm.c+11−11
@@ -217,15 +217,15 @@ static int sdev_runtime_suspend(struct device *dev) · 216 unmodified lines
217217 {
218218 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
219219 struct scsi_device *sdev = to_scsi_device(dev);
220− int err;
220+ int err = 0;
221221
222− err = blk_pre_runtime_suspend(sdev->request_queue);
223− if (err)
224− return err;
225− if (pm && pm->runtime_suspend)
222+ if (pm && pm->runtime_suspend) {
223+ err = blk_pre_runtime_suspend(sdev->request_queue);
224+ if (err)
225+ return err;
226226 err = pm->runtime_suspend(dev);
227− blk_post_runtime_suspend(sdev->request_queue, err);
228−
227+ blk_post_runtime_suspend(sdev->request_queue, err);
228+ }
229229 return err;
230230 }
231231
@@ -248,11 +248,11 @@ static int sdev_runtime_resume(struct device *dev) · 16 unmodified lines
248248 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
249249 int err = 0;
250250
251− blk_pre_runtime_resume(sdev->request_queue);
252− if (pm && pm->runtime_resume)
251+ if (pm && pm->runtime_resume) {
252+ blk_pre_runtime_resume(sdev->request_queue);
253253 err = pm->runtime_resume(dev);
254− blk_post_runtime_resume(sdev->request_queue, err);
255−
254+ blk_post_runtime_resume(sdev->request_queue, err);
255+ }
256256 return err;
257257 }
258258
drivers/target/iscsi/iscsi_target.c+2−2
@@ -968,9 +968,9 @@ int iscsit_setup_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, · 967 unmodified lines
968968 cmd->cmd_flags |= ICF_NON_IMMEDIATE_UNSOLICITED_DATA;
969969
970970 conn->sess->init_task_tag = cmd->init_task_tag = hdr->itt;
971− if (hdr->flags & ISCSI_FLAG_CMD_READ) {
971+ if (hdr->flags & ISCSI_FLAG_CMD_READ)
972972 cmd->targ_xfer_tag = session_get_next_ttt(conn->sess);
973− } else if (hdr->flags & ISCSI_FLAG_CMD_WRITE)
973+ else
974974 cmd->targ_xfer_tag = 0xFFFFFFFF;
975975 cmd->cmd_sn = be32_to_cpu(hdr->cmdsn);
976976 cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn);
drivers/target/target_core_configfs.c+8−1
@@ -457,8 +457,15 @@ void target_unregister_template(const struct target_core_fabric_ops *fo) · 456 unmodified lines
457457 if (!strcmp(t->tf_ops->name, fo->name)) {
458458 BUG_ON(atomic_read(&t->tf_access_cnt));
459459 list_del(&t->tf_list);
460+ mutex_unlock(&g_tf_lock);
461+ /*
462+ * Wait for any outstanding fabric se_deve_entry->rcu_head
463+ * callbacks to complete post kfree_rcu(), before allowing
464+ * fabric driver unload of TFO->module to proceed.
465+ */
466+ rcu_barrier();
460467 kfree(t);
461− break;
468+ return;
462469 }
463470 }
464471 mutex_unlock(&g_tf_lock);
drivers/target/target_core_hba.c+9−1
@@ -84,8 +84,16 @@ void target_backend_unregister(const struct target_backend_ops *ops) · 83 unmodified lines
8484 list_for_each_entry(tb, &backend_list, list) {
8585 if (tb->ops == ops) {
8686 list_del(&tb->list);
87+ mutex_unlock(&backend_mutex);
88+ /*
89+ * Wait for any outstanding backend driver ->rcu_head
90+ * callbacks to complete post TBO->free_device() ->
91+ * call_rcu(), before allowing backend driver module
92+ * unload of target_backend_ops->owner to proceed.
93+ */
94+ rcu_barrier();
8795 kfree(tb);
88− break;
96+ return;
8997 }
9098 }
9199 mutex_unlock(&backend_mutex);
drivers/target/target_core_spc.c+25−19
@@ -1203,17 +1203,13 @@ sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd) · 1202 unmodified lines
12031203 struct se_dev_entry *deve;
12041204 struct se_session *sess = cmd->se_sess;
12051205 struct se_node_acl *nacl;
1206+ struct scsi_lun slun;
12061207 unsigned char *buf;
12071208 u32 lun_count = 0, offset = 8;
1208−
1209− if (cmd->data_length < 16) {
1210− pr_warn("REPORT LUNS allocation length %u too small\n",
1211− cmd->data_length);
1212− return TCM_INVALID_CDB_FIELD;
1213− }
1209+ __be32 len;
12141210
12151211 buf = transport_kmap_data_sg(cmd);
1216− if (!buf)
1212+ if (cmd->data_length && !buf)
12171213 return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
12181214
12191215 /*
@@ -1221,11 +1217,9 @@ sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd) · 1 unmodified line
12211217 * coming via a target_core_mod PASSTHROUGH op, and not through
12221218 * a $FABRIC_MOD. In that case, report LUN=0 only.
12231219 */
1224− if (!sess) {
1225− int_to_scsilun(0, (struct scsi_lun *)&buf[offset]);
1226− lun_count = 1;
1220+ if (!sess)
12271221 goto done;
1228− }
1222+
12291223 nacl = sess->se_node_acl;
12301224
12311225 rcu_read_lock();
@@ -1236,10 +1230,12 @@ sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd) · 4 unmodified lines
12361230 * See SPC2-R20 7.19.
12371231 */
12381232 lun_count++;
1239− if ((offset + 8) > cmd->data_length)
1233+ if (offset >= cmd->data_length)
12401234 continue;
12411235
1242− int_to_scsilun(deve->mapped_lun, (struct scsi_lun *)&buf[offset]);
1236+ int_to_scsilun(deve->mapped_lun, &slun);
1237+ memcpy(buf + offset, &slun,
1238+ min(8u, cmd->data_length - offset));
12431239 offset += 8;
12441240 }
12451241 rcu_read_unlock();
@@ -1248,12 +1244,22 @@ sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd) · 2 unmodified lines
12481244 * See SPC3 r07, page 159.
12491245 */
12501246 done:
1251− lun_count *= 8;
1252− buf[0] = ((lun_count >> 24) & 0xff);
1253− buf[1] = ((lun_count >> 16) & 0xff);
1254− buf[2] = ((lun_count >> 8) & 0xff);
1255− buf[3] = (lun_count & 0xff);
1256− transport_kunmap_data_sg(cmd);
1247+ /*
1248+ * If no LUNs are accessible, report virtual LUN 0.
1249+ */
1250+ if (lun_count == 0) {
1251+ int_to_scsilun(0, &slun);
1252+ if (cmd->data_length > 8)
1253+ memcpy(buf + offset, &slun,
1254+ min(8u, cmd->data_length - offset));
1255+ lun_count = 1;
1256+ }
1257+
1258+ if (buf) {
1259+ len = cpu_to_be32(lun_count * 8);
1260+ memcpy(buf, &len, min_t(int, sizeof len, cmd->data_length));
1261+ transport_kunmap_data_sg(cmd);
1262+ }
12571263
12581264 target_complete_cmd_with_length(cmd, GOOD, 8 + lun_count * 8);
12591265 return 0;
drivers/thermal/cpu_cooling.c+44−29
@@ -68,7 +68,7 @@ struct power_table { · 67 unmodified lines
6868 * registered cooling device.
6969 * @cpufreq_state: integer value representing the current state of cpufreq
7070 * cooling devices.
71− * @cpufreq_val: integer value representing the absolute value of the clipped
71+ * @clipped_freq: integer value representing the absolute value of the clipped
7272 * frequency.
7373 * @max_level: maximum cooling level. One less than total number of valid
7474 * cpufreq frequencies.
@@ -91,7 +91,7 @@ struct cpufreq_cooling_device { · 16 unmodified lines
9191 int id;
9292 struct thermal_cooling_device *cool_dev;
9393 unsigned int cpufreq_state;
94− unsigned int cpufreq_val;
94+ unsigned int clipped_freq;
9595 unsigned int max_level;
9696 unsigned int *freq_table; /* In descending order */
9797 struct cpumask allowed_cpus;
@@ -107,6 +107,9 @@ struct cpufreq_cooling_device { · 9 unmodified lines
107107 static DEFINE_IDR(cpufreq_idr);
108108 static DEFINE_MUTEX(cooling_cpufreq_lock);
109109
110+static unsigned int cpufreq_dev_count;
111+
112+static DEFINE_MUTEX(cooling_list_lock);
110113 static LIST_HEAD(cpufreq_dev_list);
111114
112115 /**
@@ -185,14 +188,14 @@ unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq) · 72 unmodified lines
185188 {
186189 struct cpufreq_cooling_device *cpufreq_dev;
187190
188− mutex_lock(&cooling_cpufreq_lock);
191+ mutex_lock(&cooling_list_lock);
189192 list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) {
190193 if (cpumask_test_cpu(cpu, &cpufreq_dev->allowed_cpus)) {
191− mutex_unlock(&cooling_cpufreq_lock);
194+ mutex_unlock(&cooling_list_lock);
192195 return get_level(cpufreq_dev, freq);
193196 }
194197 }
195− mutex_unlock(&cooling_cpufreq_lock);
198+ mutex_unlock(&cooling_list_lock);
196199
197200 pr_err("%s: cpu:%d not part of any cooling device\n", __func__, cpu);
198201 return THERMAL_CSTATE_INVALID;
@@ -215,29 +218,35 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb, · 16 unmodified lines
215218 unsigned long event, void *data)
216219 {
217220 struct cpufreq_policy *policy = data;
218− unsigned long max_freq = 0;
221+ unsigned long clipped_freq;
219222 struct cpufreq_cooling_device *cpufreq_dev;
220223
221− switch (event) {
224+ if (event != CPUFREQ_ADJUST)
225+ return NOTIFY_DONE;
222226
223− case CPUFREQ_ADJUST:
224− mutex_lock(&cooling_cpufreq_lock);
225− list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) {
226− if (!cpumask_test_cpu(policy->cpu,
227− &cpufreq_dev->allowed_cpus))
228− continue;
227+ mutex_lock(&cooling_list_lock);
228+ list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) {
229+ if (!cpumask_test_cpu(policy->cpu, &cpufreq_dev->allowed_cpus))
230+ continue;
229231
230− max_freq = cpufreq_dev->cpufreq_val;
232+ /*
233+ * policy->max is the maximum allowed frequency defined by user
234+ * and clipped_freq is the maximum that thermal constraints
235+ * allow.
236+ *
237+ * If clipped_freq is lower than policy->max, then we need to
238+ * readjust policy->max.
239+ *
240+ * But, if clipped_freq is greater than policy->max, we don't
241+ * need to do anything.
242+ */
243+ clipped_freq = cpufreq_dev->clipped_freq;
231244
232− if (policy->max != max_freq)
233− cpufreq_verify_within_limits(policy, 0,
234− max_freq);
235− }
236− mutex_unlock(&cooling_cpufreq_lock);
245+ if (policy->max > clipped_freq)
246+ cpufreq_verify_within_limits(policy, 0, clipped_freq);
237247 break;
238− default:
239− return NOTIFY_DONE;
240248 }
249+ mutex_unlock(&cooling_list_lock);
241250
242251 return NOTIFY_OK;
243252 }
@@ -519,7 +528,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, · 275 unmodified lines
519528
520529 clip_freq = cpufreq_device->freq_table[state];
521530 cpufreq_device->cpufreq_state = state;
522− cpufreq_device->cpufreq_val = clip_freq;
531+ cpufreq_device->clipped_freq = clip_freq;
523532
524533 cpufreq_update_policy(cpu);
525534
@@ -861,17 +870,19 @@ __cpufreq_cooling_register(struct device_node *np, · 335 unmodified lines
861870 pr_debug("%s: freq:%u KHz\n", __func__, freq);
862871 }
863872
864− cpufreq_dev->cpufreq_val = cpufreq_dev->freq_table[0];
873+ cpufreq_dev->clipped_freq = cpufreq_dev->freq_table[0];
865874 cpufreq_dev->cool_dev = cool_dev;
866875
867876 mutex_lock(&cooling_cpufreq_lock);
868877
878+ mutex_lock(&cooling_list_lock);
879+ list_add(&cpufreq_dev->node, &cpufreq_dev_list);
880+ mutex_unlock(&cooling_list_lock);
881+
869882 /* Register the notifier for first cpufreq cooling device */
870− if (list_empty(&cpufreq_dev_list))
883+ if (!cpufreq_dev_count++)
871884 cpufreq_register_notifier(&thermal_cpufreq_notifier_block,
872885 CPUFREQ_POLICY_NOTIFIER);
873− list_add(&cpufreq_dev->node, &cpufreq_dev_list);
874−
875886 mutex_unlock(&cooling_cpufreq_lock);
876887
877888 return cool_dev;
@@ -1013,13 +1024,17 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) · 135 unmodified lines
10131024 return;
10141025
10151026 cpufreq_dev = cdev->devdata;
1016− mutex_lock(&cooling_cpufreq_lock);
1017− list_del(&cpufreq_dev->node);
10181027
10191028 /* Unregister the notifier for the last cpufreq cooling device */
1020− if (list_empty(&cpufreq_dev_list))
1029+ mutex_lock(&cooling_cpufreq_lock);
1030+ if (!--cpufreq_dev_count)
10211031 cpufreq_unregister_notifier(&thermal_cpufreq_notifier_block,
10221032 CPUFREQ_POLICY_NOTIFIER);
1033+
1034+ mutex_lock(&cooling_list_lock);
1035+ list_del(&cpufreq_dev->node);
1036+ mutex_unlock(&cooling_list_lock);
1037+
10231038 mutex_unlock(&cooling_cpufreq_lock);
10241039
10251040 thermal_cooling_device_unregister(cpufreq_dev->cool_dev);
drivers/thermal/power_allocator.c+5−6
@@ -258,8 +258,7 @@ static int allocate_power(struct thermal_zone_device *tz, · 257 unmodified lines
258258 BUILD_BUG_ON(sizeof(*req_power) != sizeof(*granted_power));
259259 BUILD_BUG_ON(sizeof(*req_power) != sizeof(*extra_actor_power));
260260 BUILD_BUG_ON(sizeof(*req_power) != sizeof(*weighted_req_power));
261− req_power = devm_kcalloc(&tz->device, num_actors * 5,
262− sizeof(*req_power), GFP_KERNEL);
261+ req_power = kcalloc(num_actors * 5, sizeof(*req_power), GFP_KERNEL);
263262 if (!req_power) {
264263 ret = -ENOMEM;
265264 goto unlock;
@@ -334,7 +333,7 @@ static int allocate_power(struct thermal_zone_device *tz, · 68 unmodified lines
334333 max_allocatable_power, current_temp,
335334 (s32)control_temp - (s32)current_temp);
336335
337− devm_kfree(&tz->device, req_power);
336+ kfree(req_power);
338337 unlock:
339338 mutex_unlock(&tz->lock);
340339
@@ -426,7 +425,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz) · 85 unmodified lines
426425 return -EINVAL;
427426 }
428427
429− params = devm_kzalloc(&tz->device, sizeof(*params), GFP_KERNEL);
428+ params = kzalloc(sizeof(*params), GFP_KERNEL);
430429 if (!params)
431430 return -ENOMEM;
432431
@@ -468,14 +467,14 @@ static int power_allocator_bind(struct thermal_zone_device *tz) · 35 unmodified lines
468467 return 0;
469468
470469 free:
471− devm_kfree(&tz->device, params);
470+ kfree(params);
472471 return ret;
473472 }
474473
475474 static void power_allocator_unbind(struct thermal_zone_device *tz)
476475 {
477476 dev_dbg(&tz->device, "Unbinding from thermal zone %d\n", tz->id);
478− devm_kfree(&tz->device, tz->governor_data);
477+ kfree(tz->governor_data);
479478 tz->governor_data = NULL;
480479 }
481480
fs/fs-writeback.c+13−9
@@ -844,14 +844,15 @@ static void bdi_split_work_to_wbs(struct backing_dev_info *bdi, · 843 unmodified lines
844844 struct wb_iter iter;
845845
846846 might_sleep();
847−
848− if (!bdi_has_dirty_io(bdi))
849− return;
850847 restart:
851848 rcu_read_lock();
852849 bdi_for_each_wb(wb, bdi, &iter, next_blkcg_id) {
853− if (!wb_has_dirty_io(wb) ||
854− (skip_if_busy && writeback_in_progress(wb)))
850+ /* SYNC_ALL writes out I_DIRTY_TIME too */
851+ if (!wb_has_dirty_io(wb) &&
852+ (base_work->sync_mode == WB_SYNC_NONE ||
853+ list_empty(&wb->b_dirty_time)))
854+ continue;
855+ if (skip_if_busy && writeback_in_progress(wb))
855856 continue;
856857
857858 base_work->nr_pages = wb_split_bdi_pages(wb, nr_pages);
@@ -899,8 +900,7 @@ static void bdi_split_work_to_wbs(struct backing_dev_info *bdi, · 41 unmodified lines
899900 {
900901 might_sleep();
901902
902− if (bdi_has_dirty_io(bdi) &&
903− (!skip_if_busy || !writeback_in_progress(&bdi->wb))) {
903+ if (!skip_if_busy || !writeback_in_progress(&bdi->wb)) {
904904 base_work->auto_free = 0;
905905 base_work->single_wait = 0;
906906 base_work->single_done = 0;
@@ -2275,8 +2275,12 @@ void sync_inodes_sb(struct super_block *sb) · 1368 unmodified lines
22752275 };
22762276 struct backing_dev_info *bdi = sb->s_bdi;
22772277
2278− /* Nothing to do? */
2279− if (!bdi_has_dirty_io(bdi) || bdi == &noop_backing_dev_info)
2278+ /*
2279+ * Can't skip on !bdi_has_dirty() because we should wait for !dirty
2280+ * inodes under writeback and I_DIRTY_TIME inodes ignored by
2281+ * bdi_has_dirty() need to be written out too.
2282+ */
2283+ if (bdi == &noop_backing_dev_info)
22802284 return;
22812285 WARN_ON(!rwsem_is_locked(&sb->s_umount));
22822286
include/drm/drm_edid.h+19−0
@@ -347,6 +347,25 @@ static inline int drm_eld_mnl(const uint8_t *eld) · 346 unmodified lines
347347 return (eld[DRM_ELD_CEA_EDID_VER_MNL] & DRM_ELD_MNL_MASK) >> DRM_ELD_MNL_SHIFT;
348348 }
349349
350+/**
351+ * drm_eld_sad - Get ELD SAD structures.
352+ * @eld: pointer to an eld memory structure with sad_count set
353+ */
354+static inline const uint8_t *drm_eld_sad(const uint8_t *eld)
355+{
356+ unsigned int ver, mnl;
357+
358+ ver = (eld[DRM_ELD_VER] & DRM_ELD_VER_MASK) >> DRM_ELD_VER_SHIFT;
359+ if (ver != 2 && ver != 31)
360+ return NULL;
361+
362+ mnl = drm_eld_mnl(eld);
363+ if (mnl > 16)
364+ return NULL;
365+
366+ return eld + DRM_ELD_CEA_SAD(mnl, 0);
367+}
368+
350369 /**
351370 * drm_eld_sad_count - Get ELD SAD count.
352371 * @eld: pointer to an eld memory structure with sad_count set
include/linux/irq.h+1−0
@@ -484,6 +484,7 @@ extern int irq_chip_set_affinity_parent(struct irq_data *data, · 483 unmodified lines
484484 extern int irq_chip_set_wake_parent(struct irq_data *data, unsigned int on);
485485 extern int irq_chip_set_vcpu_affinity_parent(struct irq_data *data,
486486 void *vcpu_info);
487+extern int irq_chip_set_type_parent(struct irq_data *data, unsigned int type);
487488 #endif
488489
489490 /* Handling of unhandled and spurious interrupts: */
include/linux/mm.h+28−0
@@ -1002,6 +1002,34 @@ static inline int page_mapped(struct page *page) · 1001 unmodified lines
10021002 return atomic_read(&(page)->_mapcount) >= 0;
10031003 }
10041004
1005+/*
1006+ * Return true only if the page has been allocated with
1007+ * ALLOC_NO_WATERMARKS and the low watermark was not
1008+ * met implying that the system is under some pressure.
1009+ */
1010+static inline bool page_is_pfmemalloc(struct page *page)
1011+{
1012+ /*
1013+ * Page index cannot be this large so this must be
1014+ * a pfmemalloc page.
1015+ */
1016+ return page->index == -1UL;
1017+}
1018+
1019+/*
1020+ * Only to be called by the page allocator on a freshly allocated
1021+ * page.
1022+ */
1023+static inline void set_page_pfmemalloc(struct page *page)
1024+{
1025+ page->index = -1UL;
1026+}
1027+
1028+static inline void clear_page_pfmemalloc(struct page *page)
1029+{
1030+ page->index = 0;
1031+}
1032+
10051033 /*
10061034 * Different kinds of faults, as returned by handle_mm_fault().
10071035 * Used to decide whether a process gets delivered SIGBUS or
include/linux/mm_types.h+0−9
@@ -63,15 +63,6 @@ struct page { · 62 unmodified lines
6363 union {
6464 pgoff_t index; /* Our offset within mapping. */
6565 void *freelist; /* sl[aou]b first free object */
66− bool pfmemalloc; /* If set by the page allocator,
67− * ALLOC_NO_WATERMARKS was set
68− * and the low watermark was not
69− * met implying that the system
70− * is under some pressure. The
71− * caller should try ensure
72− * this page is only used to
73− * free other pages.
74− */
7566 };
7667
7768 union {
include/linux/pci.h+1−0
@@ -1202,6 +1202,7 @@ struct msix_entry { · 1201 unmodified lines
12021202 u16 entry; /* driver uses to specify entry, OS writes */
12031203 };
12041204
1205+void pci_msi_setup_pci_dev(struct pci_dev *dev);
12051206
12061207 #ifdef CONFIG_PCI_MSI
12071208 int pci_msi_vec_count(struct pci_dev *dev);
include/linux/skbuff.h+5−9
@@ -1602,20 +1602,16 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i, · 1601 unmodified lines
16021602 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
16031603
16041604 /*
1605− * Propagate page->pfmemalloc to the skb if we can. The problem is
1606− * that not all callers have unique ownership of the page. If
1607− * pfmemalloc is set, we check the mapping as a mapping implies
1608− * page->index is set (index and pfmemalloc share space).
1609− * If it's a valid mapping, we cannot use page->pfmemalloc but we
1610− * do not lose pfmemalloc information as the pages would not be
1611− * allocated using __GFP_MEMALLOC.
1605+ * Propagate page pfmemalloc to the skb if we can. The problem is
1606+ * that not all callers have unique ownership of the page but rely
1607+ * on page_is_pfmemalloc doing the right thing(tm).
16121608 */
16131609 frag->page.p = page;
16141610 frag->page_offset = off;
16151611 skb_frag_size_set(frag, size);
16161612
16171613 page = compound_head(page);
1618− if (page->pfmemalloc && !page->mapping)
1614+ if (page_is_pfmemalloc(page))
16191615 skb->pfmemalloc = true;
16201616 }
16211617
@@ -2263,7 +2259,7 @@ static inline struct page *dev_alloc_page(void) · 641 unmodified lines
22632259 static inline void skb_propagate_pfmemalloc(struct page *page,
22642260 struct sk_buff *skb)
22652261 {
2266− if (page && page->pfmemalloc)
2262+ if (page_is_pfmemalloc(page))
22672263 skb->pfmemalloc = true;
22682264 }
22692265
include/media/rc-core.h+0−7
@@ -74,8 +74,6 @@ enum rc_filter_type { · 73 unmodified lines
7474 * @input_dev: the input child device used to communicate events to userspace
7575 * @driver_type: specifies if protocol decoding is done in hardware or software
7676 * @idle: used to keep track of RX state
77− * @encode_wakeup: wakeup filtering uses IR encode API, therefore the allowed
78− * wakeup protocols is the set of all raw encoders
7977 * @allowed_protocols: bitmask with the supported RC_BIT_* protocols
8078 * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols
8179 * @allowed_wakeup_protocols: bitmask with the supported RC_BIT_* wakeup protocols
@@ -136,7 +134,6 @@ struct rc_dev { · 54 unmodified lines
136134 struct input_dev *input_dev;
137135 enum rc_driver_type driver_type;
138136 bool idle;
139− bool encode_wakeup;
140137 u64 allowed_protocols;
141138 u64 enabled_protocols;
142139 u64 allowed_wakeup_protocols;
@@ -246,7 +243,6 @@ static inline void init_ir_raw_event(struct ir_raw_event *ev) · 103 unmodified lines
246243 #define US_TO_NS(usec) ((usec) * 1000)
247244 #define MS_TO_US(msec) ((msec) * 1000)
248245 #define MS_TO_NS(msec) ((msec) * 1000 * 1000)
249−#define NS_TO_US(nsec) DIV_ROUND_UP(nsec, 1000L)
250246
251247 void ir_raw_event_handle(struct rc_dev *dev);
252248 int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev);
@@ -254,9 +250,6 @@ int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type); · 1 unmodified line
254250 int ir_raw_event_store_with_filter(struct rc_dev *dev,
255251 struct ir_raw_event *ev);
256252 void ir_raw_event_set_idle(struct rc_dev *dev, bool idle);
257−int ir_raw_encode_scancode(u64 protocols,
258− const struct rc_scancode_filter *scancode,
259− struct ir_raw_event *events, unsigned int max);
260253
261254 static inline void ir_raw_event_reset(struct rc_dev *dev)
262255 {
include/media/videobuf2-core.h+2−0
@@ -139,6 +139,7 @@ enum vb2_io_modes { · 138 unmodified lines
139139 * @VB2_BUF_STATE_PREPARING: buffer is being prepared in videobuf
140140 * @VB2_BUF_STATE_PREPARED: buffer prepared in videobuf and by the driver
141141 * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver
142+ * @VB2_BUF_STATE_REQUEUEING: re-queue a buffer to the driver
142143 * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used
143144 * in a hardware operation
144145 * @VB2_BUF_STATE_DONE: buffer returned from driver to videobuf, but
@@ -152,6 +153,7 @@ enum vb2_buffer_state { · 7 unmodified lines
152153 VB2_BUF_STATE_PREPARING,
153154 VB2_BUF_STATE_PREPARED,
154155 VB2_BUF_STATE_QUEUED,
156+ VB2_BUF_STATE_REQUEUEING,
155157 VB2_BUF_STATE_ACTIVE,
156158 VB2_BUF_STATE_DONE,
157159 VB2_BUF_STATE_ERROR,
include/sound/soc-topology.h+12−0
@@ -141,6 +141,8 @@ struct snd_soc_tplg_ops { · 140 unmodified lines
141141 int io_ops_count;
142142 };
143143
144+#ifdef CONFIG_SND_SOC_TOPOLOGY
145+
144146 /* gets a pointer to data from the firmware block header */
145147 static inline const void *snd_soc_tplg_get_data(struct snd_soc_tplg_hdr *hdr)
146148 {
@@ -165,4 +167,14 @@ int snd_soc_tplg_widget_bind_event(struct snd_soc_dapm_widget *w, · 18 unmodified lines
165167 const struct snd_soc_tplg_widget_events *events, int num_events,
166168 u16 event_type);
167169
170+#else
171+
172+static inline int snd_soc_tplg_component_remove(struct snd_soc_component *comp,
173+ u32 index)
174+{
175+ return 0;
176+}
177+
178+#endif
179+
168180 #endif
include/uapi/sound/asoc.h+6−0
@@ -18,6 +18,12 @@ · 17 unmodified lines
1818 #include <linux/types.h>
1919 #include <sound/asound.h>
2020
21+#ifndef __KERNEL__
22+#error This API is an early revision and not enabled in the current
23+#error kernel release, it will be enabled in a future kernel version
24+#error with incompatible changes to what is here.
25+#endif
26+
2127 /*
2228 * Maximum number of channels topology kcontrol can represent.
2329 */
kernel/irq/chip.c+18−1
@@ -984,6 +984,23 @@ int irq_chip_set_affinity_parent(struct irq_data *data, · 983 unmodified lines
984984 return -ENOSYS;
985985 }
986986
987+/**
988+ * irq_chip_set_type_parent - Set IRQ type on the parent interrupt
989+ * @data: Pointer to interrupt specific data
990+ * @type: IRQ_TYPE_{LEVEL,EDGE}_* value - see include/linux/irq.h
991+ *
992+ * Conditional, as the underlying parent chip might not implement it.
993+ */
994+int irq_chip_set_type_parent(struct irq_data *data, unsigned int type)
995+{
996+ data = data->parent_data;
997+
998+ if (data->chip->irq_set_type)
999+ return data->chip->irq_set_type(data, type);
1000+
1001+ return -ENOSYS;
1002+}
1003+
9871004 /**
9881005 * irq_chip_retrigger_hierarchy - Retrigger an interrupt in hardware
9891006 * @data: Pointer to interrupt specific data
@@ -997,7 +1014,7 @@ int irq_chip_retrigger_hierarchy(struct irq_data *data) · 7 unmodified lines
9971014 if (data->chip && data->chip->irq_retrigger)
9981015 return data->chip->irq_retrigger(data);
9991016
1000− return -ENOSYS;
1017+ return 0;
10011018 }
10021019
10031020 /**
kernel/time/timer.c+2−2
@@ -807,8 +807,8 @@ __mod_timer(struct timer_list *timer, unsigned long expires, · 806 unmodified lines
807807 spin_unlock(&base->lock);
808808 base = new_base;
809809 spin_lock(&base->lock);
810− timer->flags &= ~TIMER_BASEMASK;
811− timer->flags |= base->cpu;
810+ WRITE_ONCE(timer->flags,
811+ (timer->flags & ~TIMER_BASEMASK) | base->cpu);
812812 }
813813 }
814814
mm/page_alloc.c+6−3
@@ -1343,12 +1343,15 @@ static int prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags, · 1342 unmodified lines
13431343 set_page_owner(page, order, gfp_flags);
13441344
13451345 /*
1346− * page->pfmemalloc is set when ALLOC_NO_WATERMARKS was necessary to
1346+ * page is set pfmemalloc when ALLOC_NO_WATERMARKS was necessary to
13471347 * allocate the page. The expectation is that the caller is taking
13481348 * steps that will free more memory. The caller should avoid the page
13491349 * being used for !PFMEMALLOC purposes.
13501350 */
1351− page->pfmemalloc = !!(alloc_flags & ALLOC_NO_WATERMARKS);
1351+ if (alloc_flags & ALLOC_NO_WATERMARKS)
1352+ set_page_pfmemalloc(page);
1353+ else
1354+ clear_page_pfmemalloc(page);
13521355
13531356 return 0;
13541357 }
@@ -3345,7 +3348,7 @@ refill: · 1990 unmodified lines
33453348 atomic_add(size - 1, &page->_count);
33463349
33473350 /* reset page count bias and offset to start of new frag */
3348− nc->pfmemalloc = page->pfmemalloc;
3351+ nc->pfmemalloc = page_is_pfmemalloc(page);
33493352 nc->pagecnt_bias = size;
33503353 nc->offset = size;
33513354 }
mm/slab.c+2−2
@@ -1603,7 +1603,7 @@ static struct page *kmem_getpages(struct kmem_cache *cachep, gfp_t flags, · 1602 unmodified lines
16031603 }
16041604
16051605 /* Record if ALLOC_NO_WATERMARKS was set when allocating the slab */
1606− if (unlikely(page->pfmemalloc))
1606+ if (page_is_pfmemalloc(page))
16071607 pfmemalloc_active = true;
16081608
16091609 nr_pages = (1 << cachep->gfporder);
@@ -1614,7 +1614,7 @@ static struct page *kmem_getpages(struct kmem_cache *cachep, gfp_t flags, · 4 unmodified lines
16141614 add_zone_page_state(page_zone(page),
16151615 NR_SLAB_UNRECLAIMABLE, nr_pages);
16161616 __SetPageSlab(page);
1617− if (page->pfmemalloc)
1617+ if (page_is_pfmemalloc(page))
16181618 SetPageSlabPfmemalloc(page);
16191619
16201620 if (kmemcheck_enabled && !(cachep->flags & SLAB_NOTRACK)) {
mm/slub.c+1−1
@@ -1427,7 +1427,7 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) · 1426 unmodified lines
14271427 inc_slabs_node(s, page_to_nid(page), page->objects);
14281428 page->slab_cache = s;
14291429 __SetPageSlab(page);
1430− if (page->pfmemalloc)
1430+ if (page_is_pfmemalloc(page))
14311431 SetPageSlabPfmemalloc(page);
14321432
14331433 start = page_address(page);
net/9p/client.c+2−0
@@ -1541,6 +1541,7 @@ p9_client_read(struct p9_fid *fid, u64 offset, struct iov_iter *to, int *err) · 1540 unmodified lines
15411541 struct p9_client *clnt = fid->clnt;
15421542 struct p9_req_t *req;
15431543 int total = 0;
1544+ *err = 0;
15441545
15451546 p9_debug(P9_DEBUG_9P, ">>> TREAD fid %d offset %llu %d\n",
15461547 fid->fid, (unsigned long long) offset, (int)iov_iter_count(to));
@@ -1620,6 +1621,7 @@ p9_client_write(struct p9_fid *fid, u64 offset, struct iov_iter *from, int *err) · 73 unmodified lines
16201621 struct p9_client *clnt = fid->clnt;
16211622 struct p9_req_t *req;
16221623 int total = 0;
1624+ *err = 0;
16231625
16241626 p9_debug(P9_DEBUG_9P, ">>> TWRITE fid %d offset %llu count %zd\n",
16251627 fid->fid, (unsigned long long) offset,
net/batman-adv/translation-table.c+4−1
@@ -595,8 +595,11 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr, · 594 unmodified lines
595595 /* increase the refcounter of the related vlan */
596596 vlan = batadv_softif_vlan_get(bat_priv, vid);
597597 if (WARN(!vlan, "adding TT local entry %pM to non-existent VLAN %d",
598− addr, BATADV_PRINT_VID(vid)))
598+ addr, BATADV_PRINT_VID(vid))) {
599+ kfree(tt_local);
600+ tt_local = NULL;
599601 goto out;
602+ }
600603
601604 batadv_dbg(BATADV_DBG_TT, bat_priv,
602605 "Creating new local tt entry: %pM (vid: %d, ttvn: %d)\n",
net/bridge/br_multicast.c+2−2
@@ -1591,7 +1591,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, · 1590 unmodified lines
15911591 break;
15921592 }
15931593
1594− if (skb_trimmed)
1594+ if (skb_trimmed && skb_trimmed != skb)
15951595 kfree_skb(skb_trimmed);
15961596
15971597 return err;
@@ -1636,7 +1636,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, · 38 unmodified lines
16361636 break;
16371637 }
16381638
1639− if (skb_trimmed)
1639+ if (skb_trimmed && skb_trimmed != skb)
16401640 kfree_skb(skb_trimmed);
16411641
16421642 return err;
net/core/skbuff.c+19−20
@@ -340,7 +340,7 @@ struct sk_buff *build_skb(void *data, unsigned int frag_size) · 339 unmodified lines
340340
341341 if (skb && frag_size) {
342342 skb->head_frag = 1;
343− if (virt_to_head_page(data)->pfmemalloc)
343+ if (page_is_pfmemalloc(virt_to_head_page(data)))
344344 skb->pfmemalloc = 1;
345345 }
346346 return skb;
@@ -4022,8 +4022,8 @@ EXPORT_SYMBOL(skb_checksum_setup); · 3675 unmodified lines
40224022 * Otherwise returns the provided skb. Returns NULL in error cases
40234023 * (e.g. transport_len exceeds skb length or out-of-memory).
40244024 *
4025− * Caller needs to set the skb transport header and release the returned skb.
4026− * Provided skb is consumed.
4025+ * Caller needs to set the skb transport header and free any returned skb if it
4026+ * differs from the provided skb.
40274027 */
40284028 static struct sk_buff *skb_checksum_maybe_trim(struct sk_buff *skb,
40294029 unsigned int transport_len)
@@ -4032,16 +4032,12 @@ static struct sk_buff *skb_checksum_maybe_trim(struct sk_buff *skb, · 2 unmodified lines
40324032 unsigned int len = skb_transport_offset(skb) + transport_len;
40334033 int ret;
40344034
4035− if (skb->len < len) {
4036− kfree_skb(skb);
4035+ if (skb->len < len)
40374036 return NULL;
4038− } else if (skb->len == len) {
4037+ else if (skb->len == len)
40394038 return skb;
4040− }
40414039
40424040 skb_chk = skb_clone(skb, GFP_ATOMIC);
4043− kfree_skb(skb);
4044−
40454041 if (!skb_chk)
40464042 return NULL;
40474043
@@ -4066,8 +4062,8 @@ static struct sk_buff *skb_checksum_maybe_trim(struct sk_buff *skb, · 18 unmodified lines
40664062 * If the skb has data beyond the given transport length, then a
40674063 * trimmed & cloned skb is checked and returned.
40684064 *
4069− * Caller needs to set the skb transport header and release the returned skb.
4070− * Provided skb is consumed.
4065+ * Caller needs to set the skb transport header and free any returned skb if it
4066+ * differs from the provided skb.
40714067 */
40724068 struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb,
40734069 unsigned int transport_len,
@@ -4079,23 +4075,26 @@ struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb, · 5 unmodified lines
40794075
40804076 skb_chk = skb_checksum_maybe_trim(skb, transport_len);
40814077 if (!skb_chk)
4082− return NULL;
4078+ goto err;
40834079
4084− if (!pskb_may_pull(skb_chk, offset)) {
4085− kfree_skb(skb_chk);
4086− return NULL;
4087− }
4080+ if (!pskb_may_pull(skb_chk, offset))
4081+ goto err;
40884082
40894083 __skb_pull(skb_chk, offset);
40904084 ret = skb_chkf(skb_chk);
40914085 __skb_push(skb_chk, offset);
40924086
4093− if (ret) {
4094− kfree_skb(skb_chk);
4095− return NULL;
4096− }
4087+ if (ret)
4088+ goto err;
40974089
40984090 return skb_chk;
4091+
4092+err:
4093+ if (skb_chk && skb_chk != skb)
4094+ kfree_skb(skb_chk);
4095+
4096+ return NULL;
4097+
40994098 }
41004099 EXPORT_SYMBOL(skb_checksum_trimmed);
41014100
net/ipv4/fib_trie.c+1−1
@@ -2465,7 +2465,7 @@ static struct key_vector *fib_route_get_idx(struct fib_route_iter *iter, · 2464 unmodified lines
24652465 key = l->key + 1;
24662466 iter->pos++;
24672467
2468− if (pos-- <= 0)
2468+ if (--pos <= 0)
24692469 break;
24702470
24712471 l = NULL;
net/ipv4/igmp.c+18−15
@@ -1435,33 +1435,35 @@ static int __ip_mc_check_igmp(struct sk_buff *skb, struct sk_buff **skb_trimmed) · 1434 unmodified lines
14351435 struct sk_buff *skb_chk;
14361436 unsigned int transport_len;
14371437 unsigned int len = skb_transport_offset(skb) + sizeof(struct igmphdr);
1438− int ret;
1438+ int ret = -EINVAL;
14391439
14401440 transport_len = ntohs(ip_hdr(skb)->tot_len) - ip_hdrlen(skb);
14411441
1442− skb_get(skb);
14431442 skb_chk = skb_checksum_trimmed(skb, transport_len,
14441443 ip_mc_validate_checksum);
14451444 if (!skb_chk)
1446− return -EINVAL;
1445+ goto err;
14471446
1448− if (!pskb_may_pull(skb_chk, len)) {
1449− kfree_skb(skb_chk);
1450− return -EINVAL;
1451− }
1447+ if (!pskb_may_pull(skb_chk, len))
1448+ goto err;
14521449
14531450 ret = ip_mc_check_igmp_msg(skb_chk);
1454− if (ret) {
1455− kfree_skb(skb_chk);
1456− return ret;
1457− }
1451+ if (ret)
1452+ goto err;
14581453
14591454 if (skb_trimmed)
14601455 *skb_trimmed = skb_chk;
1461− else
1456+ /* free now unneeded clone */
1457+ else if (skb_chk != skb)
14621458 kfree_skb(skb_chk);
14631459
1464− return 0;
1460+ ret = 0;
1461+
1462+err:
1463+ if (ret && skb_chk && skb_chk != skb)
1464+ kfree_skb(skb_chk);
1465+
1466+ return ret;
14651467 }
14661468
14671469 /**
@@ -1470,7 +1472,7 @@ static int __ip_mc_check_igmp(struct sk_buff *skb, struct sk_buff **skb_trimmed) · 2 unmodified lines
14701472 * @skb_trimmed: to store an skb pointer trimmed to IPv4 packet tail (optional)
14711473 *
14721474 * Checks whether an IPv4 packet is a valid IGMP packet. If so sets
1473− * skb network and transport headers accordingly and returns zero.
1475+ * skb transport header accordingly and returns zero.
14741476 *
14751477 * -EINVAL: A broken packet was detected, i.e. it violates some internet
14761478 * standard
@@ -1485,7 +1487,8 @@ static int __ip_mc_check_igmp(struct sk_buff *skb, struct sk_buff **skb_trimmed) · 8 unmodified lines
14851487 * to leave the original skb and its full frame unchanged (which might be
14861488 * desirable for layer 2 frame jugglers).
14871489 *
1488− * The caller needs to release a reference count from any returned skb_trimmed.
1490+ * Caller needs to set the skb network header and free any returned skb if it
1491+ * differs from the provided skb.
14891492 */
14901493 int ip_mc_check_igmp(struct sk_buff *skb, struct sk_buff **skb_trimmed)
14911494 {
net/ipv4/inet_connection_sock.c+1−1
@@ -593,7 +593,7 @@ static bool reqsk_queue_unlink(struct request_sock_queue *queue, · 592 unmodified lines
593593 }
594594
595595 spin_unlock(&queue->syn_wait_lock);
596− if (del_timer_sync(&req->rsk_timer))
596+ if (timer_pending(&req->rsk_timer) && del_timer_sync(&req->rsk_timer))
597597 reqsk_put(req);
598598 return found;
599599 }
net/ipv4/sysctl_net_ipv4.c+4−6
@@ -41,8 +41,6 @@ static int tcp_syn_retries_min = 1; · 40 unmodified lines
4141 static int tcp_syn_retries_max = MAX_TCP_SYNCNT;
4242 static int ip_ping_group_range_min[] = { 0, 0 };
4343 static int ip_ping_group_range_max[] = { GID_T_MAX, GID_T_MAX };
44−static int min_sndbuf = SOCK_MIN_SNDBUF;
45−static int min_rcvbuf = SOCK_MIN_RCVBUF;
4644
4745 /* Update system visible IP port range */
4846 static void set_local_port_range(struct net *net, int range[2])
@@ -530,7 +528,7 @@ static struct ctl_table ipv4_table[] = { · 481 unmodified lines
530528 .maxlen = sizeof(sysctl_tcp_wmem),
531529 .mode = 0644,
532530 .proc_handler = proc_dointvec_minmax,
533− .extra1 = &min_sndbuf,
531+ .extra1 = &one,
534532 },
535533 {
536534 .procname = "tcp_notsent_lowat",
@@ -545,7 +543,7 @@ static struct ctl_table ipv4_table[] = { · 8 unmodified lines
545543 .maxlen = sizeof(sysctl_tcp_rmem),
546544 .mode = 0644,
547545 .proc_handler = proc_dointvec_minmax,
548− .extra1 = &min_rcvbuf,
546+ .extra1 = &one,
549547 },
550548 {
551549 .procname = "tcp_app_win",
@@ -758,7 +756,7 @@ static struct ctl_table ipv4_table[] = { · 206 unmodified lines
758756 .maxlen = sizeof(sysctl_udp_rmem_min),
759757 .mode = 0644,
760758 .proc_handler = proc_dointvec_minmax,
761− .extra1 = &min_rcvbuf,
759+ .extra1 = &one
762760 },
763761 {
764762 .procname = "udp_wmem_min",
@@ -766,7 +764,7 @@ static struct ctl_table ipv4_table[] = { · 1 unmodified line
766764 .maxlen = sizeof(sysctl_udp_wmem_min),
767765 .mode = 0644,
768766 .proc_handler = proc_dointvec_minmax,
769− .extra1 = &min_sndbuf,
767+ .extra1 = &one
770768 },
771769 { }
772770 };
net/ipv6/ip6_fib.c+2−0
@@ -172,6 +172,8 @@ static void rt6_free_pcpu(struct rt6_info *non_pcpu_rt) · 171 unmodified lines
172172 *ppcpu_rt = NULL;
173173 }
174174 }
175+
176+ non_pcpu_rt->rt6i_pcpu = NULL;
175177 }
176178
177179 static void rt6_release(struct rt6_info *rt)
net/ipv6/ip6_gre.c+1−0
@@ -361,6 +361,7 @@ static void ip6gre_tunnel_uninit(struct net_device *dev) · 360 unmodified lines
361361 struct ip6gre_net *ign = net_generic(t->net, ip6gre_net_id);
362362
363363 ip6gre_tunnel_unlink(ign, t);
364+ ip6_tnl_dst_reset(t);
364365 dev_put(dev);
365366 }
366367
net/ipv6/mcast_snoop.c+18−15
@@ -143,34 +143,36 @@ static int __ipv6_mc_check_mld(struct sk_buff *skb, · 142 unmodified lines
143143 struct sk_buff *skb_chk = NULL;
144144 unsigned int transport_len;
145145 unsigned int len = skb_transport_offset(skb) + sizeof(struct mld_msg);
146− int ret;
146+ int ret = -EINVAL;
147147
148148 transport_len = ntohs(ipv6_hdr(skb)->payload_len);
149149 transport_len -= skb_transport_offset(skb) - sizeof(struct ipv6hdr);
150150
151− skb_get(skb);
152151 skb_chk = skb_checksum_trimmed(skb, transport_len,
153152 ipv6_mc_validate_checksum);
154153 if (!skb_chk)
155− return -EINVAL;
154+ goto err;
156155
157− if (!pskb_may_pull(skb_chk, len)) {
158− kfree_skb(skb_chk);
159− return -EINVAL;
160− }
156+ if (!pskb_may_pull(skb_chk, len))
157+ goto err;
161158
162159 ret = ipv6_mc_check_mld_msg(skb_chk);
163− if (ret) {
164− kfree_skb(skb_chk);
165− return ret;
166− }
160+ if (ret)
161+ goto err;
167162
168163 if (skb_trimmed)
169164 *skb_trimmed = skb_chk;
170− else
165+ /* free now unneeded clone */
166+ else if (skb_chk != skb)
171167 kfree_skb(skb_chk);
172168
173− return 0;
169+ ret = 0;
170+
171+err:
172+ if (ret && skb_chk && skb_chk != skb)
173+ kfree_skb(skb_chk);
174+
175+ return ret;
174176 }
175177
176178 /**
@@ -179,7 +181,7 @@ static int __ipv6_mc_check_mld(struct sk_buff *skb, · 2 unmodified lines
179181 * @skb_trimmed: to store an skb pointer trimmed to IPv6 packet tail (optional)
180182 *
181183 * Checks whether an IPv6 packet is a valid MLD packet. If so sets
182− * skb network and transport headers accordingly and returns zero.
184+ * skb transport header accordingly and returns zero.
183185 *
184186 * -EINVAL: A broken packet was detected, i.e. it violates some internet
185187 * standard
@@ -194,7 +196,8 @@ static int __ipv6_mc_check_mld(struct sk_buff *skb, · 8 unmodified lines
194196 * to leave the original skb and its full frame unchanged (which might be
195197 * desirable for layer 2 frame jugglers).
196198 *
197− * The caller needs to release a reference count from any returned skb_trimmed.
199+ * Caller needs to set the skb network header and free any returned skb if it
200+ * differs from the provided skb.
198201 */
199202 int ipv6_mc_check_mld(struct sk_buff *skb, struct sk_buff **skb_trimmed)
200203 {
net/ipv6/route.c+55−24
@@ -318,8 +318,7 @@ static const struct rt6_info ip6_blk_hole_entry_template = { · 317 unmodified lines
318318 /* allocate dst with ip6_dst_ops */
319319 static struct rt6_info *__ip6_dst_alloc(struct net *net,
320320 struct net_device *dev,
321− int flags,
322− struct fib6_table *table)
321+ int flags)
323322 {
324323 struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev,
325324 0, DST_OBSOLETE_FORCE_CHK, flags);
@@ -336,10 +335,9 @@ static struct rt6_info *__ip6_dst_alloc(struct net *net, · 10 unmodified lines
336335
337336 static struct rt6_info *ip6_dst_alloc(struct net *net,
338337 struct net_device *dev,
339− int flags,
340− struct fib6_table *table)
338+ int flags)
341339 {
342− struct rt6_info *rt = __ip6_dst_alloc(net, dev, flags, table);
340+ struct rt6_info *rt = __ip6_dst_alloc(net, dev, flags);
343341
344342 if (rt) {
345343 rt->rt6i_pcpu = alloc_percpu_gfp(struct rt6_info *, GFP_ATOMIC);
@@ -950,8 +948,7 @@ static struct rt6_info *ip6_rt_cache_alloc(struct rt6_info *ort, · 604 unmodified lines
950948 if (ort->rt6i_flags & (RTF_CACHE | RTF_PCPU))
951949 ort = (struct rt6_info *)ort->dst.from;
952950
953− rt = __ip6_dst_alloc(dev_net(ort->dst.dev), ort->dst.dev,
954− 0, ort->rt6i_table);
951+ rt = __ip6_dst_alloc(dev_net(ort->dst.dev), ort->dst.dev, 0);
955952
956953 if (!rt)
957954 return NULL;
@@ -983,8 +980,7 @@ static struct rt6_info *ip6_rt_pcpu_alloc(struct rt6_info *rt) · 25 unmodified lines
983980 struct rt6_info *pcpu_rt;
984981
985982 pcpu_rt = __ip6_dst_alloc(dev_net(rt->dst.dev),
986− rt->dst.dev, rt->dst.flags,
987− rt->rt6i_table);
983+ rt->dst.dev, rt->dst.flags);
988984
989985 if (!pcpu_rt)
990986 return NULL;
@@ -997,32 +993,53 @@ static struct rt6_info *ip6_rt_pcpu_alloc(struct rt6_info *rt) · 6 unmodified lines
997993 /* It should be called with read_lock_bh(&tb6_lock) acquired */
998994 static struct rt6_info *rt6_get_pcpu_route(struct rt6_info *rt)
999995 {
1000− struct rt6_info *pcpu_rt, *prev, **p;
996+ struct rt6_info *pcpu_rt, **p;
1001997
1002998 p = this_cpu_ptr(rt->rt6i_pcpu);
1003999 pcpu_rt = *p;
10041000
1005− if (pcpu_rt)
1006− goto done;
1001+ if (pcpu_rt) {
1002+ dst_hold(&pcpu_rt->dst);
1003+ rt6_dst_from_metrics_check(pcpu_rt);
1004+ }
1005+ return pcpu_rt;
1006+}
1007+
1008+static struct rt6_info *rt6_make_pcpu_route(struct rt6_info *rt)
1009+{
1010+ struct fib6_table *table = rt->rt6i_table;
1011+ struct rt6_info *pcpu_rt, *prev, **p;
10071012
10081013 pcpu_rt = ip6_rt_pcpu_alloc(rt);
10091014 if (!pcpu_rt) {
10101015 struct net *net = dev_net(rt->dst.dev);
10111016
1012− pcpu_rt = net->ipv6.ip6_null_entry;
1013− goto done;
1017+ dst_hold(&net->ipv6.ip6_null_entry->dst);
1018+ return net->ipv6.ip6_null_entry;
10141019 }
10151020
1016− prev = cmpxchg(p, NULL, pcpu_rt);
1017− if (prev) {
1018− /* If someone did it before us, return prev instead */
1021+ read_lock_bh(&table->tb6_lock);
1022+ if (rt->rt6i_pcpu) {
1023+ p = this_cpu_ptr(rt->rt6i_pcpu);
1024+ prev = cmpxchg(p, NULL, pcpu_rt);
1025+ if (prev) {
1026+ /* If someone did it before us, return prev instead */
1027+ dst_destroy(&pcpu_rt->dst);
1028+ pcpu_rt = prev;
1029+ }
1030+ } else {
1031+ /* rt has been removed from the fib6 tree
1032+ * before we have a chance to acquire the read_lock.
1033+ * In this case, don't brother to create a pcpu rt
1034+ * since rt is going away anyway. The next
1035+ * dst_check() will trigger a re-lookup.
1036+ */
10191037 dst_destroy(&pcpu_rt->dst);
1020− pcpu_rt = prev;
1038+ pcpu_rt = rt;
10211039 }
1022−
1023−done:
10241040 dst_hold(&pcpu_rt->dst);
10251041 rt6_dst_from_metrics_check(pcpu_rt);
1042+ read_unlock_bh(&table->tb6_lock);
10261043 return pcpu_rt;
10271044 }
10281045
@@ -1097,9 +1114,22 @@ redo_rt6_select: · 68 unmodified lines
10971114 rt->dst.lastuse = jiffies;
10981115 rt->dst.__use++;
10991116 pcpu_rt = rt6_get_pcpu_route(rt);
1100− read_unlock_bh(&table->tb6_lock);
1117+
1118+ if (pcpu_rt) {
1119+ read_unlock_bh(&table->tb6_lock);
1120+ } else {
1121+ /* We have to do the read_unlock first
1122+ * because rt6_make_pcpu_route() may trigger
1123+ * ip6_dst_gc() which will take the write_lock.
1124+ */
1125+ dst_hold(&rt->dst);
1126+ read_unlock_bh(&table->tb6_lock);
1127+ pcpu_rt = rt6_make_pcpu_route(rt);
1128+ dst_release(&rt->dst);
1129+ }
11011130
11021131 return pcpu_rt;
1132+
11031133 }
11041134 }
11051135
@@ -1555,7 +1585,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev, · 449 unmodified lines
15551585 if (unlikely(!idev))
15561586 return ERR_PTR(-ENODEV);
15571587
1558− rt = ip6_dst_alloc(net, dev, 0, NULL);
1588+ rt = ip6_dst_alloc(net, dev, 0);
15591589 if (unlikely(!rt)) {
15601590 in6_dev_put(idev);
15611591 dst = ERR_PTR(-ENOMEM);
@@ -1742,7 +1772,8 @@ int ip6_route_add(struct fib6_config *cfg) · 180 unmodified lines
17421772 if (!table)
17431773 goto out;
17441774
1745− rt = ip6_dst_alloc(net, NULL, (cfg->fc_flags & RTF_ADDRCONF) ? 0 : DST_NOCOUNT, table);
1775+ rt = ip6_dst_alloc(net, NULL,
1776+ (cfg->fc_flags & RTF_ADDRCONF) ? 0 : DST_NOCOUNT);
17461777
17471778 if (!rt) {
17481779 err = -ENOMEM;
@@ -2399,7 +2430,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, · 650 unmodified lines
23992430 {
24002431 struct net *net = dev_net(idev->dev);
24012432 struct rt6_info *rt = ip6_dst_alloc(net, net->loopback_dev,
2402− DST_NOCOUNT, NULL);
2433+ DST_NOCOUNT);
24032434 if (!rt)
24042435 return ERR_PTR(-ENOMEM);
24052436
net/key/af_key.c+23−23
@@ -219,7 +219,7 @@ static int pfkey_broadcast_one(struct sk_buff *skb, struct sk_buff **skb2, · 218 unmodified lines
219219 #define BROADCAST_ONE 1
220220 #define BROADCAST_REGISTERED 2
221221 #define BROADCAST_PROMISC_ONLY 4
222−static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation,
222+static int pfkey_broadcast(struct sk_buff *skb,
223223 int broadcast_flags, struct sock *one_sk,
224224 struct net *net)
225225 {
@@ -244,7 +244,7 @@ static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation, · 18 unmodified lines
244244 * socket.
245245 */
246246 if (pfk->promisc)
247− pfkey_broadcast_one(skb, &skb2, allocation, sk);
247+ pfkey_broadcast_one(skb, &skb2, GFP_ATOMIC, sk);
248248
249249 /* the exact target will be processed later */
250250 if (sk == one_sk)
@@ -259,7 +259,7 @@ static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation, · 8 unmodified lines
259259 continue;
260260 }
261261
262− err2 = pfkey_broadcast_one(skb, &skb2, allocation, sk);
262+ err2 = pfkey_broadcast_one(skb, &skb2, GFP_ATOMIC, sk);
263263
264264 /* Error is cleare after succecful sending to at least one
265265 * registered KM */
@@ -269,7 +269,7 @@ static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation, · 3 unmodified lines
269269 rcu_read_unlock();
270270
271271 if (one_sk != NULL)
272− err = pfkey_broadcast_one(skb, &skb2, allocation, one_sk);
272+ err = pfkey_broadcast_one(skb, &skb2, GFP_KERNEL, one_sk);
273273
274274 kfree_skb(skb2);
275275 kfree_skb(skb);
@@ -292,7 +292,7 @@ static int pfkey_do_dump(struct pfkey_sock *pfk) · 16 unmodified lines
292292 hdr = (struct sadb_msg *) pfk->dump.skb->data;
293293 hdr->sadb_msg_seq = 0;
294294 hdr->sadb_msg_errno = rc;
295− pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE,
295+ pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE,
296296 &pfk->sk, sock_net(&pfk->sk));
297297 pfk->dump.skb = NULL;
298298 }
@@ -333,7 +333,7 @@ static int pfkey_error(const struct sadb_msg *orig, int err, struct sock *sk) · 34 unmodified lines
333333 hdr->sadb_msg_len = (sizeof(struct sadb_msg) /
334334 sizeof(uint64_t));
335335
336− pfkey_broadcast(skb, GFP_KERNEL, BROADCAST_ONE, sk, sock_net(sk));
336+ pfkey_broadcast(skb, BROADCAST_ONE, sk, sock_net(sk));
337337
338338 return 0;
339339 }
@@ -1365,7 +1365,7 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, const struct sadb_ · 1025 unmodified lines
13651365
13661366 xfrm_state_put(x);
13671367
1368− pfkey_broadcast(resp_skb, GFP_KERNEL, BROADCAST_ONE, sk, net);
1368+ pfkey_broadcast(resp_skb, BROADCAST_ONE, sk, net);
13691369
13701370 return 0;
13711371 }
@@ -1452,7 +1452,7 @@ static int key_notify_sa(struct xfrm_state *x, const struct km_event *c) · 80 unmodified lines
14521452 hdr->sadb_msg_seq = c->seq;
14531453 hdr->sadb_msg_pid = c->portid;
14541454
1455− pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xs_net(x));
1455+ pfkey_broadcast(skb, BROADCAST_ALL, NULL, xs_net(x));
14561456
14571457 return 0;
14581458 }
@@ -1565,7 +1565,7 @@ static int pfkey_get(struct sock *sk, struct sk_buff *skb, const struct sadb_msg · 106 unmodified lines
15651565 out_hdr->sadb_msg_reserved = 0;
15661566 out_hdr->sadb_msg_seq = hdr->sadb_msg_seq;
15671567 out_hdr->sadb_msg_pid = hdr->sadb_msg_pid;
1568− pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ONE, sk, sock_net(sk));
1568+ pfkey_broadcast(out_skb, BROADCAST_ONE, sk, sock_net(sk));
15691569
15701570 return 0;
15711571 }
@@ -1670,7 +1670,7 @@ static int pfkey_register(struct sock *sk, struct sk_buff *skb, const struct sad · 98 unmodified lines
16701670 return -ENOBUFS;
16711671 }
16721672
1673− pfkey_broadcast(supp_skb, GFP_KERNEL, BROADCAST_REGISTERED, sk, sock_net(sk));
1673+ pfkey_broadcast(supp_skb, BROADCAST_REGISTERED, sk, sock_net(sk));
16741674
16751675 return 0;
16761676 }
@@ -1689,7 +1689,7 @@ static int unicast_flush_resp(struct sock *sk, const struct sadb_msg *ihdr) · 12 unmodified lines
16891689 hdr->sadb_msg_errno = (uint8_t) 0;
16901690 hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
16911691
1692− return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ONE, sk, sock_net(sk));
1692+ return pfkey_broadcast(skb, BROADCAST_ONE, sk, sock_net(sk));
16931693 }
16941694
16951695 static int key_notify_sa_flush(const struct km_event *c)
@@ -1710,7 +1710,7 @@ static int key_notify_sa_flush(const struct km_event *c) · 14 unmodified lines
17101710 hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
17111711 hdr->sadb_msg_reserved = 0;
17121712
1713− pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
1713+ pfkey_broadcast(skb, BROADCAST_ALL, NULL, c->net);
17141714
17151715 return 0;
17161716 }
@@ -1767,7 +1767,7 @@ static int dump_sa(struct xfrm_state *x, int count, void *ptr) · 50 unmodified lines
17671767 out_hdr->sadb_msg_pid = pfk->dump.msg_portid;
17681768
17691769 if (pfk->dump.skb)
1770− pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE,
1770+ pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE,
17711771 &pfk->sk, sock_net(&pfk->sk));
17721772 pfk->dump.skb = out_skb;
17731773
@@ -1847,7 +1847,7 @@ static int pfkey_promisc(struct sock *sk, struct sk_buff *skb, const struct sadb · 73 unmodified lines
18471847 new_hdr->sadb_msg_errno = 0;
18481848 }
18491849
1850− pfkey_broadcast(skb, GFP_KERNEL, BROADCAST_ALL, NULL, sock_net(sk));
1850+ pfkey_broadcast(skb, BROADCAST_ALL, NULL, sock_net(sk));
18511851 return 0;
18521852 }
18531853
@@ -2181,7 +2181,7 @@ static int key_notify_policy(struct xfrm_policy *xp, int dir, const struct km_ev · 327 unmodified lines
21812181 out_hdr->sadb_msg_errno = 0;
21822182 out_hdr->sadb_msg_seq = c->seq;
21832183 out_hdr->sadb_msg_pid = c->portid;
2184− pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xp_net(xp));
2184+ pfkey_broadcast(out_skb, BROADCAST_ALL, NULL, xp_net(xp));
21852185 return 0;
21862186
21872187 }
@@ -2401,7 +2401,7 @@ static int key_pol_get_resp(struct sock *sk, struct xfrm_policy *xp, const struc · 213 unmodified lines
24012401 out_hdr->sadb_msg_errno = 0;
24022402 out_hdr->sadb_msg_seq = hdr->sadb_msg_seq;
24032403 out_hdr->sadb_msg_pid = hdr->sadb_msg_pid;
2404− pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ONE, sk, xp_net(xp));
2404+ pfkey_broadcast(out_skb, BROADCAST_ONE, sk, xp_net(xp));
24052405 err = 0;
24062406
24072407 out:
@@ -2655,7 +2655,7 @@ static int dump_sp(struct xfrm_policy *xp, int dir, int count, void *ptr) · 247 unmodified lines
26552655 out_hdr->sadb_msg_pid = pfk->dump.msg_portid;
26562656
26572657 if (pfk->dump.skb)
2658− pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE,
2658+ pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE,
26592659 &pfk->sk, sock_net(&pfk->sk));
26602660 pfk->dump.skb = out_skb;
26612661
@@ -2708,7 +2708,7 @@ static int key_notify_policy_flush(const struct km_event *c) · 46 unmodified lines
27082708 hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC;
27092709 hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
27102710 hdr->sadb_msg_reserved = 0;
2711− pfkey_broadcast(skb_out, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
2711+ pfkey_broadcast(skb_out, BROADCAST_ALL, NULL, c->net);
27122712 return 0;
27132713
27142714 }
@@ -2770,7 +2770,7 @@ static int pfkey_process(struct sock *sk, struct sk_buff *skb, const struct sadb · 55 unmodified lines
27702770 void *ext_hdrs[SADB_EXT_MAX];
27712771 int err;
27722772
2773− pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL,
2773+ pfkey_broadcast(skb_clone(skb, GFP_KERNEL),
27742774 BROADCAST_PROMISC_ONLY, NULL, sock_net(sk));
27752775
27762776 memset(ext_hdrs, 0, sizeof(ext_hdrs));
@@ -2992,7 +2992,7 @@ static int key_notify_sa_expire(struct xfrm_state *x, const struct km_event *c) · 215 unmodified lines
29922992 out_hdr->sadb_msg_seq = 0;
29932993 out_hdr->sadb_msg_pid = 0;
29942994
2995− pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL, xs_net(x));
2995+ pfkey_broadcast(out_skb, BROADCAST_REGISTERED, NULL, xs_net(x));
29962996 return 0;
29972997 }
29982998
@@ -3182,7 +3182,7 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct · 183 unmodified lines
31823182 xfrm_ctx->ctx_len);
31833183 }
31843184
3185− return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL, xs_net(x));
3185+ return pfkey_broadcast(skb, BROADCAST_REGISTERED, NULL, xs_net(x));
31863186 }
31873187
31883188 static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt,
@@ -3380,7 +3380,7 @@ static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, · 191 unmodified lines
33803380 n_port->sadb_x_nat_t_port_port = sport;
33813381 n_port->sadb_x_nat_t_port_reserved = 0;
33823382
3383− return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL, xs_net(x));
3383+ return pfkey_broadcast(skb, BROADCAST_REGISTERED, NULL, xs_net(x));
33843384 }
33853385
33863386 #ifdef CONFIG_NET_KEY_MIGRATE
@@ -3572,7 +3572,7 @@ static int pfkey_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, · 185 unmodified lines
35723572 }
35733573
35743574 /* broadcast migrate message to sockets */
3575− pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, &init_net);
3575+ pfkey_broadcast(skb, BROADCAST_ALL, NULL, &init_net);
35763576
35773577 return 0;
35783578
net/mac80211/rc80211_minstrel.c+6−5
@@ -92,14 +92,15 @@ int minstrel_get_tp_avg(struct minstrel_rate *mr, int prob_ewma) · 91 unmodified lines
9292 static inline void
9393 minstrel_sort_best_tp_rates(struct minstrel_sta_info *mi, int i, u8 *tp_list)
9494 {
95− int j = MAX_THR_RATES;
96− struct minstrel_rate_stats *tmp_mrs = &mi->r[j - 1].stats;
95+ int j;
96+ struct minstrel_rate_stats *tmp_mrs;
9797 struct minstrel_rate_stats *cur_mrs = &mi->r[i].stats;
9898
99− while (j > 0 && (minstrel_get_tp_avg(&mi->r[i], cur_mrs->prob_ewma) >
100− minstrel_get_tp_avg(&mi->r[tp_list[j - 1]], tmp_mrs->prob_ewma))) {
101− j--;
99+ for (j = MAX_THR_RATES; j > 0; --j) {
102100 tmp_mrs = &mi->r[tp_list[j - 1]].stats;
101+ if (minstrel_get_tp_avg(&mi->r[i], cur_mrs->prob_ewma) <=
102+ minstrel_get_tp_avg(&mi->r[tp_list[j - 1]], tmp_mrs->prob_ewma))
103+ break;
103104 }
104105
105106 if (j < MAX_THR_RATES - 1)
net/netlink/af_netlink.c+1−1
@@ -2401,7 +2401,7 @@ static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) · 2400 unmodified lines
24012401 * sendmsg(), but that's what we've got...
24022402 */
24032403 if (netlink_tx_is_mmaped(sk) &&
2404− msg->msg_iter.type == ITER_IOVEC &&
2404+ iter_is_iovec(&msg->msg_iter) &&
24052405 msg->msg_iter.nr_segs == 1 &&
24062406 msg->msg_iter.iov->iov_base == NULL) {
24072407 err = netlink_mmap_sendmsg(sk, msg, dst_portid, dst_group,
net/sched/cls_u32.c+13−0
@@ -490,6 +490,19 @@ static bool u32_destroy(struct tcf_proto *tp, bool force) · 489 unmodified lines
490490 return false;
491491 }
492492 }
493+
494+ if (tp_c->refcnt > 1)
495+ return false;
496+
497+ if (tp_c->refcnt == 1) {
498+ struct tc_u_hnode *ht;
499+
500+ for (ht = rtnl_dereference(tp_c->hlist);
501+ ht;
502+ ht = rtnl_dereference(ht->next))
503+ if (!ht_empty(ht))
504+ return false;
505+ }
493506 }
494507
495508 if (root_ht && --root_ht->refcnt == 0)
net/sctp/sm_make_chunk.c+7−0
@@ -3132,11 +3132,18 @@ bool sctp_verify_asconf(const struct sctp_association *asoc, · 3131 unmodified lines
31323132 case SCTP_PARAM_IPV4_ADDRESS:
31333133 if (length != sizeof(sctp_ipv4addr_param_t))
31343134 return false;
3135+ /* ensure there is only one addr param and it's in the
3136+ * beginning of addip_hdr params, or we reject it.
3137+ */
3138+ if (param.v != addip->addip_hdr.params)
3139+ return false;
31353140 addr_param_seen = true;
31363141 break;
31373142 case SCTP_PARAM_IPV6_ADDRESS:
31383143 if (length != sizeof(sctp_ipv6addr_param_t))
31393144 return false;
3145+ if (param.v != addip->addip_hdr.params)
3146+ return false;
31403147 addr_param_seen = true;
31413148 break;
31423149 case SCTP_PARAM_ADD_IP:
net/sctp/sm_sideeffect.c+1−1
@@ -702,7 +702,7 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds, · 701 unmodified lines
702702 * outstanding data and rely on the retransmission limit be reached
703703 * to shutdown the association.
704704 */
705− if (t->asoc->state != SCTP_STATE_SHUTDOWN_PENDING)
705+ if (t->asoc->state < SCTP_STATE_SHUTDOWN_PENDING)
706706 t->asoc->overall_error_count = 0;
707707
708708 /* Clear the hb_sent flag to signal that we had a good
security/security.c+6−5
@@ -380,8 +380,8 @@ int security_inode_init_security(struct inode *inode, struct inode *dir, · 379 unmodified lines
380380 return 0;
381381
382382 if (!initxattrs)
383− return call_int_hook(inode_init_security, 0, inode, dir, qstr,
384− NULL, NULL, NULL);
383+ return call_int_hook(inode_init_security, -EOPNOTSUPP, inode,
384+ dir, qstr, NULL, NULL, NULL);
385385 memset(new_xattrs, 0, sizeof(new_xattrs));
386386 lsm_xattr = new_xattrs;
387387 ret = call_int_hook(inode_init_security, -EOPNOTSUPP, inode, dir, qstr,
@@ -409,8 +409,8 @@ int security_old_inode_init_security(struct inode *inode, struct inode *dir, · 21 unmodified lines
409409 {
410410 if (unlikely(IS_PRIVATE(inode)))
411411 return -EOPNOTSUPP;
412− return call_int_hook(inode_init_security, 0, inode, dir, qstr,
413− name, value, len);
412+ return call_int_hook(inode_init_security, -EOPNOTSUPP, inode, dir,
413+ qstr, name, value, len);
414414 }
415415 EXPORT_SYMBOL(security_old_inode_init_security);
416416
@@ -1281,7 +1281,8 @@ int security_socket_getpeersec_stream(struct socket *sock, char __user *optval, · 864 unmodified lines
12811281
12821282 int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
12831283 {
1284− return call_int_hook(socket_getpeersec_dgram, 0, sock, skb, secid);
1284+ return call_int_hook(socket_getpeersec_dgram, -ENOPROTOOPT, sock,
1285+ skb, secid);
12851286 }
12861287 EXPORT_SYMBOL(security_socket_getpeersec_dgram);
12871288
sound/pci/hda/hda_codec.c+1−1
@@ -3172,7 +3172,7 @@ static int add_std_chmaps(struct hda_codec *codec) · 3171 unmodified lines
31723172 struct snd_pcm_chmap *chmap;
31733173 const struct snd_pcm_chmap_elem *elem;
31743174
3175− if (!pcm || pcm->own_chmap ||
3175+ if (!pcm || !pcm->pcm || pcm->own_chmap ||
31763176 !hinfo->substreams)
31773177 continue;
31783178 elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps;
sound/pci/hda/hda_generic.c+4−7
@@ -671,7 +671,8 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid, · 670 unmodified lines
671671 }
672672 for (i = 0; i < path->depth; i++) {
673673 if (path->path[i] == nid) {
674− if (dir == HDA_OUTPUT || path->idx[i] == idx)
674+ if (dir == HDA_OUTPUT || idx == -1 ||
675+ path->idx[i] == idx)
675676 return true;
676677 break;
677678 }
@@ -682,7 +683,7 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid, · 4 unmodified lines
682683
683684 /* check whether the NID is referred by any active paths */
684685 #define is_active_nid_for_any(codec, nid) \
685− is_active_nid(codec, nid, HDA_OUTPUT, 0)
686+ is_active_nid(codec, nid, HDA_OUTPUT, -1)
686687
687688 /* get the default amp value for the target state */
688689 static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid,
@@ -883,8 +884,7 @@ void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path, · 194 unmodified lines
883884 struct hda_gen_spec *spec = codec->spec;
884885 int i;
885886
886− if (!enable)
887− path->active = false;
887+ path->active = enable;
888888
889889 /* make sure the widget is powered up */
890890 if (enable && (spec->power_down_unused || codec->power_save_node))
@@ -902,9 +902,6 @@ void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path, · 11 unmodified lines
902902 if (has_amp_out(codec, path, i))
903903 activate_amp_out(codec, path, i, enable);
904904 }
905−
906− if (enable)
907− path->active = true;
908905 }
909906 EXPORT_SYMBOL_GPL(snd_hda_activate_path);
910907
sound/pci/hda/patch_conexant.c+22−1
@@ -200,12 +200,33 @@ static int cx_auto_init(struct hda_codec *codec) · 199 unmodified lines
200200 return 0;
201201 }
202202
203−#define cx_auto_free snd_hda_gen_free
203+static void cx_auto_reboot_notify(struct hda_codec *codec)
204+{
205+ struct conexant_spec *spec = codec->spec;
206+
207+ if (codec->core.vendor_id != 0x14f150f2)
208+ return;
209+
210+ /* Turn the CX20722 codec into D3 to avoid spurious noises
211+ from the internal speaker during (and after) reboot */
212+ cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
213+
214+ snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3);
215+ snd_hda_codec_write(codec, codec->core.afg, 0,
216+ AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
217+}
218+
219+static void cx_auto_free(struct hda_codec *codec)
220+{
221+ cx_auto_reboot_notify(codec);
222+ snd_hda_gen_free(codec);
223+}
204224
205225 static const struct hda_codec_ops cx_auto_patch_ops = {
206226 .build_controls = cx_auto_build_controls,
207227 .build_pcms = snd_hda_gen_build_pcms,
208228 .init = cx_auto_init,
229+ .reboot_notify = cx_auto_reboot_notify,
209230 .free = cx_auto_free,
210231 .unsol_event = snd_hda_jack_unsol_event,
211232 #ifdef CONFIG_PM
sound/pci/hda/patch_realtek.c+2−0
@@ -5190,6 +5190,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 5189 unmodified lines
51905190 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
51915191 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
51925192 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC292_FIXUP_DISABLE_AAMIX),
5193+ SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC292_FIXUP_DISABLE_AAMIX),
51935194 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
51945195 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
51955196 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
@@ -5291,6 +5292,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 95 unmodified lines
52915292 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440_DOCK),
52925293 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
52935294 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
5295+ SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
52945296 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
52955297 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
52965298 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
sound/soc/Kconfig+3−0
@@ -30,6 +30,9 @@ config SND_SOC_GENERIC_DMAENGINE_PCM · 29 unmodified lines
3030 bool
3131 select SND_DMAENGINE_PCM
3232
33+config SND_SOC_TOPOLOGY
34+ bool
35+
3336 # All the supported SoCs
3437 source "sound/soc/adi/Kconfig"
3538 source "sound/soc/atmel/Kconfig"
sound/soc/Makefile+3−0
@@ -1,6 +1,9 @@
11 snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o
22 snd-soc-core-objs += soc-pcm.o soc-compress.o soc-io.o soc-devres.o soc-ops.o
3+
4+ifneq ($(CONFIG_SND_SOC_TOPOLOGY),)
35 snd-soc-core-objs += soc-topology.o
6+endif
47
58 ifneq ($(CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM),)
69 snd-soc-core-objs += soc-generic-dmaengine-pcm.o
sound/usb/card.c+1−1
@@ -638,7 +638,7 @@ int snd_usb_autoresume(struct snd_usb_audio *chip) · 637 unmodified lines
638638 int err = -ENODEV;
639639
640640 down_read(&chip->shutdown_rwsem);
641− if (chip->probing && chip->in_pm)
641+ if (chip->probing || chip->in_pm)
642642 err = 0;
643643 else if (!chip->shutdown)
644644 err = usb_autopm_get_interface(chip->pm_intf);
sound/usb/quirks.c+1−0
@@ -1268,6 +1268,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, · 1267 unmodified lines
12681268 return SNDRV_PCM_FMTBIT_DSD_U32_BE;
12691269 break;
12701270
1271+ case USB_ID(0x20b1, 0x000a): /* Gustard DAC-X20U */
12711272 case USB_ID(0x20b1, 0x2009): /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */
12721273 case USB_ID(0x20b1, 0x2023): /* JLsounds I2SoverUSB */
12731274 if (fp->altsetting == 3)
tools/perf/builtin-stat.c+2−3
@@ -565,7 +565,7 @@ static void print_aggr(char *prefix) · 564 unmodified lines
565565 {
566566 FILE *output = stat_config.output;
567567 struct perf_evsel *counter;
568− int cpu, cpu2, s, s2, id, nr;
568+ int cpu, s, s2, id, nr;
569569 double uval;
570570 u64 ena, run, val;
571571
@@ -578,8 +578,7 @@ static void print_aggr(char *prefix) · 6 unmodified lines
578578 val = ena = run = 0;
579579 nr = 0;
580580 for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
581− cpu2 = perf_evsel__cpus(counter)->map[cpu];
582− s2 = aggr_get_id(evsel_list->cpus, cpu2);
581+ s2 = aggr_get_id(perf_evsel__cpus(counter), cpu);
583582 if (s2 != id)
584583 continue;
585584 val += perf_counts(counter->counts, cpu, 0)->val;