···3232- target-supply : regulator for SATA target power3333- phys : reference to the SATA PHY node3434- phy-names : must be "sata-phy"3535+- ports-implemented : Mask that indicates which ports that the HBA supports3636+ are available for software to use. Useful if PORTS_IMPL3737+ is not programmed by the BIOS, which is true with3838+ some embedded SOC's.35393640Required properties when using sub-nodes:3741- #address-cells : number of cells to encode an address
+3-3
Documentation/devicetree/bindings/net/cpsw.txt
···4545Optional properties:4646- dual_emac_res_vlan : Specifies VID to be used to segregate the ports4747- mac-address : See ethernet.txt file in the same directory4848-- phy_id : Specifies slave phy id4848+- phy_id : Specifies slave phy id (deprecated, use phy-handle)4949- phy-handle : See ethernet.txt file in the same directory50505151Slave sub-nodes:5252- fixed-link : See fixed-link.txt file in the same directory5353- Either the property phy_id, or the sub-node5454- fixed-link can be specified5353+5454+Note: Exactly one of phy_id, phy-handle, or fixed-link must be specified.55555656Note: "ti,hwmods" field is used to fetch the base address and irq5757resources from TI, omap hwmod data base during device registration.
+3-3
Documentation/networking/altera_tse.txt
···66using the SGDMA and MSGDMA soft DMA IP components. The driver uses the77platform bus to obtain component resources. The designs used to test this88driver were built for a Cyclone(R) V SOC FPGA board, a Cyclone(R) V FPGA board,99-and tested with ARM and NIOS processor hosts seperately. The anticipated use99+and tested with ARM and NIOS processor hosts separately. The anticipated use1010cases are simple communications between an embedded system and an external peer1111for status and simple configuration of the embedded system.1212···65654.1) Transmit process6666When the driver's transmit routine is called by the kernel, it sets up a6767transmit descriptor by calling the underlying DMA transmit routine (SGDMA or6868-MSGDMA), and initites a transmit operation. Once the transmit is complete, an6868+MSGDMA), and initiates a transmit operation. Once the transmit is complete, an6969interrupt is driven by the transmit DMA logic. The driver handles the transmit7070completion in the context of the interrupt handling chain by recycling7171resource required to send and track the requested transmit operation.727273734.2) Receive process7474The driver will post receive buffers to the receive DMA logic during driver7575-intialization. Receive buffers may or may not be queued depending upon the7575+initialization. Receive buffers may or may not be queued depending upon the7676underlying DMA logic (MSGDMA is able queue receive buffers, SGDMA is not able7777to queue receive buffers to the SGDMA receive logic). When a packet is7878received, the DMA logic generates an interrupt. The driver handles a receive
+7-7
Documentation/networking/checksum-offloads.txt
···6969LCO is a technique for efficiently computing the outer checksum of an7070 encapsulated datagram when the inner checksum is due to be offloaded.7171The ones-complement sum of a correctly checksummed TCP or UDP packet is7272- equal to the sum of the pseudo header, because everything else gets7373- 'cancelled out' by the checksum field. This is because the sum was7272+ equal to the complement of the sum of the pseudo header, because everything7373+ else gets 'cancelled out' by the checksum field. This is because the sum was7474 complemented before being written to the checksum field.7575More generally, this holds in any case where the 'IP-style' ones complement7676 checksum is used, and thus any checksum that TX Checksum Offload supports.7777That is, if we have set up TX Checksum Offload with a start/offset pair, we7878- know that _after the device has filled in that checksum_, the ones7878+ know that after the device has filled in that checksum, the ones7979 complement sum from csum_start to the end of the packet will be equal to8080- _whatever value we put in the checksum field beforehand_. This allows us8181- to compute the outer checksum without looking at the payload: we simply8282- stop summing when we get to csum_start, then add the 16-bit word at8383- (csum_start + csum_offset).8080+ the complement of whatever value we put in the checksum field beforehand.8181+ This allows us to compute the outer checksum without looking at the payload:8282+ we simply stop summing when we get to csum_start, then add the complement of8383+ the 16-bit word at (csum_start + csum_offset).8484Then, when the true inner checksum is filled in (either by hardware or by8585 skb_checksum_help()), the outer checksum will become correct by virtue of8686 the arithmetic.
+3-3
Documentation/networking/ipvlan.txt
···88 This is conceptually very similar to the macvlan driver with one major99exception of using L3 for mux-ing /demux-ing among slaves. This property makes1010the master device share the L2 with it's slave devices. I have developed this1111-driver in conjuntion with network namespaces and not sure if there is use case1111+driver in conjunction with network namespaces and not sure if there is use case1212outside of it.13131414···4242as well.434344444.2 L3 mode:4545- In this mode TX processing upto L3 happens on the stack instance attached4545+ In this mode TX processing up to L3 happens on the stack instance attached4646to the slave device and packets are switched to the stack instance of the4747master device for the L2 processing and routing from that instance will be4848used before packets are queued on the outbound device. In this mode the slaves···5656 (a) The Linux host that is connected to the external switch / router has5757policy configured that allows only one mac per port.5858 (b) No of virtual devices created on a master exceed the mac capacity and5959-puts the NIC in promiscous mode and degraded performance is a concern.5959+puts the NIC in promiscuous mode and degraded performance is a concern.6060 (c) If the slave device is to be put into the hostile / untrusted network6161namespace where L2 on the slave could be changed / misused.6262
+3-3
Documentation/networking/pktgen.txt
···6767 * add_device DEVICE@NAME -- adds a single device6868 * rem_device_all -- remove all associated devices69697070-When adding a device to a thread, a corrosponding procfile is created7070+When adding a device to a thread, a corresponding procfile is created7171which is used for configuring this device. Thus, device names need to7272be unique.73737474To support adding the same device to multiple threads, which is useful7575-with multi queue NICs, a the device naming scheme is extended with "@":7575+with multi queue NICs, the device naming scheme is extended with "@":7676 device@something77777878The part after "@" can be anything, but it is custom to use the thread···221221222222A collection of tutorial scripts and helpers for pktgen is in the223223samples/pktgen directory. The helper parameters.sh file support easy224224-and consistant parameter parsing across the sample scripts.224224+and consistent parameter parsing across the sample scripts.225225226226Usage example and help:227227 ./pktgen_sample01_simple.sh -i eth4 -m 00:1B:21:3C:9D:F8 -d 192.168.8.2
+1-1
Documentation/networking/vrf.txt
···4141the VRF device. Similarly on egress routing rules are used to send packets4242to the VRF device driver before getting sent out the actual interface. This4343allows tcpdump on a VRF device to capture all packets into and out of the4444-VRF as a whole.[1] Similiarly, netfilter [2] and tc rules can be applied4444+VRF as a whole.[1] Similarly, netfilter [2] and tc rules can be applied4545using the VRF device to specify rules that apply to the VRF domain as a whole.46464747[1] Packets in the forwarded state do not flow through the device, so those
+3-3
Documentation/networking/xfrm_sync.txt
···44from Jamal <hadi@cyberus.ca>.5566The end goal for syncing is to be able to insert attributes + generate77-events so that the an SA can be safely moved from one machine to another77+events so that the SA can be safely moved from one machine to another88for HA purposes.99The idea is to synchronize the SA so that the takeover machine can do1010the processing of the SA as accurate as possible if it has access to it.···1313These patches add ability to sync and have accurate lifetime byte (to1414ensure proper decay of SAs) and replay counters to avoid replay attacks1515with as minimal loss at failover time.1616-This way a backup stays as closely uptodate as an active member.1616+This way a backup stays as closely up-to-date as an active member.17171818Because the above items change for every packet the SA receives,1919it is possible for a lot of the events to be generated.···163163there is a period where the timer threshold expires with no packets164164seen, then an odd behavior is seen as follows:165165The first packet arrival after a timer expiry will trigger a timeout166166-aevent; i.e we dont wait for a timeout period or a packet threshold166166+event; i.e we don't wait for a timeout period or a packet threshold167167to be reached. This is done for simplicity and efficiency reasons.168168169169-JHS
+1-1
Documentation/sysctl/kernel.txt
···646646perf_event_paranoid:647647648648Controls use of the performance events system by unprivileged649649-users (without CAP_SYS_ADMIN). The default value is 1.649649+users (without CAP_SYS_ADMIN). The default value is 2.650650651651 -1: Allow use of (almost) all events by all users652652>=0: Disallow raw tracepoint access by users without CAP_IOC_LOCK
+45-30
MAINTAINERS
···872872F: include/linux/perf/arm_pmu.h873873874874ARM PORT875875-M: Russell King <linux@arm.linux.org.uk>875875+M: Russell King <linux@armlinux.org.uk>876876L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)877877-W: http://www.arm.linux.org.uk/877877+W: http://www.armlinux.org.uk/878878S: Maintained879879F: arch/arm/880880···886886T: git git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git887887888888ARM PRIMECELL AACI PL041 DRIVER889889-M: Russell King <linux@arm.linux.org.uk>889889+M: Russell King <linux@armlinux.org.uk>890890S: Maintained891891F: sound/arm/aaci.*892892893893ARM PRIMECELL CLCD PL110 DRIVER894894-M: Russell King <linux@arm.linux.org.uk>894894+M: Russell King <linux@armlinux.org.uk>895895S: Maintained896896F: drivers/video/fbdev/amba-clcd.*897897898898ARM PRIMECELL KMI PL050 DRIVER899899-M: Russell King <linux@arm.linux.org.uk>899899+M: Russell King <linux@armlinux.org.uk>900900S: Maintained901901F: drivers/input/serio/ambakmi.*902902F: include/linux/amba/kmi.h903903904904ARM PRIMECELL MMCI PL180/1 DRIVER905905-M: Russell King <linux@arm.linux.org.uk>905905+M: Russell King <linux@armlinux.org.uk>906906S: Maintained907907F: drivers/mmc/host/mmci.*908908F: include/linux/amba/mmci.h909909910910ARM PRIMECELL UART PL010 AND PL011 DRIVERS911911-M: Russell King <linux@arm.linux.org.uk>911911+M: Russell King <linux@armlinux.org.uk>912912S: Maintained913913F: drivers/tty/serial/amba-pl01*.c914914F: include/linux/amba/serial.h915915916916ARM PRIMECELL BUS SUPPORT917917-M: Russell King <linux@arm.linux.org.uk>917917+M: Russell King <linux@armlinux.org.uk>918918S: Maintained919919F: drivers/amba/920920F: include/linux/amba/bus.h···10361036S: Maintained1037103710381038ARM/CLKDEV SUPPORT10391039-M: Russell King <linux@arm.linux.org.uk>10391039+M: Russell King <linux@armlinux.org.uk>10401040L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)10411041S: Maintained10421042F: arch/arm/include/asm/clkdev.h···10931093N: digicolor1094109410951095ARM/EBSA110 MACHINE SUPPORT10961096-M: Russell King <linux@arm.linux.org.uk>10961096+M: Russell King <linux@armlinux.org.uk>10971097L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)10981098-W: http://www.arm.linux.org.uk/10981098+W: http://www.armlinux.org.uk/10991099S: Maintained11001100F: arch/arm/mach-ebsa110/11011101F: drivers/net/ethernet/amd/am79c961a.*···11241124F: arch/arm/mm/*-fa*1125112511261126ARM/FOOTBRIDGE ARCHITECTURE11271127-M: Russell King <linux@arm.linux.org.uk>11271127+M: Russell King <linux@armlinux.org.uk>11281128L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)11291129-W: http://www.arm.linux.org.uk/11291129+W: http://www.armlinux.org.uk/11301130S: Maintained11311131F: arch/arm/include/asm/hardware/dec21285.h11321132F: arch/arm/mach-footbridge/···14571457ARM/PT DIGITAL BOARD PORT14581458M: Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>14591459L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)14601460-W: http://www.arm.linux.org.uk/14601460+W: http://www.armlinux.org.uk/14611461S: Maintained1462146214631463ARM/QUALCOMM SUPPORT···14931493F: arch/arm64/boot/dts/renesas/1494149414951495ARM/RISCPC ARCHITECTURE14961496-M: Russell King <linux@arm.linux.org.uk>14961496+M: Russell King <linux@armlinux.org.uk>14971497L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)14981498-W: http://www.arm.linux.org.uk/14981498+W: http://www.armlinux.org.uk/14991499S: Maintained15001500F: arch/arm/include/asm/hardware/entry-macro-iomd.S15011501F: arch/arm/include/asm/hardware/ioc.h···17731773F: drivers/clocksource/versatile.c1774177417751775ARM/VFP SUPPORT17761776-M: Russell King <linux@arm.linux.org.uk>17761776+M: Russell King <linux@armlinux.org.uk>17771777L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)17781778-W: http://www.arm.linux.org.uk/17781778+W: http://www.armlinux.org.uk/17791779S: Maintained17801780F: arch/arm/vfp/17811781···29212921F: include/linux/cleancache.h2922292229232923CLK API29242924-M: Russell King <linux@arm.linux.org.uk>29242924+M: Russell King <linux@armlinux.org.uk>29252925L: linux-clk@vger.kernel.org29262926S: Maintained29272927F: include/linux/clk.h···33543354F: drivers/net/ethernet/stmicro/stmmac/3355335533563356CYBERPRO FB DRIVER33573357-M: Russell King <linux@arm.linux.org.uk>33573357+M: Russell King <linux@armlinux.org.uk>33583358L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)33593359-W: http://www.arm.linux.org.uk/33593359+W: http://www.armlinux.org.uk/33603360S: Maintained33613361F: drivers/video/fbdev/cyber2000fb.*33623362···3881388138823882DRM DRIVERS FOR VIVANTE GPU IP38833883M: Lucas Stach <l.stach@pengutronix.de>38843884-R: Russell King <linux+etnaviv@arm.linux.org.uk>38843884+R: Russell King <linux+etnaviv@armlinux.org.uk>38853885R: Christian Gmeiner <christian.gmeiner@gmail.com>38863886L: dri-devel@lists.freedesktop.org38873887S: Maintained···42234223F: arch/ia64/kernel/efi.c42244224F: arch/x86/boot/compressed/eboot.[ch]42254225F: arch/x86/include/asm/efi.h42264226-F: arch/x86/platform/efi/*42274227-F: drivers/firmware/efi/*42264226+F: arch/x86/platform/efi/42274227+F: drivers/firmware/efi/42284228F: include/linux/efi*.h4229422942304230EFI VARIABLE FILESYSTEM···4744474447454745FUSE: FILESYSTEM IN USERSPACE47464746M: Miklos Szeredi <miklos@szeredi.hu>47474747-L: fuse-devel@lists.sourceforge.net47474747+L: linux-fsdevel@vger.kernel.org47484748W: http://fuse.sourceforge.net/47494749T: git git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git47504750S: Maintained···49034903F: include/net/gre.h4904490449054905GRETH 10/100/1G Ethernet MAC device driver49064906-M: Kristoffer Glembo <kristoffer@gaisler.com>49064906+M: Andreas Larsson <andreas@gaisler.com>49074907L: netdev@vger.kernel.org49084908S: Maintained49094909F: drivers/net/ethernet/aeroflex/···69056905S: Maintained6906690669076907MARVELL ARMADA DRM SUPPORT69086908-M: Russell King <rmk+kernel@arm.linux.org.uk>69086908+M: Russell King <rmk+kernel@armlinux.org.uk>69096909S: Maintained69106910F: drivers/gpu/drm/armada/69116911···79057905F: drivers/nfc/nxp-nci7906790679077907NXP TDA998X DRM DRIVER79087908-M: Russell King <rmk+kernel@arm.linux.org.uk>79087908+M: Russell King <rmk+kernel@armlinux.org.uk>79097909S: Supported79107910F: drivers/gpu/drm/i2c/tda998x_drv.c79117911F: include/drm/i2c/tda998x.h···79787978F: drivers/cpufreq/omap-cpufreq.c7979797979807980OMAP POWERDOMAIN SOC ADAPTATION LAYER SUPPORT79817981-M: Rajendra Nayak <rnayak@ti.com>79817981+M: Rajendra Nayak <rnayak@codeaurora.org>79827982M: Paul Walmsley <paul@pwsan.com>79837983L: linux-omap@vger.kernel.org79847984S: Maintained···10014100141001510015SFC NETWORK DRIVER1001610016M: Solarflare linux maintainers <linux-net-drivers@solarflare.com>1001710017-M: Shradha Shah <sshah@solarflare.com>1001710017+M: Edward Cree <ecree@solarflare.com>1001810018+M: Bert Kenward <bkenward@solarflare.com>1001810019L: netdev@vger.kernel.org1001910020S: Supported1002010021F: drivers/net/ethernet/sfc/···1131711316F: include/trace/1131811317F: kernel/trace/1131911318F: tools/testing/selftests/ftrace/1131911319+1132011320+TRACING MMIO ACCESSES (MMIOTRACE)1132111321+M: Steven Rostedt <rostedt@goodmis.org>1132211322+M: Ingo Molnar <mingo@kernel.org>1132311323+R: Karol Herbst <karolherbst@gmail.com>1132411324+R: Pekka Paalanen <ppaalanen@gmail.com>1132511325+S: Maintained1132611326+L: linux-kernel@vger.kernel.org1132711327+L: nouveau@lists.freedesktop.org1132811328+F: kernel/trace/trace_mmiotrace.c1132911329+F: include/linux/mmiotrace.h1133011330+F: arch/x86/mm/kmmio.c1133111331+F: arch/x86/mm/mmio-mod.c1133211332+F: arch/x86/mm/testmmiotrace.c11320113331132111334TRIVIAL PATCHES1132211335M: Jiri Kosina <trivial@kernel.org>
···5858config RWSEM_GENERIC_SPINLOCK5959 def_bool y60606161+config ARCH_DISCONTIGMEM_ENABLE6262+ def_bool y6363+6164config ARCH_FLATMEM_ENABLE6265 def_bool y6366···350347351348endchoice352349350350+config NODES_SHIFT351351+ int "Maximum NUMA Nodes (as a power of 2)"352352+ default "1" if !DISCONTIGMEM353353+ default "2" if DISCONTIGMEM354354+ depends on NEED_MULTIPLE_NODES355355+ ---help---356356+ Accessing memory beyond 1GB (with or w/o PAE) requires 2 memory357357+ zones.358358+353359if ISA_ARCOMPACT354360355361config ARC_COMPACT_IRQ_LEVELS···467455468456config HIGHMEM469457 bool "High Memory Support"458458+ select DISCONTIGMEM470459 help471460 With ARC 2G:2G address split, only upper 2G is directly addressable by472461 kernel. Enable this to potentially allow access to rest of 2G and PAE
+18-9
arch/arc/include/asm/io.h
···1313#include <asm/byteorder.h>1414#include <asm/page.h>15151616+#ifdef CONFIG_ISA_ARCV21717+#include <asm/barrier.h>1818+#define __iormb() rmb()1919+#define __iowmb() wmb()2020+#else2121+#define __iormb() do { } while (0)2222+#define __iowmb() do { } while (0)2323+#endif2424+1625extern void __iomem *ioremap(phys_addr_t paddr, unsigned long size);1726extern void __iomem *ioremap_prot(phys_addr_t paddr, unsigned long size,1827 unsigned long flags);···3930#define ioremap_nocache(phy, sz) ioremap(phy, sz)4031#define ioremap_wc(phy, sz) ioremap(phy, sz)4132#define ioremap_wt(phy, sz) ioremap(phy, sz)3333+3434+/*3535+ * io{read,write}{16,32}be() macros3636+ */3737+#define ioread16be(p) ({ u16 __v = be16_to_cpu((__force __be16)__raw_readw(p)); __iormb(); __v; })3838+#define ioread32be(p) ({ u32 __v = be32_to_cpu((__force __be32)__raw_readl(p)); __iormb(); __v; })3939+4040+#define iowrite16be(v,p) ({ __iowmb(); __raw_writew((__force u16)cpu_to_be16(v), p); })4141+#define iowrite32be(v,p) ({ __iowmb(); __raw_writel((__force u32)cpu_to_be32(v), p); })42424343/* Change struct page to physical address */4444#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)···125107 : "memory");126108127109}128128-129129-#ifdef CONFIG_ISA_ARCV2130130-#include <asm/barrier.h>131131-#define __iormb() rmb()132132-#define __iowmb() wmb()133133-#else134134-#define __iormb() do { } while (0)135135-#define __iowmb() do { } while (0)136136-#endif137110138111/*139112 * MMIO can also get buffered/optimized in micro-arch, so barriers needed
+43
arch/arc/include/asm/mmzone.h
···11+/*22+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)33+ *44+ * This program is free software; you can redistribute it and/or modify55+ * it under the terms of the GNU General Public License version 2 as66+ * published by the Free Software Foundation.77+ */88+99+#ifndef _ASM_ARC_MMZONE_H1010+#define _ASM_ARC_MMZONE_H1111+1212+#ifdef CONFIG_DISCONTIGMEM1313+1414+extern struct pglist_data node_data[];1515+#define NODE_DATA(nid) (&node_data[nid])1616+1717+static inline int pfn_to_nid(unsigned long pfn)1818+{1919+ int is_end_low = 1;2020+2121+ if (IS_ENABLED(CONFIG_ARC_HAS_PAE40))2222+ is_end_low = pfn <= virt_to_pfn(0xFFFFFFFFUL);2323+2424+ /*2525+ * node 0: lowmem: 0x8000_0000 to 0xFFFF_FFFF2626+ * node 1: HIGHMEM w/o PAE40: 0x0 to 0x7FFF_FFFF2727+ * HIGHMEM with PAE40: 0x1_0000_0000 to ...2828+ */2929+ if (pfn >= ARCH_PFN_OFFSET && is_end_low)3030+ return 0;3131+3232+ return 1;3333+}3434+3535+static inline int pfn_valid(unsigned long pfn)3636+{3737+ int nid = pfn_to_nid(pfn);3838+3939+ return (pfn <= node_end_pfn(nid));4040+}4141+#endif /* CONFIG_DISCONTIGMEM */4242+4343+#endif
+11-4
arch/arc/include/asm/page.h
···72727373typedef pte_t * pgtable_t;74747575+/*7676+ * Use virt_to_pfn with caution:7777+ * If used in pte or paddr related macros, it could cause truncation7878+ * in PAE40 builds7979+ * As a rule of thumb, only use it in helpers starting with virt_8080+ * You have been warned !8181+ */7582#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)76837784#define ARCH_PFN_OFFSET virt_to_pfn(CONFIG_LINUX_LINK_BASE)78858686+#ifdef CONFIG_FLATMEM7987#define pfn_valid(pfn) (((pfn) - ARCH_PFN_OFFSET) < max_mapnr)8888+#endif80898190/*8291 * __pa, __va, virt_to_page (ALERT: deprecated, don't use them)···9485 * virt here means link-address/program-address as embedded in object code.9586 * And for ARC, link-addr = physical address9687 */9797-#define __pa(vaddr) ((unsigned long)vaddr)8888+#define __pa(vaddr) ((unsigned long)(vaddr))9889#define __va(paddr) ((void *)((unsigned long)(paddr)))9990100100-#define virt_to_page(kaddr) \101101- (mem_map + virt_to_pfn((kaddr) - CONFIG_LINUX_LINK_BASE))102102-9191+#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))10392#define virt_addr_valid(kaddr) pfn_valid(virt_to_pfn(kaddr))1049310594/* Default Permissions for stack/heaps pages (Non Executable) */
+6-7
arch/arc/include/asm/pgtable.h
···278278#define pmd_present(x) (pmd_val(x))279279#define pmd_clear(xp) do { pmd_val(*(xp)) = 0; } while (0)280280281281-#define pte_page(pte) \282282- (mem_map + virt_to_pfn(pte_val(pte) - CONFIG_LINUX_LINK_BASE))283283-281281+#define pte_page(pte) pfn_to_page(pte_pfn(pte))284282#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)285285-#define pte_pfn(pte) virt_to_pfn(pte_val(pte))286286-#define pfn_pte(pfn, prot) (__pte(((pte_t)(pfn) << PAGE_SHIFT) | \287287- pgprot_val(prot)))288288-#define __pte_index(addr) (virt_to_pfn(addr) & (PTRS_PER_PTE - 1))283283+#define pfn_pte(pfn, prot) (__pte(((pte_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot)))284284+285285+/* Don't use virt_to_pfn for macros below: could cause truncations for PAE40*/286286+#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)287287+#define __pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))289288290289/*291290 * pte_offset gets a @ptr to PMD entry (PGD in our 2-tier paging system)
+39-15
arch/arc/mm/init.c
···3030static unsigned long low_mem_sz;31313232#ifdef CONFIG_HIGHMEM3333-static unsigned long min_high_pfn;3333+static unsigned long min_high_pfn, max_high_pfn;3434static u64 high_mem_start;3535static u64 high_mem_sz;3636+#endif3737+3838+#ifdef CONFIG_DISCONTIGMEM3939+struct pglist_data node_data[MAX_NUMNODES] __read_mostly;4040+EXPORT_SYMBOL(node_data);3641#endif37423843/* User can over-ride above with "mem=nnn[KkMm]" in cmdline */···114109 /* Last usable page of low mem */115110 max_low_pfn = max_pfn = PFN_DOWN(low_mem_start + low_mem_sz);116111117117-#ifdef CONFIG_HIGHMEM118118- min_high_pfn = PFN_DOWN(high_mem_start);119119- max_pfn = PFN_DOWN(high_mem_start + high_mem_sz);112112+#ifdef CONFIG_FLATMEM113113+ /* pfn_valid() uses this */114114+ max_mapnr = max_low_pfn - min_low_pfn;120115#endif121121-122122- max_mapnr = max_pfn - min_low_pfn;123116124117 /*------------- bootmem allocator setup -----------------------*/125118···132129 * the crash133130 */134131135135- memblock_add(low_mem_start, low_mem_sz);132132+ memblock_add_node(low_mem_start, low_mem_sz, 0);136133 memblock_reserve(low_mem_start, __pa(_end) - low_mem_start);137134138135#ifdef CONFIG_BLK_DEV_INITRD···152149 zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn;153150 zones_holes[ZONE_NORMAL] = 0;154151155155-#ifdef CONFIG_HIGHMEM156156- zones_size[ZONE_HIGHMEM] = max_pfn - max_low_pfn;157157-158158- /* This handles the peripheral address space hole */159159- zones_holes[ZONE_HIGHMEM] = min_high_pfn - max_low_pfn;160160-#endif161161-162152 /*163153 * We can't use the helper free_area_init(zones[]) because it uses164154 * PAGE_OFFSET to compute the @min_low_pfn which would be wrong···164168 zones_holes); /* holes */165169166170#ifdef CONFIG_HIGHMEM171171+ /*172172+ * Populate a new node with highmem173173+ *174174+ * On ARC (w/o PAE) HIGHMEM addresses are actually smaller (0 based)175175+ * than addresses in normal ala low memory (0x8000_0000 based).176176+ * Even with PAE, the huge peripheral space hole would waste a lot of177177+ * mem with single mem_map[]. This warrants a mem_map per region design.178178+ * Thus HIGHMEM on ARC is imlemented with DISCONTIGMEM.179179+ *180180+ * DISCONTIGMEM in turns requires multiple nodes. node 0 above is181181+ * populated with normal memory zone while node 1 only has highmem182182+ */183183+ node_set_online(1);184184+185185+ min_high_pfn = PFN_DOWN(high_mem_start);186186+ max_high_pfn = PFN_DOWN(high_mem_start + high_mem_sz);187187+188188+ zones_size[ZONE_NORMAL] = 0;189189+ zones_holes[ZONE_NORMAL] = 0;190190+191191+ zones_size[ZONE_HIGHMEM] = max_high_pfn - min_high_pfn;192192+ zones_holes[ZONE_HIGHMEM] = 0;193193+194194+ free_area_init_node(1, /* node-id */195195+ zones_size, /* num pages per zone */196196+ min_high_pfn, /* first pfn of node */197197+ zones_holes); /* holes */198198+167199 high_memory = (void *)(min_high_pfn << PAGE_SHIFT);168200 kmap_init();169201#endif···209185 unsigned long tmp;210186211187 reset_all_zones_managed_pages();212212- for (tmp = min_high_pfn; tmp < max_pfn; tmp++)188188+ for (tmp = min_high_pfn; tmp < max_high_pfn; tmp++)213189 free_highmem_page(pfn_to_page(tmp));214190#endif215191
···10041004 kvm_pfn_t pfn = *pfnp;10051005 gfn_t gfn = *ipap >> PAGE_SHIFT;1006100610071007- if (PageTransCompound(pfn_to_page(pfn))) {10071007+ if (PageTransCompoundMap(pfn_to_page(pfn))) {10081008 unsigned long mask;10091009 /*10101010 * The address we faulted on is backed by a transparent huge
+5
arch/arm/mach-davinci/board-mityomapl138.c
···121121 const char *partnum = NULL;122122 struct davinci_soc_info *soc_info = &davinci_soc_info;123123124124+ if (!IS_BUILTIN(CONFIG_NVMEM)) {125125+ pr_warn("Factory Config not available without CONFIG_NVMEM\n");126126+ goto bad_config;127127+ }128128+124129 ret = nvmem_device_read(nvmem, 0, sizeof(factory_config),125130 &factory_config);126131 if (ret != sizeof(struct factory_config)) {
+5
arch/arm/mach-davinci/common.c
···3333 char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;3434 off_t offset = (off_t)context;35353636+ if (!IS_BUILTIN(CONFIG_NVMEM)) {3737+ pr_warn("Cannot read MAC addr from EEPROM without CONFIG_NVMEM\n");3838+ return;3939+ }4040+3641 /* Read MAC addr from EEPROM */3742 if (nvmem_device_read(nvmem, offset, ETH_ALEN, mac_addr) == ETH_ALEN)3843 pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr);
+1-1
arch/arm/mach-exynos/pm_domains.c
···9292 if (IS_ERR(pd->clk[i]))9393 break;94949595- if (IS_ERR(pd->clk[i]))9595+ if (IS_ERR(pd->pclk[i]))9696 continue; /* Skip on first power up */9797 if (clk_set_parent(pd->clk[i], pd->pclk[i]))9898 pr_err("%s: error setting parent to clock%d\n",
+1
arch/arm/mach-socfpga/headsmp.S
···1313#include <asm/assembler.h>14141515 .arch armv7-a1616+ .arm16171718ENTRY(secondary_trampoline)1819 /* CPU1 will always fetch from 0x0 when it is brought out of reset.
+8-7
arch/arm/mm/nommu.c
···8787/* MPU initialisation functions */8888void __init sanity_check_meminfo_mpu(void)8989{9090- int i;9190 phys_addr_t phys_offset = PHYS_OFFSET;9291 phys_addr_t aligned_region_size, specified_mem_size, rounded_mem_size;9392 struct memblock_region *reg;···109110 } else {110111 /*111112 * memblock auto merges contiguous blocks, remove112112- * all blocks afterwards113113+ * all blocks afterwards in one go (we can't remove114114+ * blocks separately while iterating)113115 */114116 pr_notice("Ignoring RAM after %pa, memory at %pa ignored\n",115115- &mem_start, ®->base);116116- memblock_remove(reg->base, reg->size);117117+ &mem_end, ®->base);118118+ memblock_remove(reg->base, 0 - reg->base);119119+ break;117120 }118121 }119122···145144 pr_warn("Truncating memory from %pa to %pa (MPU region constraints)",146145 &specified_mem_size, &aligned_region_size);147146 memblock_remove(mem_start + aligned_region_size,148148- specified_mem_size - aligned_round_size);147147+ specified_mem_size - aligned_region_size);149148150149 mem_end = mem_start + aligned_region_size;151150 }···262261 return;263262264263 region_err = mpu_setup_region(MPU_RAM_REGION, PHYS_OFFSET,265265- ilog2(meminfo.bank[0].size),264264+ ilog2(memblock.memory.regions[0].size),266265 MPU_AP_PL1RW_PL0RW | MPU_RGN_NORMAL);267266 if (region_err) {268267 panic("MPU region initialization failure! %d", region_err);···286285 * some architectures which the DRAM is the exception vector to trap,287286 * alloc_page breaks with error, although it is not NULL, but "0."288287 */289289- memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);288288+ memblock_reserve(CONFIG_VECTORS_BASE, 2 * PAGE_SIZE);290289#else /* ifndef CONFIG_CPU_V7M */291290 /*292291 * There is no dedicated vector page on V7-M. So nothing needs to be
···2424CONFIG_INET_ESP=y2525CONFIG_INET_IPCOMP=y2626# CONFIG_INET_LRO is not set2727-CONFIG_IPV6_PRIVACY=y2827CONFIG_INET6_AH=m2928CONFIG_INET6_ESP=m3029CONFIG_INET6_IPCOMP=m
···328328 case SUN4V_CHIP_NIAGARA5:329329 case SUN4V_CHIP_SPARC_M6:330330 case SUN4V_CHIP_SPARC_M7:331331+ case SUN4V_CHIP_SPARC_SN:331332 case SUN4V_CHIP_SPARC64X:332333 rover_inc_table = niagara_iterate_method;333334 break;
···3333jiffies = jiffies_64;3434#endif35353636+#ifdef CONFIG_SPARC643737+ASSERT((swapper_tsb == 0x0000000000408000), "Error: sparc64 early assembler too large")3838+#endif3939+3640SECTIONS3741{3842#ifdef CONFIG_SPARC64
+1-2
arch/sparc/kernel/winfixup.S
···3232 rd %pc, %g73333 call do_sparc64_fault3434 add %sp, PTREGS_OFF, %o03535- ba,pt %xcc, rtrap3636- nop3535+ ba,a,pt %xcc, rtrap37363837 /* Be very careful about usage of the trap globals here.3938 * You cannot touch %g5 as that has the fault information.
···891891 }892892 pr_info("UV: Found %s hub\n", hub);893893894894- /* We now only need to map the MMRs on UV1 */895895- if (is_uv1_hub())896896- map_low_mmrs();894894+ map_low_mmrs();897895898896 m_n_config.v = uv_read_local_mmr(UVH_RH_GAM_CONFIG_MMR );899897 m_val = m_n_config.s.m_skt;
+1-1
arch/x86/kernel/cpu/intel.c
···336336{337337 unsigned int eax, ebx, ecx, edx;338338339339- if (c->cpuid_level < 4)339339+ if (!IS_ENABLED(CONFIG_SMP) || c->cpuid_level < 4)340340 return 1;341341342342 /* Intel has a non-standard dependency on %ecx for this CPUID level. */
···202202203203 If unsure, say N.204204205205+config SATA_AHCI_SEATTLE206206+ tristate "AMD Seattle 6.0Gbps AHCI SATA host controller support"207207+ depends on ARCH_SEATTLE208208+ help209209+ This option enables support for AMD Seattle SATA host controller.210210+211211+ If unsure, say N212212+205213config SATA_INIC162X206214 tristate "Initio 162x SATA support (Very Experimental)"207215 depends on PCI
···259259 reg = opp_table->regulator;260260 if (IS_ERR(reg)) {261261 /* Regulator may not be required for device */262262- if (reg)263263- dev_err(dev, "%s: Invalid regulator (%ld)\n", __func__,264264- PTR_ERR(reg));265262 rcu_read_unlock();266263 return 0;267264 }
···15571557 if (!cpufreq_driver)15581558 return;1559155915601560- if (!has_target())15601560+ if (!has_target() && !cpufreq_driver->suspend)15611561 goto suspend;1562156215631563 pr_debug("%s: Suspending Governors\n", __func__);1564156415651565 for_each_active_policy(policy) {15661566- down_write(&policy->rwsem);15671567- ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP);15681568- up_write(&policy->rwsem);15661566+ if (has_target()) {15671567+ down_write(&policy->rwsem);15681568+ ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP);15691569+ up_write(&policy->rwsem);1569157015701570- if (ret)15711571- pr_err("%s: Failed to stop governor for policy: %p\n",15721572- __func__, policy);15731573- else if (cpufreq_driver->suspend15741574- && cpufreq_driver->suspend(policy))15711571+ if (ret) {15721572+ pr_err("%s: Failed to stop governor for policy: %p\n",15731573+ __func__, policy);15741574+ continue;15751575+ }15761576+ }15771577+15781578+ if (cpufreq_driver->suspend && cpufreq_driver->suspend(policy))15751579 pr_err("%s: Failed to suspend driver: %p\n", __func__,15761580 policy);15771581 }···1600159616011597 cpufreq_suspended = false;1602159816031603- if (!has_target())15991599+ if (!has_target() && !cpufreq_driver->resume)16041600 return;1605160116061602 pr_debug("%s: Resuming Governors\n", __func__);···16091605 if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) {16101606 pr_err("%s: Failed to resume driver: %p\n", __func__,16111607 policy);16121612- } else {16081608+ } else if (has_target()) {16131609 down_write(&policy->rwsem);16141610 ret = cpufreq_start_governor(policy);16151611 up_write(&policy->rwsem);
+18-8
drivers/cpufreq/intel_pstate.c
···453453 }454454}455455456456+static int intel_pstate_hwp_set_policy(struct cpufreq_policy *policy)457457+{458458+ if (hwp_active)459459+ intel_pstate_hwp_set(policy->cpus);460460+461461+ return 0;462462+}463463+456464static void intel_pstate_hwp_set_online_cpus(void)457465{458466 get_online_cpus();···1070106210711063static inline int32_t get_avg_frequency(struct cpudata *cpu)10721064{10731073- return div64_u64(cpu->pstate.max_pstate_physical * cpu->sample.aperf *10741074- cpu->pstate.scaling, cpu->sample.mperf);10651065+ return fp_toint(mul_fp(cpu->sample.core_pct_busy,10661066+ int_tofp(cpu->pstate.max_pstate_physical *10671067+ cpu->pstate.scaling / 100)));10751068}1076106910771070static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)···11141105{11151106 int32_t core_busy, max_pstate, current_pstate, sample_ratio;11161107 u64 duration_ns;11171117-11181118- intel_pstate_calc_busy(cpu);1119110811201109 /*11211110 * core_busy is the ratio of actual performance to max···11981191 if ((s64)delta_ns >= pid_params.sample_rate_ns) {11991192 bool sample_taken = intel_pstate_sample(cpu, time);1200119312011201- if (sample_taken && !hwp_active)12021202- intel_pstate_adjust_busy_pstate(cpu);11941194+ if (sample_taken) {11951195+ intel_pstate_calc_busy(cpu);11961196+ if (!hwp_active)11971197+ intel_pstate_adjust_busy_pstate(cpu);11981198+ }12031199 }12041200}12051201···13561346 out:13571347 intel_pstate_set_update_util_hook(policy->cpu);1358134813591359- if (hwp_active)13601360- intel_pstate_hwp_set(policy->cpus);13491349+ intel_pstate_hwp_set_policy(policy);1361135013621351 return 0;13631352}···14201411 .flags = CPUFREQ_CONST_LOOPS,14211412 .verify = intel_pstate_verify_policy,14221413 .setpolicy = intel_pstate_set_policy,14141414+ .resume = intel_pstate_hwp_set_policy,14231415 .get = intel_pstate_get,14241416 .init = intel_pstate_cpu_init,14251417 .stop_cpu = intel_pstate_stop_cpu,
+4
drivers/cpufreq/sti-cpufreq.c
···259259{260260 int ret;261261262262+ if ((!of_machine_is_compatible("st,stih407")) &&263263+ (!of_machine_is_compatible("st,stih410")))264264+ return -ENODEV;265265+262266 ddata.cpu = get_cpu_device(0);263267 if (!ddata.cpu) {264268 dev_err(ddata.cpu, "Failed to get device for CPU0\n");
+1-1
drivers/cpuidle/cpuidle-arm.c
···5050 * call the CPU ops suspend protocol with idle index as a5151 * parameter.5252 */5353- arm_cpuidle_suspend(idx);5353+ ret = arm_cpuidle_suspend(idx);54545555 cpu_pm_exit();5656 }
···541541 if (!metadata_size) {542542 if (bo->metadata_size) {543543 kfree(bo->metadata);544544+ bo->metadata = NULL;544545 bo->metadata_size = 0;545546 }546547 return 0;
+4
drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
···298298 && (mode->crtc_vsync_start < (mode->crtc_vdisplay + 2)))299299 adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + 2;300300301301+ /* vertical FP must be at least 1 */302302+ if (mode->crtc_vsync_start == mode->crtc_vdisplay)303303+ adjusted_mode->crtc_vsync_start++;304304+301305 /* get the native mode for scaling */302306 if (amdgpu_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT))303307 amdgpu_panel_mode_fixup(encoder, adjusted_mode);
+31-1
drivers/gpu/drm/i915/i915_drv.c
···792792static int i915_drm_resume_early(struct drm_device *dev)793793{794794 struct drm_i915_private *dev_priv = dev->dev_private;795795- int ret = 0;795795+ int ret;796796797797 /*798798 * We have a resume ordering issue with the snd-hda driver also···802802 *803803 * FIXME: This should be solved with a special hdmi sink device or804804 * similar so that power domains can be employed.805805+ */806806+807807+ /*808808+ * Note that we need to set the power state explicitly, since we809809+ * powered off the device during freeze and the PCI core won't power810810+ * it back up for us during thaw. Powering off the device during811811+ * freeze is not a hard requirement though, and during the812812+ * suspend/resume phases the PCI core makes sure we get here with the813813+ * device powered on. So in case we change our freeze logic and keep814814+ * the device powered we can also remove the following set power state815815+ * call.816816+ */817817+ ret = pci_set_power_state(dev->pdev, PCI_D0);818818+ if (ret) {819819+ DRM_ERROR("failed to set PCI D0 power state (%d)\n", ret);820820+ goto out;821821+ }822822+823823+ /*824824+ * Note that pci_enable_device() first enables any parent bridge825825+ * device and only then sets the power state for this device. The826826+ * bridge enabling is a nop though, since bridge devices are resumed827827+ * first. The order of enabling power and enabling the device is828828+ * imposed by the PCI core as described above, so here we preserve the829829+ * same order for the freeze/thaw phases.830830+ *831831+ * TODO: eventually we should remove pci_disable_device() /832832+ * pci_enable_enable_device() from suspend/resume. Due to how they833833+ * depend on the device enable refcount we can't anyway depend on them834834+ * disabling/enabling the device.805835 */806836 if (pci_enable_device(dev->pdev)) {807837 ret = -EIO;
+8-1
drivers/gpu/drm/i915/i915_reg.h
···29072907#define GEN6_RP_STATE_CAP _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5998)29082908#define BXT_RP_STATE_CAP _MMIO(0x138170)2909290929102910-#define INTERVAL_1_28_US(us) (((us) * 100) >> 7)29102910+/*29112911+ * Make these a multiple of magic 25 to avoid SNB (eg. Dell XPS29122912+ * 8300) freezing up around GPU hangs. Looks as if even29132913+ * scheduling/timer interrupts start misbehaving if the RPS29142914+ * EI/thresholds are "bad", leading to a very sluggish or even29152915+ * frozen machine.29162916+ */29172917+#define INTERVAL_1_28_US(us) roundup(((us) * 100) >> 7, 25)29112918#define INTERVAL_1_33_US(us) (((us) * 3) >> 2)29122919#define INTERVAL_0_833_US(us) (((us) * 6) / 5)29132920#define GT_INTERVAL_FROM_US(dev_priv, us) (IS_GEN9(dev_priv) ? \
···14151415 hdmi_to_dig_port(intel_hdmi));14161416 }1417141714181418- if (!live_status)14191419- DRM_DEBUG_KMS("Live status not up!");14181418+ if (!live_status) {14191419+ DRM_DEBUG_KMS("HDMI live status down\n");14201420+ /*14211421+ * Live status register is not reliable on all intel platforms.14221422+ * So consider live_status only for certain platforms, for14231423+ * others, read EDID to determine presence of sink.14241424+ */14251425+ if (INTEL_INFO(dev_priv)->gen < 7 || IS_IVYBRIDGE(dev_priv))14261426+ live_status = true;14271427+ }1420142814211429 intel_hdmi_unset_edid(connector);14221430
+4
drivers/gpu/drm/radeon/atombios_encoders.c
···310310 && (mode->crtc_vsync_start < (mode->crtc_vdisplay + 2)))311311 adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + 2;312312313313+ /* vertical FP must be at least 1 */314314+ if (mode->crtc_vsync_start == mode->crtc_vdisplay)315315+ adjusted_mode->crtc_vsync_start++;316316+313317 /* get the native mode for scaling */314318 if (radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) {315319 radeon_panel_mode_fixup(encoder, adjusted_mode);
+6-1
drivers/gpu/ipu-v3/ipu-common.c
···10681068 goto err_register;10691069 }1070107010711071- pdev->dev.of_node = of_node;10721071 pdev->dev.parent = dev;1073107210741073 ret = platform_device_add_data(pdev, ®->pdata,···10781079 platform_device_put(pdev);10791080 goto err_register;10801081 }10821082+10831083+ /*10841084+ * Set of_node only after calling platform_device_add. Otherwise10851085+ * the platform:imx-ipuv3-crtc modalias won't be used.10861086+ */10871087+ pdev->dev.of_node = of_node;10811088 }1082108910831090 return 0;
···103103 * there is room for the producer to send the pending packet.104104 */105105106106-static bool hv_need_to_signal_on_read(u32 prev_write_sz,107107- struct hv_ring_buffer_info *rbi)106106+static bool hv_need_to_signal_on_read(struct hv_ring_buffer_info *rbi)108107{109108 u32 cur_write_sz;110109 u32 r_size;111111- u32 write_loc = rbi->ring_buffer->write_index;110110+ u32 write_loc;112111 u32 read_loc = rbi->ring_buffer->read_index;113113- u32 pending_sz = rbi->ring_buffer->pending_send_sz;112112+ u32 pending_sz;114113114114+ /*115115+ * Issue a full memory barrier before making the signaling decision.116116+ * Here is the reason for having this barrier:117117+ * If the reading of the pend_sz (in this function)118118+ * were to be reordered and read before we commit the new read119119+ * index (in the calling function) we could120120+ * have a problem. If the host were to set the pending_sz after we121121+ * have sampled pending_sz and go to sleep before we commit the122122+ * read index, we could miss sending the interrupt. Issue a full123123+ * memory barrier to address this.124124+ */125125+ mb();126126+127127+ pending_sz = rbi->ring_buffer->pending_send_sz;128128+ write_loc = rbi->ring_buffer->write_index;115129 /* If the other end is not blocked on write don't bother. */116130 if (pending_sz == 0)117131 return false;···134120 cur_write_sz = write_loc >= read_loc ? r_size - (write_loc - read_loc) :135121 read_loc - write_loc;136122137137- if ((prev_write_sz < pending_sz) && (cur_write_sz >= pending_sz))123123+ if (cur_write_sz >= pending_sz)138124 return true;139125140126 return false;···469455 /* Update the read index */470456 hv_set_next_read_location(inring_info, next_read_location);471457472472- *signal = hv_need_to_signal_on_read(bytes_avail_towrite, inring_info);458458+ *signal = hv_need_to_signal_on_read(inring_info);473459474460 return ret;475461}
+2
drivers/iio/adc/at91-sama5d2_adc.c
···451451 if (ret)452452 goto vref_disable;453453454454+ platform_set_drvdata(pdev, indio_dev);455455+454456 ret = iio_device_register(indio_dev);455457 if (ret < 0)456458 goto per_clk_disable_unprepare;
+27-3
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
···104104 return 0;105105}106106107107+static const char *inv_mpu_match_acpi_device(struct device *dev, int *chip_id)108108+{109109+ const struct acpi_device_id *id;110110+111111+ id = acpi_match_device(dev->driver->acpi_match_table, dev);112112+ if (!id)113113+ return NULL;114114+115115+ *chip_id = (int)id->driver_data;116116+117117+ return dev_name(dev);118118+}119119+107120/**108121 * inv_mpu_probe() - probe function.109122 * @client: i2c client.···128115 const struct i2c_device_id *id)129116{130117 struct inv_mpu6050_state *st;131131- int result;132132- const char *name = id ? id->name : NULL;118118+ int result, chip_type;133119 struct regmap *regmap;120120+ const char *name;134121135122 if (!i2c_check_functionality(client->adapter,136123 I2C_FUNC_SMBUS_I2C_BLOCK))137124 return -EOPNOTSUPP;125125+126126+ if (id) {127127+ chip_type = (int)id->driver_data;128128+ name = id->name;129129+ } else if (ACPI_HANDLE(&client->dev)) {130130+ name = inv_mpu_match_acpi_device(&client->dev, &chip_type);131131+ if (!name)132132+ return -ENODEV;133133+ } else {134134+ return -ENOSYS;135135+ }138136139137 regmap = devm_regmap_init_i2c(client, &inv_mpu_regmap_config);140138 if (IS_ERR(regmap)) {···155131 }156132157133 result = inv_mpu_core_probe(regmap, client->irq, name,158158- NULL, id->driver_data);134134+ NULL, chip_type);159135 if (result < 0)160136 return result;161137
+2-1
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
···4646 struct regmap *regmap;4747 const struct spi_device_id *id = spi_get_device_id(spi);4848 const char *name = id ? id->name : NULL;4949+ const int chip_type = id ? id->driver_data : 0;49505051 regmap = devm_regmap_init_spi(spi, &inv_mpu_regmap_config);5152 if (IS_ERR(regmap)) {···5655 }57565857 return inv_mpu_core_probe(regmap, spi->irq, name,5959- inv_mpu_i2c_disable, id->driver_data);5858+ inv_mpu_i2c_disable, chip_type);6059}61606261static int inv_mpu_remove(struct spi_device *spi)
+3-3
drivers/iio/magnetometer/ak8975.c
···462462 int rc;463463 int irq;464464465465+ init_waitqueue_head(&data->data_ready_queue);466466+ clear_bit(0, &data->flags);465467 if (client->irq)466468 irq = client->irq;467469 else···479477 return rc;480478 }481479482482- init_waitqueue_head(&data->data_ready_queue);483483- clear_bit(0, &data->flags);484480 data->eoc_irq = irq;485481486482 return rc;···732732 int eoc_gpio;733733 int err;734734 const char *name = NULL;735735- enum asahi_compass_chipset chipset;735735+ enum asahi_compass_chipset chipset = AK_MAX_TYPE;736736737737 /* Grab and set up the supplied GPIO. */738738 if (client->dev.platform_data)
+10-4
drivers/infiniband/ulp/iser/iscsi_iser.c
···612612 struct Scsi_Host *shost;613613 struct iser_conn *iser_conn = NULL;614614 struct ib_conn *ib_conn;615615+ u32 max_fr_sectors;615616 u16 max_cmds;616617617618 shost = iscsi_host_alloc(&iscsi_iser_sht, 0, 0);···633632 iser_conn = ep->dd_data;634633 max_cmds = iser_conn->max_cmds;635634 shost->sg_tablesize = iser_conn->scsi_sg_tablesize;636636- shost->max_sectors = iser_conn->scsi_max_sectors;637635638636 mutex_lock(&iser_conn->state_mutex);639637 if (iser_conn->state != ISER_CONN_UP) {···657657 */658658 shost->sg_tablesize = min_t(unsigned short, shost->sg_tablesize,659659 ib_conn->device->ib_device->attrs.max_fast_reg_page_list_len);660660- shost->max_sectors = min_t(unsigned int,661661- 1024, (shost->sg_tablesize * PAGE_SIZE) >> 9);662660663661 if (iscsi_host_add(shost,664662 ib_conn->device->ib_device->dma_device)) {···669671 if (iscsi_host_add(shost, NULL))670672 goto free_host;671673 }674674+675675+ /*676676+ * FRs or FMRs can only map up to a (device) page per entry, but if the677677+ * first entry is misaligned we'll end up using using two entries678678+ * (head and tail) for a single page worth data, so we have to drop679679+ * one segment from the calculation.680680+ */681681+ max_fr_sectors = ((shost->sg_tablesize - 1) * PAGE_SIZE) >> 9;682682+ shost->max_sectors = min(iser_max_sectors, max_fr_sectors);672683673684 if (cmds_max > max_cmds) {674685 iser_info("cmds_max changed from %u to %u\n",···996989 .queuecommand = iscsi_queuecommand,997990 .change_queue_depth = scsi_change_queue_depth,998991 .sg_tablesize = ISCSI_ISER_DEF_SG_TABLESIZE,999999- .max_sectors = ISER_DEF_MAX_SECTORS,1000992 .cmd_per_lun = ISER_DEF_CMD_PER_LUN,1001993 .eh_abort_handler = iscsi_eh_abort,1002994 .eh_device_reset_handler= iscsi_eh_device_reset,
+8-8
drivers/input/misc/twl6040-vibra.c
···181181{182182 struct vibra_info *info = container_of(work,183183 struct vibra_info, play_work);184184+ int ret;185185+186186+ /* Do not allow effect, while the routing is set to use audio */187187+ ret = twl6040_get_vibralr_status(info->twl6040);188188+ if (ret & TWL6040_VIBSEL) {189189+ dev_info(info->dev, "Vibra is configured for audio\n");190190+ return;191191+ }184192185193 mutex_lock(&info->mutex);186194···207199 struct ff_effect *effect)208200{209201 struct vibra_info *info = input_get_drvdata(input);210210- int ret;211211-212212- /* Do not allow effect, while the routing is set to use audio */213213- ret = twl6040_get_vibralr_status(info->twl6040);214214- if (ret & TWL6040_VIBSEL) {215215- dev_info(&input->dev, "Vibra is configured for audio\n");216216- return -EBUSY;217217- }218202219203 info->weak_speed = effect->u.rumble.weak_magnitude;220204 info->strong_speed = effect->u.rumble.strong_magnitude;
+14-14
drivers/input/touchscreen/atmel_mxt_ts.c
···10931093 return 0;10941094}1095109510961096+static int mxt_acquire_irq(struct mxt_data *data)10971097+{10981098+ int error;10991099+11001100+ enable_irq(data->irq);11011101+11021102+ error = mxt_process_messages_until_invalid(data);11031103+ if (error)11041104+ return error;11051105+11061106+ return 0;11071107+}11081108+10961109static int mxt_soft_reset(struct mxt_data *data)10971110{10981111 struct device *dev = &data->client->dev;···11241111 /* Ignore CHG line for 100ms after reset */11251112 msleep(100);1126111311271127- enable_irq(data->irq);11141114+ mxt_acquire_irq(data);1128111511291116 ret = mxt_wait_for_completion(data, &data->reset_completion,11301117 MXT_RESET_TIMEOUT);···14771464release_mem:14781465 kfree(config_mem);14791466 return ret;14801480-}14811481-14821482-static int mxt_acquire_irq(struct mxt_data *data)14831483-{14841484- int error;14851485-14861486- enable_irq(data->irq);14871487-14881488- error = mxt_process_messages_until_invalid(data);14891489- if (error)14901490- return error;14911491-14921492- return 0;14931467}1494146814951469static int mxt_get_info(struct mxt_data *data)
+2-2
drivers/input/touchscreen/zforce_ts.c
···370370 point.coord_x = point.coord_y = 0;371371 }372372373373- point.state = payload[9 * i + 5] & 0x03;374374- point.id = (payload[9 * i + 5] & 0xfc) >> 2;373373+ point.state = payload[9 * i + 5] & 0x0f;374374+ point.id = (payload[9 * i + 5] & 0xf0) >> 4;375375376376 /* determine touch major, minor and orientation */377377 point.area_major = max(payload[9 * i + 6],
+2
drivers/md/md.c
···284284 * go away inside make_request285285 */286286 sectors = bio_sectors(bio);287287+ /* bio could be mergeable after passing to underlayer */288288+ bio->bi_rw &= ~REQ_NOMERGE;287289 mddev->pers->make_request(mddev, bio);288290289291 cpu = part_stat_lock();
+1-1
drivers/md/raid0.c
···7070 (unsigned long long)zone_size>>1);7171 zone_start = conf->strip_zone[j].zone_end;7272 }7373- printk(KERN_INFO "\n");7473}75747675static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)···8485 struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL);8586 unsigned short blksize = 512;86878888+ *private_conf = ERR_PTR(-ENOMEM);8789 if (!conf)8890 return -ENOMEM;8991 rdev_for_each(rdev1, mddev) {
-2
drivers/md/raid5.c
···35023502 dev = &sh->dev[i];35033503 } else if (test_bit(R5_Discard, &dev->flags))35043504 discard_pending = 1;35053505- WARN_ON(test_bit(R5_SkipCopy, &dev->flags));35063506- WARN_ON(dev->page != dev->orig_page);35073505 }3508350635093507 r5l_stripe_write_finished(sh);
···1446144614471447 platform_set_drvdata(pdev, fmd);1448144814491449- /* Protect the media graph while we're registering entities */14501450- mutex_lock(&fmd->media_dev.graph_mutex);14511451-14521449 ret = fimc_md_register_platform_entities(fmd, dev->of_node);14531453- if (ret) {14541454- mutex_unlock(&fmd->media_dev.graph_mutex);14501450+ if (ret)14551451 goto err_clk;14561456- }1457145214581453 ret = fimc_md_register_sensor_entities(fmd);14591459- if (ret) {14601460- mutex_unlock(&fmd->media_dev.graph_mutex);14541454+ if (ret)14611455 goto err_m_ent;14621462- }14631463-14641464- mutex_unlock(&fmd->media_dev.graph_mutex);1465145614661457 ret = device_create_file(&pdev->dev, &dev_attr_subdev_conf_mode);14671458 if (ret)
+3-9
drivers/media/platform/s3c-camif/camif-core.c
···493493 if (ret < 0)494494 goto err_sens;495495496496- mutex_lock(&camif->media_dev.graph_mutex);497497-498496 ret = v4l2_device_register_subdev_nodes(&camif->v4l2_dev);499497 if (ret < 0)500500- goto err_unlock;498498+ goto err_sens;501499502500 ret = camif_register_video_nodes(camif);503501 if (ret < 0)504504- goto err_unlock;502502+ goto err_sens;505503506504 ret = camif_create_media_links(camif);507505 if (ret < 0)508508- goto err_unlock;509509-510510- mutex_unlock(&camif->media_dev.graph_mutex);506506+ goto err_sens;511507512508 ret = media_device_register(&camif->media_dev);513509 if (ret < 0)···512516 pm_runtime_put(dev);513517 return 0;514518515515-err_unlock:516516- mutex_unlock(&camif->media_dev.graph_mutex);517519err_sens:518520 v4l2_device_unregister(&camif->v4l2_dev);519521 media_device_unregister(&camif->media_dev);
+5
drivers/misc/mic/vop/vop_vringh.c
···945945 ret = -EFAULT;946946 goto free_ret;947947 }948948+ /* Ensure desc has not changed between the two reads */949949+ if (memcmp(&dd, dd_config, sizeof(dd))) {950950+ ret = -EINVAL;951951+ goto free_ret;952952+ }948953 mutex_lock(&vdev->vdev_mutex);949954 mutex_lock(&vi->vop_mutex);950955 ret = vop_virtio_add_device(vdev, dd_config);
···33543354 /* Enable per-CPU interrupts on the CPU that is33553355 * brought up.33563356 */33573357- smp_call_function_single(cpu, mvneta_percpu_enable,33583358- pp, true);33573357+ mvneta_percpu_enable(pp);3359335833603359 /* Enable per-CPU interrupt on the one CPU we care33613360 * about.···33863387 /* Disable per-CPU interrupts on the CPU that is33873388 * brought down.33883389 */33893389- smp_call_function_single(cpu, mvneta_percpu_disable,33903390- pp, true);33903390+ mvneta_percpu_disable(pp);3391339133923392 break;33933393 case CPU_DEAD:
+2
drivers/net/ethernet/marvell/pxa168_eth.c
···979979 return 0;980980981981 pep->phy = mdiobus_scan(pep->smi_bus, pep->phy_addr);982982+ if (IS_ERR(pep->phy))983983+ return PTR_ERR(pep->phy);982984 if (!pep->phy)983985 return -ENODEV;984986
···3131 This flag is depended on the kernel's DCB support.32323333 If unsure, set to Y3434+3535+config MLX5_CORE_EN_VXLAN3636+ bool "VXLAN offloads Support"3737+ default y3838+ depends on MLX5_CORE_EN && VXLAN && !(MLX5_CORE=y && VXLAN=m)3939+ ---help---4040+ Say Y here if you want to use VXLAN offloads in the driver.
···2668266826692669 del_timer_sync(&mgp->watchdog_timer);26702670 mgp->running = MYRI10GE_ETH_STOPPING;26712671- local_bh_disable(); /* myri10ge_ss_lock_napi needs bh disabled */26722671 for (i = 0; i < mgp->num_slices; i++) {26732672 napi_disable(&mgp->ss[i].napi);26732673+ local_bh_disable(); /* myri10ge_ss_lock_napi needs this */26742674 /* Lock the slice to prevent the busy_poll handler from26752675 * accessing it. Later when we bring the NIC up, myri10ge_open26762676 * resets the slice including this lock.···26792679 pr_info("Slice %d locked\n", i);26802680 mdelay(1);26812681 }26822682+ local_bh_enable();26822683 }26832683- local_bh_enable();26842684 netif_carrier_off(dev);2685268526862686 netif_tx_stop_all_queues(dev);
···2929#include <linux/crc32.h>3030#include <linux/usb/usbnet.h>3131#include <linux/slab.h>3232+#include <linux/of_net.h>3233#include "smsc75xx.h"33343435#define SMSC_CHIPNAME "smsc75xx"···762761763762static void smsc75xx_init_mac_address(struct usbnet *dev)764763{764764+ const u8 *mac_addr;765765+766766+ /* maybe the boot loader passed the MAC address in devicetree */767767+ mac_addr = of_get_mac_address(dev->udev->dev.of_node);768768+ if (mac_addr) {769769+ memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN);770770+ return;771771+ }772772+765773 /* try reading mac address from EEPROM */766774 if (smsc75xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,767775 dev->net->dev_addr) == 0) {···782772 }783773 }784774785785- /* no eeprom, or eeprom values are invalid. generate random MAC */775775+ /* no useful static MAC address found. generate a random one */786776 eth_hw_addr_random(dev->net);787777 netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n");788778}
+11-1
drivers/net/usb/smsc95xx.c
···2929#include <linux/crc32.h>3030#include <linux/usb/usbnet.h>3131#include <linux/slab.h>3232+#include <linux/of_net.h>3233#include "smsc95xx.h"33343435#define SMSC_CHIPNAME "smsc95xx"···766765767766static void smsc95xx_init_mac_address(struct usbnet *dev)768767{768768+ const u8 *mac_addr;769769+770770+ /* maybe the boot loader passed the MAC address in devicetree */771771+ mac_addr = of_get_mac_address(dev->udev->dev.of_node);772772+ if (mac_addr) {773773+ memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN);774774+ return;775775+ }776776+769777 /* try reading mac address from EEPROM */770778 if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,771779 dev->net->dev_addr) == 0) {···785775 }786776 }787777788788- /* no eeprom, or eeprom values are invalid. generate random MAC */778778+ /* no useful static MAC address found. generate a random one */789779 eth_hw_addr_random(dev->net);790780 netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n");791781}
+3-2
drivers/net/vxlan.c
···616616static int vxlan_gro_complete(struct sk_buff *skb, int nhoff,617617 struct udp_offload *uoff)618618{619619- udp_tunnel_gro_complete(skb, nhoff);620620-619619+ /* Sets 'skb->inner_mac_header' since we are always called with620620+ * 'skb->encapsulation' set.621621+ */621622 return eth_gro_complete(skb, nhoff + sizeof(struct vxlanhdr));622623}623624
+3-5
drivers/net/wireless/ath/ath9k/ar5008_phy.c
···274274 };275275 static const int inc[4] = { 0, 100, 0, 0 };276276277277+ memset(&mask_m, 0, sizeof(int8_t) * 123);278278+ memset(&mask_p, 0, sizeof(int8_t) * 123);279279+277280 cur_bin = -6000;278281 upper = bin + 100;279282 lower = bin - 100;···427424 int tmp, new;428425 int i;429426430430- int8_t mask_m[123];431431- int8_t mask_p[123];432427 int cur_bb_spur;433428 bool is2GHz = IS_CHAN_2GHZ(chan);434434-435435- memset(&mask_m, 0, sizeof(int8_t) * 123);436436- memset(&mask_p, 0, sizeof(int8_t) * 123);437429438430 for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {439431 cur_bb_spur = ah->eep_ops->get_spur_channel(ah, i, is2GHz);
···238238 snprintf(drv->firmware_name, sizeof(drv->firmware_name), "%s%s.ucode",239239 name_pre, tag);240240241241- /*242242- * Starting 8000B - FW name format has changed. This overwrites the243243- * previous name and uses the new format.244244- */245245- if (drv->trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) {246246- char rev_step = 'A' + CSR_HW_REV_STEP(drv->trans->hw_rev);247247-248248- if (rev_step != 'A')249249- snprintf(drv->firmware_name,250250- sizeof(drv->firmware_name), "%s%c-%s.ucode",251251- name_pre, rev_step, tag);252252- }253253-254241 IWL_DEBUG_INFO(drv, "attempting to load firmware %s'%s'\n",255242 (drv->fw_index == UCODE_EXPERIMENTAL_INDEX)256243 ? "EXPERIMENTAL " : "",···10471060 return -EINVAL;10481061 }1049106210501050- if (WARN(fw_has_capa(capa, IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT) &&10511051- !gscan_capa,10521052- "GSCAN is supported but capabilities TLV is unavailable\n"))10631063+ /*10641064+ * If ucode advertises that it supports GSCAN but GSCAN10651065+ * capabilities TLV is not present, or if it has an old format,10661066+ * warn and continue without GSCAN.10671067+ */10681068+ if (fw_has_capa(capa, IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT) &&10691069+ !gscan_capa) {10701070+ IWL_DEBUG_INFO(drv,10711071+ "GSCAN is supported but capabilities TLV is unavailable\n");10531072 __clear_bit((__force long)IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT,10541073 capa->_capa);10741074+ }1055107510561076 return 0;10571077
+4-2
drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c
···526526 file_len += sizeof(*dump_data) + sizeof(*dump_mem) + sram2_len;527527528528 /* Make room for fw's virtual image pages, if it exists */529529- if (mvm->fw->img[mvm->cur_ucode].paging_mem_size)529529+ if (mvm->fw->img[mvm->cur_ucode].paging_mem_size &&530530+ mvm->fw_paging_db[0].fw_paging_block)530531 file_len += mvm->num_of_paging_blk *531532 (sizeof(*dump_data) +532533 sizeof(struct iwl_fw_error_dump_paging) +···644643 }645644646645 /* Dump fw's virtual image */647647- if (mvm->fw->img[mvm->cur_ucode].paging_mem_size) {646646+ if (mvm->fw->img[mvm->cur_ucode].paging_mem_size &&647647+ mvm->fw_paging_db[0].fw_paging_block) {648648 for (i = 1; i < mvm->num_of_paging_blk + 1; i++) {649649 struct iwl_fw_error_dump_paging *paging;650650 struct page *pages =
···151151static void balloon_process(struct work_struct *work);152152static DECLARE_DELAYED_WORK(balloon_worker, balloon_process);153153154154+static void release_memory_resource(struct resource *resource);155155+154156/* When ballooning out (allocating memory to return to Xen) we don't really155157 want the kernel to try too hard since that can trigger the oom killer. */156158#define GFP_BALLOON \···268266 kfree(res);269267 return NULL;270268 }269269+270270+#ifdef CONFIG_SPARSEMEM271271+ {272272+ unsigned long limit = 1UL << (MAX_PHYSMEM_BITS - PAGE_SHIFT);273273+ unsigned long pfn = res->start >> PAGE_SHIFT;274274+275275+ if (pfn > limit) {276276+ pr_err("New System RAM resource outside addressable RAM (%lu > %lu)\n",277277+ pfn, limit);278278+ release_memory_resource(res);279279+ return NULL;280280+ }281281+ }282282+#endif271283272284 return res;273285}
+8-12
drivers/xen/evtchn.c
···316316{317317 unsigned int new_size;318318 evtchn_port_t *new_ring, *old_ring;319319- unsigned int p, c;320319321320 /*322321 * Ensure the ring is large enough to capture all possible···345346 /*346347 * Copy the old ring contents to the new ring.347348 *348348- * If the ring contents crosses the end of the current ring,349349- * it needs to be copied in two chunks.349349+ * To take care of wrapping, a full ring, and the new index350350+ * pointing into the second half, simply copy the old contents351351+ * twice.350352 *351353 * +---------+ +------------------+352352- * |34567 12| -> | 1234567 |353353- * +-----p-c-+ +------------------+354354+ * |34567 12| -> |34567 1234567 12|355355+ * +-----p-c-+ +-------c------p---+354356 */355355- p = evtchn_ring_offset(u, u->ring_prod);356356- c = evtchn_ring_offset(u, u->ring_cons);357357- if (p < c) {358358- memcpy(new_ring + c, u->ring + c, (u->ring_size - c) * sizeof(*u->ring));359359- memcpy(new_ring + u->ring_size, u->ring, p * sizeof(*u->ring));360360- } else361361- memcpy(new_ring + c, u->ring + c, (p - c) * sizeof(*u->ring));357357+ memcpy(new_ring, old_ring, u->ring_size * sizeof(*u->ring));358358+ memcpy(new_ring + u->ring_size, old_ring,359359+ u->ring_size * sizeof(*u->ring));362360363361 u->ring = new_ring;364362 u->ring_size = new_size;
···3232#error Wordsize not 32 or 643333#endif34343535+/*3636+ * The above primes are actively bad for hashing, since they are3737+ * too sparse. The 32-bit one is mostly ok, the 64-bit one causes3838+ * real problems. Besides, the "prime" part is pointless for the3939+ * multiplicative hash.4040+ *4141+ * Although a random odd number will do, it turns out that the golden4242+ * ratio phi = (sqrt(5)-1)/2, or its negative, has particularly nice4343+ * properties.4444+ *4545+ * These are the negative, (1 - phi) = (phi^2) = (3 - sqrt(5))/2.4646+ * (See Knuth vol 3, section 6.4, exercise 9.)4747+ */4848+#define GOLDEN_RATIO_32 0x61C886474949+#define GOLDEN_RATIO_64 0x61C8864680B583EBull5050+3551static __always_inline u64 hash_64(u64 val, unsigned int bits)3652{3753 u64 hash = val;38543939-#if defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 644040- hash = hash * GOLDEN_RATIO_PRIME_64;5555+#if BITS_PER_LONG == 645656+ hash = hash * GOLDEN_RATIO_64;4157#else4258 /* Sigh, gcc can't optimise this alone like it does for 32 bits. */4359 u64 n = hash;
···517517}518518519519/*520520+ * PageTransCompoundMap is the same as PageTransCompound, but it also521521+ * guarantees the primary MMU has the entire compound page mapped522522+ * through pmd_trans_huge, which in turn guarantees the secondary MMUs523523+ * can also map the entire compound page. This allows the secondary524524+ * MMUs to call get_user_pages() only once for each compound page and525525+ * to immediately map the entire compound page with a single secondary526526+ * MMU fault. If there will be a pmd split later, the secondary MMUs527527+ * will get an update through the MMU notifier invalidation through528528+ * split_huge_pmd().529529+ *530530+ * Unlike PageTransCompound, this is safe to be called only while531531+ * split_huge_pmd() cannot run from under us, like if protected by the532532+ * MMU notifier, otherwise it may result in page->_mapcount < 0 false533533+ * positives.534534+ */535535+static inline int PageTransCompoundMap(struct page *page)536536+{537537+ return PageTransCompound(page) && atomic_read(&page->_mapcount) < 0;538538+}539539+540540+/*520541 * PageTransTail returns true for both transparent huge pages521542 * and hugetlbfs pages, so it should only be called when it's known522543 * that hugetlbfs pages aren't involved.···580559#else581560TESTPAGEFLAG_FALSE(TransHuge)582561TESTPAGEFLAG_FALSE(TransCompound)562562+TESTPAGEFLAG_FALSE(TransCompoundMap)583563TESTPAGEFLAG_FALSE(TransTail)584564TESTPAGEFLAG_FALSE(DoubleMap)585565 TESTSETFLAG_FALSE(DoubleMap)
···3131{3232 switch (type) {3333 case BPF_TYPE_PROG:3434- atomic_inc(&((struct bpf_prog *)raw)->aux->refcnt);3434+ raw = bpf_prog_inc(raw);3535 break;3636 case BPF_TYPE_MAP:3737- bpf_map_inc(raw, true);3737+ raw = bpf_map_inc(raw, true);3838 break;3939 default:4040 WARN_ON_ONCE(1);···297297 goto out;298298299299 raw = bpf_any_get(inode->i_private, *type);300300- touch_atime(&path);300300+ if (!IS_ERR(raw))301301+ touch_atime(&path);301302302303 path_put(&path);303304 return raw;
+20-4
kernel/bpf/syscall.c
···218218 return f.file->private_data;219219}220220221221-void bpf_map_inc(struct bpf_map *map, bool uref)221221+/* prog's and map's refcnt limit */222222+#define BPF_MAX_REFCNT 32768223223+224224+struct bpf_map *bpf_map_inc(struct bpf_map *map, bool uref)222225{223223- atomic_inc(&map->refcnt);226226+ if (atomic_inc_return(&map->refcnt) > BPF_MAX_REFCNT) {227227+ atomic_dec(&map->refcnt);228228+ return ERR_PTR(-EBUSY);229229+ }224230 if (uref)225231 atomic_inc(&map->usercnt);232232+ return map;226233}227234228235struct bpf_map *bpf_map_get_with_uref(u32 ufd)···241234 if (IS_ERR(map))242235 return map;243236244244- bpf_map_inc(map, true);237237+ map = bpf_map_inc(map, true);245238 fdput(f);246239247240 return map;···665658 return f.file->private_data;666659}667660661661+struct bpf_prog *bpf_prog_inc(struct bpf_prog *prog)662662+{663663+ if (atomic_inc_return(&prog->aux->refcnt) > BPF_MAX_REFCNT) {664664+ atomic_dec(&prog->aux->refcnt);665665+ return ERR_PTR(-EBUSY);666666+ }667667+ return prog;668668+}669669+668670/* called by sockets/tracing/seccomp before attaching program to an event669671 * pairs with bpf_prog_put()670672 */···686670 if (IS_ERR(prog))687671 return prog;688672689689- atomic_inc(&prog->aux->refcnt);673673+ prog = bpf_prog_inc(prog);690674 fdput(f);691675692676 return prog;
+47-29
kernel/bpf/verifier.c
···239239 [CONST_IMM] = "imm",240240};241241242242-static const struct {243243- int map_type;244244- int func_id;245245-} func_limit[] = {246246- {BPF_MAP_TYPE_PROG_ARRAY, BPF_FUNC_tail_call},247247- {BPF_MAP_TYPE_PERF_EVENT_ARRAY, BPF_FUNC_perf_event_read},248248- {BPF_MAP_TYPE_PERF_EVENT_ARRAY, BPF_FUNC_perf_event_output},249249- {BPF_MAP_TYPE_STACK_TRACE, BPF_FUNC_get_stackid},250250-};251251-252242static void print_verifier_state(struct verifier_env *env)253243{254244 enum bpf_reg_type t;···911921912922static int check_map_func_compatibility(struct bpf_map *map, int func_id)913923{914914- bool bool_map, bool_func;915915- int i;916916-917924 if (!map)918925 return 0;919926920920- for (i = 0; i < ARRAY_SIZE(func_limit); i++) {921921- bool_map = (map->map_type == func_limit[i].map_type);922922- bool_func = (func_id == func_limit[i].func_id);923923- /* only when map & func pair match it can continue.924924- * don't allow any other map type to be passed into925925- * the special func;926926- */927927- if (bool_func && bool_map != bool_func) {928928- verbose("cannot pass map_type %d into func %d\n",929929- map->map_type, func_id);930930- return -EINVAL;931931- }927927+ /* We need a two way check, first is from map perspective ... */928928+ switch (map->map_type) {929929+ case BPF_MAP_TYPE_PROG_ARRAY:930930+ if (func_id != BPF_FUNC_tail_call)931931+ goto error;932932+ break;933933+ case BPF_MAP_TYPE_PERF_EVENT_ARRAY:934934+ if (func_id != BPF_FUNC_perf_event_read &&935935+ func_id != BPF_FUNC_perf_event_output)936936+ goto error;937937+ break;938938+ case BPF_MAP_TYPE_STACK_TRACE:939939+ if (func_id != BPF_FUNC_get_stackid)940940+ goto error;941941+ break;942942+ default:943943+ break;944944+ }945945+946946+ /* ... and second from the function itself. */947947+ switch (func_id) {948948+ case BPF_FUNC_tail_call:949949+ if (map->map_type != BPF_MAP_TYPE_PROG_ARRAY)950950+ goto error;951951+ break;952952+ case BPF_FUNC_perf_event_read:953953+ case BPF_FUNC_perf_event_output:954954+ if (map->map_type != BPF_MAP_TYPE_PERF_EVENT_ARRAY)955955+ goto error;956956+ break;957957+ case BPF_FUNC_get_stackid:958958+ if (map->map_type != BPF_MAP_TYPE_STACK_TRACE)959959+ goto error;960960+ break;961961+ default:962962+ break;932963 }933964934965 return 0;966966+error:967967+ verbose("cannot pass map_type %d into func %d\n",968968+ map->map_type, func_id);969969+ return -EINVAL;935970}936971937972static int check_call(struct verifier_env *env, int func_id)···20642049 return -E2BIG;20652050 }2066205120672067- /* remember this map */20682068- env->used_maps[env->used_map_cnt++] = map;20692069-20702052 /* hold the map. If the program is rejected by verifier,20712053 * the map will be released by release_maps() or it20722054 * will be used by the valid program until it's unloaded20732055 * and all maps are released in free_bpf_prog_info()20742056 */20752075- bpf_map_inc(map, false);20572057+ map = bpf_map_inc(map, false);20582058+ if (IS_ERR(map)) {20592059+ fdput(f);20602060+ return PTR_ERR(map);20612061+ }20622062+ env->used_maps[env->used_map_cnt++] = map;20632063+20762064 fdput(f);20772065next_insn:20782066 insn++;
+1-1
kernel/events/core.c
···353353 * 1 - disallow cpu events for unpriv354354 * 2 - disallow kernel profiling for unpriv355355 */356356-int sysctl_perf_event_paranoid __read_mostly = 1;356356+int sysctl_perf_event_paranoid __read_mostly = 2;357357358358/* Minimum for 512 kiB + 1 user control page */359359int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 'free' kiB per user */
+16-13
kernel/sched/core.c
···596596 return false;597597598598 /*599599- * FIFO realtime policy runs the highest priority task (after DEADLINE).600600- * Other runnable tasks are of a lower priority. The scheduler tick601601- * isn't needed.602602- */603603- fifo_nr_running = rq->rt.rt_nr_running - rq->rt.rr_nr_running;604604- if (fifo_nr_running)605605- return true;606606-607607- /*608608- * Round-robin realtime tasks time slice with other tasks at the same609609- * realtime priority.599599+ * If there are more than one RR tasks, we need the tick to effect the600600+ * actual RR behaviour.610601 */611602 if (rq->rt.rr_nr_running) {612603 if (rq->rt.rr_nr_running == 1)···606615 return false;607616 }608617609609- /* Normal multitasking need periodic preemption checks */610610- if (rq->cfs.nr_running > 1)618618+ /*619619+ * If there's no RR tasks, but FIFO tasks, we can skip the tick, no620620+ * forced preemption between FIFO tasks.621621+ */622622+ fifo_nr_running = rq->rt.rt_nr_running - rq->rt.rr_nr_running;623623+ if (fifo_nr_running)624624+ return true;625625+626626+ /*627627+ * If there are no DL,RR/FIFO tasks, there must only be CFS tasks left;628628+ * if there's more than one we need the tick for involuntary629629+ * preemption.630630+ */631631+ if (rq->nr_running > 1)611632 return false;612633613634 return true;
···852852 pfn = isolate_migratepages_block(cc, pfn, block_end_pfn,853853 ISOLATE_UNEVICTABLE);854854855855- /*856856- * In case of fatal failure, release everything that might857857- * have been isolated in the previous iteration, and signal858858- * the failure back to caller.859859- */860860- if (!pfn) {861861- putback_movable_pages(&cc->migratepages);862862- cc->nr_migratepages = 0;855855+ if (!pfn)863856 break;864864- }865857866858 if (cc->nr_migratepages == COMPACT_CLUSTER_MAX)867859 break;···1733174117341742static inline bool kcompactd_work_requested(pg_data_t *pgdat)17351743{17361736- return pgdat->kcompactd_max_order > 0;17441744+ return pgdat->kcompactd_max_order > 0 || kthread_should_stop();17371745}1738174617391747static bool kcompactd_node_suitable(pg_data_t *pgdat)···17971805 INIT_LIST_HEAD(&cc.freepages);17981806 INIT_LIST_HEAD(&cc.migratepages);1799180718081808+ if (kthread_should_stop())18091809+ return;18001810 status = compact_zone(zone, &cc);1801181118021812 if (zone_watermark_ok(zone, cc.order, low_wmark_pages(zone),
+2-2
mm/huge_memory.c
···34523452 }34533453 }3454345434553455- pr_info("%lu of %lu THP split", split, total);34553455+ pr_info("%lu of %lu THP split\n", split, total);3456345634573457 return 0;34583458}···34633463{34643464 void *ret;3465346534663466- ret = debugfs_create_file("split_huge_pages", 0644, NULL, NULL,34663466+ ret = debugfs_create_file("split_huge_pages", 0200, NULL, NULL,34673467 &split_huge_pages_fops);34683468 if (!ret)34693469 pr_warn("Failed to create split_huge_pages in debugfs");
+2-9
mm/memory.c
···12221222 next = pmd_addr_end(addr, end);12231223 if (pmd_trans_huge(*pmd) || pmd_devmap(*pmd)) {12241224 if (next - addr != HPAGE_PMD_SIZE) {12251225-#ifdef CONFIG_DEBUG_VM12261226- if (!rwsem_is_locked(&tlb->mm->mmap_sem)) {12271227- pr_err("%s: mmap_sem is unlocked! addr=0x%lx end=0x%lx vma->vm_start=0x%lx vma->vm_end=0x%lx\n",12281228- __func__, addr, end,12291229- vma->vm_start,12301230- vma->vm_end);12311231- BUG();12321232- }12331233-#endif12251225+ VM_BUG_ON_VMA(vma_is_anonymous(vma) &&12261226+ !rwsem_is_locked(&tlb->mm->mmap_sem), vma);12341227 split_huge_pmd(vma, pmd, addr);12351228 } else if (zap_huge_pmd(tlb, vma, pmd, addr))12361229 goto next;
+4-2
mm/page-writeback.c
···19101910 if (gdtc->dirty > gdtc->bg_thresh)19111911 return true;1912191219131913- if (wb_stat(wb, WB_RECLAIMABLE) > __wb_calc_thresh(gdtc))19131913+ if (wb_stat(wb, WB_RECLAIMABLE) >19141914+ wb_calc_thresh(gdtc->wb, gdtc->bg_thresh))19141915 return true;1915191619161917 if (mdtc) {···19251924 if (mdtc->dirty > mdtc->bg_thresh)19261925 return true;1927192619281928- if (wb_stat(wb, WB_RECLAIMABLE) > __wb_calc_thresh(mdtc))19271927+ if (wb_stat(wb, WB_RECLAIMABLE) >19281928+ wb_calc_thresh(mdtc->wb, mdtc->bg_thresh))19291929 return true;19301930 }19311931
+1-1
mm/page_alloc.c
···64856485 setup_per_zone_inactive_ratio();64866486 return 0;64876487}64886488-module_init(init_per_zone_wmark_min)64886488+core_initcall(init_per_zone_wmark_min)6489648964906490/*64916491 * min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so
+5-2
mm/zsmalloc.c
···17351735static unsigned long zs_can_compact(struct size_class *class)17361736{17371737 unsigned long obj_wasted;17381738+ unsigned long obj_allocated = zs_stat_get(class, OBJ_ALLOCATED);17391739+ unsigned long obj_used = zs_stat_get(class, OBJ_USED);1738174017391739- obj_wasted = zs_stat_get(class, OBJ_ALLOCATED) -17401740- zs_stat_get(class, OBJ_USED);17411741+ if (obj_allocated <= obj_used)17421742+ return 0;1741174317441744+ obj_wasted = obj_allocated - obj_used;17421745 obj_wasted /= get_maxobj_per_zspage(class->size,17431746 class->pages_per_zspage);17441747
+7-1
mm/zswap.c
···170170static LIST_HEAD(zswap_pools);171171/* protects zswap_pools list modification */172172static DEFINE_SPINLOCK(zswap_pools_lock);173173+/* pool counter to provide unique names to zpool */174174+static atomic_t zswap_pools_count = ATOMIC_INIT(0);173175174176/* used by param callback function */175177static bool zswap_init_started;···567565static struct zswap_pool *zswap_pool_create(char *type, char *compressor)568566{569567 struct zswap_pool *pool;568568+ char name[38]; /* 'zswap' + 32 char (max) num + \0 */570569 gfp_t gfp = __GFP_NORETRY | __GFP_NOWARN | __GFP_KSWAPD_RECLAIM;571570572571 pool = kzalloc(sizeof(*pool), GFP_KERNEL);···576573 return NULL;577574 }578575579579- pool->zpool = zpool_create_pool(type, "zswap", gfp, &zswap_zpool_ops);576576+ /* unique name for each pool specifically required by zsmalloc */577577+ snprintf(name, 38, "zswap%x", atomic_inc_return(&zswap_pools_count));578578+579579+ pool->zpool = zpool_create_pool(type, name, gfp, &zswap_zpool_ops);580580 if (!pool->zpool) {581581 pr_err("%s zpool not available\n", type);582582 goto error;
+12
net/batman-adv/bat_v.c
···32323333#include "bat_v_elp.h"3434#include "bat_v_ogm.h"3535+#include "hard-interface.h"3536#include "hash.h"3637#include "originator.h"3738#include "packet.h"3939+4040+static void batadv_v_iface_activate(struct batadv_hard_iface *hard_iface)4141+{4242+ /* B.A.T.M.A.N. V does not use any queuing mechanism, therefore it can4343+ * set the interface as ACTIVE right away, without any risk of race4444+ * condition4545+ */4646+ if (hard_iface->if_status == BATADV_IF_TO_BE_ACTIVATED)4747+ hard_iface->if_status = BATADV_IF_ACTIVE;4848+}38493950static int batadv_v_iface_enable(struct batadv_hard_iface *hard_iface)4051{···285274286275static struct batadv_algo_ops batadv_batman_v __read_mostly = {287276 .name = "BATMAN_V",277277+ .bat_iface_activate = batadv_v_iface_activate,288278 .bat_iface_enable = batadv_v_iface_enable,289279 .bat_iface_disable = batadv_v_iface_disable,290280 .bat_iface_update_mac = batadv_v_iface_update_mac,
+10-7
net/batman-adv/distributed-arp-table.c
···568568 * be sent to569569 * @bat_priv: the bat priv with all the soft interface information570570 * @ip_dst: ipv4 to look up in the DHT571571+ * @vid: VLAN identifier571572 *572573 * An originator O is selected if and only if its DHT_ID value is one of three573574 * closest values (from the LEFT, with wrap around if needed) then the hash···577576 * Return: the candidate array of size BATADV_DAT_CANDIDATE_NUM.578577 */579578static struct batadv_dat_candidate *580580-batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)579579+batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst,580580+ unsigned short vid)581581{582582 int select;583583 batadv_dat_addr_t last_max = BATADV_DAT_ADDR_MAX, ip_key;···594592 return NULL;595593596594 dat.ip = ip_dst;597597- dat.vid = 0;595595+ dat.vid = vid;598596 ip_key = (batadv_dat_addr_t)batadv_hash_dat(&dat,599597 BATADV_DAT_ADDR_MAX);600598···614612 * @bat_priv: the bat priv with all the soft interface information615613 * @skb: payload to send616614 * @ip: the DHT key615615+ * @vid: VLAN identifier617616 * @packet_subtype: unicast4addr packet subtype to use618617 *619618 * This function copies the skb with pskb_copy() and is sent as unicast packet···625622 */626623static bool batadv_dat_send_data(struct batadv_priv *bat_priv,627624 struct sk_buff *skb, __be32 ip,628628- int packet_subtype)625625+ unsigned short vid, int packet_subtype)629626{630627 int i;631628 bool ret = false;···634631 struct sk_buff *tmp_skb;635632 struct batadv_dat_candidate *cand;636633637637- cand = batadv_dat_select_candidates(bat_priv, ip);634634+ cand = batadv_dat_select_candidates(bat_priv, ip, vid);638635 if (!cand)639636 goto out;640637···10251022 ret = true;10261023 } else {10271024 /* Send the request to the DHT */10281028- ret = batadv_dat_send_data(bat_priv, skb, ip_dst,10251025+ ret = batadv_dat_send_data(bat_priv, skb, ip_dst, vid,10291026 BATADV_P_DAT_DHT_GET);10301027 }10311028out:···11531150 /* Send the ARP reply to the candidates for both the IP addresses that11541151 * the node obtained from the ARP reply11551152 */11561156- batadv_dat_send_data(bat_priv, skb, ip_src, BATADV_P_DAT_DHT_PUT);11571157- batadv_dat_send_data(bat_priv, skb, ip_dst, BATADV_P_DAT_DHT_PUT);11531153+ batadv_dat_send_data(bat_priv, skb, ip_src, vid, BATADV_P_DAT_DHT_PUT);11541154+ batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT);11581155}1159115611601157/**
+4-2
net/batman-adv/hard-interface.c
···407407408408 batadv_update_min_mtu(hard_iface->soft_iface);409409410410+ if (bat_priv->bat_algo_ops->bat_iface_activate)411411+ bat_priv->bat_algo_ops->bat_iface_activate(hard_iface);412412+410413out:411414 if (primary_if)412415 batadv_hardif_put(primary_if);···575572 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);576573 struct batadv_hard_iface *primary_if = NULL;577574578578- if (hard_iface->if_status == BATADV_IF_ACTIVE)579579- batadv_hardif_deactivate_interface(hard_iface);575575+ batadv_hardif_deactivate_interface(hard_iface);580576581577 if (hard_iface->if_status != BATADV_IF_INACTIVE)582578 goto out;
···105105 neigh_node = NULL;106106107107 spin_lock_bh(&orig_node->neigh_list_lock);108108+ /* curr_router used earlier may not be the current orig_ifinfo->router109109+ * anymore because it was dereferenced outside of the neigh_list_lock110110+ * protected region. After the new best neighbor has replace the current111111+ * best neighbor the reference counter needs to decrease. Consequently,112112+ * the code needs to ensure the curr_router variable contains a pointer113113+ * to the replaced best neighbor.114114+ */115115+ curr_router = rcu_dereference_protected(orig_ifinfo->router, true);116116+108117 rcu_assign_pointer(orig_ifinfo->router, neigh_node);109118 spin_unlock_bh(&orig_node->neigh_list_lock);110119 batadv_orig_ifinfo_put(orig_ifinfo);
+6
net/batman-adv/send.c
···675675676676 if (pending) {677677 hlist_del(&forw_packet->list);678678+ if (!forw_packet->own)679679+ atomic_inc(&bat_priv->bcast_queue_left);680680+678681 batadv_forw_packet_free(forw_packet);679682 }680683 }···705702706703 if (pending) {707704 hlist_del(&forw_packet->list);705705+ if (!forw_packet->own)706706+ atomic_inc(&bat_priv->batman_queue_left);707707+708708 batadv_forw_packet_free(forw_packet);709709 }710710 }
+6-2
net/batman-adv/soft-interface.c
···408408 */409409 nf_reset(skb);410410411411+ if (unlikely(!pskb_may_pull(skb, ETH_HLEN)))412412+ goto dropped;413413+411414 vid = batadv_get_vid(skb, 0);412415 ethhdr = eth_hdr(skb);413416414417 switch (ntohs(ethhdr->h_proto)) {415418 case ETH_P_8021Q:419419+ if (!pskb_may_pull(skb, VLAN_ETH_HLEN))420420+ goto dropped;421421+416422 vhdr = (struct vlan_ethhdr *)skb->data;417423418424 if (vhdr->h_vlan_encapsulated_proto != ethertype)···430424 }431425432426 /* skb->dev & skb->pkt_type are set here */433433- if (unlikely(!pskb_may_pull(skb, ETH_HLEN)))434434- goto dropped;435427 skb->protocol = eth_type_trans(skb, soft_iface);436428437429 /* should not be necessary anymore as we use skb_pull_rcsum()
+4-38
net/batman-adv/translation-table.c
···215215 tt_local_entry = container_of(ref, struct batadv_tt_local_entry,216216 common.refcount);217217218218+ batadv_softif_vlan_put(tt_local_entry->vlan);219219+218220 kfree_rcu(tt_local_entry, common.rcu);219221}220222···675673 kref_get(&tt_local->common.refcount);676674 tt_local->last_seen = jiffies;677675 tt_local->common.added_at = tt_local->last_seen;676676+ tt_local->vlan = vlan;678677679678 /* the batman interface mac and multicast addresses should never be680679 * purged···994991 struct batadv_tt_common_entry *tt_common_entry;995992 struct batadv_tt_local_entry *tt_local;996993 struct batadv_hard_iface *primary_if;997997- struct batadv_softif_vlan *vlan;998994 struct hlist_head *head;999995 unsigned short vid;1000996 u32 i;···10291027 last_seen_msecs = last_seen_msecs % 1000;1030102810311029 no_purge = tt_common_entry->flags & np_flag;10321032-10331033- vlan = batadv_softif_vlan_get(bat_priv, vid);10341034- if (!vlan) {10351035- seq_printf(seq, "Cannot retrieve VLAN %d\n",10361036- BATADV_PRINT_VID(vid));10371037- continue;10381038- }10391039-10401030 seq_printf(seq,10411031 " * %pM %4i [%c%c%c%c%c%c] %3u.%03u (%#.8x)\n",10421032 tt_common_entry->addr,···10461052 BATADV_TT_CLIENT_ISOLA) ? 'I' : '.'),10471053 no_purge ? 0 : last_seen_secs,10481054 no_purge ? 0 : last_seen_msecs,10491049- vlan->tt.crc);10501050-10511051- batadv_softif_vlan_put(vlan);10551055+ tt_local->vlan->tt.crc);10521056 }10531057 rcu_read_unlock();10541058 }···10911099{10921100 struct batadv_tt_local_entry *tt_local_entry;10931101 u16 flags, curr_flags = BATADV_NO_FLAGS;10941094- struct batadv_softif_vlan *vlan;10951102 void *tt_entry_exists;1096110310971104 tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, vid);···1129113811301139 /* extra call to free the local tt entry */11311140 batadv_tt_local_entry_put(tt_local_entry);11321132-11331133- /* decrease the reference held for this vlan */11341134- vlan = batadv_softif_vlan_get(bat_priv, vid);11351135- if (!vlan)11361136- goto out;11371137-11381138- batadv_softif_vlan_put(vlan);11391139- batadv_softif_vlan_put(vlan);1140114111411142out:11421143 if (tt_local_entry)···12021219 spinlock_t *list_lock; /* protects write access to the hash lists */12031220 struct batadv_tt_common_entry *tt_common_entry;12041221 struct batadv_tt_local_entry *tt_local;12051205- struct batadv_softif_vlan *vlan;12061222 struct hlist_node *node_tmp;12071223 struct hlist_head *head;12081224 u32 i;···12221240 tt_local = container_of(tt_common_entry,12231241 struct batadv_tt_local_entry,12241242 common);12251225-12261226- /* decrease the reference held for this vlan */12271227- vlan = batadv_softif_vlan_get(bat_priv,12281228- tt_common_entry->vid);12291229- if (vlan) {12301230- batadv_softif_vlan_put(vlan);12311231- batadv_softif_vlan_put(vlan);12321232- }1233124312341244 batadv_tt_local_entry_put(tt_local);12351245 }···32833309 struct batadv_hashtable *hash = bat_priv->tt.local_hash;32843310 struct batadv_tt_common_entry *tt_common;32853311 struct batadv_tt_local_entry *tt_local;32863286- struct batadv_softif_vlan *vlan;32873312 struct hlist_node *node_tmp;32883313 struct hlist_head *head;32893314 spinlock_t *list_lock; /* protects write access to the hash lists */···33113338 tt_local = container_of(tt_common,33123339 struct batadv_tt_local_entry,33133340 common);33143314-33153315- /* decrease the reference held for this vlan */33163316- vlan = batadv_softif_vlan_get(bat_priv, tt_common->vid);33173317- if (vlan) {33183318- batadv_softif_vlan_put(vlan);33193319- batadv_softif_vlan_put(vlan);33203320- }3321334133223342 batadv_tt_local_entry_put(tt_local);33233343 }
+7
net/batman-adv/types.h
···433433 * @ifinfo_lock: lock protecting private ifinfo members and list434434 * @if_incoming: pointer to incoming hard-interface435435 * @last_seen: when last packet via this neighbor was received436436+ * @hardif_neigh: hardif_neigh of this neighbor436437 * @refcount: number of contexts the object is used437438 * @rcu: struct used for freeing in an RCU-safe manner438439 */···445444 spinlock_t ifinfo_lock; /* protects ifinfo_list and its members */446445 struct batadv_hard_iface *if_incoming;447446 unsigned long last_seen;447447+ struct batadv_hardif_neigh_node *hardif_neigh;448448 struct kref refcount;449449 struct rcu_head rcu;450450};···10751073 * struct batadv_tt_local_entry - translation table local entry data10761074 * @common: general translation table data10771075 * @last_seen: timestamp used for purging stale tt local entries10761076+ * @vlan: soft-interface vlan of the entry10781077 */10791078struct batadv_tt_local_entry {10801079 struct batadv_tt_common_entry common;10811080 unsigned long last_seen;10811081+ struct batadv_softif_vlan *vlan;10821082};1083108310841084/**···12541250 * struct batadv_algo_ops - mesh algorithm callbacks12551251 * @list: list node for the batadv_algo_list12561252 * @name: name of the algorithm12531253+ * @bat_iface_activate: start routing mechanisms when hard-interface is brought12541254+ * up12571255 * @bat_iface_enable: init routing info when hard-interface is enabled12581256 * @bat_iface_disable: de-init routing info when hard-interface is disabled12591257 * @bat_iface_update_mac: (re-)init mac addresses of the protocol information···12831277struct batadv_algo_ops {12841278 struct hlist_node list;12851279 char *name;12801280+ void (*bat_iface_activate)(struct batadv_hard_iface *hard_iface);12861281 int (*bat_iface_enable)(struct batadv_hard_iface *hard_iface);12871282 void (*bat_iface_disable)(struct batadv_hard_iface *hard_iface);12881283 void (*bat_iface_update_mac)(struct batadv_hard_iface *hard_iface);
+3-2
net/bridge/br_ioctl.c
···2121#include <asm/uaccess.h>2222#include "br_private.h"23232424-/* called with RTNL */2524static int get_bridge_ifindices(struct net *net, int *indices, int num)2625{2726 struct net_device *dev;2827 int i = 0;29283030- for_each_netdev(net, dev) {2929+ rcu_read_lock();3030+ for_each_netdev_rcu(net, dev) {3131 if (i >= num)3232 break;3333 if (dev->priv_flags & IFF_EBRIDGE)3434 indices[i++] = dev->ifindex;3535 }3636+ rcu_read_unlock();36373738 return i;3839}
+7-5
net/bridge/br_multicast.c
···12791279 struct br_ip saddr;12801280 unsigned long max_delay;12811281 unsigned long now = jiffies;12821282+ unsigned int offset = skb_transport_offset(skb);12821283 __be32 group;12831284 int err = 0;12841285···1290128912911290 group = ih->group;1292129112931293- if (skb->len == sizeof(*ih)) {12921292+ if (skb->len == offset + sizeof(*ih)) {12941293 max_delay = ih->code * (HZ / IGMP_TIMER_SCALE);1295129412961295 if (!max_delay) {12971296 max_delay = 10 * HZ;12981297 group = 0;12991298 }13001300- } else if (skb->len >= sizeof(*ih3)) {12991299+ } else if (skb->len >= offset + sizeof(*ih3)) {13011300 ih3 = igmpv3_query_hdr(skb);13021301 if (ih3->nsrcs)13031302 goto out;···13581357 struct br_ip saddr;13591358 unsigned long max_delay;13601359 unsigned long now = jiffies;13601360+ unsigned int offset = skb_transport_offset(skb);13611361 const struct in6_addr *group = NULL;13621362 bool is_general_query;13631363 int err = 0;···13681366 (port && port->state == BR_STATE_DISABLED))13691367 goto out;1370136813711371- if (skb->len == sizeof(*mld)) {13721372- if (!pskb_may_pull(skb, sizeof(*mld))) {13691369+ if (skb->len == offset + sizeof(*mld)) {13701370+ if (!pskb_may_pull(skb, offset + sizeof(*mld))) {13731371 err = -EINVAL;13741372 goto out;13751373 }···13781376 if (max_delay)13791377 group = &mld->mld_mca;13801378 } else {13811381- if (!pskb_may_pull(skb, sizeof(*mld2q))) {13791379+ if (!pskb_may_pull(skb, offset + sizeof(*mld2q))) {13821380 err = -EINVAL;13831381 goto out;13841382 }
+1-1
net/core/dev.c
···2802280228032803 if (skb->ip_summed != CHECKSUM_NONE &&28042804 !can_checksum_protocol(features, type)) {28052805- features &= ~NETIF_F_CSUM_MASK;28052805+ features &= ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);28062806 } else if (illegal_highdma(skb->dev, skb)) {28072807 features &= ~NETIF_F_SG;28082808 }
···326326327327 if (!IS_ERR(rt)) {328328 tdev = rt->dst.dev;329329- dst_cache_set_ip4(&tunnel->dst_cache, &rt->dst,330330- fl4.saddr);331329 ip_rt_put(rt);332330 }333331 if (dev->type != ARPHRD_ETHER)334332 dev->flags |= IFF_POINTOPOINT;333333+334334+ dst_cache_reset(&tunnel->dst_cache);335335 }336336337337 if (!tdev && tunnel->parms.link)
+18
net/ipv4/ip_vti.c
···156156 struct dst_entry *dst = skb_dst(skb);157157 struct net_device *tdev; /* Device to other host */158158 int err;159159+ int mtu;159160160161 if (!dst) {161162 dev->stats.tx_carrier_errors++;···191190 dst_link_failure(skb);192191 } else193192 tunnel->err_count = 0;193193+ }194194+195195+ mtu = dst_mtu(dst);196196+ if (skb->len > mtu) {197197+ skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, skb, mtu);198198+ if (skb->protocol == htons(ETH_P_IP)) {199199+ icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,200200+ htonl(mtu));201201+ } else {202202+ if (mtu < IPV6_MIN_MTU)203203+ mtu = IPV6_MIN_MTU;204204+205205+ icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);206206+ }207207+208208+ dst_release(dst);209209+ goto tx_error;194210 }195211196212 skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(dev)));
+5-3
net/ipv4/udp_offload.c
···399399400400 uh->len = newlen;401401402402+ /* Set encapsulation before calling into inner gro_complete() functions403403+ * to make them set up the inner offsets.404404+ */405405+ skb->encapsulation = 1;406406+402407 rcu_read_lock();403408404409 uo_priv = rcu_dereference(udp_offload_base);···425420426421 if (skb->remcsum_offload)427422 skb_shinfo(skb)->gso_type |= SKB_GSO_TUNNEL_REMCSUM;428428-429429- skb->encapsulation = 1;430430- skb_set_inner_mac_header(skb, nhoff + sizeof(struct udphdr));431423432424 return err;433425}
+2-3
net/ipv6/icmp.c
···445445446446 if (__ipv6_addr_needs_scope_id(addr_type))447447 iif = skb->dev->ifindex;448448+ else449449+ iif = l3mdev_master_ifindex(skb->dev);448450449451 /*450452 * Must not send error if the source does not uniquely···500498 fl6.flowi6_oif = np->mcast_oif;501499 else if (!fl6.flowi6_oif)502500 fl6.flowi6_oif = np->ucast_oif;503503-504504- if (!fl6.flowi6_oif)505505- fl6.flowi6_oif = l3mdev_master_ifindex(skb->dev);506501507502 dst = icmpv6_route_lookup(net, skb, sk, &fl6);508503 if (IS_ERR(dst))
+1-2
net/ipv6/ila/ila_lwt.c
···120120121121static int ila_encap_nlsize(struct lwtunnel_state *lwtstate)122122{123123- /* No encapsulation overhead */124124- return 0;123123+ return nla_total_size(sizeof(u64)); /* ILA_ATTR_LOCATOR */125124}126125127126static int ila_encap_cmp(struct lwtunnel_state *a, struct lwtunnel_state *b)
···127127128128/*129129 * This is the only path that sets tc->t_sock. Send and receive trust that130130- * it is set. The RDS_CONN_CONNECTED bit protects those paths from being130130+ * it is set. The RDS_CONN_UP bit protects those paths from being131131 * called while it isn't set.132132 */133133void rds_tcp_set_callbacks(struct socket *sock, struct rds_connection *conn)···216216 if (!tc)217217 return -ENOMEM;218218219219+ mutex_init(&tc->t_conn_lock);219220 tc->t_sock = NULL;220221 tc->t_tinc = NULL;221222 tc->t_tinc_hdr_rem = sizeof(struct rds_header);
···7878 struct socket *sock = NULL;7979 struct sockaddr_in src, dest;8080 int ret;8181+ struct rds_tcp_connection *tc = conn->c_transport_data;81828383+ mutex_lock(&tc->t_conn_lock);8484+8585+ if (rds_conn_up(conn)) {8686+ mutex_unlock(&tc->t_conn_lock);8787+ return 0;8888+ }8289 ret = sock_create_kern(rds_conn_net(conn), PF_INET,8390 SOCK_STREAM, IPPROTO_TCP, &sock);8491 if (ret < 0)···127120 }128121129122out:123123+ mutex_unlock(&tc->t_conn_lock);130124 if (sock)131125 sock_release(sock);132126 return ret;
+36-18
net/rds/tcp_listen.c
···7676 struct rds_connection *conn;7777 int ret;7878 struct inet_sock *inet;7979- struct rds_tcp_connection *rs_tcp;7979+ struct rds_tcp_connection *rs_tcp = NULL;8080+ int conn_state;8181+ struct sock *nsk;80828183 ret = sock_create_kern(sock_net(sock->sk), sock->sk->sk_family,8284 sock->sk->sk_type, sock->sk->sk_protocol,···117115 * rds_tcp_state_change() will do that cleanup118116 */119117 rs_tcp = (struct rds_tcp_connection *)conn->c_transport_data;120120- if (rs_tcp->t_sock &&121121- ntohl(inet->inet_saddr) < ntohl(inet->inet_daddr)) {122122- struct sock *nsk = new_sock->sk;123123-124124- nsk->sk_user_data = NULL;125125- nsk->sk_prot->disconnect(nsk, 0);126126- tcp_done(nsk);127127- new_sock = NULL;128128- ret = 0;129129- goto out;130130- } else if (rs_tcp->t_sock) {131131- rds_tcp_restore_callbacks(rs_tcp->t_sock, rs_tcp);132132- conn->c_outgoing = 0;133133- }134134-135118 rds_conn_transition(conn, RDS_CONN_DOWN, RDS_CONN_CONNECTING);119119+ mutex_lock(&rs_tcp->t_conn_lock);120120+ conn_state = rds_conn_state(conn);121121+ if (conn_state != RDS_CONN_CONNECTING && conn_state != RDS_CONN_UP)122122+ goto rst_nsk;123123+ if (rs_tcp->t_sock) {124124+ /* Need to resolve a duelling SYN between peers.125125+ * We have an outstanding SYN to this peer, which may126126+ * potentially have transitioned to the RDS_CONN_UP state,127127+ * so we must quiesce any send threads before resetting128128+ * c_transport_data.129129+ */130130+ wait_event(conn->c_waitq,131131+ !test_bit(RDS_IN_XMIT, &conn->c_flags));132132+ if (ntohl(inet->inet_saddr) < ntohl(inet->inet_daddr)) {133133+ goto rst_nsk;134134+ } else if (rs_tcp->t_sock) {135135+ rds_tcp_restore_callbacks(rs_tcp->t_sock, rs_tcp);136136+ conn->c_outgoing = 0;137137+ }138138+ }136139 rds_tcp_set_callbacks(new_sock, conn);137137- rds_connect_complete(conn);140140+ rds_connect_complete(conn); /* marks RDS_CONN_UP */138141 new_sock = NULL;139142 ret = 0;140140-143143+ goto out;144144+rst_nsk:145145+ /* reset the newly returned accept sock and bail */146146+ nsk = new_sock->sk;147147+ rds_tcp_stats_inc(s_tcp_listen_closed_stale);148148+ nsk->sk_user_data = NULL;149149+ nsk->sk_prot->disconnect(nsk, 0);150150+ tcp_done(nsk);151151+ new_sock = NULL;152152+ ret = 0;141153out:154154+ if (rs_tcp)155155+ mutex_unlock(&rs_tcp->t_conn_lock);142156 if (new_sock)143157 sock_release(new_sock);144158 return ret;
+59-2
net/sched/sch_netem.c
···395395 sch->q.qlen++;396396}397397398398+/* netem can't properly corrupt a megapacket (like we get from GSO), so instead399399+ * when we statistically choose to corrupt one, we instead segment it, returning400400+ * the first packet to be corrupted, and re-enqueue the remaining frames401401+ */402402+static struct sk_buff *netem_segment(struct sk_buff *skb, struct Qdisc *sch)403403+{404404+ struct sk_buff *segs;405405+ netdev_features_t features = netif_skb_features(skb);406406+407407+ segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);408408+409409+ if (IS_ERR_OR_NULL(segs)) {410410+ qdisc_reshape_fail(skb, sch);411411+ return NULL;412412+ }413413+ consume_skb(skb);414414+ return segs;415415+}416416+398417/*399418 * Insert one skb into qdisc.400419 * Note: parent depends on return value to account for queue length.···426407 /* We don't fill cb now as skb_unshare() may invalidate it */427408 struct netem_skb_cb *cb;428409 struct sk_buff *skb2;410410+ struct sk_buff *segs = NULL;411411+ unsigned int len = 0, last_len, prev_len = qdisc_pkt_len(skb);412412+ int nb = 0;429413 int count = 1;414414+ int rc = NET_XMIT_SUCCESS;430415431416 /* Random duplication */432417 if (q->duplicate && q->duplicate >= get_crandom(&q->dup_cor))···476453 * do it now in software before we mangle it.477454 */478455 if (q->corrupt && q->corrupt >= get_crandom(&q->corrupt_cor)) {456456+ if (skb_is_gso(skb)) {457457+ segs = netem_segment(skb, sch);458458+ if (!segs)459459+ return NET_XMIT_DROP;460460+ } else {461461+ segs = skb;462462+ }463463+464464+ skb = segs;465465+ segs = segs->next;466466+479467 if (!(skb = skb_unshare(skb, GFP_ATOMIC)) ||480468 (skb->ip_summed == CHECKSUM_PARTIAL &&481481- skb_checksum_help(skb)))482482- return qdisc_drop(skb, sch);469469+ skb_checksum_help(skb))) {470470+ rc = qdisc_drop(skb, sch);471471+ goto finish_segs;472472+ }483473484474 skb->data[prandom_u32() % skb_headlen(skb)] ^=485475 1<<(prandom_u32() % 8);···552516 sch->qstats.requeues++;553517 }554518519519+finish_segs:520520+ if (segs) {521521+ while (segs) {522522+ skb2 = segs->next;523523+ segs->next = NULL;524524+ qdisc_skb_cb(segs)->pkt_len = segs->len;525525+ last_len = segs->len;526526+ rc = qdisc_enqueue(segs, sch);527527+ if (rc != NET_XMIT_SUCCESS) {528528+ if (net_xmit_drop_count(rc))529529+ qdisc_qstats_drop(sch);530530+ } else {531531+ nb++;532532+ len += last_len;533533+ }534534+ segs = skb2;535535+ }536536+ sch->q.qlen += nb;537537+ if (nb > 1)538538+ qdisc_tree_reduce_backlog(sch, 1 - nb, prev_len - len);539539+ }555540 return NET_XMIT_SUCCESS;556541}557542
+5
net/tipc/node.c
···14441444 int bearer_id = b->identity;14451445 struct tipc_link_entry *le;14461446 u16 bc_ack = msg_bcast_ack(hdr);14471447+ u32 self = tipc_own_addr(net);14471448 int rc = 0;1448144914491450 __skb_queue_head_init(&xmitq);···14601459 else14611460 return tipc_node_bc_rcv(net, skb, bearer_id);14621461 }14621462+14631463+ /* Discard unicast link messages destined for another node */14641464+ if (unlikely(!msg_short(hdr) && (msg_destnode(hdr) != self)))14651465+ goto discard;1463146614641467 /* Locate neighboring node that sent packet */14651468 n = tipc_node_find(net, msg_prevnode(hdr));
+1-20
net/vmw_vsock/af_vsock.c
···18081808 else if (sk->sk_shutdown & RCV_SHUTDOWN)18091809 err = 0;1810181018111811- if (copied > 0) {18121812- /* We only do these additional bookkeeping/notification steps18131813- * if we actually copied something out of the queue pair18141814- * instead of just peeking ahead.18151815- */18161816-18171817- if (!(flags & MSG_PEEK)) {18181818- /* If the other side has shutdown for sending and there18191819- * is nothing more to read, then modify the socket18201820- * state.18211821- */18221822- if (vsk->peer_shutdown & SEND_SHUTDOWN) {18231823- if (vsock_stream_has_data(vsk) <= 0) {18241824- sk->sk_state = SS_UNCONNECTED;18251825- sock_set_flag(sk, SOCK_DONE);18261826- sk->sk_state_change(sk);18271827- }18281828- }18291829- }18111811+ if (copied > 0)18301812 err = copied;18311831- }1832181318331814out:18341815 release_sock(sk);