···99- max-speed: number, specifies maximum speed in Mbit/s supported by the device;1010- max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather than1111 the maximum frame size (there's contradiction in ePAPR).1212-- phy-mode: string, operation mode of the PHY interface; supported values are1313- "mii", "gmii", "sgmii", "qsgmii", "tbi", "rev-mii", "rmii", "rgmii", "rgmii-id",1414- "rgmii-rxid", "rgmii-txid", "rtbi", "smii", "xgmii", "trgmii"; this is now a1515- de-facto standard property;1212+- phy-mode: string, operation mode of the PHY interface. This is now a de-facto1313+ standard property; supported values are:1414+ * "mii"1515+ * "gmii"1616+ * "sgmii"1717+ * "qsgmii"1818+ * "tbi"1919+ * "rev-mii"2020+ * "rmii"2121+ * "rgmii" (RX and TX delays are added by the MAC when required)2222+ * "rgmii-id" (RGMII with internal RX and TX delays provided by the PHY, the2323+ MAC should not add the RX or TX delays in this case)2424+ * "rgmii-rxid" (RGMII with internal RX delay provided by the PHY, the MAC2525+ should not add an RX delay in this case)2626+ * "rgmii-txid" (RGMII with internal TX delay provided by the PHY, the MAC2727+ should not add an TX delay in this case)2828+ * "rtbi"2929+ * "smii"3030+ * "xgmii"3131+ * "trgmii"1632- phy-connection-type: the same as "phy-mode" property but described in ePAPR;1733- phy-handle: phandle, specifies a reference to a node representing a PHY1834 device; this property is described in ePAPR and so preferred;
+5-2
Documentation/networking/nf_conntrack-sysctl.txt
···6262 protocols.63636464nf_conntrack_helper - BOOLEAN6565- 0 - disabled6666- not 0 - enabled (default)6565+ 0 - disabled (default)6666+ not 0 - enabled67676868 Enable automatic conntrack helper assignment.6969+ If disabled it is required to set up iptables rules to assign7070+ helpers to connections. See the CT target description in the7171+ iptables-extensions(8) man page for further information.69727073nf_conntrack_icmp_timeout - INTEGER (seconds)7174 default 30
+14-9
MAINTAINERS
···7777 Q: Patchwork web based patch tracking system site7878 T: SCM tree type and location.7979 Type is one of: git, hg, quilt, stgit, topgit8080+ B: Bug tracking system location.8081 S: Status, one of the following:8182 Supported: Someone is actually paid to look after this.8283 Maintained: Someone actually looks after it.···282281W: https://01.org/linux-acpi283282Q: https://patchwork.kernel.org/project/linux-acpi/list/284283T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm284284+B: https://bugzilla.kernel.org285285S: Supported286286F: drivers/acpi/287287F: drivers/pnp/pnpacpi/···306304W: https://github.com/acpica/acpica/307305Q: https://patchwork.kernel.org/project/linux-acpi/list/308306T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm307307+B: https://bugzilla.kernel.org308308+B: https://bugs.acpica.org309309S: Supported310310F: drivers/acpi/acpica/311311F: include/acpi/···317313M: Zhang Rui <rui.zhang@intel.com>318314L: linux-acpi@vger.kernel.org319315W: https://01.org/linux-acpi316316+B: https://bugzilla.kernel.org320317S: Supported321318F: drivers/acpi/fan.c322319···333328M: Zhang Rui <rui.zhang@intel.com>334329L: linux-acpi@vger.kernel.org335330W: https://01.org/linux-acpi331331+B: https://bugzilla.kernel.org336332S: Supported337333F: drivers/acpi/*thermal*338334···341335M: Zhang Rui <rui.zhang@intel.com>342336L: linux-acpi@vger.kernel.org343337W: https://01.org/linux-acpi338338+B: https://bugzilla.kernel.org344339S: Supported345340F: drivers/acpi/acpi_video.c346341···56705663M: "Rafael J. Wysocki" <rjw@rjwysocki.net>56715664M: Pavel Machek <pavel@ucw.cz>56725665L: linux-pm@vger.kernel.org56665666+B: https://bugzilla.kernel.org56735667S: Supported56745668F: arch/x86/power/56755669F: drivers/base/power/···92579249F: drivers/pci/host/*layerscape*9258925092599251PCI DRIVER FOR IMX692609260-M: Richard Zhu <Richard.Zhu@freescale.com>92529252+M: Richard Zhu <hongxing.zhu@nxp.com>92619253M: Lucas Stach <l.stach@pengutronix.de>92629254L: linux-pci@vger.kernel.org92639255L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)92649256S: Maintained92579257+F: Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt92659258F: drivers/pci/host/*imx6*9266925992679260PCI DRIVER FOR TI KEYSTONE···9321931293229313PCI DRIVER FOR SYNOPSIS DESIGNWARE93239314M: Jingoo Han <jingoohan1@gmail.com>93249324-M: Pratyush Anand <pratyush.anand@gmail.com>93259325-L: linux-pci@vger.kernel.org93269326-S: Maintained93279327-F: drivers/pci/host/*designware*93289328-93299329-PCI DRIVER FOR SYNOPSYS PROTOTYPING DEVICE93309330-M: Jose Abreu <Jose.Abreu@synopsys.com>93159315+M: Joao Pinto <Joao.Pinto@synopsys.com>93319316L: linux-pci@vger.kernel.org93329317S: Maintained93339318F: Documentation/devicetree/bindings/pci/designware-pcie.txt93349334-F: drivers/pci/host/pcie-designware-plat.c93199319+F: drivers/pci/host/*designware*9335932093369321PCI DRIVER FOR GENERIC OF HOSTS93379322M: Will Deacon <will.deacon@arm.com>···96279624M: "Rafael J. Wysocki" <rjw@rjwysocki.net>96289625L: linux-pm@vger.kernel.org96299626T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm96279627+B: https://bugzilla.kernel.org96309628S: Supported96319629F: drivers/base/power/96329630F: include/linux/pm.h···1161711613M: Len Brown <len.brown@intel.com>1161811614M: Pavel Machek <pavel@ucw.cz>1161911615L: linux-pm@vger.kernel.org1161611616+B: https://bugzilla.kernel.org1162011617S: Supported1162111618F: Documentation/power/1162211619F: arch/x86/kernel/acpi/
+9-4
Makefile
···11VERSION = 422PATCHLEVEL = 933SUBLEVEL = 044-EXTRAVERSION = -rc644+EXTRAVERSION = -rc855NAME = Psychotic Stoned Sheep6677# *DOCUMENTATION*···607607include/config/auto.conf: ;608608endif # $(dot-config)609609610610+# For the kernel to actually contain only the needed exported symbols,611611+# we have to build modules as well to determine what those symbols are.612612+# (this can be evaluated only once include/config/auto.conf has been included)613613+ifdef CONFIG_TRIM_UNUSED_KSYMS614614+ KBUILD_MODULES := 1615615+endif616616+610617# The all: target is the default when no target is given on the611618# command line.612619# This allow a user to issue only 'make' to build a kernel including modules···951944endif952945ifdef CONFIG_TRIM_UNUSED_KSYMS953946 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \954954- "$(MAKE) KBUILD_MODULES=1 -f $(srctree)/Makefile vmlinux_prereq"947947+ "$(MAKE) -f $(srctree)/Makefile vmlinux"955948endif956949957950# standalone target for easier testing···10261019prepare1: prepare2 $(version_h) include/generated/utsrelease.h \10271020 include/config/auto.conf10281021 $(cmd_crmodverdir)10291029- $(Q)test -e include/generated/autoksyms.h || \10301030- touch include/generated/autoksyms.h1031102210321023archprepare: archheaders archscripts prepare1 scripts_basic10331024
···280280281281#define pte_page(pte) pfn_to_page(pte_pfn(pte))282282#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)283283-#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))283283+#define pfn_pte(pfn, prot) __pte(__pfn_to_phys(pfn) | pgprot_val(prot))284284285285/* Don't use virt_to_pfn for macros below: could cause truncations for PAE40*/286286#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
+1-1
arch/arc/mm/cache.c
···23232424static int l2_line_sz;2525static int ioc_exists;2626-int slc_enable = 1, ioc_enable = 1;2626+int slc_enable = 1, ioc_enable = 0;2727unsigned long perip_base = ARC_UNCACHED_ADDR_SPACE; /* legacy value for boot */2828unsigned long perip_end = 0xFFFFFFFF; /* legacy value */2929
···1616#include <asm/opcodes-sec.h>1717#include <asm/opcodes-virt.h>1818#include <asm/unwind.h>1919-#include <asm/export.h>20192120 /*2221 * Wrap c macros in asm macros to delay expansion until after the···5152ENTRY(arm_smccc_smc)5253 SMCCC SMCCC_SMC5354ENDPROC(arm_smccc_smc)5454-EXPORT_SYMBOL(arm_smccc_smc)55555656/*5757 * void smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,···6062ENTRY(arm_smccc_hvc)6163 SMCCC SMCCC_HVC6264ENDPROC(arm_smccc_hvc)6363-EXPORT_SYMBOL(arm_smccc_hvc)
-3
arch/arm/lib/ashldi3.S
···28282929#include <linux/linkage.h>3030#include <asm/assembler.h>3131-#include <asm/export.h>32313332#ifdef __ARMEB__3433#define al r1···52535354ENDPROC(__ashldi3)5455ENDPROC(__aeabi_llsl)5555-EXPORT_SYMBOL(__ashldi3)5656-EXPORT_SYMBOL(__aeabi_llsl)
-3
arch/arm/lib/ashrdi3.S
···28282929#include <linux/linkage.h>3030#include <asm/assembler.h>3131-#include <asm/export.h>32313332#ifdef __ARMEB__3433#define al r1···52535354ENDPROC(__ashrdi3)5455ENDPROC(__aeabi_lasr)5555-EXPORT_SYMBOL(__ashrdi3)5656-EXPORT_SYMBOL(__aeabi_lasr)
···88 * published by the Free Software Foundation.99 */1010#include <asm/assembler.h>1111-#include <asm/export.h>12111312/*1413 * unsigned int···331332 mov r5, r4, get_byte_1332333 b .Lexit333334FN_EXIT334334-FN_EXPORT
···1515 */1616#include <linux/linkage.h>1717#include <asm/assembler.h>1818-#include <asm/export.h>1918 .text20192120/*···37383: mov r0, r1 @ no free bits3839 ret lr3940ENDPROC(_find_first_zero_bit_le)4040-EXPORT_SYMBOL(_find_first_zero_bit_le)41414242/*4343 * Purpose : Find next 'zero' bit···5759 add r2, r2, #1 @ align bit pointer5860 b 2b @ loop for next bit5961ENDPROC(_find_next_zero_bit_le)6060-EXPORT_SYMBOL(_find_next_zero_bit_le)61626263/*6364 * Purpose : Find a 'one' bit···78813: mov r0, r1 @ no free bits7982 ret lr8083ENDPROC(_find_first_bit_le)8181-EXPORT_SYMBOL(_find_first_bit_le)82848385/*8486 * Purpose : Find next 'one' bit···97101 add r2, r2, #1 @ align bit pointer98102 b 2b @ loop for next bit99103ENDPROC(_find_next_bit_le)100100-EXPORT_SYMBOL(_find_next_bit_le)101104102105#ifdef __ARMEB__103106···1161213: mov r0, r1 @ no free bits117122 ret lr118123ENDPROC(_find_first_zero_bit_be)119119-EXPORT_SYMBOL(_find_first_zero_bit_be)120124121125ENTRY(_find_next_zero_bit_be)122126 teq r1, #0···133139 add r2, r2, #1 @ align bit pointer134140 b 2b @ loop for next bit135141ENDPROC(_find_next_zero_bit_be)136136-EXPORT_SYMBOL(_find_next_zero_bit_be)137142138143ENTRY(_find_first_bit_be)139144 teq r1, #0···1501573: mov r0, r1 @ no free bits151158 ret lr152159ENDPROC(_find_first_bit_be)153153-EXPORT_SYMBOL(_find_first_bit_be)154160155161ENTRY(_find_next_bit_be)156162 teq r1, #0···166174 add r2, r2, #1 @ align bit pointer167175 b 2b @ loop for next bit168176ENDPROC(_find_next_bit_be)169169-EXPORT_SYMBOL(_find_next_bit_be)170177171178#endif172179
···99 */1010#include <linux/linkage.h>1111#include <asm/assembler.h>1212-#include <asm/export.h>13121413ENTRY(__raw_readsl)1514 teq r2, #0 @ do we have to check for the zero len?···7778 strb r3, [r1, #0]7879 ret lr7980ENDPROC(__raw_readsl)8080-EXPORT_SYMBOL(__raw_readsl)
···99 */1010#include <linux/linkage.h>1111#include <asm/assembler.h>1212-#include <asm/export.h>13121413ENTRY(__raw_writesl)1514 teq r2, #0 @ do we have to check for the zero len?···6566 bne 6b6667 ret lr6768ENDPROC(__raw_writesl)6868-EXPORT_SYMBOL(__raw_writesl)
···12121313#include <linux/linkage.h>1414#include <asm/assembler.h>1515-#include <asm/export.h>16151716#ifdef __ARMEB__1817#define xh r0···3536 ret lr36373738ENDPROC(__ucmpdi2)3838-EXPORT_SYMBOL(__ucmpdi2)39394040#ifdef CONFIG_AEABI4141···4850 ret lr49515052ENDPROC(__aeabi_ulcmp)5151-EXPORT_SYMBOL(__aeabi_ulcmp)52535354#endif5455
+1
arch/arm/mach-imx/Makefile
···32323333ifdef CONFIG_SND_IMX_SOC3434obj-y += ssi-fiq.o3535+obj-y += ssi-fiq-ksym.o3536endif36373738# i.MX21 based machines
+20
arch/arm/mach-imx/ssi-fiq-ksym.c
···11+/*22+ * Exported ksyms for the SSI FIQ handler33+ *44+ * Copyright (C) 2009, Sascha Hauer <s.hauer@pengutronix.de>55+ *66+ * This program is free software; you can redistribute it and/or modify77+ * it under the terms of the GNU General Public License version 2 as88+ * published by the Free Software Foundation.99+ */1010+1111+#include <linux/module.h>1212+1313+#include <linux/platform_data/asoc-imx-ssi.h>1414+1515+EXPORT_SYMBOL(imx_ssi_fiq_tx_buffer);1616+EXPORT_SYMBOL(imx_ssi_fiq_rx_buffer);1717+EXPORT_SYMBOL(imx_ssi_fiq_start);1818+EXPORT_SYMBOL(imx_ssi_fiq_end);1919+EXPORT_SYMBOL(imx_ssi_fiq_base);2020+
+1-6
arch/arm/mach-imx/ssi-fiq.S
···8899#include <linux/linkage.h>1010#include <asm/assembler.h>1111-#include <asm/export.h>12111312/*1413 * r8 = bit 0-15: tx offset, bit 16-31: tx buffer size···144145 .word 0x0145146.L_imx_ssi_fiq_end:146147imx_ssi_fiq_end:147147-EXPORT_SYMBOL(imx_ssi_fiq_tx_buffer)148148-EXPORT_SYMBOL(imx_ssi_fiq_rx_buffer)149149-EXPORT_SYMBOL(imx_ssi_fiq_start)150150-EXPORT_SYMBOL(imx_ssi_fiq_end)151151-EXPORT_SYMBOL(imx_ssi_fiq_base)148148+
···9595CONFIG_NF_TABLES_NETDEV=m9696CONFIG_NFT_EXTHDR=m9797CONFIG_NFT_META=m9898+CONFIG_NFT_NUMGEN=m9899CONFIG_NFT_CT=m9999-CONFIG_NFT_RBTREE=m100100-CONFIG_NFT_HASH=m100100+CONFIG_NFT_SET_RBTREE=m101101+CONFIG_NFT_SET_HASH=m101102CONFIG_NFT_COUNTER=m102103CONFIG_NFT_LOG=m103104CONFIG_NFT_LIMIT=m···106105CONFIG_NFT_REDIR=m107106CONFIG_NFT_NAT=m108107CONFIG_NFT_QUEUE=m108108+CONFIG_NFT_QUOTA=m109109CONFIG_NFT_REJECT=m110110CONFIG_NFT_COMPAT=m111111+CONFIG_NFT_HASH=m111112CONFIG_NFT_DUP_NETDEV=m112113CONFIG_NFT_FWD_NETDEV=m113114CONFIG_NETFILTER_XT_SET=m···369366CONFIG_NETCONSOLE_DYNAMIC=y370367CONFIG_VETH=m371368# CONFIG_NET_VENDOR_3COM is not set369369+# CONFIG_NET_VENDOR_AMAZON is not set372370CONFIG_A2065=y373371CONFIG_ARIADNE=y374372# CONFIG_NET_VENDOR_ARC is not set
+6-2
arch/m68k/configs/apollo_defconfig
···9393CONFIG_NF_TABLES_NETDEV=m9494CONFIG_NFT_EXTHDR=m9595CONFIG_NFT_META=m9696+CONFIG_NFT_NUMGEN=m9697CONFIG_NFT_CT=m9797-CONFIG_NFT_RBTREE=m9898-CONFIG_NFT_HASH=m9898+CONFIG_NFT_SET_RBTREE=m9999+CONFIG_NFT_SET_HASH=m99100CONFIG_NFT_COUNTER=m100101CONFIG_NFT_LOG=m101102CONFIG_NFT_LIMIT=m···104103CONFIG_NFT_REDIR=m105104CONFIG_NFT_NAT=m106105CONFIG_NFT_QUEUE=m106106+CONFIG_NFT_QUOTA=m107107CONFIG_NFT_REJECT=m108108CONFIG_NFT_COMPAT=m109109+CONFIG_NFT_HASH=m109110CONFIG_NFT_DUP_NETDEV=m110111CONFIG_NFT_FWD_NETDEV=m111112CONFIG_NETFILTER_XT_SET=m···350347CONFIG_NETCONSOLE=m351348CONFIG_NETCONSOLE_DYNAMIC=y352349CONFIG_VETH=m350350+# CONFIG_NET_VENDOR_AMAZON is not set353351# CONFIG_NET_VENDOR_ARC is not set354352# CONFIG_NET_CADENCE is not set355353# CONFIG_NET_VENDOR_BROADCOM is not set
+6-2
arch/m68k/configs/atari_defconfig
···9393CONFIG_NF_TABLES_NETDEV=m9494CONFIG_NFT_EXTHDR=m9595CONFIG_NFT_META=m9696+CONFIG_NFT_NUMGEN=m9697CONFIG_NFT_CT=m9797-CONFIG_NFT_RBTREE=m9898-CONFIG_NFT_HASH=m9898+CONFIG_NFT_SET_RBTREE=m9999+CONFIG_NFT_SET_HASH=m99100CONFIG_NFT_COUNTER=m100101CONFIG_NFT_LOG=m101102CONFIG_NFT_LIMIT=m···104103CONFIG_NFT_REDIR=m105104CONFIG_NFT_NAT=m106105CONFIG_NFT_QUEUE=m106106+CONFIG_NFT_QUOTA=m107107CONFIG_NFT_REJECT=m108108CONFIG_NFT_COMPAT=m109109+CONFIG_NFT_HASH=m109110CONFIG_NFT_DUP_NETDEV=m110111CONFIG_NFT_FWD_NETDEV=m111112CONFIG_NETFILTER_XT_SET=m···359356CONFIG_NETCONSOLE=m360357CONFIG_NETCONSOLE_DYNAMIC=y361358CONFIG_VETH=m359359+# CONFIG_NET_VENDOR_AMAZON is not set362360CONFIG_ATARILANCE=y363361# CONFIG_NET_VENDOR_ARC is not set364362# CONFIG_NET_CADENCE is not set
+6-2
arch/m68k/configs/bvme6000_defconfig
···9191CONFIG_NF_TABLES_NETDEV=m9292CONFIG_NFT_EXTHDR=m9393CONFIG_NFT_META=m9494+CONFIG_NFT_NUMGEN=m9495CONFIG_NFT_CT=m9595-CONFIG_NFT_RBTREE=m9696-CONFIG_NFT_HASH=m9696+CONFIG_NFT_SET_RBTREE=m9797+CONFIG_NFT_SET_HASH=m9798CONFIG_NFT_COUNTER=m9899CONFIG_NFT_LOG=m99100CONFIG_NFT_LIMIT=m···102101CONFIG_NFT_REDIR=m103102CONFIG_NFT_NAT=m104103CONFIG_NFT_QUEUE=m104104+CONFIG_NFT_QUOTA=m105105CONFIG_NFT_REJECT=m106106CONFIG_NFT_COMPAT=m107107+CONFIG_NFT_HASH=m107108CONFIG_NFT_DUP_NETDEV=m108109CONFIG_NFT_FWD_NETDEV=m109110CONFIG_NETFILTER_XT_SET=m···349346CONFIG_NETCONSOLE=m350347CONFIG_NETCONSOLE_DYNAMIC=y351348CONFIG_VETH=m349349+# CONFIG_NET_VENDOR_AMAZON is not set352350# CONFIG_NET_VENDOR_ARC is not set353351# CONFIG_NET_CADENCE is not set354352# CONFIG_NET_VENDOR_BROADCOM is not set
+6-2
arch/m68k/configs/hp300_defconfig
···9393CONFIG_NF_TABLES_NETDEV=m9494CONFIG_NFT_EXTHDR=m9595CONFIG_NFT_META=m9696+CONFIG_NFT_NUMGEN=m9697CONFIG_NFT_CT=m9797-CONFIG_NFT_RBTREE=m9898-CONFIG_NFT_HASH=m9898+CONFIG_NFT_SET_RBTREE=m9999+CONFIG_NFT_SET_HASH=m99100CONFIG_NFT_COUNTER=m100101CONFIG_NFT_LOG=m101102CONFIG_NFT_LIMIT=m···104103CONFIG_NFT_REDIR=m105104CONFIG_NFT_NAT=m106105CONFIG_NFT_QUEUE=m106106+CONFIG_NFT_QUOTA=m107107CONFIG_NFT_REJECT=m108108CONFIG_NFT_COMPAT=m109109+CONFIG_NFT_HASH=m109110CONFIG_NFT_DUP_NETDEV=m110111CONFIG_NFT_FWD_NETDEV=m111112CONFIG_NETFILTER_XT_SET=m···350347CONFIG_NETCONSOLE=m351348CONFIG_NETCONSOLE_DYNAMIC=y352349CONFIG_VETH=m350350+# CONFIG_NET_VENDOR_AMAZON is not set353351CONFIG_HPLANCE=y354352# CONFIG_NET_VENDOR_ARC is not set355353# CONFIG_NET_CADENCE is not set
+6-2
arch/m68k/configs/mac_defconfig
···9292CONFIG_NF_TABLES_NETDEV=m9393CONFIG_NFT_EXTHDR=m9494CONFIG_NFT_META=m9595+CONFIG_NFT_NUMGEN=m9596CONFIG_NFT_CT=m9696-CONFIG_NFT_RBTREE=m9797-CONFIG_NFT_HASH=m9797+CONFIG_NFT_SET_RBTREE=m9898+CONFIG_NFT_SET_HASH=m9899CONFIG_NFT_COUNTER=m99100CONFIG_NFT_LOG=m100101CONFIG_NFT_LIMIT=m···103102CONFIG_NFT_REDIR=m104103CONFIG_NFT_NAT=m105104CONFIG_NFT_QUEUE=m105105+CONFIG_NFT_QUOTA=m106106CONFIG_NFT_REJECT=m107107CONFIG_NFT_COMPAT=m108108+CONFIG_NFT_HASH=m108109CONFIG_NFT_DUP_NETDEV=m109110CONFIG_NFT_FWD_NETDEV=m110111CONFIG_NETFILTER_XT_SET=m···366363CONFIG_NETCONSOLE=m367364CONFIG_NETCONSOLE_DYNAMIC=y368365CONFIG_VETH=m366366+# CONFIG_NET_VENDOR_AMAZON is not set369367CONFIG_MACMACE=y370368# CONFIG_NET_VENDOR_ARC is not set371369# CONFIG_NET_CADENCE is not set
+6-2
arch/m68k/configs/multi_defconfig
···102102CONFIG_NF_TABLES_NETDEV=m103103CONFIG_NFT_EXTHDR=m104104CONFIG_NFT_META=m105105+CONFIG_NFT_NUMGEN=m105106CONFIG_NFT_CT=m106106-CONFIG_NFT_RBTREE=m107107-CONFIG_NFT_HASH=m107107+CONFIG_NFT_SET_RBTREE=m108108+CONFIG_NFT_SET_HASH=m108109CONFIG_NFT_COUNTER=m109110CONFIG_NFT_LOG=m110111CONFIG_NFT_LIMIT=m···113112CONFIG_NFT_REDIR=m114113CONFIG_NFT_NAT=m115114CONFIG_NFT_QUEUE=m115115+CONFIG_NFT_QUOTA=m116116CONFIG_NFT_REJECT=m117117CONFIG_NFT_COMPAT=m118118+CONFIG_NFT_HASH=m118119CONFIG_NFT_DUP_NETDEV=m119120CONFIG_NFT_FWD_NETDEV=m120121CONFIG_NETFILTER_XT_SET=m···400397CONFIG_NETCONSOLE_DYNAMIC=y401398CONFIG_VETH=m402399# CONFIG_NET_VENDOR_3COM is not set400400+# CONFIG_NET_VENDOR_AMAZON is not set403401CONFIG_A2065=y404402CONFIG_ARIADNE=y405403CONFIG_ATARILANCE=y
+6-2
arch/m68k/configs/mvme147_defconfig
···9090CONFIG_NF_TABLES_NETDEV=m9191CONFIG_NFT_EXTHDR=m9292CONFIG_NFT_META=m9393+CONFIG_NFT_NUMGEN=m9394CONFIG_NFT_CT=m9494-CONFIG_NFT_RBTREE=m9595-CONFIG_NFT_HASH=m9595+CONFIG_NFT_SET_RBTREE=m9696+CONFIG_NFT_SET_HASH=m9697CONFIG_NFT_COUNTER=m9798CONFIG_NFT_LOG=m9899CONFIG_NFT_LIMIT=m···101100CONFIG_NFT_REDIR=m102101CONFIG_NFT_NAT=m103102CONFIG_NFT_QUEUE=m103103+CONFIG_NFT_QUOTA=m104104CONFIG_NFT_REJECT=m105105CONFIG_NFT_COMPAT=m106106+CONFIG_NFT_HASH=m106107CONFIG_NFT_DUP_NETDEV=m107108CONFIG_NFT_FWD_NETDEV=m108109CONFIG_NETFILTER_XT_SET=m···348345CONFIG_NETCONSOLE=m349346CONFIG_NETCONSOLE_DYNAMIC=y350347CONFIG_VETH=m348348+# CONFIG_NET_VENDOR_AMAZON is not set351349CONFIG_MVME147_NET=y352350# CONFIG_NET_VENDOR_ARC is not set353351# CONFIG_NET_CADENCE is not set
+6-2
arch/m68k/configs/mvme16x_defconfig
···9191CONFIG_NF_TABLES_NETDEV=m9292CONFIG_NFT_EXTHDR=m9393CONFIG_NFT_META=m9494+CONFIG_NFT_NUMGEN=m9495CONFIG_NFT_CT=m9595-CONFIG_NFT_RBTREE=m9696-CONFIG_NFT_HASH=m9696+CONFIG_NFT_SET_RBTREE=m9797+CONFIG_NFT_SET_HASH=m9798CONFIG_NFT_COUNTER=m9899CONFIG_NFT_LOG=m99100CONFIG_NFT_LIMIT=m···102101CONFIG_NFT_REDIR=m103102CONFIG_NFT_NAT=m104103CONFIG_NFT_QUEUE=m104104+CONFIG_NFT_QUOTA=m105105CONFIG_NFT_REJECT=m106106CONFIG_NFT_COMPAT=m107107+CONFIG_NFT_HASH=m107108CONFIG_NFT_DUP_NETDEV=m108109CONFIG_NFT_FWD_NETDEV=m109110CONFIG_NETFILTER_XT_SET=m···349346CONFIG_NETCONSOLE=m350347CONFIG_NETCONSOLE_DYNAMIC=y351348CONFIG_VETH=m349349+# CONFIG_NET_VENDOR_AMAZON is not set352350# CONFIG_NET_VENDOR_ARC is not set353351# CONFIG_NET_CADENCE is not set354352# CONFIG_NET_VENDOR_BROADCOM is not set
+6-2
arch/m68k/configs/q40_defconfig
···9191CONFIG_NF_TABLES_NETDEV=m9292CONFIG_NFT_EXTHDR=m9393CONFIG_NFT_META=m9494+CONFIG_NFT_NUMGEN=m9495CONFIG_NFT_CT=m9595-CONFIG_NFT_RBTREE=m9696-CONFIG_NFT_HASH=m9696+CONFIG_NFT_SET_RBTREE=m9797+CONFIG_NFT_SET_HASH=m9798CONFIG_NFT_COUNTER=m9899CONFIG_NFT_LOG=m99100CONFIG_NFT_LIMIT=m···102101CONFIG_NFT_REDIR=m103102CONFIG_NFT_NAT=m104103CONFIG_NFT_QUEUE=m104104+CONFIG_NFT_QUOTA=m105105CONFIG_NFT_REJECT=m106106CONFIG_NFT_COMPAT=m107107+CONFIG_NFT_HASH=m107108CONFIG_NFT_DUP_NETDEV=m108109CONFIG_NFT_FWD_NETDEV=m109110CONFIG_NETFILTER_XT_SET=m···356353CONFIG_NETCONSOLE_DYNAMIC=y357354CONFIG_VETH=m358355# CONFIG_NET_VENDOR_3COM is not set356356+# CONFIG_NET_VENDOR_AMAZON is not set359357# CONFIG_NET_VENDOR_AMD is not set360358# CONFIG_NET_VENDOR_ARC is not set361359# CONFIG_NET_CADENCE is not set
+6-2
arch/m68k/configs/sun3_defconfig
···8888CONFIG_NF_TABLES_NETDEV=m8989CONFIG_NFT_EXTHDR=m9090CONFIG_NFT_META=m9191+CONFIG_NFT_NUMGEN=m9192CONFIG_NFT_CT=m9292-CONFIG_NFT_RBTREE=m9393-CONFIG_NFT_HASH=m9393+CONFIG_NFT_SET_RBTREE=m9494+CONFIG_NFT_SET_HASH=m9495CONFIG_NFT_COUNTER=m9596CONFIG_NFT_LOG=m9697CONFIG_NFT_LIMIT=m···9998CONFIG_NFT_REDIR=m10099CONFIG_NFT_NAT=m101100CONFIG_NFT_QUEUE=m101101+CONFIG_NFT_QUOTA=m102102CONFIG_NFT_REJECT=m103103CONFIG_NFT_COMPAT=m104104+CONFIG_NFT_HASH=m104105CONFIG_NFT_DUP_NETDEV=m105106CONFIG_NFT_FWD_NETDEV=m106107CONFIG_NETFILTER_XT_SET=m···346343CONFIG_NETCONSOLE=m347344CONFIG_NETCONSOLE_DYNAMIC=y348345CONFIG_VETH=m346346+# CONFIG_NET_VENDOR_AMAZON is not set349347CONFIG_SUN3LANCE=y350348# CONFIG_NET_VENDOR_ARC is not set351349# CONFIG_NET_CADENCE is not set
+6-2
arch/m68k/configs/sun3x_defconfig
···8888CONFIG_NF_TABLES_NETDEV=m8989CONFIG_NFT_EXTHDR=m9090CONFIG_NFT_META=m9191+CONFIG_NFT_NUMGEN=m9192CONFIG_NFT_CT=m9292-CONFIG_NFT_RBTREE=m9393-CONFIG_NFT_HASH=m9393+CONFIG_NFT_SET_RBTREE=m9494+CONFIG_NFT_SET_HASH=m9495CONFIG_NFT_COUNTER=m9596CONFIG_NFT_LOG=m9697CONFIG_NFT_LIMIT=m···9998CONFIG_NFT_REDIR=m10099CONFIG_NFT_NAT=m101100CONFIG_NFT_QUEUE=m101101+CONFIG_NFT_QUOTA=m102102CONFIG_NFT_REJECT=m103103CONFIG_NFT_COMPAT=m104104+CONFIG_NFT_HASH=m104105CONFIG_NFT_DUP_NETDEV=m105106CONFIG_NFT_FWD_NETDEV=m106107CONFIG_NETFILTER_XT_SET=m···346343CONFIG_NETCONSOLE=m347344CONFIG_NETCONSOLE_DYNAMIC=y348345CONFIG_VETH=m346346+# CONFIG_NET_VENDOR_AMAZON is not set349347CONFIG_SUN3LANCE=y350348# CONFIG_NET_VENDOR_ARC is not set351349# CONFIG_NET_CADENCE is not set
···215215#endif216216217217/*218218+ * Wired register bits219219+ */220220+#define MIPSR6_WIRED_LIMIT (_ULCAST_(0xffff) << 16)221221+#define MIPSR6_WIRED_WIRED (_ULCAST_(0xffff) << 0)222222+223223+/*218224 * Values used for computation of new tlb entries219225 */220226#define PL_4K 12
+13
arch/mips/include/asm/tlb.h
···11#ifndef __ASM_TLB_H22#define __ASM_TLB_H3344+#include <asm/cpu-features.h>55+#include <asm/mipsregs.h>66+47/*58 * MIPS doesn't need any special per-pte or per-vma handling, except69 * we need to flush cache for area to be unmapped.···2421#define UNIQUE_ENTRYHI(idx) \2522 ((CKSEG0 + ((idx) << (PAGE_SHIFT + 1))) | \2623 (cpu_has_tlbinv ? MIPS_ENTRYHI_EHINV : 0))2424+2525+static inline unsigned int num_wired_entries(void)2626+{2727+ unsigned int wired = read_c0_wired();2828+2929+ if (cpu_has_mips_r6)3030+ wired &= MIPSR6_WIRED_WIRED;3131+3232+ return wired;3333+}27342835#include <asm-generic/tlb.h>2936
···334334 /* tell PDC we're Linux. Nevermind failure. */335335 pdc_stable_write(0x40, &osid, sizeof(osid));336336337337+ /* start with known state */338338+ flush_cache_all_local();339339+ flush_tlb_all_local(NULL);340340+337341 processor_init();338342#ifdef CONFIG_SMP339343 pr_info("CPU(s): %d out of %d %s at %d.%06d MHz online\n",
+11-46
arch/parisc/kernel/time.c
···1414#include <linux/module.h>1515#include <linux/rtc.h>1616#include <linux/sched.h>1717+#include <linux/sched_clock.h>1718#include <linux/kernel.h>1819#include <linux/param.h>1920#include <linux/string.h>···3938#include <linux/timex.h>40394140static unsigned long clocktick __read_mostly; /* timer cycles per tick */4242-4343-#ifndef CONFIG_64BIT4444-/*4545- * The processor-internal cycle counter (Control Register 16) is used as time4646- * source for the sched_clock() function. This register is 64bit wide on a4747- * 64-bit kernel and 32bit on a 32-bit kernel. Since sched_clock() always4848- * requires a 64bit counter we emulate on the 32-bit kernel the higher 32bits4949- * with a per-cpu variable which we increase every time the counter5050- * wraps-around (which happens every ~4 secounds).5151- */5252-static DEFINE_PER_CPU(unsigned long, cr16_high_32_bits);5353-#endif54415542/*5643 * We keep time on PA-RISC Linux by using the Interval Timer which is···109120 * Only bottom 32-bits of next_tick are writable in CR16!110121 */111122 mtctl(next_tick, 16);112112-113113-#if !defined(CONFIG_64BIT)114114- /* check for overflow on a 32bit kernel (every ~4 seconds). */115115- if (unlikely(next_tick < now))116116- this_cpu_inc(cr16_high_32_bits);117117-#endif118123119124 /* Skip one clocktick on purpose if we missed next_tick.120125 * The new CR16 must be "later" than current CR16 otherwise···191208192209/* clock source code */193210194194-static cycle_t read_cr16(struct clocksource *cs)211211+static cycle_t notrace read_cr16(struct clocksource *cs)195212{196213 return get_cycles();197214}···270287}271288272289273273-/*274274- * sched_clock() framework275275- */276276-277277-static u32 cyc2ns_mul __read_mostly;278278-static u32 cyc2ns_shift __read_mostly;279279-280280-u64 sched_clock(void)290290+static u64 notrace read_cr16_sched_clock(void)281291{282282- u64 now;283283-284284- /* Get current cycle counter (Control Register 16). */285285-#ifdef CONFIG_64BIT286286- now = mfctl(16);287287-#else288288- now = mfctl(16) + (((u64) this_cpu_read(cr16_high_32_bits)) << 32);289289-#endif290290-291291- /* return the value in ns (cycles_2_ns) */292292- return mul_u64_u32_shr(now, cyc2ns_mul, cyc2ns_shift);292292+ return get_cycles();293293}294294295295···282316283317void __init time_init(void)284318{285285- unsigned long current_cr16_khz;319319+ unsigned long cr16_hz;286320287287- current_cr16_khz = PAGE0->mem_10msec/10; /* kHz */288321 clocktick = (100 * PAGE0->mem_10msec) / HZ;289289-290290- /* calculate mult/shift values for cr16 */291291- clocks_calc_mult_shift(&cyc2ns_mul, &cyc2ns_shift, current_cr16_khz,292292- NSEC_PER_MSEC, 0);293293-294322 start_cpu_itimer(); /* get CPU 0 started */295323324324+ cr16_hz = 100 * PAGE0->mem_10msec; /* Hz */325325+296326 /* register at clocksource framework */297297- clocksource_register_khz(&clocksource_cr16, current_cr16_khz);327327+ clocksource_register_hz(&clocksource_cr16, cr16_hz);328328+329329+ /* register as sched_clock source */330330+ sched_clock_register(read_cr16_sched_clock, BITS_PER_LONG, cr16_hz);298331}
···12121313 .text14141515+ .globl opal_kentry1616+opal_kentry:1717+ /* r3 is the fdt ptr */1818+ mtctr r41919+ li r4, 02020+ li r5, 02121+ li r6, 02222+ li r7, 02323+ ld r11,opal@got(r2)2424+ ld r8,0(r11)2525+ ld r9,8(r11)2626+ bctr2727+1528#define OPAL_CALL(name, token) \1629 .globl name; \1730name: \
+12-1
arch/powerpc/boot/opal.c
···1313#include <libfdt.h>1414#include "../include/asm/opal-api.h"15151616-#ifdef __powerpc64__1616+#ifdef CONFIG_PPC64_BOOT_WRAPPER17171818/* Global OPAL struct used by opal-call.S */1919struct opal {···23232424static u32 opal_con_id;25252626+/* see opal-wrappers.S */2627int64_t opal_console_write(int64_t term_number, u64 *length, const u8 *buffer);2728int64_t opal_console_read(int64_t term_number, uint64_t *length, u8 *buffer);2829int64_t opal_console_write_buffer_space(uint64_t term_number, uint64_t *length);2930int64_t opal_console_flush(uint64_t term_number);3031int64_t opal_poll_events(uint64_t *outstanding_event_mask);31323333+void opal_kentry(unsigned long fdt_addr, void *vmlinux_addr);3434+3235static int opal_con_open(void)3336{3737+ /*3838+ * When OPAL loads the boot kernel it stashes the OPAL base and entry3939+ * address in r8 and r9 so the kernel can use the OPAL console4040+ * before unflattening the devicetree. While executing the wrapper will4141+ * probably trash r8 and r9 so this kentry hook restores them before4242+ * entering the decompressed kernel.4343+ */4444+ platform_ops.kentry = opal_kentry;3445 return 0;3546}3647
+1
arch/powerpc/boot/ops.h
···3030 void * (*realloc)(void *ptr, unsigned long size);3131 void (*exit)(void);3232 void * (*vmlinux_alloc)(unsigned long size);3333+ void (*kentry)(unsigned long fdt_addr, void *vmlinux_addr);3334};3435extern struct platform_ops platform_ops;3536
···2929 */30303131/*3232+ * Kernel read only support.3333+ * We added the ppp value 0b110 in ISA 2.04.3434+ */3535+#define MMU_FTR_KERNEL_RO ASM_CONST(0x00004000)3636+3737+/*3238 * We need to clear top 16bits of va (from the remaining 64 bits )in3339 * tlbie* instructions3440 */···109103#define MMU_FTRS_POWER4 MMU_FTRS_DEFAULT_HPTE_ARCH_V2110104#define MMU_FTRS_PPC970 MMU_FTRS_POWER4 | MMU_FTR_TLBIE_CROP_VA111105#define MMU_FTRS_POWER5 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE112112-#define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE113113-#define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE114114-#define MMU_FTRS_POWER8 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE115115-#define MMU_FTRS_POWER9 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE106106+#define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO107107+#define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO108108+#define MMU_FTRS_POWER8 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO109109+#define MMU_FTRS_POWER9 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO116110#define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \117111 MMU_FTR_CI_LARGE_PAGE118112#define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
+1
arch/powerpc/include/asm/reg.h
···355355#define LPCR_PECE0 ASM_CONST(0x0000000000004000) /* ext. exceptions can cause exit */356356#define LPCR_PECE1 ASM_CONST(0x0000000000002000) /* decrementer can cause exit */357357#define LPCR_PECE2 ASM_CONST(0x0000000000001000) /* machine check etc can cause exit */358358+#define LPCR_PECE_HVEE ASM_CONST(0x0000400000000000) /* P9 Wakeup on HV interrupts */358359#define LPCR_MER ASM_CONST(0x0000000000000800) /* Mediated External Exception */359360#define LPCR_MER_SH 11360361#define LPCR_TC ASM_CONST(0x0000000000000200) /* Translation control */
+4-4
arch/powerpc/kernel/cpu_setup_power.S
···9898 li r0,09999 mtspr SPRN_LPID,r0100100 mfspr r3,SPRN_LPCR101101- ori r3, r3, LPCR_PECEDH102102- ori r3, r3, LPCR_HVICE101101+ LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE)102102+ or r3, r3, r4103103 bl __init_LPCR104104 bl __init_HFSCR105105 bl __init_tlb_power9···118118 li r0,0119119 mtspr SPRN_LPID,r0120120 mfspr r3,SPRN_LPCR121121- ori r3, r3, LPCR_PECEDH122122- ori r3, r3, LPCR_HVICE121121+ LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE)122122+ or r3, r3, r4123123 bl __init_LPCR124124 bl __init_HFSCR125125 bl __init_tlb_power9
+3-1
arch/powerpc/kernel/eeh_driver.c
···671671672672 /* Clear frozen state */673673 rc = eeh_clear_pe_frozen_state(pe, false);674674- if (rc)674674+ if (rc) {675675+ pci_unlock_rescan_remove();675676 return rc;677677+ }676678677679 /* Give the system 5 seconds to finish running the user-space678680 * hotplug shutdown scripts, e.g. ifdown for ethernet. Yes,
+9
arch/powerpc/kernel/vmlinux.lds.S
···9494 * detected, and will result in a crash at boot due to offsets being9595 * wrong.9696 */9797+#ifdef CONFIG_PPC649898+ /*9999+ * BLOCK(0) overrides the default output section alignment because100100+ * this needs to start right after .head.text in order for fixed101101+ * section placement to work.102102+ */103103+ .text BLOCK(0) : AT(ADDR(.text) - LOAD_OFFSET) {104104+#else97105 .text : AT(ADDR(.text) - LOAD_OFFSET) {98106 ALIGN_FUNCTION();107107+#endif99108 /* careful! __ftr_alt_* sections need to be close to .text */100109 *(.text .fixup __ftr_alt_* .ref.text)101110 SCHED_TEXT
+1-1
arch/powerpc/mm/hash64_4k.c
···5555 */5656 rflags = htab_convert_pte_flags(new_pte);57575858- if (!cpu_has_feature(CPU_FTR_NOEXECUTE) &&5858+ if (cpu_has_feature(CPU_FTR_NOEXECUTE) &&5959 !cpu_has_feature(CPU_FTR_COHERENT_ICACHE))6060 rflags = hash_page_do_lazy_icache(rflags, __pte(old_pte), trap);6161
+2-2
arch/powerpc/mm/hash64_64k.c
···8787 subpg_pte = new_pte & ~subpg_prot;8888 rflags = htab_convert_pte_flags(subpg_pte);89899090- if (!cpu_has_feature(CPU_FTR_NOEXECUTE) &&9090+ if (cpu_has_feature(CPU_FTR_NOEXECUTE) &&9191 !cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) {92929393 /*···258258259259 rflags = htab_convert_pte_flags(new_pte);260260261261- if (!cpu_has_feature(CPU_FTR_NOEXECUTE) &&261261+ if (cpu_has_feature(CPU_FTR_NOEXECUTE) &&262262 !cpu_has_feature(CPU_FTR_COHERENT_ICACHE))263263 rflags = hash_page_do_lazy_icache(rflags, __pte(old_pte), trap);264264
+6-2
arch/powerpc/mm/hash_utils_64.c
···193193 /*194194 * Kernel read only mapped with ppp bits 0b110195195 */196196- if (!(pteflags & _PAGE_WRITE))197197- rflags |= (HPTE_R_PP0 | 0x2);196196+ if (!(pteflags & _PAGE_WRITE)) {197197+ if (mmu_has_feature(MMU_FTR_KERNEL_RO))198198+ rflags |= (HPTE_R_PP0 | 0x2);199199+ else200200+ rflags |= 0x3;201201+ }198202 } else {199203 if (pteflags & _PAGE_RWX)200204 rflags |= 0x2;
+1-1
arch/x86/events/core.c
···6969 int shift = 64 - x86_pmu.cntval_bits;7070 u64 prev_raw_count, new_raw_count;7171 int idx = hwc->idx;7272- s64 delta;7272+ u64 delta;73737474 if (idx == INTEL_PMC_IDX_FIXED_BTS)7575 return 0;
+1-1
arch/x86/events/intel/core.c
···4034403440354035 /* Support full width counters using alternative MSR range */40364036 if (x86_pmu.intel_cap.full_width_write) {40374037- x86_pmu.max_period = x86_pmu.cntval_mask;40374037+ x86_pmu.max_period = x86_pmu.cntval_mask >> 1;40384038 x86_pmu.perfctr = MSR_IA32_PMC0;40394039 pr_cont("full-width counters, ");40404040 }
···42424343struct dest_map {4444 /* vcpu bitmap where IRQ has been sent */4545- DECLARE_BITMAP(map, KVM_MAX_VCPUS);4545+ DECLARE_BITMAP(map, KVM_MAX_VCPU_ID);46464747 /*4848 * Vector sent to a given vcpu, only valid when4949 * the vcpu's bit in map is set5050 */5151- u8 vectors[KVM_MAX_VCPUS];5151+ u8 vectors[KVM_MAX_VCPU_ID];5252};53535454
+13
arch/x86/kvm/irq_comm.c
···4141 bool line_status)4242{4343 struct kvm_pic *pic = pic_irqchip(kvm);4444+4545+ /*4646+ * XXX: rejecting pic routes when pic isn't in use would be better,4747+ * but the default routing table is installed while kvm->arch.vpic is4848+ * NULL and KVM_CREATE_IRQCHIP can race with KVM_IRQ_LINE.4949+ */5050+ if (!pic)5151+ return -1;5252+4453 return kvm_pic_set_irq(pic, e->irqchip.pin, irq_source_id, level);4554}4655···5849 bool line_status)5950{6051 struct kvm_ioapic *ioapic = kvm->arch.vioapic;5252+5353+ if (!ioapic)5454+ return -1;5555+6156 return kvm_ioapic_set_irq(ioapic, e->irqchip.pin, irq_source_id, level,6257 line_status);6358}
···8181{8282 unsigned as = crypto_aead_authsize(crypto_aead_reqtfm(&ctx->aead_req));83838484- return ctx->used >= ctx->aead_assoclen + as;8484+ /*8585+ * The minimum amount of memory needed for an AEAD cipher is8686+ * the AAD and in case of decryption the tag.8787+ */8888+ return ctx->used >= ctx->aead_assoclen + (ctx->enc ? 0 : as);8589}86908791static void aead_reset_ctx(struct aead_ctx *ctx)···420416 unsigned int i, reqlen = GET_REQ_SIZE(tfm);421417 int err = -ENOMEM;422418 unsigned long used;423423- size_t outlen;419419+ size_t outlen = 0;424420 size_t usedpages = 0;425421426422 lock_sock(sk);···430426 goto unlock;431427 }432428433433- used = ctx->used;434434- outlen = used;435435-436429 if (!aead_sufficient_data(ctx))437430 goto unlock;431431+432432+ used = ctx->used;433433+ if (ctx->enc)434434+ outlen = used + as;435435+ else436436+ outlen = used - as;438437439438 req = sock_kmalloc(sk, reqlen, GFP_KERNEL);440439 if (unlikely(!req))···452445 aead_request_set_ad(req, ctx->aead_assoclen);453446 aead_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,454447 aead_async_cb, sk);455455- used -= ctx->aead_assoclen + (ctx->enc ? as : 0);448448+ used -= ctx->aead_assoclen;456449457450 /* take over all tx sgls from ctx */458451 areq->tsgl = sock_kmalloc(sk, sizeof(*areq->tsgl) * sgl->cur,···468461 areq->tsgls = sgl->cur;469462470463 /* create rx sgls */471471- while (iov_iter_count(&msg->msg_iter)) {464464+ while (outlen > usedpages && iov_iter_count(&msg->msg_iter)) {472465 size_t seglen = min_t(size_t, iov_iter_count(&msg->msg_iter),473466 (outlen - usedpages));474467···498491499492 last_rsgl = rsgl;500493501501- /* we do not need more iovecs as we have sufficient memory */502502- if (outlen <= usedpages)503503- break;504504-505494 iov_iter_advance(&msg->msg_iter, err);506495 }507507- err = -EINVAL;496496+508497 /* ensure output buffer is sufficiently large */509509- if (usedpages < outlen)510510- goto free;498498+ if (usedpages < outlen) {499499+ err = -EINVAL;500500+ goto unlock;501501+ }511502512503 aead_request_set_crypt(req, areq->tsgl, areq->first_rsgl.sgl.sg, used,513504 areq->iv);···576571 goto unlock;577572 }578573574574+ /* data length provided by caller via sendmsg/sendpage */579575 used = ctx->used;580576581577 /*···591585 if (!aead_sufficient_data(ctx))592586 goto unlock;593587594594- outlen = used;588588+ /*589589+ * Calculate the minimum output buffer size holding the result of the590590+ * cipher operation. When encrypting data, the receiving buffer is591591+ * larger by the tag length compared to the input buffer as the592592+ * encryption operation generates the tag. For decryption, the input593593+ * buffer provides the tag which is consumed resulting in only the594594+ * plaintext without a buffer for the tag returned to the caller.595595+ */596596+ if (ctx->enc)597597+ outlen = used + as;598598+ else599599+ outlen = used - as;595600596601 /*597602 * The cipher operation input data is reduced by the associated data598603 * length as this data is processed separately later on.599604 */600600- used -= ctx->aead_assoclen + (ctx->enc ? as : 0);605605+ used -= ctx->aead_assoclen;601606602607 /* convert iovecs of output buffers into scatterlists */603603- while (iov_iter_count(&msg->msg_iter)) {608608+ while (outlen > usedpages && iov_iter_count(&msg->msg_iter)) {604609 size_t seglen = min_t(size_t, iov_iter_count(&msg->msg_iter),605610 (outlen - usedpages));606611···638621639622 last_rsgl = rsgl;640623641641- /* we do not need more iovecs as we have sufficient memory */642642- if (outlen <= usedpages)643643- break;644624 iov_iter_advance(&msg->msg_iter, err);645625 }646626647647- err = -EINVAL;648627 /* ensure output buffer is sufficiently large */649649- if (usedpages < outlen)628628+ if (usedpages < outlen) {629629+ err = -EINVAL;650630 goto unlock;631631+ }651632652633 sg_mark_end(sgl->sg + sgl->cur - 1);653634 aead_request_set_crypt(&ctx->aead_req, sgl->sg, ctx->first_rsgl.sgl.sg,
···4747 }4848}49495050-static void acpi_sleep_pts_switch(u32 acpi_state)5151-{5252- acpi_status status;5353-5454- status = acpi_execute_simple_method(NULL, "\\_PTS", acpi_state);5555- if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {5656- /*5757- * OS can't evaluate the _PTS object correctly. Some warning5858- * message will be printed. But it won't break anything.5959- */6060- printk(KERN_NOTICE "Failure in evaluating _PTS object\n");6161- }6262-}6363-6464-static int sleep_notify_reboot(struct notifier_block *this,5050+static int tts_notify_reboot(struct notifier_block *this,6551 unsigned long code, void *x)6652{6753 acpi_sleep_tts_switch(ACPI_STATE_S5);6868-6969- acpi_sleep_pts_switch(ACPI_STATE_S5);7070-7154 return NOTIFY_DONE;7255}73567474-static struct notifier_block sleep_notifier = {7575- .notifier_call = sleep_notify_reboot,5757+static struct notifier_block tts_notifier = {5858+ .notifier_call = tts_notify_reboot,7659 .next = NULL,7760 .priority = 0,7861};···899916 pr_info(PREFIX "(supports%s)\n", supported);900917901918 /*902902- * Register the sleep_notifier to reboot notifier list so that the _TTS903903- * and _PTS object can also be evaluated when the system enters S5.919919+ * Register the tts_notifier to reboot notifier list so that the _TTS920920+ * object can also be evaluated when the system enters S5.904921 */905905- register_reboot_notifier(&sleep_notifier);922922+ register_reboot_notifier(&tts_notifier);906923 return 0;907924}
-7
drivers/ata/ahci.c
···14361436 "ahci: MRSM is on, fallback to single MSI\n");14371437 pci_free_irq_vectors(pdev);14381438 }14391439-14401440- /*14411441- * -ENOSPC indicated we don't have enough vectors. Don't bother14421442- * trying a single vectors for any other error:14431443- */14441444- if (nvec < 0 && nvec != -ENOSPC)14451445- return nvec;14461439 }1447144014481441 /*
+2-1
drivers/ata/libata-scsi.c
···10881088 desc[1] = tf->command; /* status */10891089 desc[2] = tf->device;10901090 desc[3] = tf->nsect;10911091- desc[0] = 0;10911091+ desc[7] = 0;10921092 if (tf->flags & ATA_TFLAG_LBA48) {10931093 desc[8] |= 0x80;10941094 if (tf->hob_nsect)···11591159{11601160 sdev->use_10_for_rw = 1;11611161 sdev->use_10_for_ms = 1;11621162+ sdev->no_write_same = 1;1162116311631164 /* Schedule policy is determined by ->qc_defer() callback and11641165 * it needs to see every deferred qc. Set dev_blocked to 1 to
···14031403 zram = idr_find(&zram_index_idr, dev_id);14041404 if (zram) {14051405 ret = zram_remove(zram);14061406- idr_remove(&zram_index_idr, dev_id);14061406+ if (!ret)14071407+ idr_remove(&zram_index_idr, dev_id);14071408 } else {14081409 ret = -ENODEV;14091410 }···14131412 return ret ? ret : count;14141413}1415141414151415+/*14161416+ * NOTE: hot_add attribute is not the usual read-only sysfs attribute. In a14171417+ * sense that reading from this file does alter the state of your system -- it14181418+ * creates a new un-initialized zram device and returns back this device's14191419+ * device_id (or an error code if it fails to create a new device).14201420+ */14161421static struct class_attribute zram_control_class_attrs[] = {14171417- __ATTR_RO(hot_add),14221422+ __ATTR(hot_add, 0400, hot_add_show, NULL),14181423 __ATTR_WO(hot_remove),14191424 __ATTR_NULL,14201425};
+1-1
drivers/clk/bcm/Kconfig
···20202121config COMMON_CLK_IPROC2222 bool "Broadcom iProc clock support"2323- depends on ARCH_BCM_IPROC || COMPILE_TEST2323+ depends on ARCH_BCM_IPROC || ARCH_BCM_63XX || COMPILE_TEST2424 depends on COMMON_CLK2525 default ARCH_BCM_IPROC2626 help
···479479static void480480amdgpu_pci_shutdown(struct pci_dev *pdev)481481{482482+ struct drm_device *dev = pci_get_drvdata(pdev);483483+ struct amdgpu_device *adev = dev->dev_private;484484+482485 /* if we are running in a VM, make sure the device483486 * torn down properly on reboot/shutdown.484487 * unfortunately we can't detect certain485488 * hypervisors so just do this all the time.486489 */487487- amdgpu_pci_remove(pdev);490490+ amdgpu_suspend(adev);488491}489492490493static int amdgpu_pmops_suspend(struct device *dev)
···254254 req->value = dev->mode_config.async_page_flip;255255 break;256256 case DRM_CAP_PAGE_FLIP_TARGET:257257- req->value = 1;258258- drm_for_each_crtc(crtc, dev) {259259- if (!crtc->funcs->page_flip_target)260260- req->value = 0;257257+ if (drm_core_check_feature(dev, DRIVER_MODESET)) {258258+ req->value = 1;259259+ drm_for_each_crtc(crtc, dev) {260260+ if (!crtc->funcs->page_flip_target)261261+ req->value = 0;262262+ }261263 }262264 break;263265 case DRM_CAP_CURSOR_WIDTH:
+5
drivers/gpu/drm/exynos/exynos_hdmi.c
···19071907err_hdmiphy:19081908 if (hdata->hdmiphy_port)19091909 put_device(&hdata->hdmiphy_port->dev);19101910+ if (hdata->regs_hdmiphy)19111911+ iounmap(hdata->regs_hdmiphy);19101912err_ddc:19111913 put_device(&hdata->ddc_adpt->dev);19121914···1930192819311929 if (hdata->hdmiphy_port)19321930 put_device(&hdata->hdmiphy_port->dev);19311931+19321932+ if (hdata->regs_hdmiphy)19331933+ iounmap(hdata->regs_hdmiphy);1933193419341935 put_device(&hdata->ddc_adpt->dev);19351936
···34343535static struct radeon_atpx_priv {3636 bool atpx_detected;3737+ bool bridge_pm_usable;3738 /* handle for device - and atpx */3839 acpi_handle dhandle;3940 struct radeon_atpx atpx;···204203 atpx->is_hybrid = false;205204 if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) {206205 printk("ATPX Hybrid Graphics\n");207207- atpx->functions.power_cntl = false;206206+ /*207207+ * Disable legacy PM methods only when pcie port PM is usable,208208+ * otherwise the device might fail to power off or power on.209209+ */210210+ atpx->functions.power_cntl = !radeon_atpx_priv.bridge_pm_usable;208211 atpx->is_hybrid = true;209212 }210213···553548 struct pci_dev *pdev = NULL;554549 bool has_atpx = false;555550 int vga_count = 0;551551+ bool d3_supported = false;552552+ struct pci_dev *parent_pdev;556553557554 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {558555 vga_count++;559556560557 has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);558558+559559+ parent_pdev = pci_upstream_bridge(pdev);560560+ d3_supported |= parent_pdev && parent_pdev->bridge_d3;561561 }562562563563 /* some newer PX laptops mark the dGPU as a non-VGA display device */···570560 vga_count++;571561572562 has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);563563+564564+ parent_pdev = pci_upstream_bridge(pdev);565565+ d3_supported |= parent_pdev && parent_pdev->bridge_d3;573566 }574567575568 if (has_atpx && vga_count == 2) {···580567 printk(KERN_INFO "vga_switcheroo: detected switching method %s handle\n",581568 acpi_method_name);582569 radeon_atpx_priv.atpx_detected = true;570570+ radeon_atpx_priv.bridge_pm_usable = d3_supported;583571 radeon_atpx_init();584572 return true;585573 }
+79-36
drivers/hid/hid-cp2112.c
···3232#include <linux/usb/ch9.h>3333#include "hid-ids.h"34343535+#define CP2112_REPORT_MAX_LENGTH 643636+#define CP2112_GPIO_CONFIG_LENGTH 53737+#define CP2112_GPIO_GET_LENGTH 23838+#define CP2112_GPIO_SET_LENGTH 33939+3540enum {3641 CP2112_GPIO_CONFIG = 0x02,3742 CP2112_GPIO_GET = 0x03,···166161 atomic_t read_avail;167162 atomic_t xfer_avail;168163 struct gpio_chip gc;164164+ u8 *in_out_buffer;165165+ spinlock_t lock;169166};170167171168static int gpio_push_pull = 0xFF;···178171{179172 struct cp2112_device *dev = gpiochip_get_data(chip);180173 struct hid_device *hdev = dev->hdev;181181- u8 buf[5];174174+ u8 *buf = dev->in_out_buffer;175175+ unsigned long flags;182176 int ret;183177178178+ spin_lock_irqsave(&dev->lock, flags);179179+184180 ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf,185185- sizeof(buf), HID_FEATURE_REPORT,186186- HID_REQ_GET_REPORT);187187- if (ret != sizeof(buf)) {181181+ CP2112_GPIO_CONFIG_LENGTH, HID_FEATURE_REPORT,182182+ HID_REQ_GET_REPORT);183183+ if (ret != CP2112_GPIO_CONFIG_LENGTH) {188184 hid_err(hdev, "error requesting GPIO config: %d\n", ret);189189- return ret;185185+ goto exit;190186 }191187192188 buf[1] &= ~(1 << offset);193189 buf[2] = gpio_push_pull;194190195195- ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, sizeof(buf),196196- HID_FEATURE_REPORT, HID_REQ_SET_REPORT);191191+ ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf,192192+ CP2112_GPIO_CONFIG_LENGTH, HID_FEATURE_REPORT,193193+ HID_REQ_SET_REPORT);197194 if (ret < 0) {198195 hid_err(hdev, "error setting GPIO config: %d\n", ret);199199- return ret;196196+ goto exit;200197 }201198202202- return 0;199199+ ret = 0;200200+201201+exit:202202+ spin_unlock_irqrestore(&dev->lock, flags);203203+ return ret <= 0 ? ret : -EIO;203204}204205205206static void cp2112_gpio_set(struct gpio_chip *chip, unsigned offset, int value)206207{207208 struct cp2112_device *dev = gpiochip_get_data(chip);208209 struct hid_device *hdev = dev->hdev;209209- u8 buf[3];210210+ u8 *buf = dev->in_out_buffer;211211+ unsigned long flags;210212 int ret;213213+214214+ spin_lock_irqsave(&dev->lock, flags);211215212216 buf[0] = CP2112_GPIO_SET;213217 buf[1] = value ? 0xff : 0;214218 buf[2] = 1 << offset;215219216216- ret = hid_hw_raw_request(hdev, CP2112_GPIO_SET, buf, sizeof(buf),217217- HID_FEATURE_REPORT, HID_REQ_SET_REPORT);220220+ ret = hid_hw_raw_request(hdev, CP2112_GPIO_SET, buf,221221+ CP2112_GPIO_SET_LENGTH, HID_FEATURE_REPORT,222222+ HID_REQ_SET_REPORT);218223 if (ret < 0)219224 hid_err(hdev, "error setting GPIO values: %d\n", ret);225225+226226+ spin_unlock_irqrestore(&dev->lock, flags);220227}221228222229static int cp2112_gpio_get(struct gpio_chip *chip, unsigned offset)223230{224231 struct cp2112_device *dev = gpiochip_get_data(chip);225232 struct hid_device *hdev = dev->hdev;226226- u8 buf[2];233233+ u8 *buf = dev->in_out_buffer;234234+ unsigned long flags;227235 int ret;228236229229- ret = hid_hw_raw_request(hdev, CP2112_GPIO_GET, buf, sizeof(buf),230230- HID_FEATURE_REPORT, HID_REQ_GET_REPORT);231231- if (ret != sizeof(buf)) {237237+ spin_lock_irqsave(&dev->lock, flags);238238+239239+ ret = hid_hw_raw_request(hdev, CP2112_GPIO_GET, buf,240240+ CP2112_GPIO_GET_LENGTH, HID_FEATURE_REPORT,241241+ HID_REQ_GET_REPORT);242242+ if (ret != CP2112_GPIO_GET_LENGTH) {232243 hid_err(hdev, "error requesting GPIO values: %d\n", ret);233233- return ret;244244+ ret = ret < 0 ? ret : -EIO;245245+ goto exit;234246 }235247236236- return (buf[1] >> offset) & 1;248248+ ret = (buf[1] >> offset) & 1;249249+250250+exit:251251+ spin_unlock_irqrestore(&dev->lock, flags);252252+253253+ return ret;237254}238255239256static int cp2112_gpio_direction_output(struct gpio_chip *chip,···265234{266235 struct cp2112_device *dev = gpiochip_get_data(chip);267236 struct hid_device *hdev = dev->hdev;268268- u8 buf[5];237237+ u8 *buf = dev->in_out_buffer;238238+ unsigned long flags;269239 int ret;270240241241+ spin_lock_irqsave(&dev->lock, flags);242242+271243 ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf,272272- sizeof(buf), HID_FEATURE_REPORT,273273- HID_REQ_GET_REPORT);274274- if (ret != sizeof(buf)) {244244+ CP2112_GPIO_CONFIG_LENGTH, HID_FEATURE_REPORT,245245+ HID_REQ_GET_REPORT);246246+ if (ret != CP2112_GPIO_CONFIG_LENGTH) {275247 hid_err(hdev, "error requesting GPIO config: %d\n", ret);276276- return ret;248248+ goto fail;277249 }278250279251 buf[1] |= 1 << offset;280252 buf[2] = gpio_push_pull;281253282282- ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, sizeof(buf),283283- HID_FEATURE_REPORT, HID_REQ_SET_REPORT);254254+ ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf,255255+ CP2112_GPIO_CONFIG_LENGTH, HID_FEATURE_REPORT,256256+ HID_REQ_SET_REPORT);284257 if (ret < 0) {285258 hid_err(hdev, "error setting GPIO config: %d\n", ret);286286- return ret;259259+ goto fail;287260 }261261+262262+ spin_unlock_irqrestore(&dev->lock, flags);288263289264 /*290265 * Set gpio value when output direction is already set,···299262 cp2112_gpio_set(chip, offset, value);300263301264 return 0;265265+266266+fail:267267+ spin_unlock_irqrestore(&dev->lock, flags);268268+ return ret < 0 ? ret : -EIO;302269}303270304271static int cp2112_hid_get(struct hid_device *hdev, unsigned char report_number,···10481007 struct cp2112_smbus_config_report config;10491008 int ret;1050100910101010+ dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL);10111011+ if (!dev)10121012+ return -ENOMEM;10131013+10141014+ dev->in_out_buffer = devm_kzalloc(&hdev->dev, CP2112_REPORT_MAX_LENGTH,10151015+ GFP_KERNEL);10161016+ if (!dev->in_out_buffer)10171017+ return -ENOMEM;10181018+10191019+ spin_lock_init(&dev->lock);10201020+10511021 ret = hid_parse(hdev);10521022 if (ret) {10531023 hid_err(hdev, "parse failed\n");···11151063 goto err_power_normal;11161064 }1117106511181118- dev = kzalloc(sizeof(*dev), GFP_KERNEL);11191119- if (!dev) {11201120- ret = -ENOMEM;11211121- goto err_power_normal;11221122- }11231123-11241066 hid_set_drvdata(hdev, (void *)dev);11251067 dev->hdev = hdev;11261068 dev->adap.owner = THIS_MODULE;···1133108711341088 if (ret) {11351089 hid_err(hdev, "error registering i2c adapter\n");11361136- goto err_free_dev;10901090+ goto err_power_normal;11371091 }1138109211391093 hid_dbg(hdev, "adapter registered\n");···11691123 gpiochip_remove(&dev->gc);11701124err_free_i2c:11711125 i2c_del_adapter(&dev->adap);11721172-err_free_dev:11731173- kfree(dev);11741126err_power_normal:11751127 hid_hw_power(hdev, PM_HINT_NORMAL);11761128err_hid_close:···11931149 */11941150 hid_hw_close(hdev);11951151 hid_hw_stop(hdev);11961196- kfree(dev);11971152}1198115311991154static int cp2112_raw_event(struct hid_device *hdev, struct hid_report *report,
+10-4
drivers/hid/hid-lg.c
···756756757757 /* Setup wireless link with Logitech Wii wheel */758758 if (hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) {759759- unsigned char buf[] = { 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };759759+ const unsigned char cbuf[] = { 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };760760+ u8 *buf = kmemdup(cbuf, sizeof(cbuf), GFP_KERNEL);760761761761- ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf),762762+ if (!buf) {763763+ ret = -ENOMEM;764764+ goto err_free;765765+ }766766+767767+ ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(cbuf),762768 HID_FEATURE_REPORT, HID_REQ_SET_REPORT);763763-764769 if (ret >= 0) {765770 /* insert a little delay of 10 jiffies ~ 40ms */766771 wait_queue_head_t wait;···777772 buf[1] = 0xB2;778773 get_random_bytes(&buf[2], 2);779774780780- ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf),775775+ ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(cbuf),781776 HID_FEATURE_REPORT, HID_REQ_SET_REPORT);782777 }778778+ kfree(buf);783779 }784780785781 if (drv_data->quirks & LG_FF)
+10-2
drivers/hid/hid-magicmouse.c
···493493static int magicmouse_probe(struct hid_device *hdev,494494 const struct hid_device_id *id)495495{496496- __u8 feature[] = { 0xd7, 0x01 };496496+ const u8 feature[] = { 0xd7, 0x01 };497497+ u8 *buf;497498 struct magicmouse_sc *msc;498499 struct hid_report *report;499500 int ret;···545544 }546545 report->size = 6;547546547547+ buf = kmemdup(feature, sizeof(feature), GFP_KERNEL);548548+ if (!buf) {549549+ ret = -ENOMEM;550550+ goto err_stop_hw;551551+ }552552+548553 /*549554 * Some devices repond with 'invalid report id' when feature550555 * report switching it into multitouch mode is sent to it.···559552 * but there seems to be no other way of switching the mode.560553 * Thus the super-ugly hacky success check below.561554 */562562- ret = hid_hw_raw_request(hdev, feature[0], feature, sizeof(feature),555555+ ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(feature),563556 HID_FEATURE_REPORT, HID_REQ_SET_REPORT);557557+ kfree(buf);564558 if (ret != -EIO && ret != sizeof(feature)) {565559 hid_err(hdev, "unable to request touch data (%d)\n", ret);566560 goto err_stop_hw;
+8-2
drivers/hid/hid-rmi.c
···188188static int rmi_set_mode(struct hid_device *hdev, u8 mode)189189{190190 int ret;191191- u8 txbuf[2] = {RMI_SET_RMI_MODE_REPORT_ID, mode};191191+ const u8 txbuf[2] = {RMI_SET_RMI_MODE_REPORT_ID, mode};192192+ u8 *buf;192193193193- ret = hid_hw_raw_request(hdev, RMI_SET_RMI_MODE_REPORT_ID, txbuf,194194+ buf = kmemdup(txbuf, sizeof(txbuf), GFP_KERNEL);195195+ if (!buf)196196+ return -ENOMEM;197197+198198+ ret = hid_hw_raw_request(hdev, RMI_SET_RMI_MODE_REPORT_ID, buf,194199 sizeof(txbuf), HID_FEATURE_REPORT, HID_REQ_SET_REPORT);200200+ kfree(buf);195201 if (ret < 0) {196202 dev_err(&hdev->dev, "unable to set rmi mode to %d (%d)\n", mode,197203 ret);
+1
drivers/hid/hid-sensor-hub.c
···212212 __s32 value;213213 int ret = 0;214214215215+ memset(buffer, 0, buffer_size);215216 mutex_lock(&data->mutex);216217 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);217218 if (!report || (field_index >= report->maxfield)) {
+25-39
drivers/i2c/busses/i2c-designware-core.c
···9191 DW_IC_INTR_TX_ABRT | \9292 DW_IC_INTR_STOP_DET)93939494-#define DW_IC_STATUS_ACTIVITY 0x19595-#define DW_IC_STATUS_TFE BIT(2)9696-#define DW_IC_STATUS_MST_ACTIVITY BIT(5)9494+#define DW_IC_STATUS_ACTIVITY 0x197959896#define DW_IC_SDA_HOLD_RX_SHIFT 169997#define DW_IC_SDA_HOLD_RX_MASK GENMASK(23, DW_IC_SDA_HOLD_RX_SHIFT)···476478{477479 struct i2c_msg *msgs = dev->msgs;478480 u32 ic_tar = 0;479479- bool enabled;480481481481- enabled = dw_readl(dev, DW_IC_ENABLE_STATUS) & 1;482482-483483- if (enabled) {484484- u32 ic_status;485485-486486- /*487487- * Only disable adapter if ic_tar and ic_con can't be488488- * dynamically updated489489- */490490- ic_status = dw_readl(dev, DW_IC_STATUS);491491- if (!dev->dynamic_tar_update_enabled ||492492- (ic_status & DW_IC_STATUS_MST_ACTIVITY) ||493493- !(ic_status & DW_IC_STATUS_TFE)) {494494- __i2c_dw_enable_and_wait(dev, false);495495- enabled = false;496496- }497497- }482482+ /* Disable the adapter */483483+ __i2c_dw_enable_and_wait(dev, false);498484499485 /* if the slave address is ten bit address, enable 10BITADDR */500486 if (dev->dynamic_tar_update_enabled) {···508526 /* enforce disabled interrupts (due to HW issues) */509527 i2c_dw_disable_int(dev);510528511511- if (!enabled)512512- __i2c_dw_enable(dev, true);529529+ /* Enable the adapter */530530+ __i2c_dw_enable(dev, true);513531514532 /* Clear and enable interrupts */515533 dw_readl(dev, DW_IC_CLR_INTR);···593611 if (msgs[dev->msg_write_idx].flags & I2C_M_RD) {594612595613 /* avoid rx buffer overrun */596596- if (rx_limit - dev->rx_outstanding <= 0)614614+ if (dev->rx_outstanding >= dev->rx_fifo_depth)597615 break;598616599617 dw_writel(dev, cmd | 0x100, DW_IC_DATA_CMD);···690708}691709692710/*693693- * Prepare controller for a transaction and start transfer by calling694694- * i2c_dw_xfer_init()711711+ * Prepare controller for a transaction and call i2c_dw_xfer_msg695712 */696713static int697714i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)···733752 goto done;734753 }735754755755+ /*756756+ * We must disable the adapter before returning and signaling the end757757+ * of the current transfer. Otherwise the hardware might continue758758+ * generating interrupts which in turn causes a race condition with759759+ * the following transfer. Needs some more investigation if the760760+ * additional interrupts are a hardware bug or this driver doesn't761761+ * handle them correctly yet.762762+ */763763+ __i2c_dw_enable(dev, false);764764+736765 if (dev->msg_err) {737766 ret = dev->msg_err;738767 goto done;739768 }740769741770 /* no error */742742- if (likely(!dev->cmd_err)) {771771+ if (likely(!dev->cmd_err && !dev->status)) {743772 ret = num;744773 goto done;745774 }···759768 ret = i2c_dw_handle_tx_abort(dev);760769 goto done;761770 }771771+772772+ if (dev->status)773773+ dev_err(dev->dev,774774+ "transfer terminated early - interrupt latency too high?\n");775775+762776 ret = -EIO;763777764778done:···884888 */885889886890tx_aborted:887887- if ((stat & (DW_IC_INTR_TX_ABRT | DW_IC_INTR_STOP_DET))888888- || dev->msg_err) {889889- /*890890- * We must disable interruts before returning and signaling891891- * the end of the current transfer. Otherwise the hardware892892- * might continue generating interrupts for non-existent893893- * transfers.894894- */895895- i2c_dw_disable_int(dev);896896- dw_readl(dev, DW_IC_CLR_INTR);897897-891891+ if ((stat & (DW_IC_INTR_TX_ABRT | DW_IC_INTR_STOP_DET)) || dev->msg_err)898892 complete(&dev->cmd_complete);899899- } else if (unlikely(dev->accessor_flags & ACCESS_INTR_MASK)) {893893+ else if (unlikely(dev->accessor_flags & ACCESS_INTR_MASK)) {900894 /* workaround to trigger pending interrupt */901895 stat = dw_readl(dev, DW_IC_INTR_MASK);902896 i2c_dw_disable_int(dev);
+1-3
drivers/i2c/busses/i2c-octeon-core.c
···381381 if (result)382382 return result;383383384384- data[i] = octeon_i2c_data_read(i2c, &result);385385- if (result)386386- return result;384384+ data[i] = octeon_i2c_data_read(i2c);387385 if (recv_len && i == 0) {388386 if (data[i] > I2C_SMBUS_BLOCK_MAX + 1)389387 return -EPROTO;
···11151115 if (psmouse_try_protocol(psmouse, PSMOUSE_TOUCHKIT_PS2,11161116 &max_proto, set_properties, true))11171117 return PSMOUSE_TOUCHKIT_PS2;11181118-11191119- if (psmouse_try_protocol(psmouse, PSMOUSE_BYD,11201120- &max_proto, set_properties, true))11211121- return PSMOUSE_BYD;11221118 }1123111911241120 /*
+3-1
drivers/iommu/dmar.c
···338338 struct pci_dev *pdev = to_pci_dev(data);339339 struct dmar_pci_notify_info *info;340340341341- /* Only care about add/remove events for physical functions */341341+ /* Only care about add/remove events for physical functions.342342+ * For VFs we actually do the lookup based on the corresponding343343+ * PF in device_to_iommu() anyway. */342344 if (pdev->is_virtfn)343345 return NOTIFY_DONE;344346 if (action != BUS_NOTIFY_ADD_DEVICE &&
+13
drivers/iommu/intel-iommu.c
···892892 return NULL;893893894894 if (dev_is_pci(dev)) {895895+ struct pci_dev *pf_pdev;896896+895897 pdev = to_pci_dev(dev);898898+ /* VFs aren't listed in scope tables; we need to look up899899+ * the PF instead to find the IOMMU. */900900+ pf_pdev = pci_physfn(pdev);901901+ dev = &pf_pdev->dev;896902 segment = pci_domain_nr(pdev->bus);897903 } else if (has_acpi_companion(dev))898904 dev = &ACPI_COMPANION(dev)->dev;···911905 for_each_active_dev_scope(drhd->devices,912906 drhd->devices_cnt, i, tmp) {913907 if (tmp == dev) {908908+ /* For a VF use its original BDF# not that of the PF909909+ * which we used for the IOMMU lookup. Strictly speaking910910+ * we could do this for all PCI devices; we only need to911911+ * get the BDF# from the scope table for ACPI matches. */912912+ if (pdev->is_virtfn)913913+ goto got_pdev;914914+914915 *bus = drhd->devices[i].bus;915916 *devfn = drhd->devices[i].devfn;916917 goto out;
+16-10
drivers/iommu/intel-svm.c
···3939 struct page *pages;4040 int order;41414242- order = ecap_pss(iommu->ecap) + 7 - PAGE_SHIFT;4343- if (order < 0)4444- order = 0;4242+ /* Start at 2 because it's defined as 2^(1+PSS) */4343+ iommu->pasid_max = 2 << ecap_pss(iommu->ecap);45444545+ /* Eventually I'm promised we will get a multi-level PASID table4646+ * and it won't have to be physically contiguous. Until then,4747+ * limit the size because 8MiB contiguous allocations can be hard4848+ * to come by. The limit of 0x20000, which is 1MiB for each of4949+ * the PASID and PASID-state tables, is somewhat arbitrary. */5050+ if (iommu->pasid_max > 0x20000)5151+ iommu->pasid_max = 0x20000;5252+5353+ order = get_order(sizeof(struct pasid_entry) * iommu->pasid_max);4654 pages = alloc_pages(GFP_KERNEL | __GFP_ZERO, order);4755 if (!pages) {4856 pr_warn("IOMMU: %s: Failed to allocate PASID table\n",···6153 pr_info("%s: Allocated order %d PASID table.\n", iommu->name, order);62546355 if (ecap_dis(iommu->ecap)) {5656+ /* Just making it explicit... */5757+ BUILD_BUG_ON(sizeof(struct pasid_entry) != sizeof(struct pasid_state_entry));6458 pages = alloc_pages(GFP_KERNEL | __GFP_ZERO, order);6559 if (pages)6660 iommu->pasid_state_table = page_address(pages);···78687969int intel_svm_free_pasid_tables(struct intel_iommu *iommu)8070{8181- int order;8282-8383- order = ecap_pss(iommu->ecap) + 7 - PAGE_SHIFT;8484- if (order < 0)8585- order = 0;7171+ int order = get_order(sizeof(struct pasid_entry) * iommu->pasid_max);86728773 if (iommu->pasid_table) {8874 free_pages((unsigned long)iommu->pasid_table, order);···377371 }378372 svm->iommu = iommu;379373380380- if (pasid_max > 2 << ecap_pss(iommu->ecap))381381- pasid_max = 2 << ecap_pss(iommu->ecap);374374+ if (pasid_max > iommu->pasid_max)375375+ pasid_max = iommu->pasid_max;382376383377 /* Do not use PASID 0 in caching mode (virtualised IOMMU) */384378 ret = idr_alloc(&iommu->pasid_idr, svm,
+3-1
drivers/isdn/gigaset/ser-gigaset.c
···755755 driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS,756756 GIGASET_MODULENAME, GIGASET_DEVNAME,757757 &ops, THIS_MODULE);758758- if (!driver)758758+ if (!driver) {759759+ rc = -ENOMEM;759760 goto error;761761+ }760762761763 rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc);762764 if (rc != 0) {
···281281 int i;282282 tuner_dbg("%s called\n", __func__);283283284284+ /* free allocated f/w string */285285+ if (priv->fname != firmware_name)286286+ kfree(priv->fname);287287+ priv->fname = NULL;288288+289289+ priv->state = XC2028_NO_FIRMWARE;290290+ memset(&priv->cur_fw, 0, sizeof(priv->cur_fw));291291+284292 if (!priv->firm)285293 return;286294···299291300292 priv->firm = NULL;301293 priv->firm_size = 0;302302- priv->state = XC2028_NO_FIRMWARE;303303-304304- memset(&priv->cur_fw, 0, sizeof(priv->cur_fw));305294}306295307296static int load_all_firmwares(struct dvb_frontend *fe,···889884 return 0;890885891886fail:892892- priv->state = XC2028_NO_FIRMWARE;887887+ free_firmware(priv);893888894894- memset(&priv->cur_fw, 0, sizeof(priv->cur_fw));895889 if (retry_count < 8) {896890 msleep(50);897891 retry_count++;···13361332 mutex_lock(&xc2028_list_mutex);1337133313381334 /* only perform final cleanup if this is the last instance */13391339- if (hybrid_tuner_report_instance_count(priv) == 1) {13351335+ if (hybrid_tuner_report_instance_count(priv) == 1)13401336 free_firmware(priv);13411341- kfree(priv->ctrl.fname);13421342- priv->ctrl.fname = NULL;13431343- }1344133713451338 if (priv)13461339 hybrid_tuner_release_state(priv);···1400139914011400 /*14021401 * Copy the config data.14031403- * For the firmware name, keep a local copy of the string,14041404- * in order to avoid troubles during device release.14051402 */14061406- kfree(priv->ctrl.fname);14071407- priv->ctrl.fname = NULL;14081403 memcpy(&priv->ctrl, p, sizeof(priv->ctrl));14091409- if (p->fname) {14101410- priv->ctrl.fname = kstrdup(p->fname, GFP_KERNEL);14111411- if (priv->ctrl.fname == NULL) {14121412- rc = -ENOMEM;14131413- goto unlock;14141414- }14151415- }1416140414171405 /*14181406 * If firmware name changed, frees firmware. As free_firmware will···1416142614171427 if (priv->state == XC2028_NO_FIRMWARE) {14181428 if (!firmware_name[0])14191419- priv->fname = priv->ctrl.fname;14291429+ priv->fname = kstrdup(p->fname, GFP_KERNEL);14201430 else14211431 priv->fname = firmware_name;14321432+14331433+ if (!priv->fname) {14341434+ rc = -ENOMEM;14351435+ goto unlock;14361436+ }1422143714231438 rc = request_firmware_nowait(THIS_MODULE, 1,14241439 priv->fname,
+3-1
drivers/mfd/syscon.c
···7373 /* Parse the device's DT node for an endianness specification */7474 if (of_property_read_bool(np, "big-endian"))7575 syscon_config.val_format_endian = REGMAP_ENDIAN_BIG;7676- else if (of_property_read_bool(np, "little-endian"))7676+ else if (of_property_read_bool(np, "little-endian"))7777 syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE;7878+ else if (of_property_read_bool(np, "native-endian"))7979+ syscon_config.val_format_endian = REGMAP_ENDIAN_NATIVE;78807981 /*8082 * search for reg-io-width property in DT. If it is not provided,
+12-4
drivers/mfd/wm8994-core.c
···393393 BUG();394394 goto err;395395 }396396-397397- ret = devm_regulator_bulk_get(wm8994->dev, wm8994->num_supplies,396396+397397+ /*398398+ * Can't use devres helper here as some of the supplies are provided by399399+ * wm8994->dev's children (regulators) and those regulators are400400+ * unregistered by the devres core before the supplies are freed.401401+ */402402+ ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies,398403 wm8994->supplies);399404 if (ret != 0) {400405 dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret);···410405 wm8994->supplies);411406 if (ret != 0) {412407 dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret);413413- goto err;408408+ goto err_regulator_free;414409 }415410416411 ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET);···601596err_enable:602597 regulator_bulk_disable(wm8994->num_supplies,603598 wm8994->supplies);599599+err_regulator_free:600600+ regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);604601err:605602 mfd_remove_devices(wm8994->dev);606603 return ret;···611604static void wm8994_device_exit(struct wm8994 *wm8994)612605{613606 pm_runtime_disable(wm8994->dev);614614- mfd_remove_devices(wm8994->dev);615607 wm8994_irq_exit(wm8994);616608 regulator_bulk_disable(wm8994->num_supplies,617609 wm8994->supplies);610610+ regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);611611+ mfd_remove_devices(wm8994->dev);618612}619613620614static const struct of_device_id wm8994_of_match[] = {
+1
drivers/mmc/host/dw_mmc.c
···10581058 spin_unlock_irqrestore(&host->irq_lock, irqflags);1059105910601060 if (host->dma_ops->start(host, sg_len)) {10611061+ host->dma_ops->stop(host);10611062 /* We can't do DMA, try PIO for this one */10621063 dev_dbg(host->dev,10631064 "%s: fall back to PIO mode for current transfer\n",
+14
drivers/mmc/host/sdhci-of-esdhc.c
···6666 return ret;6767 }6868 }6969+ /*7070+ * The DAT[3:0] line signal levels and the CMD line signal level are7171+ * not compatible with standard SDHC register. The line signal levels7272+ * DAT[7:0] are at bits 31:24 and the command line signal level is at7373+ * bit 23. All other bits are the same as in the standard SDHC7474+ * register.7575+ */7676+ if (spec_reg == SDHCI_PRESENT_STATE) {7777+ ret = value & 0x000fffff;7878+ ret |= (value >> 4) & SDHCI_DATA_LVL_MASK;7979+ ret |= (value << 1) & SDHCI_CMD_LVL;8080+ return ret;8181+ }8282+6983 ret = value;7084 return ret;7185}
···1872187218731873 ering->rx_max_pending = MAX_RX_AVAIL;1874187418751875+ /* If size isn't already set, we give an estimation of the number18761876+ * of buffers we'll have. We're neglecting some possible conditions18771877+ * [we couldn't know for certain at this point if number of queues18781878+ * might shrink] but the number would be correct for the likely18791879+ * scenario.18801880+ */18751881 if (bp->rx_ring_size)18761882 ering->rx_pending = bp->rx_ring_size;18831883+ else if (BNX2X_NUM_RX_QUEUES(bp))18841884+ ering->rx_pending = MAX_RX_AVAIL / BNX2X_NUM_RX_QUEUES(bp);18771885 else18781886 ering->rx_pending = MAX_RX_AVAIL;18791887
···2969296929702970 netdev->netdev_ops = &cxgb4vf_netdev_ops;29712971 netdev->ethtool_ops = &cxgb4vf_ethtool_ops;29722972+ netdev->dev_port = pi->port_id;2972297329732974 /*29742975 * Initialize the hardware/software state for the port.
+4
drivers/net/ethernet/cirrus/ep93xx_eth.c
···468468 struct device *dev = ep->dev->dev.parent;469469 int i;470470471471+ if (!ep->descs)472472+ return;473473+471474 for (i = 0; i < RX_QUEUE_ENTRIES; i++) {472475 dma_addr_t d;473476···493490494491 dma_free_coherent(dev, sizeof(struct ep93xx_descs), ep->descs,495492 ep->descs_dma_addr);493493+ ep->descs = NULL;496494}497495498496static int ep93xx_alloc_buffers(struct ep93xx_priv *ep)
···574574 unsigned int reload_period;575575 int pps_enable;576576 unsigned int next_counter;577577+578578+ u64 ethtool_stats[0];577579};578580579581void fec_ptp_init(struct platform_device *pdev);
···4931493149324932 /* initialize outer IP header fields */49334933 if (ip.v4->version == 4) {49344934+ unsigned char *csum_start = skb_checksum_start(skb);49354935+ unsigned char *trans_start = ip.hdr + (ip.v4->ihl * 4);49364936+49344937 /* IP header will have to cancel out any data that49354938 * is not a part of the outer IP header49364939 */49374937- ip.v4->check = csum_fold(csum_add(lco_csum(skb),49384938- csum_unfold(l4.tcp->check)));49404940+ ip.v4->check = csum_fold(csum_partial(trans_start,49414941+ csum_start - trans_start,49424942+ 0));49394943 type_tucmd |= E1000_ADVTXD_TUCMD_IPV4;4940494449414945 ip.v4->tot_len = 0;
+6-2
drivers/net/ethernet/intel/igbvf/netdev.c
···1965196519661966 /* initialize outer IP header fields */19671967 if (ip.v4->version == 4) {19681968+ unsigned char *csum_start = skb_checksum_start(skb);19691969+ unsigned char *trans_start = ip.hdr + (ip.v4->ihl * 4);19701970+19681971 /* IP header will have to cancel out any data that19691972 * is not a part of the outer IP header19701973 */19711971- ip.v4->check = csum_fold(csum_add(lco_csum(skb),19721972- csum_unfold(l4.tcp->check)));19741974+ ip.v4->check = csum_fold(csum_partial(trans_start,19751975+ csum_start - trans_start,19761976+ 0));19731977 type_tucmd |= E1000_ADVTXD_TUCMD_IPV4;1974197819751979 ip.v4->tot_len = 0;
+6-2
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
···7277727772787278 /* initialize outer IP header fields */72797279 if (ip.v4->version == 4) {72807280+ unsigned char *csum_start = skb_checksum_start(skb);72817281+ unsigned char *trans_start = ip.hdr + (ip.v4->ihl * 4);72827282+72807283 /* IP header will have to cancel out any data that72817284 * is not a part of the outer IP header72827285 */72837283- ip.v4->check = csum_fold(csum_add(lco_csum(skb),72847284- csum_unfold(l4.tcp->check)));72867286+ ip.v4->check = csum_fold(csum_partial(trans_start,72877287+ csum_start - trans_start,72887288+ 0));72857289 type_tucmd |= IXGBE_ADVTXD_TUCMD_IPV4;7286729072877291 ip.v4->tot_len = 0;
+6-2
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
···3329332933303330 /* initialize outer IP header fields */33313331 if (ip.v4->version == 4) {33323332+ unsigned char *csum_start = skb_checksum_start(skb);33333333+ unsigned char *trans_start = ip.hdr + (ip.v4->ihl * 4);33343334+33323335 /* IP header will have to cancel out any data that33333336 * is not a part of the outer IP header33343337 */33353335- ip.v4->check = csum_fold(csum_add(lco_csum(skb),33363336- csum_unfold(l4.tcp->check)));33383338+ ip.v4->check = csum_fold(csum_partial(trans_start,33393339+ csum_start - trans_start,33403340+ 0));33373341 type_tucmd |= IXGBE_ADVTXD_TUCMD_IPV4;3338334233393343 ip.v4->tot_len = 0;
+1
drivers/net/ethernet/lantiq_etop.c
···704704 priv->pldata = dev_get_platdata(&pdev->dev);705705 priv->netdev = dev;706706 spin_lock_init(&priv->lock);707707+ SET_NETDEV_DEV(dev, &pdev->dev);707708708709 for (i = 0; i < MAX_DMA_CHAN; i++) {709710 if (IS_TX(i))
···129129 }130130};131131132132+/* Must not acquire state_lock, as its corresponding work_sync133133+ * is done under it.134134+ */132135static void mlx4_en_filter_work(struct work_struct *work)133136{134137 struct mlx4_en_filter *filter = container_of(work,···20792076 return -ENOMEM;20802077}2081207820822082-static void mlx4_en_shutdown(struct net_device *dev)20832083-{20842084- rtnl_lock();20852085- netif_device_detach(dev);20862086- mlx4_en_close(dev);20872087- rtnl_unlock();20882088-}2089207920902080static int mlx4_en_copy_priv(struct mlx4_en_priv *dst,20912081 struct mlx4_en_priv *src,···21552159{21562160 struct mlx4_en_priv *priv = netdev_priv(dev);21572161 struct mlx4_en_dev *mdev = priv->mdev;21582158- bool shutdown = mdev->dev->persist->interface_state &21592159- MLX4_INTERFACE_STATE_SHUTDOWN;2160216221612163 en_dbg(DRV, priv, "Destroying netdev on port:%d\n", priv->port);21622164···21622168 if (priv->registered) {21632169 devlink_port_type_clear(mlx4_get_devlink_port(mdev->dev,21642170 priv->port));21652165- if (shutdown)21662166- mlx4_en_shutdown(dev);21672167- else21682168- unregister_netdev(dev);21712171+ unregister_netdev(dev);21692172 }2170217321712174 if (priv->allocated)···21802189 mutex_lock(&mdev->state_lock);21812190 mdev->pndev[priv->port] = NULL;21822191 mdev->upper[priv->port] = NULL;21832183- mutex_unlock(&mdev->state_lock);2184219221852193#ifdef CONFIG_RFS_ACCEL21862194 mlx4_en_cleanup_filters(priv);21872195#endif2188219621892197 mlx4_en_free_resources(priv);21982198+ mutex_unlock(&mdev->state_lock);2190219921912200 kfree(priv->tx_ring);21922201 kfree(priv->tx_cq);2193220221942194- if (!shutdown)21952195- free_netdev(dev);22032203+ free_netdev(dev);21962204}2197220521982206static int mlx4_en_change_mtu(struct net_device *dev, int new_mtu)
+1-4
drivers/net/ethernet/mellanox/mlx4/main.c
···4147414741484148 mlx4_info(persist->dev, "mlx4_shutdown was called\n");41494149 mutex_lock(&persist->interface_state_mutex);41504150- if (persist->interface_state & MLX4_INTERFACE_STATE_UP) {41514151- /* Notify mlx4 clients that the kernel is being shut down */41524152- persist->interface_state |= MLX4_INTERFACE_STATE_SHUTDOWN;41504150+ if (persist->interface_state & MLX4_INTERFACE_STATE_UP)41534151 mlx4_unload_one(pdev);41544154- }41554152 mutex_unlock(&persist->interface_state_mutex);41564153}41574154
···1818 default n1919 ---help---2020 Ethernet support in Mellanox Technologies ConnectX-4 NIC.2121- Ethernet and Infiniband support in ConnectX-4 are currently mutually2222- exclusive.23212422config MLX5_CORE_EN_DCB2523 bool "Data Center Bridging (DCB) Support"
···409409410410 sq = container_of(cq, struct mlx5e_sq, cq);411411412412- if (unlikely(test_bit(MLX5E_SQ_STATE_FLUSH, &sq->state)))412412+ if (unlikely(!test_bit(MLX5E_SQ_STATE_ENABLED, &sq->state)))413413 return false;414414415415 npkts = 0;
+2-2
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
···5656 struct mlx5_cqe64 *cqe;5757 u16 sqcc;58585959- if (unlikely(test_bit(MLX5E_SQ_STATE_FLUSH, &sq->state)))5959+ if (unlikely(!test_bit(MLX5E_SQ_STATE_ENABLED, &sq->state)))6060 return;61616262 cqe = mlx5e_get_cqe(cq);···113113114114 sq = container_of(cq, struct mlx5e_sq, cq);115115116116- if (unlikely(test_bit(MLX5E_SQ_STATE_FLUSH, &sq->state)))116116+ if (unlikely(!test_bit(MLX5E_SQ_STATE_ENABLED, &sq->state)))117117 return false;118118119119 /* sq->cc must be updated only after mlx5_cqwq_update_db_record(),
+25-18
drivers/net/ethernet/mellanox/mlx5/core/main.c
···4646#include <linux/mlx5/srq.h>4747#include <linux/debugfs.h>4848#include <linux/kmod.h>4949-#include <linux/delay.h>5049#include <linux/mlx5/mlx5_ifc.h>5150#ifdef CONFIG_RFS_ACCEL5251#include <linux/cpu_rmap.h>···6263MODULE_LICENSE("Dual BSD/GPL");6364MODULE_VERSION(DRIVER_VERSION);64656565-int mlx5_core_debug_mask;6666-module_param_named(debug_mask, mlx5_core_debug_mask, int, 0644);6666+unsigned int mlx5_core_debug_mask;6767+module_param_named(debug_mask, mlx5_core_debug_mask, uint, 0644);6768MODULE_PARM_DESC(debug_mask, "debug mask: 1 = dump cmd data, 2 = dump cmd exec time, 3 = both. Default=0");68696970#define MLX5_DEFAULT_PROF 27070-static int prof_sel = MLX5_DEFAULT_PROF;7171-module_param_named(prof_sel, prof_sel, int, 0444);7171+static unsigned int prof_sel = MLX5_DEFAULT_PROF;7272+module_param_named(prof_sel, prof_sel, uint, 0444);7273MODULE_PARM_DESC(prof_sel, "profile selector. Valid range 0 - 2");73747475enum {···732733 u8 status;733734734735 mlx5_cmd_mbox_status(query_out, &status, &syndrome);735735- if (status == MLX5_CMD_STAT_BAD_OP_ERR) {736736- pr_debug("Only ISSI 0 is supported\n");737737- return 0;736736+ if (!status || syndrome == MLX5_DRIVER_SYND) {737737+ mlx5_core_err(dev, "Failed to query ISSI err(%d) status(%d) synd(%d)\n",738738+ err, status, syndrome);739739+ return err;738740 }739741740740- pr_err("failed to query ISSI err(%d)\n", err);741741- return err;742742+ mlx5_core_warn(dev, "Query ISSI is not supported by FW, ISSI is 0\n");743743+ dev->issi = 0;744744+ return 0;742745 }743746744747 sup_issi = MLX5_GET(query_issi_out, query_out, supported_issi_dw0);···754753 err = mlx5_cmd_exec(dev, set_in, sizeof(set_in),755754 set_out, sizeof(set_out));756755 if (err) {757757- pr_err("failed to set ISSI=1 err(%d)\n", err);756756+ mlx5_core_err(dev, "Failed to set ISSI to 1 err(%d)\n",757757+ err);758758 return err;759759 }760760···1230122812311229 dev->pdev = pdev;12321230 dev->event = mlx5_core_event;12331233-12341234- if (prof_sel < 0 || prof_sel >= ARRAY_SIZE(profile)) {12351235- mlx5_core_warn(dev,12361236- "selected profile out of range, selecting default (%d)\n",12371237- MLX5_DEFAULT_PROF);12381238- prof_sel = MLX5_DEFAULT_PROF;12391239- }12401231 dev->profile = &profile[prof_sel];1241123212421233 INIT_LIST_HEAD(&priv->ctx_list);···14461451 .sriov_configure = mlx5_core_sriov_configure,14471452};1448145314541454+static void mlx5_core_verify_params(void)14551455+{14561456+ if (prof_sel >= ARRAY_SIZE(profile)) {14571457+ pr_warn("mlx5_core: WARNING: Invalid module parameter prof_sel %d, valid range 0-%zu, changing back to default(%d)\n",14581458+ prof_sel,14591459+ ARRAY_SIZE(profile) - 1,14601460+ MLX5_DEFAULT_PROF);14611461+ prof_sel = MLX5_DEFAULT_PROF;14621462+ }14631463+}14641464+14491465static int __init init(void)14501466{14511467 int err;1452146814691469+ mlx5_core_verify_params();14531470 mlx5_register_debugfs();1454147114551472 err = pci_register_driver(&mlx5_core_driver);
···711711err_undo_napi:712712 netif_napi_del(&adpt->rx_q.napi);713713err_undo_mdiobus:714714+ if (!has_acpi_companion(&pdev->dev))715715+ put_device(&adpt->phydev->mdio.dev);714716 mdiobus_unregister(adpt->mii_bus);715717err_undo_clocks:716718 emac_clks_teardown(adpt);···732730733731 emac_clks_teardown(adpt);734732733733+ if (!has_acpi_companion(&pdev->dev))734734+ put_device(&adpt->phydev->mdio.dev);735735 mdiobus_unregister(adpt->mii_bus);736736 free_netdev(netdev);737737
+14-5
drivers/net/ethernet/renesas/ravb_main.c
···10081008 of_node_put(pn);10091009 if (!phydev) {10101010 netdev_err(ndev, "failed to connect PHY\n");10111011- return -ENOENT;10111011+ err = -ENOENT;10121012+ goto err_deregister_fixed_link;10121013 }1013101410141015 /* This driver only support 10/100Mbit speeds on Gen310151016 * at this time.10161017 */10171018 if (priv->chip_id == RCAR_GEN3) {10181018- int err;10191019-10201019 err = phy_set_max_speed(phydev, SPEED_100);10211020 if (err) {10221021 netdev_err(ndev, "failed to limit PHY to 100Mbit/s\n");10231023- phy_disconnect(phydev);10241024- return err;10221022+ goto err_phy_disconnect;10251023 }1026102410271025 netdev_info(ndev, "limited PHY to 100Mbit/s\n");···10311033 phy_attached_info(phydev);1032103410331035 return 0;10361036+10371037+err_phy_disconnect:10381038+ phy_disconnect(phydev);10391039+err_deregister_fixed_link:10401040+ if (of_phy_is_fixed_link(np))10411041+ of_phy_deregister_fixed_link(np);10421042+10431043+ return err;10341044}1035104510361046/* PHY control start function */···16401634/* Device close function for Ethernet AVB */16411635static int ravb_close(struct net_device *ndev)16421636{16371637+ struct device_node *np = ndev->dev.parent->of_node;16431638 struct ravb_private *priv = netdev_priv(ndev);16441639 struct ravb_tstamp_skb *ts_skb, *ts_skb2;16451640···16701663 if (ndev->phydev) {16711664 phy_stop(ndev->phydev);16721665 phy_disconnect(ndev->phydev);16661666+ if (of_phy_is_fixed_link(np))16671667+ of_phy_deregister_fixed_link(np);16731668 }1674166916751670 if (priv->chip_id != RCAR_GEN2) {
···438438 ret = regulator_bulk_get(&pdev->dev,439439 ARRAY_SIZE(pdata->supplies),440440 pdata->supplies);441441- if (ret)441441+ if (ret) {442442+ /*443443+ * Retry on deferrals, else just report the error444444+ * and try to continue.445445+ */446446+ if (ret == -EPROBE_DEFER)447447+ return ret;442448 netdev_err(ndev, "couldn't get regulators %d\n",443449 ret);450450+ }444451445452 /* Request optional RESET GPIO */446453 pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev,
···304304 struct device *dev = &pdev->dev;305305 int ret;306306 struct socfpga_dwmac *dwmac;307307+ struct net_device *ndev;308308+ struct stmmac_priv *stpriv;307309308310 ret = stmmac_get_platform_resources(pdev, &stmmac_res);309311 if (ret)···316314 return PTR_ERR(plat_dat);317315318316 dwmac = devm_kzalloc(dev, sizeof(*dwmac), GFP_KERNEL);319319- if (!dwmac)320320- return -ENOMEM;317317+ if (!dwmac) {318318+ ret = -ENOMEM;319319+ goto err_remove_config_dt;320320+ }321321322322 ret = socfpga_dwmac_parse_data(dwmac, dev);323323 if (ret) {324324 dev_err(dev, "Unable to parse OF data\n");325325- return ret;325325+ goto err_remove_config_dt;326326 }327327328328 plat_dat->bsp_priv = dwmac;329329 plat_dat->fix_mac_speed = socfpga_dwmac_fix_mac_speed;330330331331 ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);332332+ if (ret)333333+ goto err_remove_config_dt;332334333333- if (!ret) {334334- struct net_device *ndev = platform_get_drvdata(pdev);335335- struct stmmac_priv *stpriv = netdev_priv(ndev);335335+ ndev = platform_get_drvdata(pdev);336336+ stpriv = netdev_priv(ndev);336337337337- /* The socfpga driver needs to control the stmmac reset to338338- * set the phy mode. Create a copy of the core reset handel339339- * so it can be used by the driver later.340340- */341341- dwmac->stmmac_rst = stpriv->stmmac_rst;338338+ /* The socfpga driver needs to control the stmmac reset to set the phy339339+ * mode. Create a copy of the core reset handle so it can be used by340340+ * the driver later.341341+ */342342+ dwmac->stmmac_rst = stpriv->stmmac_rst;342343343343- ret = socfpga_dwmac_set_phy_mode(dwmac);344344- }344344+ ret = socfpga_dwmac_set_phy_mode(dwmac);345345+ if (ret)346346+ goto err_dvr_remove;347347+348348+ return 0;349349+350350+err_dvr_remove:351351+ stmmac_dvr_remove(&pdev->dev);352352+err_remove_config_dt:353353+ stmmac_remove_config_dt(pdev, plat_dat);345354346355 return ret;347356}
+18-5
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
···345345 return PTR_ERR(plat_dat);346346347347 dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);348348- if (!dwmac)349349- return -ENOMEM;348348+ if (!dwmac) {349349+ ret = -ENOMEM;350350+ goto err_remove_config_dt;351351+ }350352351353 ret = sti_dwmac_parse_data(dwmac, pdev);352354 if (ret) {353355 dev_err(&pdev->dev, "Unable to parse OF data\n");354354- return ret;356356+ goto err_remove_config_dt;355357 }356358357359 dwmac->fix_retime_src = data->fix_retime_src;···365363366364 ret = sti_dwmac_init(pdev, plat_dat->bsp_priv);367365 if (ret)368368- return ret;366366+ goto err_remove_config_dt;369367370370- return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);368368+ ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);369369+ if (ret)370370+ goto err_dwmac_exit;371371+372372+ return 0;373373+374374+err_dwmac_exit:375375+ sti_dwmac_exit(pdev, plat_dat->bsp_priv);376376+err_remove_config_dt:377377+ stmmac_remove_config_dt(pdev, plat_dat);378378+379379+ return ret;371380}372381373382static const struct sti_dwmac_of_data stih4xx_dwmac_data = {
+14-5
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
···107107 return PTR_ERR(plat_dat);108108109109 dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);110110- if (!dwmac)111111- return -ENOMEM;110110+ if (!dwmac) {111111+ ret = -ENOMEM;112112+ goto err_remove_config_dt;113113+ }112114113115 ret = stm32_dwmac_parse_data(dwmac, &pdev->dev);114116 if (ret) {115117 dev_err(&pdev->dev, "Unable to parse OF data\n");116116- return ret;118118+ goto err_remove_config_dt;117119 }118120119121 plat_dat->bsp_priv = dwmac;120122121123 ret = stm32_dwmac_init(plat_dat);122124 if (ret)123123- return ret;125125+ goto err_remove_config_dt;124126125127 ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);126128 if (ret)127127- stm32_dwmac_clk_disable(dwmac);129129+ goto err_clk_disable;130130+131131+ return 0;132132+133133+err_clk_disable:134134+ stm32_dwmac_clk_disable(dwmac);135135+err_remove_config_dt:136136+ stmmac_remove_config_dt(pdev, plat_dat);128137129138 return ret;130139}
+19-7
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
···120120 return PTR_ERR(plat_dat);121121122122 gmac = devm_kzalloc(dev, sizeof(*gmac), GFP_KERNEL);123123- if (!gmac)124124- return -ENOMEM;123123+ if (!gmac) {124124+ ret = -ENOMEM;125125+ goto err_remove_config_dt;126126+ }125127126128 gmac->interface = of_get_phy_mode(dev->of_node);127129128130 gmac->tx_clk = devm_clk_get(dev, "allwinner_gmac_tx");129131 if (IS_ERR(gmac->tx_clk)) {130132 dev_err(dev, "could not get tx clock\n");131131- return PTR_ERR(gmac->tx_clk);133133+ ret = PTR_ERR(gmac->tx_clk);134134+ goto err_remove_config_dt;132135 }133136134137 /* Optional regulator for PHY */135138 gmac->regulator = devm_regulator_get_optional(dev, "phy");136139 if (IS_ERR(gmac->regulator)) {137137- if (PTR_ERR(gmac->regulator) == -EPROBE_DEFER)138138- return -EPROBE_DEFER;140140+ if (PTR_ERR(gmac->regulator) == -EPROBE_DEFER) {141141+ ret = -EPROBE_DEFER;142142+ goto err_remove_config_dt;143143+ }139144 dev_info(dev, "no regulator found\n");140145 gmac->regulator = NULL;141146 }···156151157152 ret = sun7i_gmac_init(pdev, plat_dat->bsp_priv);158153 if (ret)159159- return ret;154154+ goto err_remove_config_dt;160155161156 ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);162157 if (ret)163163- sun7i_gmac_exit(pdev, plat_dat->bsp_priv);158158+ goto err_gmac_exit;159159+160160+ return 0;161161+162162+err_gmac_exit:163163+ sun7i_gmac_exit(pdev, plat_dat->bsp_priv);164164+err_remove_config_dt:165165+ stmmac_remove_config_dt(pdev, plat_dat);164166165167 return ret;166168}
···4343 if (axi->axi_xit_frm)4444 value |= DMA_AXI_LPI_XIT_FRM;45454646+ value &= ~DMA_AXI_WR_OSR_LMT;4647 value |= (axi->axi_wr_osr_lmt & DMA_AXI_WR_OSR_LMT_MASK) <<4748 DMA_AXI_WR_OSR_LMT_SHIFT;48495050+ value &= ~DMA_AXI_RD_OSR_LMT;4951 value |= (axi->axi_rd_osr_lmt & DMA_AXI_RD_OSR_LMT_MASK) <<5052 DMA_AXI_RD_OSR_LMT_SHIFT;5153
+2
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
···3030 if (axi->axi_xit_frm)3131 value |= DMA_AXI_LPI_XIT_FRM;32323333+ value &= ~DMA_AXI_WR_OSR_LMT;3334 value |= (axi->axi_wr_osr_lmt & DMA_AXI_OSR_MAX) <<3435 DMA_AXI_WR_OSR_LMT_SHIFT;35363737+ value &= ~DMA_AXI_RD_OSR_LMT;3638 value |= (axi->axi_rd_osr_lmt & DMA_AXI_OSR_MAX) <<3739 DMA_AXI_RD_OSR_LMT_SHIFT;3840
-1
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
···34163416 stmmac_set_mac(priv->ioaddr, false);34173417 netif_carrier_off(ndev);34183418 unregister_netdev(ndev);34193419- of_node_put(priv->plat->phy_node);34203419 if (priv->stmmac_rst)34213420 reset_control_assert(priv->stmmac_rst);34223421 clk_disable_unprepare(priv->pclk);
···17231723 /* Don't change this buffer size and allocation without doing17241724 * some heavy and complete testing. Don't ask why :-(17251725 * Jean II */17261726+ ret = -ENOMEM;17261727 self->speed_buff = kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);17271728 if (!self->speed_buff)17281729 goto err_out_3;
+3-1
drivers/net/irda/w83977af_ir.c
···518518519519 mtt = irda_get_mtt(skb);520520 pr_debug("%s(%ld), mtt=%d\n", __func__ , jiffies, mtt);521521- if (mtt)521521+ if (mtt > 1000)522522+ mdelay(mtt/1000);523523+ else if (mtt)522524 udelay(mtt);523525524526 /* Enable DMA interrupt */
···857857int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,858858 u32 flags, phy_interface_t interface)859859{860860+ struct module *ndev_owner = dev->dev.parent->driver->owner;860861 struct mii_bus *bus = phydev->mdio.bus;861862 struct device *d = &phydev->mdio.dev;862863 int err;863864864864- if (!try_module_get(bus->owner)) {865865+ /* For Ethernet device drivers that register their own MDIO bus, we866866+ * will have bus->owner match ndev_mod, so we do not want to increment867867+ * our own module->refcnt here, otherwise we would not be able to868868+ * unload later on.869869+ */870870+ if (ndev_owner != bus->owner && !try_module_get(bus->owner)) {865871 dev_err(&dev->dev, "failed to get the bus module\n");866872 return -EIO;867873 }···927921928922error:929923 put_device(d);930930- module_put(bus->owner);924924+ if (ndev_owner != bus->owner)925925+ module_put(bus->owner);931926 return err;932927}933928EXPORT_SYMBOL(phy_attach_direct);···978971 */979972void phy_detach(struct phy_device *phydev)980973{974974+ struct net_device *dev = phydev->attached_dev;975975+ struct module *ndev_owner = dev->dev.parent->driver->owner;981976 struct mii_bus *bus;982977 int i;983978···1007998 bus = phydev->mdio.bus;100899910091000 put_device(&phydev->mdio.dev);10101010- module_put(bus->owner);10011001+ if (ndev_owner != bus->owner)10021002+ module_put(bus->owner);10111003}10121004EXPORT_SYMBOL(phy_detach);10131005
···603603 u16 medium;604604605605 /* Stop MAC operation */606606- medium = asix_read_medium_status(dev, 0);606606+ medium = asix_read_medium_status(dev, 1);607607 medium &= ~AX_MEDIUM_RE;608608- asix_write_medium_mode(dev, medium, 0);608608+ asix_write_medium_mode(dev, medium, 1);609609610610 netdev_dbg(dev->net, "ax88772_suspend: medium=0x%04x\n",611611- asix_read_medium_status(dev, 0));611611+ asix_read_medium_status(dev, 1));612612613613 /* Preserve BMCR for restoring */614614 priv->presvd_phy_bmcr =
+31-7
drivers/net/usb/cdc_ether.c
···388388 case USB_CDC_NOTIFY_NETWORK_CONNECTION:389389 netif_dbg(dev, timer, dev->net, "CDC: carrier %s\n",390390 event->wValue ? "on" : "off");391391-392392- /* Work-around for devices with broken off-notifications */393393- if (event->wValue &&394394- !test_bit(__LINK_STATE_NOCARRIER, &dev->net->state))395395- usbnet_link_change(dev, 0, 0);396396-397391 usbnet_link_change(dev, !!event->wValue, 0);398392 break;399393 case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */···460466 return 1;461467}462468469469+/* Ensure correct link state470470+ *471471+ * Some devices (ZTE MF823/831/910) export two carrier on notifications when472472+ * connected. This causes the link state to be incorrect. Work around this by473473+ * always setting the state to off, then on.474474+ */475475+void usbnet_cdc_zte_status(struct usbnet *dev, struct urb *urb)476476+{477477+ struct usb_cdc_notification *event;478478+479479+ if (urb->actual_length < sizeof(*event))480480+ return;481481+482482+ event = urb->transfer_buffer;483483+484484+ if (event->bNotificationType != USB_CDC_NOTIFY_NETWORK_CONNECTION) {485485+ usbnet_cdc_status(dev, urb);486486+ return;487487+ }488488+489489+ netif_dbg(dev, timer, dev->net, "CDC: carrier %s\n",490490+ event->wValue ? "on" : "off");491491+492492+ if (event->wValue &&493493+ netif_carrier_ok(dev->net))494494+ netif_carrier_off(dev->net);495495+496496+ usbnet_link_change(dev, !!event->wValue, 0);497497+}498498+463499static const struct driver_info cdc_info = {464500 .description = "CDC Ethernet Device",465501 .flags = FLAG_ETHER | FLAG_POINTTOPOINT,···505481 .flags = FLAG_ETHER | FLAG_POINTTOPOINT,506482 .bind = usbnet_cdc_zte_bind,507483 .unbind = usbnet_cdc_unbind,508508- .status = usbnet_cdc_status,484484+ .status = usbnet_cdc_zte_status,509485 .set_rx_mode = usbnet_cdc_update_filter,510486 .manage_power = usbnet_manage_power,511487 .rx_fixup = usbnet_cdc_zte_rx_fixup,
+21
drivers/net/usb/cdc_mbim.c
···602602 .data = CDC_NCM_FLAG_NDP_TO_END,603603};604604605605+/* Some modems (e.g. Telit LE922A6) do not work properly with altsetting606606+ * toggle done in cdc_ncm_bind_common. CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE607607+ * flag is used to avoid this procedure.608608+ */609609+static const struct driver_info cdc_mbim_info_avoid_altsetting_toggle = {610610+ .description = "CDC MBIM",611611+ .flags = FLAG_NO_SETINT | FLAG_MULTI_PACKET | FLAG_WWAN,612612+ .bind = cdc_mbim_bind,613613+ .unbind = cdc_mbim_unbind,614614+ .manage_power = cdc_mbim_manage_power,615615+ .rx_fixup = cdc_mbim_rx_fixup,616616+ .tx_fixup = cdc_mbim_tx_fixup,617617+ .data = CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE,618618+};619619+605620static const struct usb_device_id mbim_devs[] = {606621 /* This duplicate NCM entry is intentional. MBIM devices can607622 * be disguised as NCM by default, and this is necessary to···641626 { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),642627 .driver_info = (unsigned long)&cdc_mbim_info_ndp_to_end,643628 },629629+630630+ /* Telit LE922A6 in MBIM composition */631631+ { USB_DEVICE_AND_INTERFACE_INFO(0x1bc7, 0x1041, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),632632+ .driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle,633633+ },634634+644635 /* default entry */645636 { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),646637 .driver_info = (unsigned long)&cdc_mbim_info_zlp,
+9-5
drivers/net/usb/cdc_ncm.c
···839839840840 iface_no = ctx->data->cur_altsetting->desc.bInterfaceNumber;841841842842+ /* Device-specific flags */843843+ ctx->drvflags = drvflags;844844+842845 /* Reset data interface. Some devices will not reset properly843846 * unless they are configured first. Toggle the altsetting to844844- * force a reset847847+ * force a reset.848848+ * Some other devices do not work properly with this procedure849849+ * that can be avoided using quirk CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE845850 */846846- usb_set_interface(dev->udev, iface_no, data_altsetting);851851+ if (!(ctx->drvflags & CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE))852852+ usb_set_interface(dev->udev, iface_no, data_altsetting);853853+847854 temp = usb_set_interface(dev->udev, iface_no, 0);848855 if (temp) {849856 dev_dbg(&intf->dev, "set interface failed\n");···896889897890 /* finish setting up the device specific data */898891 cdc_ncm_setup(dev);899899-900900- /* Device-specific flags */901901- ctx->drvflags = drvflags;902892903893 /* Allocate the delayed NDP if needed. */904894 if (ctx->drvflags & CDC_NCM_FLAG_NDP_TO_END) {
···33 *44 * Copyright (C) 2015-2016 Synopsys, Inc. (www.synopsys.com)55 *66- * Authors: Joao Pinto <jpmpinto@gmail.com>66+ * Authors: Joao Pinto <Joao.Pinto@synopsys.com>77 *88 * This program is free software; you can redistribute it and/or modify99 * it under the terms of the GNU General Public License version 2 as
-14
drivers/pci/pcie/aer/aer_inject.c
···307307 return 0;308308}309309310310-static struct pci_dev *pcie_find_root_port(struct pci_dev *dev)311311-{312312- while (1) {313313- if (!pci_is_pcie(dev))314314- break;315315- if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)316316- return dev;317317- if (!dev->bus->self)318318- break;319319- dev = dev->bus->self;320320- }321321- return NULL;322322-}323323-324310static int find_aer_device_iter(struct device *device, void *data)325311{326312 struct pcie_device **result = data;
+27-1
drivers/pci/probe.c
···14391439 dev_warn(&dev->dev, "PCI-X settings not supported\n");14401440}1441144114421442+static bool pcie_root_rcb_set(struct pci_dev *dev)14431443+{14441444+ struct pci_dev *rp = pcie_find_root_port(dev);14451445+ u16 lnkctl;14461446+14471447+ if (!rp)14481448+ return false;14491449+14501450+ pcie_capability_read_word(rp, PCI_EXP_LNKCTL, &lnkctl);14511451+ if (lnkctl & PCI_EXP_LNKCTL_RCB)14521452+ return true;14531453+14541454+ return false;14551455+}14561456+14421457static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)14431458{14441459 int pos;···14831468 ~hpp->pci_exp_devctl_and, hpp->pci_exp_devctl_or);1484146914851470 /* Initialize Link Control Register */14861486- if (pcie_cap_has_lnkctl(dev))14711471+ if (pcie_cap_has_lnkctl(dev)) {14721472+14731473+ /*14741474+ * If the Root Port supports Read Completion Boundary of14751475+ * 128, set RCB to 128. Otherwise, clear it.14761476+ */14771477+ hpp->pci_exp_lnkctl_and |= PCI_EXP_LNKCTL_RCB;14781478+ hpp->pci_exp_lnkctl_or &= ~PCI_EXP_LNKCTL_RCB;14791479+ if (pcie_root_rcb_set(dev))14801480+ hpp->pci_exp_lnkctl_or |= PCI_EXP_LNKCTL_RCB;14811481+14871482 pcie_capability_clear_and_set_word(dev, PCI_EXP_LNKCTL,14881483 ~hpp->pci_exp_lnkctl_and, hpp->pci_exp_lnkctl_or);14841484+ }1489148514901486 /* Find Advanced Error Reporting Enhanced Capability */14911487 pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
···2009200920102010static int hpsa_slave_alloc(struct scsi_device *sdev)20112011{20122012- struct hpsa_scsi_dev_t *sd;20122012+ struct hpsa_scsi_dev_t *sd = NULL;20132013 unsigned long flags;20142014 struct ctlr_info *h;20152015···20262026 sd->target = sdev_id(sdev);20272027 sd->lun = sdev->lun;20282028 }20292029- } else20292029+ }20302030+ if (!sd)20302031 sd = lookup_hpsa_scsi_dev(h, sdev_channel(sdev),20312032 sdev_id(sdev), sdev->lun);20322033···38413840 sizeof(this_device->vendor));38423841 memcpy(this_device->model, &inq_buff[16],38433842 sizeof(this_device->model));38433843+ this_device->rev = inq_buff[2];38443844 memset(this_device->device_id, 0,38453845 sizeof(this_device->device_id));38463846 if (hpsa_get_device_id(h, scsi3addr, this_device->device_id, 8,···3931392939323930 if (!is_logical_dev_addr_mode(lunaddrbytes)) {39333931 /* physical device, target and lun filled in later */39343934- if (is_hba_lunid(lunaddrbytes))39323932+ if (is_hba_lunid(lunaddrbytes)) {39333933+ int bus = HPSA_HBA_BUS;39343934+39353935+ if (!device->rev)39363936+ bus = HPSA_LEGACY_HBA_BUS;39353937 hpsa_set_bus_target_lun(device,39363936- HPSA_HBA_BUS, 0, lunid & 0x3fff);39373937- else39383938+ bus, 0, lunid & 0x3fff);39393939+ } else39383940 /* defer target, lun assignment for physical devices */39393941 hpsa_set_bus_target_lun(device,39403942 HPSA_PHYSICAL_DEVICE_BUS, -1, -1);
+2
drivers/scsi/hpsa.h
···6969 u64 sas_address;7070 unsigned char vendor[8]; /* bytes 8-15 of inquiry data */7171 unsigned char model[16]; /* bytes 16-31 of inquiry data */7272+ unsigned char rev; /* byte 2 of inquiry data */7273 unsigned char raid_level; /* from inquiry page 0xC1 */7374 unsigned char volume_offline; /* discovered via TUR or VPD */7475 u16 queue_depth; /* max queue_depth for this device */···403402#define HPSA_RAID_VOLUME_BUS 1404403#define HPSA_EXTERNAL_RAID_VOLUME_BUS 2405404#define HPSA_HBA_BUS 0405405+#define HPSA_LEGACY_HBA_BUS 3406406407407/*408408 Send the command to the hardware
···954954955955 /* COMMAND STAGE */956956 /* let's send the command via the control pipe */957957+ /*958958+ * Command is sometime (f.e. after scsi_eh_prep_cmnd) on the stack.959959+ * Stack may be vmallocated. So no DMA for us. Make a copy.960960+ */961961+ memcpy(us->iobuf, srb->cmnd, srb->cmd_len);957962 result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe,958963 US_CBI_ADSC, 959964 USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0, 960960- us->ifnum, srb->cmnd, srb->cmd_len);965965+ us->ifnum, us->iobuf, srb->cmd_len);961966962967 /* check the return code for the command */963968 usb_stor_dbg(us, "Call to usb_stor_ctrl_transfer() returned %d\n",
+1-1
drivers/vhost/vsock.c
···506506 * executing.507507 */508508509509- if (!vhost_vsock_get(vsk->local_addr.svm_cid)) {509509+ if (!vhost_vsock_get(vsk->remote_addr.svm_cid)) {510510 sock_set_flag(sk, SOCK_DONE);511511 vsk->peer_shutdown = SHUTDOWN_MASK;512512 sk->sk_state = SS_UNCONNECTED;
+1
drivers/watchdog/Kconfig
···155155config WDAT_WDT156156 tristate "ACPI Watchdog Action Table (WDAT)"157157 depends on ACPI158158+ select WATCHDOG_CORE158159 select ACPI_WATCHDOG159160 help160161 This driver adds support for systems with ACPI Watchdog Action
···34273427 __u16 rc = 0;34283428 struct cifs_posix_acl *cifs_acl = (struct cifs_posix_acl *)parm_data;34293429 struct posix_acl_xattr_header *local_acl = (void *)pACL;34303430+ struct posix_acl_xattr_entry *ace = (void *)(local_acl + 1);34303431 int count;34313432 int i;34323433···34543453 return 0;34553454 }34563455 for (i = 0; i < count; i++) {34573457- rc = convert_ace_to_cifs_ace(&cifs_acl->ace_array[i],34583458- (struct posix_acl_xattr_entry *)(local_acl + 1));34563456+ rc = convert_ace_to_cifs_ace(&cifs_acl->ace_array[i], &ace[i]);34593457 if (rc != 0) {34603458 /* ACE not converted */34613459 break;
+18-7
fs/cifs/connect.c
···412412 }413413 } while (server->tcpStatus == CifsNeedReconnect);414414415415+ if (server->tcpStatus == CifsNeedNegotiate)416416+ mod_delayed_work(cifsiod_wq, &server->echo, 0);417417+415418 return rc;416419}417420···424421 int rc;425422 struct TCP_Server_Info *server = container_of(work,426423 struct TCP_Server_Info, echo.work);427427- unsigned long echo_interval = server->echo_interval;424424+ unsigned long echo_interval;428425429426 /*430430- * We cannot send an echo if it is disabled or until the431431- * NEGOTIATE_PROTOCOL request is done, which is indicated by432432- * server->ops->need_neg() == true. Also, no need to ping if433433- * we got a response recently.427427+ * If we need to renegotiate, set echo interval to zero to428428+ * immediately call echo service where we can renegotiate.429429+ */430430+ if (server->tcpStatus == CifsNeedNegotiate)431431+ echo_interval = 0;432432+ else433433+ echo_interval = server->echo_interval;434434+435435+ /*436436+ * We cannot send an echo if it is disabled.437437+ * Also, no need to ping if we got a response recently.434438 */435439436440 if (server->tcpStatus == CifsNeedReconnect ||437437- server->tcpStatus == CifsExiting || server->tcpStatus == CifsNew ||441441+ server->tcpStatus == CifsExiting ||442442+ server->tcpStatus == CifsNew ||438443 (server->ops->can_echo && !server->ops->can_echo(server)) ||439444 time_before(jiffies, server->lstrp + echo_interval - HZ))440445 goto requeue_echo;···453442 server->hostname);454443455444requeue_echo:456456- queue_delayed_work(cifsiod_wq, &server->echo, echo_interval);445445+ queue_delayed_work(cifsiod_wq, &server->echo, server->echo_interval);457446}458447459448static bool
+2-5
fs/fuse/dir.c
···17391739 * This should be done on write(), truncate() and chown().17401740 */17411741 if (!fc->handle_killpriv) {17421742- int kill;17431743-17441742 /*17451743 * ia_mode calculation may have used stale i_mode.17461744 * Refresh and recalculate.···17481750 return ret;1749175117501752 attr->ia_mode = inode->i_mode;17511751- kill = should_remove_suid(entry);17521752- if (kill & ATTR_KILL_SUID) {17531753+ if (inode->i_mode & S_ISUID) {17531754 attr->ia_valid |= ATTR_MODE;17541755 attr->ia_mode &= ~S_ISUID;17551756 }17561756- if (kill & ATTR_KILL_SGID) {17571757+ if ((inode->i_mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {17571758 attr->ia_valid |= ATTR_MODE;17581759 attr->ia_mode &= ~S_ISGID;17591760 }
+2-2
fs/isofs/rock.c
···377377 {378378 int p;379379 for (p = 0; p < rr->u.ER.len_id; p++)380380- printk("%c", rr->u.ER.data[p]);380380+ printk(KERN_CONT "%c", rr->u.ER.data[p]);381381 }382382- printk("\n");382382+ printk(KERN_CONT "\n");383383 break;384384 case SIG('P', 'X'):385385 inode->i_mode = isonum_733(rr->u.PX.mode);
+3-3
fs/overlayfs/super.c
···328328 if (!real)329329 goto bug;330330331331+ /* Handle recursion */332332+ real = d_real(real, inode, open_flags);333333+331334 if (!inode || inode == d_inode(real))332335 return real;333333-334334- /* Handle recursion */335335- return d_real(real, inode, open_flags);336336bug:337337 WARN(1, "ovl_d_real(%pd4, %s:%lu): real dentry not found\n", dentry,338338 inode ? inode->i_sb->s_id : "NULL", inode ? inode->i_ino : 0);
+2-1
fs/splice.c
···408408 if (res <= 0)409409 return -ENOMEM;410410411411- nr_pages = res / PAGE_SIZE;411411+ BUG_ON(dummy);412412+ nr_pages = DIV_ROUND_UP(res, PAGE_SIZE);412413413414 vec = __vec;414415 if (nr_pages > PIPE_DEF_BUFFERS) {
···16191619 * @dcbnl_ops: Data Center Bridging netlink ops16201620 * @num_tc: Number of traffic classes in the net device16211621 * @tc_to_txq: XXX: need comments on this one16221622- * @prio_tc_map XXX: need comments on this one16221622+ * @prio_tc_map: XXX: need comments on this one16231623 *16241624 * @fcoe_ddp_xid: Max exchange id for FCoE LRO by ddp16251625 *
···374374}375375376376/*377377- * Get the offset in PAGE_SIZE.378378- * (TODO: hugepage should have ->index in PAGE_SIZE)377377+ * Get index of the page with in radix-tree378378+ * (TODO: remove once hugetlb pages will have ->index in PAGE_SIZE)379379 */380380-static inline pgoff_t page_to_pgoff(struct page *page)380380+static inline pgoff_t page_to_index(struct page *page)381381{382382 pgoff_t pgoff;383383-384384- if (unlikely(PageHeadHuge(page)))385385- return page->index << compound_order(page);386383387384 if (likely(!PageTransTail(page)))388385 return page->index;···391394 pgoff = compound_head(page)->index;392395 pgoff += page - compound_head(page);393396 return pgoff;397397+}398398+399399+/*400400+ * Get the offset in PAGE_SIZE.401401+ * (TODO: hugepage should have ->index in PAGE_SIZE)402402+ */403403+static inline pgoff_t page_to_pgoff(struct page *page)404404+{405405+ if (unlikely(PageHeadHuge(page)))406406+ return page->index << compound_order(page);407407+408408+ return page_to_index(page);394409}395410396411/*
+14
include/linux/pci.h
···19281928 return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;19291929}1930193019311931+static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev)19321932+{19331933+ while (1) {19341934+ if (!pci_is_pcie(dev))19351935+ break;19361936+ if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)19371937+ return dev;19381938+ if (!dev->bus->self)19391939+ break;19401940+ dev = dev->bus->self;19411941+ }19421942+ return NULL;19431943+}19441944+19311945void pci_request_acs(void);19321946bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags);19331947bool pci_acs_path_enabled(struct pci_dev *start,
+2-1
include/linux/usb/cdc_ncm.h
···8181#define CDC_NCM_TIMER_INTERVAL_MAX (U32_MAX / NSEC_PER_USEC)82828383/* Driver flags */8484-#define CDC_NCM_FLAG_NDP_TO_END 0x02 /* NDP is placed at end of frame */8484+#define CDC_NCM_FLAG_NDP_TO_END 0x02 /* NDP is placed at end of frame */8585+#define CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE 0x04 /* Avoid altsetting toggle during init */85868687#define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \8788 (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE)
···970970int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,971971 char __user *optval, int __user *optlen);972972973973+int __ip6_datagram_connect(struct sock *sk, struct sockaddr *addr,974974+ int addr_len);973975int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len);974976int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *addr,975977 int addr_len);
+3-3
include/net/netfilter/nf_conntrack.h
···100100101101 possible_net_t ct_net;102102103103+#if IS_ENABLED(CONFIG_NF_NAT)104104+ struct rhlist_head nat_bysource;105105+#endif103106 /* all members below initialized via memset */104107 u8 __nfct_init_offset[0];105108···120117 /* Extensions */121118 struct nf_ct_ext *ext;122119123123-#if IS_ENABLED(CONFIG_NF_NAT)124124- struct rhash_head nat_bysource;125125-#endif126120 /* Storage reserved for other modules, must be the last member */127121 union nf_conntrack_proto proto;128122};
+1-1
include/net/netfilter/nf_tables.h
···313313 * @size: maximum set size314314 * @nelems: number of elements315315 * @ndeact: number of deactivated elements queued for removal316316- * @timeout: default timeout value in msecs316316+ * @timeout: default timeout value in jiffies317317 * @gc_int: garbage collection interval in msecs318318 * @policy: set parameterization (see enum nft_set_policies)319319 * @udlen: user data length
+1
include/uapi/linux/can.h
···196196};197197198198#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */199199+#define CAN_RAW_FILTER_MAX 512 /* maximum number of can_filter set via setsockopt() */199200200201#endif /* !_UAPI_CAN_H */
···640640 * Control a data application associated with the currently viewed channel,641641 * e.g. teletext or data broadcast application (MHEG, MHP, HbbTV, etc.)642642 */643643-#define KEY_DATA 0x275643643+#define KEY_DATA 0x277644644645645#define BTN_TRIGGER_HAPPY 0x2c0646646#define BTN_TRIGGER_HAPPY1 0x2c0
···24542454 struct bpf_verifier_state *old,24552455 struct bpf_verifier_state *cur)24562456{24572457+ bool varlen_map_access = env->varlen_map_value_access;24572458 struct bpf_reg_state *rold, *rcur;24582459 int i;24592460···24682467 /* If the ranges were not the same, but everything else was and24692468 * we didn't do a variable access into a map then we are a-ok.24702469 */24712471- if (!env->varlen_map_value_access &&24702470+ if (!varlen_map_access &&24722471 rold->type == rcur->type && rold->imm == rcur->imm)24732472 continue;2474247324742474+ /* If we didn't map access then again we don't care about the24752475+ * mismatched range values and it's ok if our old type was24762476+ * UNKNOWN and we didn't go to a NOT_INIT'ed reg.24772477+ */24752478 if (rold->type == NOT_INIT ||24762476- (rold->type == UNKNOWN_VALUE && rcur->type != NOT_INIT))24792479+ (!varlen_map_access && rold->type == UNKNOWN_VALUE &&24802480+ rcur->type != NOT_INIT))24772481 continue;2478248224792483 if (rold->type == PTR_TO_PACKET && rcur->type == PTR_TO_PACKET &&
+8-11
kernel/events/core.c
···903903 */904904 cpuctx = __get_cpu_context(ctx);905905906906- /* Only set/clear cpuctx->cgrp if current task uses event->cgrp. */907907- if (perf_cgroup_from_task(current, ctx) != event->cgrp) {908908- /*909909- * We are removing the last cpu event in this context.910910- * If that event is not active in this cpu, cpuctx->cgrp911911- * should've been cleared by perf_cgroup_switch.912912- */913913- WARN_ON_ONCE(!add && cpuctx->cgrp);914914- return;915915- }916916- cpuctx->cgrp = add ? event->cgrp : NULL;906906+ /*907907+ * cpuctx->cgrp is NULL until a cgroup event is sched in or908908+ * ctx->nr_cgroup == 0 .909909+ */910910+ if (add && perf_cgroup_from_task(current, ctx) == event->cgrp)911911+ cpuctx->cgrp = event->cgrp;912912+ else if (!add)913913+ cpuctx->cgrp = NULL;917914}918915919916#else /* !CONFIG_CGROUP_PERF */
···506506 name = class->name;507507 if (!name) {508508 name = __get_key_name(class->key, str);509509- printk("%s", name);509509+ printk(KERN_CONT "%s", name);510510 } else {511511- printk("%s", name);511511+ printk(KERN_CONT "%s", name);512512 if (class->name_version > 1)513513- printk("#%d", class->name_version);513513+ printk(KERN_CONT "#%d", class->name_version);514514 if (class->subclass)515515- printk("/%d", class->subclass);515515+ printk(KERN_CONT "/%d", class->subclass);516516 }517517}518518···522522523523 get_usage_chars(class, usage);524524525525- printk(" (");525525+ printk(KERN_CONT " (");526526 __print_lock_name(class);527527- printk("){%s}", usage);527527+ printk(KERN_CONT "){%s}", usage);528528}529529530530static void print_lockdep_cache(struct lockdep_map *lock)···536536 if (!name)537537 name = __get_key_name(lock->key->subkeys, str);538538539539- printk("%s", name);539539+ printk(KERN_CONT "%s", name);540540}541541542542static void print_lock(struct held_lock *hlock)···551551 barrier();552552553553 if (!class_idx || (class_idx - 1) >= MAX_LOCKDEP_KEYS) {554554- printk("<RELEASED>\n");554554+ printk(KERN_CONT "<RELEASED>\n");555555 return;556556 }557557558558 print_lock_name(lock_classes + class_idx - 1);559559- printk(", at: ");560560- print_ip_sym(hlock->acquire_ip);559559+ printk(KERN_CONT ", at: [<%p>] %pS\n",560560+ (void *)hlock->acquire_ip, (void *)hlock->acquire_ip);561561}562562563563static void lockdep_print_held_locks(struct task_struct *curr)···792792793793 printk("\nnew class %p: %s", class->key, class->name);794794 if (class->name_version > 1)795795- printk("#%d", class->name_version);796796- printk("\n");795795+ printk(KERN_CONT "#%d", class->name_version);796796+ printk(KERN_CONT "\n");797797 dump_stack();798798799799 if (!graph_lock()) {···10711071 return 0;10721072 printk("\n-> #%u", depth);10731073 print_lock_name(target->class);10741074- printk(":\n");10741074+ printk(KERN_CONT ":\n");10751075 print_stack_trace(&target->trace, 6);1076107610771077 return 0;···11021102 if (parent != source) {11031103 printk("Chain exists of:\n ");11041104 __print_lock_name(source);11051105- printk(" --> ");11051105+ printk(KERN_CONT " --> ");11061106 __print_lock_name(parent);11071107- printk(" --> ");11071107+ printk(KERN_CONT " --> ");11081108 __print_lock_name(target);11091109- printk("\n\n");11091109+ printk(KERN_CONT "\n\n");11101110 }1111111111121112 printk(" Possible unsafe locking scenario:\n\n");···11141114 printk(" ---- ----\n");11151115 printk(" lock(");11161116 __print_lock_name(target);11171117- printk(");\n");11171117+ printk(KERN_CONT ");\n");11181118 printk(" lock(");11191119 __print_lock_name(parent);11201120- printk(");\n");11201120+ printk(KERN_CONT ");\n");11211121 printk(" lock(");11221122 __print_lock_name(target);11231123- printk(");\n");11231123+ printk(KERN_CONT ");\n");11241124 printk(" lock(");11251125 __print_lock_name(source);11261126- printk(");\n");11261126+ printk(KERN_CONT ");\n");11271127 printk("\n *** DEADLOCK ***\n\n");11281128}11291129···1359135913601360 printk("%*s->", depth, "");13611361 print_lock_name(class);13621362- printk(" ops: %lu", class->ops);13631363- printk(" {\n");13621362+ printk(KERN_CONT " ops: %lu", class->ops);13631363+ printk(KERN_CONT " {\n");1364136413651365 for (bit = 0; bit < LOCK_USAGE_STATES; bit++) {13661366 if (class->usage_mask & (1 << bit)) {13671367 int len = depth;1368136813691369 len += printk("%*s %s", depth, "", usage_str[bit]);13701370- len += printk(" at:\n");13701370+ len += printk(KERN_CONT " at:\n");13711371 print_stack_trace(class->usage_traces + bit, len);13721372 }13731373 }13741374 printk("%*s }\n", depth, "");1375137513761376- printk("%*s ... key at: ",depth,"");13771377- print_ip_sym((unsigned long)class->key);13761376+ printk("%*s ... key at: [<%p>] %pS\n",13771377+ depth, "", class->key, class->key);13781378}1379137913801380/*···14371437 if (middle_class != unsafe_class) {14381438 printk("Chain exists of:\n ");14391439 __print_lock_name(safe_class);14401440- printk(" --> ");14401440+ printk(KERN_CONT " --> ");14411441 __print_lock_name(middle_class);14421442- printk(" --> ");14421442+ printk(KERN_CONT " --> ");14431443 __print_lock_name(unsafe_class);14441444- printk("\n\n");14441444+ printk(KERN_CONT "\n\n");14451445 }1446144614471447 printk(" Possible interrupt unsafe locking scenario:\n\n");···14491449 printk(" ---- ----\n");14501450 printk(" lock(");14511451 __print_lock_name(unsafe_class);14521452- printk(");\n");14521452+ printk(KERN_CONT ");\n");14531453 printk(" local_irq_disable();\n");14541454 printk(" lock(");14551455 __print_lock_name(safe_class);14561456- printk(");\n");14561456+ printk(KERN_CONT ");\n");14571457 printk(" lock(");14581458 __print_lock_name(middle_class);14591459- printk(");\n");14591459+ printk(KERN_CONT ");\n");14601460 printk(" <Interrupt>\n");14611461 printk(" lock(");14621462 __print_lock_name(safe_class);14631463- printk(");\n");14631463+ printk(KERN_CONT ");\n");14641464 printk("\n *** DEADLOCK ***\n\n");14651465}14661466···14971497 print_lock(prev);14981498 printk("which would create a new lock dependency:\n");14991499 print_lock_name(hlock_class(prev));15001500- printk(" ->");15001500+ printk(KERN_CONT " ->");15011501 print_lock_name(hlock_class(next));15021502- printk("\n");15021502+ printk(KERN_CONT "\n");1503150315041504 printk("\nbut this new dependency connects a %s-irq-safe lock:\n",15051505 irqclass);···1521152115221522 lockdep_print_held_locks(curr);1523152315241524- printk("\nthe dependencies between %s-irq-safe lock", irqclass);15251525- printk(" and the holding lock:\n");15241524+ printk("\nthe dependencies between %s-irq-safe lock and the holding lock:\n", irqclass);15261525 if (!save_trace(&prev_root->trace))15271526 return 0;15281527 print_shortest_lock_dependencies(backwards_entry, prev_root);···16931694 printk(" ----\n");16941695 printk(" lock(");16951696 __print_lock_name(prev);16961696- printk(");\n");16971697+ printk(KERN_CONT ");\n");16971698 printk(" lock(");16981699 __print_lock_name(next);16991699- printk(");\n");17001700+ printk(KERN_CONT ");\n");17001701 printk("\n *** DEADLOCK ***\n\n");17011702 printk(" May be due to missing lock nesting notation\n\n");17021703}···18901891 graph_unlock();18911892 printk("\n new dependency: ");18921893 print_lock_name(hlock_class(prev));18931893- printk(" => ");18941894+ printk(KERN_CONT " => ");18941895 print_lock_name(hlock_class(next));18951895- printk("\n");18961896+ printk(KERN_CONT "\n");18961897 dump_stack();18971898 return graph_lock();18981899 }···23422343 printk(" ----\n");23432344 printk(" lock(");23442345 __print_lock_name(class);23452345- printk(");\n");23462346+ printk(KERN_CONT ");\n");23462347 printk(" <Interrupt>\n");23472348 printk(" lock(");23482349 __print_lock_name(class);23492349- printk(");\n");23502350+ printk(KERN_CONT ");\n");23502351 printk("\n *** DEADLOCK ***\n\n");23512352}23522353···25212522void print_irqtrace_events(struct task_struct *curr)25222523{25232524 printk("irq event stamp: %u\n", curr->irq_events);25242524- printk("hardirqs last enabled at (%u): ", curr->hardirq_enable_event);25252525- print_ip_sym(curr->hardirq_enable_ip);25262526- printk("hardirqs last disabled at (%u): ", curr->hardirq_disable_event);25272527- print_ip_sym(curr->hardirq_disable_ip);25282528- printk("softirqs last enabled at (%u): ", curr->softirq_enable_event);25292529- print_ip_sym(curr->softirq_enable_ip);25302530- printk("softirqs last disabled at (%u): ", curr->softirq_disable_event);25312531- print_ip_sym(curr->softirq_disable_ip);25252525+ printk("hardirqs last enabled at (%u): [<%p>] %pS\n",25262526+ curr->hardirq_enable_event, (void *)curr->hardirq_enable_ip,25272527+ (void *)curr->hardirq_enable_ip);25282528+ printk("hardirqs last disabled at (%u): [<%p>] %pS\n",25292529+ curr->hardirq_disable_event, (void *)curr->hardirq_disable_ip,25302530+ (void *)curr->hardirq_disable_ip);25312531+ printk("softirqs last enabled at (%u): [<%p>] %pS\n",25322532+ curr->softirq_enable_event, (void *)curr->softirq_enable_ip,25332533+ (void *)curr->softirq_enable_ip);25342534+ printk("softirqs last disabled at (%u): [<%p>] %pS\n",25352535+ curr->softirq_disable_event, (void *)curr->softirq_disable_ip,25362536+ (void *)curr->softirq_disable_ip);25322537}2533253825342539static int HARDIRQ_verbose(struct lock_class *class)···32383235 if (very_verbose(class)) {32393236 printk("\nacquire class [%p] %s", class->key, class->name);32403237 if (class->name_version > 1)32413241- printk("#%d", class->name_version);32423242- printk("\n");32383238+ printk(KERN_CONT "#%d", class->name_version);32393239+ printk(KERN_CONT "\n");32433240 dump_stack();32443241 }32453242···33813378 printk("%s/%d is trying to release lock (",33823379 curr->comm, task_pid_nr(curr));33833380 print_lockdep_cache(lock);33843384- printk(") at:\n");33813381+ printk(KERN_CONT ") at:\n");33853382 print_ip_sym(ip);33863383 printk("but there are no more locks to release!\n");33873384 printk("\nother info that might help us debug this:\n");···38743871 printk("%s/%d is trying to contend lock (",38753872 curr->comm, task_pid_nr(curr));38763873 print_lockdep_cache(lock);38773877- printk(") at:\n");38743874+ printk(KERN_CONT ") at:\n");38783875 print_ip_sym(ip);38793876 printk("but there are no locks held!\n");38803877 printk("\nother info that might help us debug this:\n");
+3-2
kernel/module.c
···13011301 goto bad_version;13021302 }1303130313041304- pr_warn("%s: no symbol version for %s\n", mod->name, symname);13051305- return 0;13041304+ /* Broken toolchain. Warn once, then let it go.. */13051305+ pr_warn_once("%s: no symbol version for %s\n", mod->name, symname);13061306+ return 1;1306130713071308bad_version:13081309 pr_warn("%s: disagrees about version of symbol %s\n",
+3-1
kernel/sched/auto_group.c
···212212{213213 static unsigned long next = INITIAL_JIFFIES;214214 struct autogroup *ag;215215+ unsigned long shares;215216 int err;216217217218 if (nice < MIN_NICE || nice > MAX_NICE)···231230232231 next = HZ / 10 + jiffies;233232 ag = autogroup_task_get(p);233233+ shares = scale_load(sched_prio_to_weight[nice + 20]);234234235235 down_write(&ag->lock);236236- err = sched_group_set_shares(ag->tg, sched_prio_to_weight[nice + 20]);236236+ err = sched_group_set_shares(ag->tg, shares);237237 if (!err)238238 ag->nice = nice;239239 up_write(&ag->lock);
+8
lib/debugobjects.c
···362362363363 __debug_object_init(addr, descr, 0);364364}365365+EXPORT_SYMBOL_GPL(debug_object_init);365366366367/**367368 * debug_object_init_on_stack - debug checks when an object on stack is···377376378377 __debug_object_init(addr, descr, 1);379378}379379+EXPORT_SYMBOL_GPL(debug_object_init_on_stack);380380381381/**382382 * debug_object_activate - debug checks when an object is activated···451449 }452450 return 0;453451}452452+EXPORT_SYMBOL_GPL(debug_object_activate);454453455454/**456455 * debug_object_deactivate - debug checks when an object is deactivated···499496500497 raw_spin_unlock_irqrestore(&db->lock, flags);501498}499499+EXPORT_SYMBOL_GPL(debug_object_deactivate);502500503501/**504502 * debug_object_destroy - debug checks when an object is destroyed···546542out_unlock:547543 raw_spin_unlock_irqrestore(&db->lock, flags);548544}545545+EXPORT_SYMBOL_GPL(debug_object_destroy);549546550547/**551548 * debug_object_free - debug checks when an object is freed···587582out_unlock:588583 raw_spin_unlock_irqrestore(&db->lock, flags);589584}585585+EXPORT_SYMBOL_GPL(debug_object_free);590586591587/**592588 * debug_object_assert_init - debug checks when object should be init-ed···632626633627 raw_spin_unlock_irqrestore(&db->lock, flags);634628}629629+EXPORT_SYMBOL_GPL(debug_object_assert_init);635630636631/**637632 * debug_object_active_state - debug checks object usage state machine···680673681674 raw_spin_unlock_irqrestore(&db->lock, flags);682675}676676+EXPORT_SYMBOL_GPL(debug_object_active_state);683677684678#ifdef CONFIG_DEBUG_OBJECTS_FREE685679static void __debug_check_no_obj_freed(const void *address, unsigned long size)
+6-1
lib/mpi/mpi-pow.c
···6464 if (!esize) {6565 /* Exponent is zero, result is 1 mod MOD, i.e., 1 or 06666 * depending on if MOD equals 1. */6767- rp[0] = 1;6867 res->nlimbs = (msize == 1 && mod->d[0] == 1) ? 0 : 1;6868+ if (res->nlimbs) {6969+ if (mpi_resize(res, 1) < 0)7070+ goto enomem;7171+ rp = res->d;7272+ rp[0] = 1;7373+ }6974 res->sign = 0;7075 goto leave;7176 }
+29
lib/test_kasan.c
···2020#include <linux/uaccess.h>2121#include <linux/module.h>22222323+/*2424+ * Note: test functions are marked noinline so that their names appear in2525+ * reports.2626+ */2727+2328static noinline void __init kmalloc_oob_right(void)2429{2530 char *ptr;···416411 kfree(kmem);417412}418413414414+static noinline void __init use_after_scope_test(void)415415+{416416+ volatile char *volatile p;417417+418418+ pr_info("use-after-scope on int\n");419419+ {420420+ int local = 0;421421+422422+ p = (char *)&local;423423+ }424424+ p[0] = 1;425425+ p[3] = 1;426426+427427+ pr_info("use-after-scope on array\n");428428+ {429429+ char local[1024] = {0};430430+431431+ p = local;432432+ }433433+ p[0] = 1;434434+ p[1023] = 1;435435+}436436+419437static int __init kmalloc_tests_init(void)420438{421439 kmalloc_oob_right();···464436 kasan_global_oob();465437 ksize_unpoisons_memory();466438 copy_user_test();439439+ use_after_scope_test();467440 return -EAGAIN;468441}469442
+2-2
mm/huge_memory.c
···14561456 new_ptl = pmd_lockptr(mm, new_pmd);14571457 if (new_ptl != old_ptl)14581458 spin_lock_nested(new_ptl, SINGLE_DEPTH_NESTING);14591459- if (pmd_present(*old_pmd) && pmd_dirty(*old_pmd))14601460- force_flush = true;14611459 pmd = pmdp_huge_get_and_clear(mm, old_addr, old_pmd);14601460+ if (pmd_present(pmd) && pmd_dirty(pmd))14611461+ force_flush = true;14621462 VM_BUG_ON(!pmd_none(*new_pmd));1463146314641464 if (pmd_move_must_withdraw(new_ptl, old_ptl) &&
+19
mm/kasan/kasan.c
···764764void __asan_handle_no_return(void) {}765765EXPORT_SYMBOL(__asan_handle_no_return);766766767767+/* Emitted by compiler to poison large objects when they go out of scope. */768768+void __asan_poison_stack_memory(const void *addr, size_t size)769769+{770770+ /*771771+ * Addr is KASAN_SHADOW_SCALE_SIZE-aligned and the object is surrounded772772+ * by redzones, so we simply round up size to simplify logic.773773+ */774774+ kasan_poison_shadow(addr, round_up(size, KASAN_SHADOW_SCALE_SIZE),775775+ KASAN_USE_AFTER_SCOPE);776776+}777777+EXPORT_SYMBOL(__asan_poison_stack_memory);778778+779779+/* Emitted by compiler to unpoison large objects when they go into scope. */780780+void __asan_unpoison_stack_memory(const void *addr, size_t size)781781+{782782+ kasan_unpoison_shadow(addr, size);783783+}784784+EXPORT_SYMBOL(__asan_unpoison_stack_memory);785785+767786#ifdef CONFIG_MEMORY_HOTPLUG768787static int kasan_mem_notifier(struct notifier_block *nb,769788 unsigned long action, void *data)
+4
mm/kasan/kasan.h
···2121#define KASAN_STACK_MID 0xF22222#define KASAN_STACK_RIGHT 0xF32323#define KASAN_STACK_PARTIAL 0xF42424+#define KASAN_USE_AFTER_SCOPE 0xF824252526/* Don't break randconfig/all*config builds */2627#ifndef KASAN_ABI_VERSION···5352 unsigned long has_dynamic_init; /* This needed for C++ */5453#if KASAN_ABI_VERSION >= 45554 struct kasan_source_location *location;5555+#endif5656+#if KASAN_ABI_VERSION >= 55757+ char *odr_indicator;5658#endif5759};5860
+3
mm/kasan/report.c
···9090 case KASAN_KMALLOC_FREE:9191 bug_type = "use-after-free";9292 break;9393+ case KASAN_USE_AFTER_SCOPE:9494+ bug_type = "use-after-scope";9595+ break;9396 }94979598 pr_err("BUG: KASAN: %s in %pS at addr %p\n",
···190190 */191191 spin_lock_irq(zone_lru_lock(zone));192192193193- nr_pages = hpage_nr_pages(page);194194- if (!TestClearPageMlocked(page))193193+ if (!TestClearPageMlocked(page)) {194194+ /* Potentially, PTE-mapped THP: do not skip the rest PTEs */195195+ nr_pages = 1;195196 goto unlock_out;197197+ }196198199199+ nr_pages = hpage_nr_pages(page);197200 __mod_zone_page_state(zone, NR_MLOCK, -nr_pages);198201199202 if (__munlock_isolate_lru_page(page, true)) {
+11-7
mm/mremap.c
···149149 if (pte_none(*old_pte))150150 continue;151151152152- /*153153- * We are remapping a dirty PTE, make sure to154154- * flush TLB before we drop the PTL for the155155- * old PTE or we may race with page_mkclean().156156- */157157- if (pte_present(*old_pte) && pte_dirty(*old_pte))158158- force_flush = true;159152 pte = ptep_get_and_clear(mm, old_addr, old_pte);153153+ /*154154+ * If we are remapping a dirty PTE, make sure155155+ * to flush TLB before we drop the PTL for the156156+ * old PTE or we may race with page_mkclean().157157+ *158158+ * This check has to be done after we removed the159159+ * old PTE from page tables or another thread may160160+ * dirty it after the check and before the removal.161161+ */162162+ if (pte_present(pte) && pte_dirty(pte))163163+ force_flush = true;160164 pte = move_pte(pte, new_vma->vm_page_prot, old_addr, new_addr);161165 pte = move_soft_dirty_pte(pte);162166 set_pte_at(mm, new_addr, new_pte, pte);
+14-1
mm/shmem.c
···18481848 return error;18491849}1850185018511851+/*18521852+ * This is like autoremove_wake_function, but it removes the wait queue18531853+ * entry unconditionally - even if something else had already woken the18541854+ * target.18551855+ */18561856+static int synchronous_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key)18571857+{18581858+ int ret = default_wake_function(wait, mode, sync, key);18591859+ list_del_init(&wait->task_list);18601860+ return ret;18611861+}18621862+18511863static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)18521864{18531865 struct inode *inode = file_inode(vma->vm_file);···18951883 vmf->pgoff >= shmem_falloc->start &&18961884 vmf->pgoff < shmem_falloc->next) {18971885 wait_queue_head_t *shmem_falloc_waitq;18981898- DEFINE_WAIT(shmem_fault_wait);18861886+ DEFINE_WAIT_FUNC(shmem_fault_wait, synchronous_wake_function);1899188719001888 ret = VM_FAULT_NOPAGE;19011889 if ((vmf->flags & FAULT_FLAG_ALLOW_RETRY) &&···26772665 spin_lock(&inode->i_lock);26782666 inode->i_private = NULL;26792667 wake_up_all(&shmem_falloc_waitq);26682668+ WARN_ON_ONCE(!list_empty(&shmem_falloc_waitq.task_list));26802669 spin_unlock(&inode->i_lock);26812670 error = 0;26822671 goto out;
+4-4
mm/truncate.c
···283283284284 if (!trylock_page(page))285285 continue;286286- WARN_ON(page_to_pgoff(page) != index);286286+ WARN_ON(page_to_index(page) != index);287287 if (PageWriteback(page)) {288288 unlock_page(page);289289 continue;···371371 }372372373373 lock_page(page);374374- WARN_ON(page_to_pgoff(page) != index);374374+ WARN_ON(page_to_index(page) != index);375375 wait_on_page_writeback(page);376376 truncate_inode_page(mapping, page);377377 unlock_page(page);···492492 if (!trylock_page(page))493493 continue;494494495495- WARN_ON(page_to_pgoff(page) != index);495495+ WARN_ON(page_to_index(page) != index);496496497497 /* Middle of THP: skip */498498 if (PageTransTail(page)) {···612612 }613613614614 lock_page(page);615615- WARN_ON(page_to_pgoff(page) != index);615615+ WARN_ON(page_to_index(page) != index);616616 if (page->mapping != mapping) {617617 unlock_page(page);618618 continue;
···499499 if (optlen % sizeof(struct can_filter) != 0)500500 return -EINVAL;501501502502+ if (optlen > CAN_RAW_FILTER_MAX * sizeof(struct can_filter))503503+ return -EINVAL;504504+502505 count = optlen / sizeof(struct can_filter);503506504507 if (count > 1) {
+1
net/core/ethtool.c
···24792479 case ETHTOOL_GET_TS_INFO:24802480 case ETHTOOL_GEEE:24812481 case ETHTOOL_GTUNABLE:24822482+ case ETHTOOL_GLINKSETTINGS:24822483 break;24832484 default:24842485 if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
···715715 val = min_t(u32, val, sysctl_wmem_max);716716set_sndbuf:717717 sk->sk_userlocks |= SOCK_SNDBUF_LOCK;718718- sk->sk_sndbuf = max_t(u32, val * 2, SOCK_MIN_SNDBUF);718718+ sk->sk_sndbuf = max_t(int, val * 2, SOCK_MIN_SNDBUF);719719 /* Wake up sending tasks if we upped the value. */720720 sk->sk_write_space(sk);721721 break;···751751 * returning the value we actually used in getsockopt752752 * is the most desirable behavior.753753 */754754- sk->sk_rcvbuf = max_t(u32, val * 2, SOCK_MIN_RCVBUF);754754+ sk->sk_rcvbuf = max_t(int, val * 2, SOCK_MIN_RCVBUF);755755 break;756756757757 case SO_RCVBUFFORCE:
···700700{701701 const struct dccp_hdr *dh;702702 unsigned int cscov;703703+ u8 dccph_doff;703704704705 if (skb->pkt_type != PACKET_HOST)705706 return 1;···722721 /*723722 * If P.Data Offset is too small for packet type, drop packet and return724723 */725725- if (dh->dccph_doff < dccp_hdr_len(skb) / sizeof(u32)) {726726- DCCP_WARN("P.Data Offset(%u) too small\n", dh->dccph_doff);724724+ dccph_doff = dh->dccph_doff;725725+ if (dccph_doff < dccp_hdr_len(skb) / sizeof(u32)) {726726+ DCCP_WARN("P.Data Offset(%u) too small\n", dccph_doff);727727 return 1;728728 }729729 /*730730 * If P.Data Offset is too too large for packet, drop packet and return731731 */732732- if (!pskb_may_pull(skb, dh->dccph_doff * sizeof(u32))) {733733- DCCP_WARN("P.Data Offset(%u) too large\n", dh->dccph_doff);732732+ if (!pskb_may_pull(skb, dccph_doff * sizeof(u32))) {733733+ DCCP_WARN("P.Data Offset(%u) too large\n", dccph_doff);734734 return 1;735735 }736736-736736+ dh = dccp_hdr(skb);737737 /*738738 * If P.type is not Data, Ack, or DataAck and P.X == 0 (the packet739739 * has short sequence numbers), drop packet and return
+4-9
net/dsa/dsa.c
···233233 genphy_read_status(phydev);234234 if (ds->ops->adjust_link)235235 ds->ops->adjust_link(ds, port, phydev);236236+237237+ put_device(&phydev->mdio.dev);236238 }237239238240 return 0;···506504507505void dsa_cpu_dsa_destroy(struct device_node *port_dn)508506{509509- struct phy_device *phydev;510510-511511- if (of_phy_is_fixed_link(port_dn)) {512512- phydev = of_phy_find_device(port_dn);513513- if (phydev) {514514- phy_device_free(phydev);515515- fixed_phy_unregister(phydev);516516- }517517- }507507+ if (of_phy_is_fixed_link(port_dn))508508+ of_phy_deregister_fixed_link(port_dn);518509}519510520511static void dsa_switch_destroy(struct dsa_switch *ds)
···11251125 p->phy_interface = mode;1126112611271127 phy_dn = of_parse_phandle(port_dn, "phy-handle", 0);11281128- if (of_phy_is_fixed_link(port_dn)) {11281128+ if (!phy_dn && of_phy_is_fixed_link(port_dn)) {11291129 /* In the case of a fixed PHY, the DT node associated11301130 * to the fixed PHY is the Port DT node11311131 */···11351135 return ret;11361136 }11371137 phy_is_fixed = true;11381138- phy_dn = port_dn;11381138+ phy_dn = of_node_get(port_dn);11391139 }1140114011411141 if (ds->ops->get_phy_flags)···11541154 ret = dsa_slave_phy_connect(p, slave_dev, phy_id);11551155 if (ret) {11561156 netdev_err(slave_dev, "failed to connect to phy%d: %d\n", phy_id, ret);11571157+ of_node_put(phy_dn);11571158 return ret;11581159 }11591160 } else {···11631162 phy_flags,11641163 p->phy_interface);11651164 }11651165+11661166+ of_node_put(phy_dn);11661167 }1167116811681169 if (p->phy && phy_is_fixed)···11771174 ret = dsa_slave_phy_connect(p, slave_dev, p->port);11781175 if (ret) {11791176 netdev_err(slave_dev, "failed to connect to port %d: %d\n", p->port, ret);11771177+ if (phy_is_fixed)11781178+ of_phy_deregister_fixed_link(port_dn);11801179 return ret;11811180 }11821181 }···12941289void dsa_slave_destroy(struct net_device *slave_dev)12951290{12961291 struct dsa_slave_priv *p = netdev_priv(slave_dev);12921292+ struct dsa_switch *ds = p->parent;12931293+ struct device_node *port_dn;12941294+12951295+ port_dn = ds->ports[p->port].dn;1297129612981297 netif_carrier_off(slave_dev);12991299- if (p->phy)12981298+ if (p->phy) {13001299 phy_disconnect(p->phy);13001300+13011301+ if (of_phy_is_fixed_link(port_dn))13021302+ of_phy_deregister_fixed_link(port_dn);13031303+ }13011304 unregister_netdev(slave_dev);13021305 free_netdev(slave_dev);13031306}
+1
net/ipv4/Kconfig
···715715 default "reno" if DEFAULT_RENO716716 default "dctcp" if DEFAULT_DCTCP717717 default "cdg" if DEFAULT_CDG718718+ default "bbr" if DEFAULT_BBR718719 default "cubic"719720720721config TCP_MD5SIG
+1-1
net/ipv4/af_inet.c
···12331233 fixedid = !!(skb_shinfo(skb)->gso_type & SKB_GSO_TCP_FIXEDID);1234123412351235 /* fixed ID is invalid if DF bit is not set */12361236- if (fixedid && !(iph->frag_off & htons(IP_DF)))12361236+ if (fixedid && !(ip_hdr(skb)->frag_off & htons(IP_DF)))12371237 goto out;12381238 }12391239
···719719{720720 unsigned char slen = tn->pos;721721 unsigned long stride, i;722722+ unsigned char slen_max;723723+724724+ /* only vector 0 can have a suffix length greater than or equal to725725+ * tn->pos + tn->bits, the second highest node will have a suffix726726+ * length at most of tn->pos + tn->bits - 1727727+ */728728+ slen_max = min_t(unsigned char, tn->pos + tn->bits - 1, tn->slen);722729723730 /* search though the list of children looking for nodes that might724731 * have a suffix greater than the one we currently have. This is···743736 slen = n->slen;744737 i &= ~(stride - 1);745738746746- /* if slen covers all but the last bit we can stop here747747- * there will be nothing longer than that since only node748748- * 0 and 1 << (bits - 1) could have that as their suffix749749- * length.750750- */751751- if ((slen + 1) >= (tn->pos + tn->bits))739739+ /* stop searching if we have hit the maximum possible value */740740+ if (slen >= slen_max)752741 break;753742 }754743···916913 return collapse(t, tn);917914918915 /* update parent in case halve failed */919919- tp = node_parent(tn);920920-921921- /* Return if at least one deflate was run */922922- if (max_work != MAX_WORK)923923- return tp;924924-925925- /* push the suffix length to the parent node */926926- if (tn->slen > tn->pos) {927927- unsigned char slen = update_suffix(tn);928928-929929- if (slen > tp->slen)930930- tp->slen = slen;931931- }932932-933933- return tp;916916+ return node_parent(tn);934917}935918936936-static void leaf_pull_suffix(struct key_vector *tp, struct key_vector *l)919919+static void node_pull_suffix(struct key_vector *tn, unsigned char slen)937920{938938- while ((tp->slen > tp->pos) && (tp->slen > l->slen)) {939939- if (update_suffix(tp) > l->slen)921921+ unsigned char node_slen = tn->slen;922922+923923+ while ((node_slen > tn->pos) && (node_slen > slen)) {924924+ slen = update_suffix(tn);925925+ if (node_slen == slen)940926 break;941941- tp = node_parent(tp);927927+928928+ tn = node_parent(tn);929929+ node_slen = tn->slen;942930 }943931}944932945945-static void leaf_push_suffix(struct key_vector *tn, struct key_vector *l)933933+static void node_push_suffix(struct key_vector *tn, unsigned char slen)946934{947947- /* if this is a new leaf then tn will be NULL and we can sort948948- * out parent suffix lengths as a part of trie_rebalance949949- */950950- while (tn->slen < l->slen) {951951- tn->slen = l->slen;935935+ while (tn->slen < slen) {936936+ tn->slen = slen;952937 tn = node_parent(tn);953938 }954939}···10571066 }1058106710591068 /* Case 3: n is NULL, and will just insert a new leaf */10691069+ node_push_suffix(tp, new->fa_slen);10601070 NODE_INIT_PARENT(l, tp);10611071 put_child_root(tp, key, l);10621072 trie_rebalance(t, tp);···10991107 /* if we added to the tail node then we need to update slen */11001108 if (l->slen < new->fa_slen) {11011109 l->slen = new->fa_slen;11021102- leaf_push_suffix(tp, l);11101110+ node_push_suffix(tp, new->fa_slen);11031111 }1104111211051113 return 0;···14911499 * out parent suffix lengths as a part of trie_rebalance14921500 */14931501 if (hlist_empty(&l->leaf)) {15021502+ if (tp->slen == l->slen)15031503+ node_pull_suffix(tp, tp->pos);14941504 put_child_root(tp, l->key, NULL);14951505 node_free(l);14961506 trie_rebalance(t, tp);···1505151115061512 /* update the trie with the latest suffix length */15071513 l->slen = fa->fa_slen;15081508- leaf_pull_suffix(tp, l);15141514+ node_pull_suffix(tp, fa->fa_slen);15091515}1510151615111517/* Caller must hold RTNL. */···17771783 if (IS_TRIE(pn))17781784 break;1779178517861786+ /* update the suffix to address pulled leaves */17871787+ if (pn->slen > pn->pos)17881788+ update_suffix(pn);17891789+17801790 /* resize completed node */17811791 pn = resize(t, pn);17821792 cindex = get_index(pkey, pn);···18461848 /* cannot resize the trie vector */18471849 if (IS_TRIE(pn))18481850 break;18511851+18521852+ /* update the suffix to address pulled leaves */18531853+ if (pn->slen > pn->pos)18541854+ update_suffix(pn);1849185518501856 /* resize completed node */18511857 pn = resize(t, pn);
···657657 if (len > 0xFFFF)658658 return -EMSGSIZE;659659660660+ /* Must have at least a full ICMP header. */661661+ if (len < icmph_len)662662+ return -EINVAL;663663+660664 /*661665 * Check the flags.662666 */
+21-1
net/ipv4/tcp_input.c
···128128#define REXMIT_LOST 1 /* retransmit packets marked lost */129129#define REXMIT_NEW 2 /* FRTO-style transmit of unsent/new packets */130130131131+static void tcp_gro_dev_warn(struct sock *sk, const struct sk_buff *skb)132132+{133133+ static bool __once __read_mostly;134134+135135+ if (!__once) {136136+ struct net_device *dev;137137+138138+ __once = true;139139+140140+ rcu_read_lock();141141+ dev = dev_get_by_index_rcu(sock_net(sk), skb->skb_iif);142142+ pr_warn("%s: Driver has suspect GRO implementation, TCP performance may be compromised.\n",143143+ dev ? dev->name : "Unknown driver");144144+ rcu_read_unlock();145145+ }146146+}147147+131148/* Adapt the MSS value used to make delayed ack decision to the132149 * real world.133150 */···161144 */162145 len = skb_shinfo(skb)->gso_size ? : skb->len;163146 if (len >= icsk->icsk_ack.rcv_mss) {164164- icsk->icsk_ack.rcv_mss = len;147147+ icsk->icsk_ack.rcv_mss = min_t(unsigned int, len,148148+ tcp_sk(sk)->advmss);149149+ if (unlikely(icsk->icsk_ack.rcv_mss != len))150150+ tcp_gro_dev_warn(sk, skb);165151 } else {166152 /* Otherwise, we make more careful check taking into account,167153 * that SACKs block is variable.
+1-1
net/ipv4/udp.c
···14551455 udp_lib_rehash(sk, new_hash);14561456}1457145714581458-static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)14581458+int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)14591459{14601460 int rc;14611461
+1-1
net/ipv4/udp_impl.h
···2525 int flags, int *addr_len);2626int udp_sendpage(struct sock *sk, struct page *page, int offset, size_t size,2727 int flags);2828-int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);2828+int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);2929void udp_destroy_sock(struct sock *sk);30303131#ifdef CONFIG_PROC_FS
···447447448448 if (__ipv6_addr_needs_scope_id(addr_type))449449 iif = skb->dev->ifindex;450450- else451451- iif = l3mdev_master_ifindex(skb_dst(skb)->dev);450450+ else {451451+ dst = skb_dst(skb);452452+ iif = l3mdev_master_ifindex(dst ? dst->dev : skb->dev);453453+ }452454453455 /*454456 * Must not send error if the source does not uniquely
+1-1
net/ipv6/ip6_offload.c
···9999 segs = ops->callbacks.gso_segment(skb, features);100100 }101101102102- if (IS_ERR(segs))102102+ if (IS_ERR_OR_NULL(segs))103103 goto out;104104105105 gso_partial = !!(skb_shinfo(segs)->gso_type & SKB_GSO_PARTIAL);
···9797 unsigned int len = skb->len;9898 int ret = l2tp_xmit_skb(session, skb, session->hdr_len);9999100100- if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) {100100+ if (likely(ret == NET_XMIT_SUCCESS)) {101101 atomic_long_add(len, &priv->tx_bytes);102102 atomic_long_inc(&priv->tx_packets);103103 } else {
+35-30
net/l2tp/l2tp_ip.c
···6161 if ((l2tp->conn_id == tunnel_id) &&6262 net_eq(sock_net(sk), net) &&6363 !(inet->inet_rcv_saddr && inet->inet_rcv_saddr != laddr) &&6464- !(sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif))6464+ (!sk->sk_bound_dev_if || !dif ||6565+ sk->sk_bound_dev_if == dif))6566 goto found;6667 }6768···183182 struct iphdr *iph = (struct iphdr *) skb_network_header(skb);184183185184 read_lock_bh(&l2tp_ip_lock);186186- sk = __l2tp_ip_bind_lookup(net, iph->daddr, 0, tunnel_id);185185+ sk = __l2tp_ip_bind_lookup(net, iph->daddr, inet_iif(skb),186186+ tunnel_id);187187+ if (!sk) {188188+ read_unlock_bh(&l2tp_ip_lock);189189+ goto discard;190190+ }191191+192192+ sock_hold(sk);187193 read_unlock_bh(&l2tp_ip_lock);188194 }189189-190190- if (sk == NULL)191191- goto discard;192192-193193- sock_hold(sk);194195195196 if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb))196197 goto discard_put;···259256 if (addr->l2tp_family != AF_INET)260257 return -EINVAL;261258262262- ret = -EADDRINUSE;263263- read_lock_bh(&l2tp_ip_lock);264264- if (__l2tp_ip_bind_lookup(net, addr->l2tp_addr.s_addr,265265- sk->sk_bound_dev_if, addr->l2tp_conn_id))266266- goto out_in_use;267267-268268- read_unlock_bh(&l2tp_ip_lock);269269-270259 lock_sock(sk);260260+261261+ ret = -EINVAL;271262 if (!sock_flag(sk, SOCK_ZAPPED))272263 goto out;273264···278281 inet->inet_rcv_saddr = inet->inet_saddr = addr->l2tp_addr.s_addr;279282 if (chk_addr_ret == RTN_MULTICAST || chk_addr_ret == RTN_BROADCAST)280283 inet->inet_saddr = 0; /* Use device */281281- sk_dst_reset(sk);282282-283283- l2tp_ip_sk(sk)->conn_id = addr->l2tp_conn_id;284284285285 write_lock_bh(&l2tp_ip_lock);286286+ if (__l2tp_ip_bind_lookup(net, addr->l2tp_addr.s_addr,287287+ sk->sk_bound_dev_if, addr->l2tp_conn_id)) {288288+ write_unlock_bh(&l2tp_ip_lock);289289+ ret = -EADDRINUSE;290290+ goto out;291291+ }292292+293293+ sk_dst_reset(sk);294294+ l2tp_ip_sk(sk)->conn_id = addr->l2tp_conn_id;295295+286296 sk_add_bind_node(sk, &l2tp_ip_bind_table);287297 sk_del_node_init(sk);288298 write_unlock_bh(&l2tp_ip_lock);299299+289300 ret = 0;290301 sock_reset_flag(sk, SOCK_ZAPPED);291302292303out:293304 release_sock(sk);294294-295295- return ret;296296-297297-out_in_use:298298- read_unlock_bh(&l2tp_ip_lock);299305300306 return ret;301307}···308308 struct sockaddr_l2tpip *lsa = (struct sockaddr_l2tpip *) uaddr;309309 int rc;310310311311- if (sock_flag(sk, SOCK_ZAPPED)) /* Must bind first - autobinding does not work */312312- return -EINVAL;313313-314311 if (addr_len < sizeof(*lsa))315312 return -EINVAL;316313317314 if (ipv4_is_multicast(lsa->l2tp_addr.s_addr))318315 return -EINVAL;319316320320- rc = ip4_datagram_connect(sk, uaddr, addr_len);321321- if (rc < 0)322322- return rc;323323-324317 lock_sock(sk);318318+319319+ /* Must bind first - autobinding does not work */320320+ if (sock_flag(sk, SOCK_ZAPPED)) {321321+ rc = -EINVAL;322322+ goto out_sk;323323+ }324324+325325+ rc = __ip4_datagram_connect(sk, uaddr, addr_len);326326+ if (rc < 0)327327+ goto out_sk;325328326329 l2tp_ip_sk(sk)->peer_conn_id = lsa->l2tp_conn_id;327330···333330 sk_add_bind_node(sk, &l2tp_ip_bind_table);334331 write_unlock_bh(&l2tp_ip_lock);335332333333+out_sk:336334 release_sock(sk);335335+337336 return rc;338337}339338
+42-37
net/l2tp/l2tp_ip6.c
···72727373 if ((l2tp->conn_id == tunnel_id) &&7474 net_eq(sock_net(sk), net) &&7575- !(addr && ipv6_addr_equal(addr, laddr)) &&7676- !(sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif))7575+ (!addr || ipv6_addr_equal(addr, laddr)) &&7676+ (!sk->sk_bound_dev_if || !dif ||7777+ sk->sk_bound_dev_if == dif))7778 goto found;7879 }7980···197196 struct ipv6hdr *iph = ipv6_hdr(skb);198197199198 read_lock_bh(&l2tp_ip6_lock);200200- sk = __l2tp_ip6_bind_lookup(net, &iph->daddr,201201- 0, tunnel_id);199199+ sk = __l2tp_ip6_bind_lookup(net, &iph->daddr, inet6_iif(skb),200200+ tunnel_id);201201+ if (!sk) {202202+ read_unlock_bh(&l2tp_ip6_lock);203203+ goto discard;204204+ }205205+206206+ sock_hold(sk);202207 read_unlock_bh(&l2tp_ip6_lock);203208 }204204-205205- if (sk == NULL)206206- goto discard;207207-208208- sock_hold(sk);209209210210 if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb))211211 goto discard_put;···268266 struct sockaddr_l2tpip6 *addr = (struct sockaddr_l2tpip6 *) uaddr;269267 struct net *net = sock_net(sk);270268 __be32 v4addr = 0;269269+ int bound_dev_if;271270 int addr_type;272271 int err;273272···287284 if (addr_type & IPV6_ADDR_MULTICAST)288285 return -EADDRNOTAVAIL;289286290290- err = -EADDRINUSE;291291- read_lock_bh(&l2tp_ip6_lock);292292- if (__l2tp_ip6_bind_lookup(net, &addr->l2tp_addr,293293- sk->sk_bound_dev_if, addr->l2tp_conn_id))294294- goto out_in_use;295295- read_unlock_bh(&l2tp_ip6_lock);296296-297287 lock_sock(sk);298288299289 err = -EINVAL;···296300 if (sk->sk_state != TCP_CLOSE)297301 goto out_unlock;298302303303+ bound_dev_if = sk->sk_bound_dev_if;304304+299305 /* Check if the address belongs to the host. */300306 rcu_read_lock();301307 if (addr_type != IPV6_ADDR_ANY) {302308 struct net_device *dev = NULL;303309304310 if (addr_type & IPV6_ADDR_LINKLOCAL) {305305- if (addr_len >= sizeof(struct sockaddr_in6) &&306306- addr->l2tp_scope_id) {307307- /* Override any existing binding, if another308308- * one is supplied by user.309309- */310310- sk->sk_bound_dev_if = addr->l2tp_scope_id;311311- }311311+ if (addr->l2tp_scope_id)312312+ bound_dev_if = addr->l2tp_scope_id;312313313314 /* Binding to link-local address requires an314314- interface */315315- if (!sk->sk_bound_dev_if)315315+ * interface.316316+ */317317+ if (!bound_dev_if)316318 goto out_unlock_rcu;317319318320 err = -ENODEV;319319- dev = dev_get_by_index_rcu(sock_net(sk),320320- sk->sk_bound_dev_if);321321+ dev = dev_get_by_index_rcu(sock_net(sk), bound_dev_if);321322 if (!dev)322323 goto out_unlock_rcu;323324 }···329336 }330337 rcu_read_unlock();331338332332- inet->inet_rcv_saddr = inet->inet_saddr = v4addr;339339+ write_lock_bh(&l2tp_ip6_lock);340340+ if (__l2tp_ip6_bind_lookup(net, &addr->l2tp_addr, bound_dev_if,341341+ addr->l2tp_conn_id)) {342342+ write_unlock_bh(&l2tp_ip6_lock);343343+ err = -EADDRINUSE;344344+ goto out_unlock;345345+ }346346+347347+ inet->inet_saddr = v4addr;348348+ inet->inet_rcv_saddr = v4addr;349349+ sk->sk_bound_dev_if = bound_dev_if;333350 sk->sk_v6_rcv_saddr = addr->l2tp_addr;334351 np->saddr = addr->l2tp_addr;335352336353 l2tp_ip6_sk(sk)->conn_id = addr->l2tp_conn_id;337354338338- write_lock_bh(&l2tp_ip6_lock);339355 sk_add_bind_node(sk, &l2tp_ip6_bind_table);340356 sk_del_node_init(sk);341357 write_unlock_bh(&l2tp_ip6_lock);···357355 rcu_read_unlock();358356out_unlock:359357 release_sock(sk);360360- return err;361358362362-out_in_use:363363- read_unlock_bh(&l2tp_ip6_lock);364359 return err;365360}366361···369370 struct in6_addr *daddr;370371 int addr_type;371372 int rc;372372-373373- if (sock_flag(sk, SOCK_ZAPPED)) /* Must bind first - autobinding does not work */374374- return -EINVAL;375373376374 if (addr_len < sizeof(*lsa))377375 return -EINVAL;···386390 return -EINVAL;387391 }388392389389- rc = ip6_datagram_connect(sk, uaddr, addr_len);390390-391393 lock_sock(sk);394394+395395+ /* Must bind first - autobinding does not work */396396+ if (sock_flag(sk, SOCK_ZAPPED)) {397397+ rc = -EINVAL;398398+ goto out_sk;399399+ }400400+401401+ rc = __ip6_datagram_connect(sk, uaddr, addr_len);402402+ if (rc < 0)403403+ goto out_sk;392404393405 l2tp_ip6_sk(sk)->peer_conn_id = lsa->l2tp_conn_id;394406···405401 sk_add_bind_node(sk, &l2tp_ip6_bind_table);406402 write_unlock_bh(&l2tp_ip6_lock);407403404404+out_sk:408405 release_sock(sk);409406410407 return rc;
···659659out_pernet:660660 unregister_pernet_subsys(&rds_tcp_net_ops);661661out_slab:662662+ if (unregister_netdevice_notifier(&rds_tcp_dev_notifier))663663+ pr_warn("could not unregister rds_tcp_dev_notifier\n");662664 kmem_cache_destroy(rds_tcp_conn_slab);663665out:664666 return ret;
+20-4
net/sched/act_pedit.c
···108108 kfree(keys);109109}110110111111+static bool offset_valid(struct sk_buff *skb, int offset)112112+{113113+ if (offset > 0 && offset > skb->len)114114+ return false;115115+116116+ if (offset < 0 && -offset > skb_headroom(skb))117117+ return false;118118+119119+ return true;120120+}121121+111122static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,112123 struct tcf_result *res)113124{···145134 if (tkey->offmask) {146135 char *d, _d;147136137137+ if (!offset_valid(skb, off + tkey->at)) {138138+ pr_info("tc filter pedit 'at' offset %d out of bounds\n",139139+ off + tkey->at);140140+ goto bad;141141+ }148142 d = skb_header_pointer(skb, off + tkey->at, 1,149143 &_d);150144 if (!d)···162146 " offset must be on 32 bit boundaries\n");163147 goto bad;164148 }165165- if (offset > 0 && offset > skb->len) {166166- pr_info("tc filter pedit"167167- " offset %d can't exceed pkt length %d\n",168168- offset, skb->len);149149+150150+ if (!offset_valid(skb, off + offset)) {151151+ pr_info("tc filter pedit offset %d out of bounds\n",152152+ offset);169153 goto bad;170154 }171155
+1-1
net/sched/cls_api.c
···112112113113 for (it_chain = chain; (tp = rtnl_dereference(*it_chain)) != NULL;114114 it_chain = &tp->next)115115- tfilter_notify(net, oskb, n, tp, n->nlmsg_flags, event, false);115115+ tfilter_notify(net, oskb, n, tp, 0, event, false);116116}117117118118/* Select new prio value from the range, managed by kernel. */
···292292 call_rcu(&prog->rcu, __cls_bpf_delete_prog);293293 }294294295295- RCU_INIT_POINTER(tp->root, NULL);296295 kfree_rcu(head, rcu);297296 return true;298297}···301302 struct cls_bpf_head *head = rtnl_dereference(tp->root);302303 struct cls_bpf_prog *prog;303304 unsigned long ret = 0UL;304304-305305- if (head == NULL)306306- return 0UL;307305308306 list_for_each_entry(prog, &head->plist, link) {309307 if (prog->handle == handle) {
+3-4
net/sched/cls_cgroup.c
···137137138138 if (!force)139139 return false;140140-141141- if (head) {142142- RCU_INIT_POINTER(tp->root, NULL);140140+ /* Head can still be NULL due to cls_cgroup_init(). */141141+ if (head)143142 call_rcu(&head->rcu, cls_cgroup_destroy_rcu);144144- }143143+145144 return true;146145}147146
···421421 dev = dev_get_by_name(net, driver_name);422422 if (!dev)423423 return -ENODEV;424424+ if (tipc_mtu_bad(dev, 0)) {425425+ dev_put(dev);426426+ return -EINVAL;427427+ }424428425429 /* Associate TIPC bearer with L2 bearer */426430 rcu_assign_pointer(b->media_ptr, dev);···614610 if (!b)615611 return NOTIFY_DONE;616612617617- b->mtu = dev->mtu;618618-619613 switch (evt) {620614 case NETDEV_CHANGE:621615 if (netif_carrier_ok(dev))···626624 tipc_reset_bearer(net, b);627625 break;628626 case NETDEV_CHANGEMTU:627627+ if (tipc_mtu_bad(dev, 0)) {628628+ bearer_disable(net, b);629629+ break;630630+ }631631+ b->mtu = dev->mtu;629632 tipc_reset_bearer(net, b);630633 break;631634 case NETDEV_CHANGEADDR:
+13
net/tipc/bearer.h
···39394040#include "netlink.h"4141#include "core.h"4242+#include "msg.h"4243#include <net/genetlink.h>43444445#define MAX_MEDIA 3···5958#define TIPC_MEDIA_TYPE_ETH 16059#define TIPC_MEDIA_TYPE_IB 26160#define TIPC_MEDIA_TYPE_UDP 36161+6262+/* minimum bearer MTU */6363+#define TIPC_MIN_BEARER_MTU (MAX_H_SIZE + INT_H_SIZE)62646365/**6466 * struct tipc_media_addr - destination address used by TIPC bearers···218214 struct tipc_media_addr *dst);219215void tipc_bearer_bc_xmit(struct net *net, u32 bearer_id,220216 struct sk_buff_head *xmitq);217217+218218+/* check if device MTU is too low for tipc headers */219219+static inline bool tipc_mtu_bad(struct net_device *dev, unsigned int reserve)220220+{221221+ if (dev->mtu >= TIPC_MIN_BEARER_MTU + reserve)222222+ return false;223223+ netdev_warn(dev, "MTU too low for tipc bearer\n");224224+ return true;225225+}221226222227#endif /* _TIPC_BEARER_H */
+22-18
net/tipc/link.c
···4747#include <linux/pkt_sched.h>48484949struct tipc_stats {5050- u32 sent_info; /* used in counting # sent packets */5151- u32 recv_info; /* used in counting # recv'd packets */5050+ u32 sent_pkts;5151+ u32 recv_pkts;5252 u32 sent_states;5353 u32 recv_states;5454 u32 sent_probes;···857857 l->acked = 0;858858 l->silent_intv_cnt = 0;859859 l->rst_cnt = 0;860860- l->stats.recv_info = 0;861860 l->stale_count = 0;862861 l->bc_peer_is_up = false;863862 memset(&l->mon_state, 0, sizeof(l->mon_state));···887888 struct sk_buff_head *transmq = &l->transmq;888889 struct sk_buff_head *backlogq = &l->backlogq;889890 struct sk_buff *skb, *_skb, *bskb;891891+ int pkt_cnt = skb_queue_len(list);890892891893 /* Match msg importance against this and all higher backlog limits: */892894 if (!skb_queue_empty(backlogq)) {···899899 if (unlikely(msg_size(hdr) > mtu)) {900900 skb_queue_purge(list);901901 return -EMSGSIZE;902902+ }903903+904904+ if (pkt_cnt > 1) {905905+ l->stats.sent_fragmented++;906906+ l->stats.sent_fragments += pkt_cnt;902907 }903908904909 /* Prepare each packet for sending, and add to relevant queue: */···925920 __skb_queue_tail(xmitq, _skb);926921 TIPC_SKB_CB(skb)->ackers = l->ackers;927922 l->rcv_unacked = 0;923923+ l->stats.sent_pkts++;928924 seqno++;929925 continue;930926 }···974968 msg_set_ack(hdr, ack);975969 msg_set_bcast_ack(hdr, bc_ack);976970 l->rcv_unacked = 0;971971+ l->stats.sent_pkts++;977972 seqno++;978973 }979974 l->snd_nxt = seqno;···1267126012681261 /* Deliver packet */12691262 l->rcv_nxt++;12701270- l->stats.recv_info++;12631263+ l->stats.recv_pkts++;12711264 if (!tipc_data_input(l, skb, l->inputq))12721265 rc |= tipc_link_input(l, skb, l->inputq);12731266 if (unlikely(++l->rcv_unacked >= TIPC_MIN_LINK_WIN))···14991492 if (in_range(peers_tol, TIPC_MIN_LINK_TOL, TIPC_MAX_LINK_TOL))15001493 l->tolerance = peers_tol;1501149415021502- if (peers_prio && in_range(peers_prio, TIPC_MIN_LINK_PRI,15031503- TIPC_MAX_LINK_PRI)) {14951495+ /* Update own prio if peer indicates a different value */14961496+ if ((peers_prio != l->priority) &&14971497+ in_range(peers_prio, 1, TIPC_MAX_LINK_PRI)) {15041498 l->priority = peers_prio;15051499 rc = tipc_link_fsm_evt(l, LINK_FAILURE_EVT);15061500 }···18071799void tipc_link_reset_stats(struct tipc_link *l)18081800{18091801 memset(&l->stats, 0, sizeof(l->stats));18101810- if (!link_is_bc_sndlink(l)) {18111811- l->stats.sent_info = l->snd_nxt;18121812- l->stats.recv_info = l->rcv_nxt;18131813- }18141802}1815180318161804static void link_print(struct tipc_link *l, const char *str)···18701866 };1871186718721868 struct nla_map map[] = {18731873- {TIPC_NLA_STATS_RX_INFO, s->recv_info},18691869+ {TIPC_NLA_STATS_RX_INFO, 0},18741870 {TIPC_NLA_STATS_RX_FRAGMENTS, s->recv_fragments},18751871 {TIPC_NLA_STATS_RX_FRAGMENTED, s->recv_fragmented},18761872 {TIPC_NLA_STATS_RX_BUNDLES, s->recv_bundles},18771873 {TIPC_NLA_STATS_RX_BUNDLED, s->recv_bundled},18781878- {TIPC_NLA_STATS_TX_INFO, s->sent_info},18741874+ {TIPC_NLA_STATS_TX_INFO, 0},18791875 {TIPC_NLA_STATS_TX_FRAGMENTS, s->sent_fragments},18801876 {TIPC_NLA_STATS_TX_FRAGMENTED, s->sent_fragmented},18811877 {TIPC_NLA_STATS_TX_BUNDLES, s->sent_bundles},···19501946 goto attr_msg_full;19511947 if (nla_put_u32(msg->skb, TIPC_NLA_LINK_MTU, link->mtu))19521948 goto attr_msg_full;19531953- if (nla_put_u32(msg->skb, TIPC_NLA_LINK_RX, link->rcv_nxt))19491949+ if (nla_put_u32(msg->skb, TIPC_NLA_LINK_RX, link->stats.recv_pkts))19541950 goto attr_msg_full;19551955- if (nla_put_u32(msg->skb, TIPC_NLA_LINK_TX, link->snd_nxt))19511951+ if (nla_put_u32(msg->skb, TIPC_NLA_LINK_TX, link->stats.sent_pkts))19561952 goto attr_msg_full;1957195319581954 if (tipc_link_is_up(link))···20072003 };2008200420092005 struct nla_map map[] = {20102010- {TIPC_NLA_STATS_RX_INFO, stats->recv_info},20062006+ {TIPC_NLA_STATS_RX_INFO, stats->recv_pkts},20112007 {TIPC_NLA_STATS_RX_FRAGMENTS, stats->recv_fragments},20122008 {TIPC_NLA_STATS_RX_FRAGMENTED, stats->recv_fragmented},20132009 {TIPC_NLA_STATS_RX_BUNDLES, stats->recv_bundles},20142010 {TIPC_NLA_STATS_RX_BUNDLED, stats->recv_bundled},20152015- {TIPC_NLA_STATS_TX_INFO, stats->sent_info},20112011+ {TIPC_NLA_STATS_TX_INFO, stats->sent_pkts},20162012 {TIPC_NLA_STATS_TX_FRAGMENTS, stats->sent_fragments},20172013 {TIPC_NLA_STATS_TX_FRAGMENTED, stats->sent_fragmented},20182014 {TIPC_NLA_STATS_TX_BUNDLES, stats->sent_bundles},···20792075 goto attr_msg_full;20802076 if (nla_put_string(msg->skb, TIPC_NLA_LINK_NAME, bcl->name))20812077 goto attr_msg_full;20822082- if (nla_put_u32(msg->skb, TIPC_NLA_LINK_RX, bcl->rcv_nxt))20782078+ if (nla_put_u32(msg->skb, TIPC_NLA_LINK_RX, 0))20832079 goto attr_msg_full;20842084- if (nla_put_u32(msg->skb, TIPC_NLA_LINK_TX, bcl->snd_nxt))20802080+ if (nla_put_u32(msg->skb, TIPC_NLA_LINK_TX, 0))20852081 goto attr_msg_full;2086208220872083 prop = nla_nest_start(msg->skb, TIPC_NLA_LINK_PROP);
+5-5
net/tipc/monitor.c
···455455 int i, applied_bef;456456457457 state->probing = false;458458- if (!dlen)459459- return;460458461459 /* Sanity check received domain record */462462- if ((dlen < new_dlen) || ntohs(arrv_dom->len) != new_dlen) {463463- pr_warn_ratelimited("Received illegal domain record\n");460460+ if (dlen < dom_rec_len(arrv_dom, 0))464461 return;465465- }462462+ if (dlen != dom_rec_len(arrv_dom, new_member_cnt))463463+ return;464464+ if ((dlen < new_dlen) || ntohs(arrv_dom->len) != new_dlen)465465+ return;466466467467 /* Synch generation numbers with peer if link just came up */468468 if (!state->synched) {
+1-1
net/tipc/socket.c
···186186187187static bool tsk_conn_cong(struct tipc_sock *tsk)188188{189189- return tsk->snt_unacked >= tsk->snd_win;189189+ return tsk->snt_unacked > tsk->snd_win;190190}191191192192/* tsk_blocks(): translate a buffer size in bytes to number of