The following commit has been merged in the master branch: commit 8644c85b9368df6795dcc79daa8d3e0fb852f171 Merge: c6d5c76fe5a9359852aa7b76649af8f9d01278b6 18343b80691560f41c3339119a2e9314d4672c77 Author: Stephen Rothwell sfr@canb.auug.org.au Date: Wed Jan 5 10:51:27 2022 +1100
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
diff --combined Documentation/devicetree/bindings/vendor-prefixes.yaml index eb8ab0d82198,0d1679b4ff99..5c938a54ccc4 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@@ -187,8 -187,6 +187,8 @@@ patternProperties description: Shanghai Broadmobi Communication Technology Co.,Ltd. "^brcm,.*": description: Broadcom Corporation + "^bsh,.*": + description: BSH Hausgeraete GmbH "^buffalo,.*": description: Buffalo, Inc. "^bur,.*": @@@ -381,6 -379,8 +381,8 @@@ description: Silicon Laboratories (formerly Energy Micro AS) "^engicam,.*": description: Engicam S.r.l. + "^engleder,.*": + description: Engleder "^epcos,.*": description: EPCOS AG "^epfl,.*": @@@ -595,8 -595,6 +597,8 @@@ description: JetHome (IP Sokolov P.A.) "^jianda,.*": description: Jiandangjing Technology Co., Ltd. + "^joz,.*": + description: JOZ BV "^kam,.*": description: Kamstrup A/S "^karo,.*": @@@ -1276,6 -1274,8 +1278,8 @@@ description: Variscite Ltd. "^vdl,.*": description: Van der Laan b.v. + "^vertexcom,.*": + description: Vertexcom Technologies, Inc. "^via,.*": description: VIA Technologies, Inc. "^videostrong,.*": @@@ -1322,8 -1322,6 +1326,8 @@@ description: Wiligear, Ltd. "^winbond,.*": description: Winbond Electronics corp. + "^winlink,.*": + description: WinLink Co., Ltd "^winstar,.*": description: Winstar Display Corp. "^wits,.*": @@@ -1356,8 -1354,6 +1360,8 @@@ description: Shenzhen Xunlong Software CO.,Limited "^xylon,.*": description: Xylon + "^yadro,.*": + description: YADRO "^yamaha,.*": description: Yamaha Corporation "^yes-optoelectronics,.*": diff --combined MAINTAINERS index 7f365496277f,0b5fdb517c76..a579935f6f52 --- a/MAINTAINERS +++ b/MAINTAINERS @@@ -993,13 -993,6 +993,13 @@@ S: Supporte T: git https://gitlab.freedesktop.org/agd5f/linux.git F: drivers/gpu/drm/amd/pm/
+AMD PSTATE DRIVER +M: Huang Rui ray.huang@amd.com +L: linux-pm@vger.kernel.org +S: Supported +F: Documentation/admin-guide/pm/amd-pstate.rst +F: drivers/cpufreq/amd-pstate* + AMD PTDMA DRIVER M: Sanjay R Mehta sanju.mehta@amd.com L: dmaengine@vger.kernel.org @@@ -1146,7 -1139,6 +1146,7 @@@ ANALOG DEVICES INC ADV748X DRIVE M: Kieran Bingham kieran.bingham@ideasonboard.com L: linux-media@vger.kernel.org S: Maintained +F: Documentation/devicetree/bindings/media/i2c/adv748x.yaml F: drivers/media/i2c/adv748x/*
ANALOG DEVICES INC ADV7511 DRIVER @@@ -1753,21 -1745,17 +1753,21 @@@ B: https://github.com/AsahiLinux/linux/ C: irc://irc.oftc.net/asahi-dev T: git https://github.com/AsahiLinux/linux.git F: Documentation/devicetree/bindings/arm/apple.yaml +F: Documentation/devicetree/bindings/arm/apple/* F: Documentation/devicetree/bindings/i2c/apple,i2c.yaml F: Documentation/devicetree/bindings/interrupt-controller/apple,aic.yaml F: Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml F: Documentation/devicetree/bindings/pci/apple,pcie.yaml F: Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml +F: Documentation/devicetree/bindings/power/apple* +F: Documentation/devicetree/bindings/watchdog/apple,wdt.yaml F: arch/arm64/boot/dts/apple/ F: drivers/i2c/busses/i2c-pasemi-core.c F: drivers/i2c/busses/i2c-pasemi-platform.c F: drivers/irqchip/irq-apple-aic.c F: drivers/mailbox/apple-mailbox.c F: drivers/pinctrl/pinctrl-apple-gpio.c +F: drivers/soc/apple/* F: include/dt-bindings/interrupt-controller/apple-aic.h F: include/dt-bindings/pinctrl/apple.h F: include/linux/apple-mailbox.h @@@ -2563,7 -2551,6 +2563,7 @@@ Q: https://patchwork.kernel.org/project F: Documentation/arm/samsung/ F: Documentation/devicetree/bindings/arm/samsung/ F: Documentation/devicetree/bindings/power/pd-samsung.yaml +F: Documentation/devicetree/bindings/soc/samsung/ F: arch/arm/boot/dts/exynos* F: arch/arm/boot/dts/s3c* F: arch/arm/boot/dts/s5p* @@@ -2590,7 -2577,7 +2590,7 @@@ N: s3c64x N: s5pv210
ARM/SAMSUNG S5P SERIES 2D GRAPHICS ACCELERATION (G2D) SUPPORT -M: Andrzej Hajda a.hajda@samsung.com +M: ��ukasz Stelmach l.stelmach@samsung.com L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-media@vger.kernel.org S: Maintained @@@ -2614,8 -2601,7 +2614,8 @@@ S: Maintaine F: drivers/media/platform/s5p-jpeg/
ARM/SAMSUNG S5P SERIES Multi Format Codec (MFC) SUPPORT -M: Andrzej Hajda a.hajda@samsung.com +M: Marek Szyprowski m.szyprowski@samsung.com +M: Andrzej Hajda andrzej.hajda@intel.com L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-media@vger.kernel.org S: Maintained @@@ -3012,20 -2998,6 +3012,20 @@@ W: http://acpi4asus.sf.ne F: drivers/platform/x86/asus*.c F: drivers/platform/x86/eeepc*.c
+ASUS WMI HARDWARE MONITOR DRIVER +M: Ed Brindley kernel@maidavale.org +M: Denis Pauk pauk.denis@gmail.com +L: linux-hwmon@vger.kernel.org +S: Maintained +F: drivers/hwmon/asus_wmi_sensors.c + +ASUS WMI EC HARDWARE MONITOR DRIVER +M: Eugene Shalygin eugene.shalygin@gmail.com +M: Denis Pauk pauk.denis@gmail.com +L: linux-hwmon@vger.kernel.org +S: Maintained +F: drivers/hwmon/asus_wmi_ec_sensors.c + ASUS WIRELESS RADIO CONTROL DRIVER M: Jo��o Paulo Rechi Vita jprvita@gmail.com L: platform-driver-x86@vger.kernel.org @@@ -3597,7 -3569,7 +3597,7 @@@ R: Florent Revest <revest@chromium.org R: Brendan Jackman jackmanb@chromium.org L: bpf@vger.kernel.org S: Maintained - F: Documentation/bpf/bpf_lsm.rst + F: Documentation/bpf/prog_lsm.rst F: include/linux/bpf_lsm.h F: kernel/bpf/bpf_lsm.c F: security/bpf/ @@@ -3664,7 -3636,6 +3664,7 @@@ F: drivers/net/ethernet/broadcom/bcm490 F: drivers/net/ethernet/broadcom/unimac.h
BROADCOM BCM5301X ARM ARCHITECTURE +M: Florian Fainelli f.fainelli@gmail.com M: Hauke Mehrtens hauke@hauke-m.de M: Rafa�� Mi��ecki zajec5@gmail.com M: bcm-kernel-feedback-list@broadcom.com @@@ -3676,7 -3647,6 +3676,7 @@@ F: arch/arm/boot/dts/bcm953012 F: arch/arm/mach-bcm/bcm_5301x.c
BROADCOM BCM53573 ARM ARCHITECTURE +M: Florian Fainelli f.fainelli@gmail.com M: Rafa�� Mi��ecki rafal@milecki.pl L: bcm-kernel-feedback-list@broadcom.com L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) @@@ -3799,8 -3769,7 +3799,8 @@@ S: Supporte F: drivers/net/wireless/broadcom/brcm80211/
BROADCOM BRCMSTB GPIO DRIVER -M: Gregory Fong gregory.0xf0@gmail.com +M: Doug Berger opendmb@gmail.com +M: Florian Fainelli f.fainelli@gmail.com L: bcm-kernel-feedback-list@broadcom.com S: Supported F: Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.txt @@@ -5453,12 -5422,6 +5453,12 @@@ W: https://linuxtv.or T: git git://linuxtv.org/media_tree.git F: drivers/media/platform/sti/delta
+DELTA AHE-50DC FAN CONTROL MODULE DRIVER +M: Zev Weiss zev@bewilderbeest.net +L: linux-hwmon@vger.kernel.org +S: Maintained +F: drivers/hwmon/pmbus/delta-ahe50dc-fan.c + DELTA DPS920AB PSU DRIVER M: Robert Marko robert.marko@sartura.hr L: linux-hwmon@vger.kernel.org @@@ -6347,7 -6310,7 +6347,7 @@@ F: Documentation/devicetree/bindings/di F: drivers/gpu/drm/atmel-hlcdc/
DRM DRIVERS FOR BRIDGE CHIPS -M: Andrzej Hajda a.hajda@samsung.com +M: Andrzej Hajda andrzej.hajda@intel.com M: Neil Armstrong narmstrong@baylibre.com M: Robert Foss robert.foss@linaro.org R: Laurent Pinchart Laurent.pinchart@ideasonboard.com @@@ -7704,7 -7667,8 +7704,7 @@@ M: Qiang Zhao <qiang.zhao@nxp.com L: linuxppc-dev@lists.ozlabs.org S: Maintained F: drivers/soc/fsl/qe/ -F: include/soc/fsl/*qe*.h -F: include/soc/fsl/*ucc*.h +F: include/soc/fsl/qe/
FREESCALE QUICC ENGINE UCC ETHERNET DRIVER M: Li Yang leoyang.li@nxp.com @@@ -7735,7 -7699,6 +7735,7 @@@ F: Documentation/devicetree/bindings/mi F: Documentation/devicetree/bindings/soc/fsl/ F: drivers/soc/fsl/ F: include/linux/fsl/ +F: include/soc/fsl/
FREESCALE SOC FS_ENET DRIVER M: Pantelis Antoniou pantelis.antoniou@gmail.com @@@ -8523,12 -8486,6 +8523,12 @@@ F: drivers/hid F: include/linux/hid* F: include/uapi/linux/hid*
+HID LOGITECH DRIVERS +R: Filipe La��ns lains@riseup.net +L: linux-input@vger.kernel.org +S: Maintained +F: drivers/hid/hid-logitech-* + HID PLAYSTATION DRIVER M: Roderick Colenbrander roderick.colenbrander@sony.com L: linux-input@vger.kernel.org @@@ -8650,10 -8607,8 +8650,10 @@@ F: drivers/misc/hisi_hikey_usb.
HISILICON PMU DRIVER M: Shaokun Zhang zhangshaokun@hisilicon.com +M: Qi Liu liuqi115@huawei.com S: Supported W: http://www.hisilicon.com +F: Documentation/admin-guide/perf/hisi-pcie-pmu.rst F: Documentation/admin-guide/perf/hisi-pmu.rst F: drivers/perf/hisilicon
@@@ -11578,12 -11533,6 +11578,12 @@@ S: Maintaine F: Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml F: drivers/media/i2c/max9286.c
+MAX96712 QUAD GMSL2 DESERIALIZER DRIVER +M: Niklas S��derlund niklas.soderlund@ragnatech.se +L: linux-media@vger.kernel.org +S: Maintained +F: drivers/staging/media/max96712/max96712.c + MAX9860 MONO AUDIO VOICE CODEC DRIVER M: Peter Rosin peda@axentia.se L: alsa-devel@alsa-project.org (moderated for non-subscribers) @@@ -12574,6 -12523,13 +12574,13 @@@ L: netdev@vger.kernel.or S: Maintained F: drivers/net/ethernet/microchip/lan743x_*
+ MICROCHIP LAN966X ETHERNET DRIVER + M: Horatiu Vultur horatiu.vultur@microchip.com + M: UNGLinuxDriver@microchip.com + L: netdev@vger.kernel.org + S: Maintained + F: drivers/net/ethernet/microchip/lan966x/* + MICROCHIP LCDFB DRIVER M: Nicolas Ferre nicolas.ferre@microchip.com L: linux-fbdev@vger.kernel.org @@@ -13836,13 -13792,6 +13843,13 @@@ S: Maintaine F: Documentation/hwmon/nzxt-kraken2.rst F: drivers/hwmon/nzxt-kraken2.c
+NZXT-SMART2 HARDWARE MONITORING DRIVER +M: Aleksandr Mezin mezin.alexander@gmail.com +L: linux-hwmon@vger.kernel.org +S: Maintained +F: Documentation/hwmon/nzxt-smart2.rst +F: drivers/hwmon/nzxt-smart2.c + OBJAGG M: Jiri Pirko jiri@nvidia.com L: netdev@vger.kernel.org @@@ -14155,6 -14104,7 +14162,6 @@@ F: drivers/media/i2c/ov5647.
OMNIVISION OV5670 SENSOR DRIVER M: Chiranjeevi Rapolu chiranjeevi.rapolu@intel.com -M: Hyungwoo Yang hyungwoo.yang@intel.com L: linux-media@vger.kernel.org S: Maintained T: git git://linuxtv.org/media_tree.git @@@ -14167,13 -14117,6 +14174,13 @@@ S: Maintaine T: git git://linuxtv.org/media_tree.git F: drivers/media/i2c/ov5675.c
+OMNIVISION OV5693 SENSOR DRIVER +M: Daniel Scally djrscally@gmail.com +L: linux-media@vger.kernel.org +S: Maintained +T: git git://linuxtv.org/media_tree.git +F: drivers/media/i2c/ov5693.c + OMNIVISION OV5695 SENSOR DRIVER M: Shunqian Zheng zhengsq@rock-chips.com L: linux-media@vger.kernel.org @@@ -14791,19 -14734,6 +14798,19 @@@ L: linux-pci@vger.kernel.or S: Supported F: Documentation/PCI/pci-error-recovery.rst
+PCI PEER-TO-PEER DMA (P2PDMA) +M: Bjorn Helgaas bhelgaas@google.com +M: Logan Gunthorpe logang@deltatee.com +L: linux-pci@vger.kernel.org +S: Supported +Q: https://patchwork.kernel.org/project/linux-pci/list/ +B: https://bugzilla.kernel.org +C: irc://irc.oftc.net/linux-pci +T: git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git +F: Documentation/driver-api/pci/p2pdma.rst +F: drivers/pci/p2pdma.c +F: include/linux/pci-p2pdma.h + PCI MSI DRIVER FOR ALTERA MSI IP M: Joyce Ooi joyce.ooi@intel.com L: linux-pci@vger.kernel.org @@@ -15803,6 -15733,14 +15810,14 @@@ W: https://wireless.wiki.kernel.org/en/ F: Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml F: drivers/net/wireless/ath/ath9k/
+ QUALCOMM BAM-DMUX WWAN NETWORK DRIVER + M: Stephan Gerhold stephan@gerhold.net + L: netdev@vger.kernel.org + L: linux-arm-msm@vger.kernel.org + S: Maintained + F: Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml + F: drivers/net/wwan/qcom_bam_dmux.c + QUALCOMM CAMERA SUBSYSTEM DRIVER M: Robert Foss robert.foss@linaro.org M: Todor Tomov todor.too@gmail.com @@@ -15812,15 -15750,6 +15827,15 @@@ F: Documentation/admin-guide/media/qcom F: Documentation/devicetree/bindings/media/*camss* F: drivers/media/platform/qcom/camss/
+QUALCOMM CLOCK DRIVERS +M: Bjorn Andersson bjorn.andersson@linaro.org +L: linux-arm-msm@vger.kernel.org +S: Supported +T: git git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git +F: Documentation/devicetree/bindings/clock/qcom,* +F: drivers/clk/qcom/ +F: include/dt-bindings/clock/qcom,* + QUALCOMM CORE POWER REDUCTION (CPR) AVS DRIVER M: Niklas Cassel nks@flawful.org L: linux-pm@vger.kernel.org @@@ -16922,15 -16851,13 +16937,15 @@@ F: Documentation/devicetree/bindings/ne F: drivers/nfc/s3fwrn5
SAMSUNG S5C73M3 CAMERA DRIVER -M: Andrzej Hajda a.hajda@samsung.com +M: Sylwester Nawrocki s.nawrocki@samsung.com +M: Andrzej Hajda andrzej.hajda@intel.com L: linux-media@vger.kernel.org S: Supported F: drivers/media/i2c/s5c73m3/*
SAMSUNG S5K5BAF CAMERA DRIVER -M: Andrzej Hajda a.hajda@samsung.com +M: Sylwester Nawrocki s.nawrocki@samsung.com +M: Andrzej Hajda andrzej.hajda@intel.com L: linux-media@vger.kernel.org S: Supported F: drivers/media/i2c/s5k5baf.c @@@ -17754,17 -17681,12 +17769,17 @@@ F: drivers/firmware/arm_sdei. F: include/linux/arm_sdei.h F: include/uapi/linux/arm_sdei.h
-SOFTWARE NODES +SOFTWARE NODES AND DEVICE PROPERTIES R: Andy Shevchenko andriy.shevchenko@linux.intel.com +R: Daniel Scally djrscally@gmail.com R: Heikki Krogerus heikki.krogerus@linux.intel.com +R: Sakari Ailus sakari.ailus@linux.intel.com L: linux-acpi@vger.kernel.org S: Maintained +F: drivers/base/property.c F: drivers/base/swnode.c +F: include/linux/fwnode.h +F: include/linux/property.h
SOFTWARE RAID (Multiple Disks) SUPPORT M: Song Liu song@kernel.org @@@ -18249,28 -18171,6 +18264,28 @@@ M: Ion Badulescu <ionut@badula.org S: Odd Fixes F: drivers/net/ethernet/adaptec/starfire*
+STARFIVE JH7100 CLOCK DRIVER +M: Emil Renner Berthing kernel@esmil.dk +S: Maintained +F: Documentation/devicetree/bindings/clock/starfive,jh7100-clkgen.yaml +F: drivers/clk/starfive/clk-starfive-jh7100.c +F: include/dt-bindings/clock/starfive-jh7100.h + +STARFIVE JH7100 PINCTRL DRIVER +M: Emil Renner Berthing kernel@esmil.dk +L: linux-gpio@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml +F: drivers/pinctrl/pinctrl-starfive.c +F: include/dt-bindings/pinctrl/pinctrl-starfive.h + +STARFIVE JH7100 RESET CONTROLLER DRIVER +M: Emil Renner Berthing kernel@esmil.dk +S: Maintained +F: Documentation/devicetree/bindings/reset/starfive,jh7100-reset.yaml +F: drivers/reset/reset-starfive-jh7100.c +F: include/dt-bindings/reset/starfive-jh7100.h + STATIC BRANCH/CALL M: Peter Zijlstra peterz@infradead.org M: Josh Poimboeuf jpoimboe@redhat.com @@@ -18432,7 -18332,6 +18447,7 @@@ M: Vineet Gupta <vgupta@kernel.org L: linux-snps-arc@lists.infradead.org S: Supported T: git git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git +F: Documentation/arc/ F: Documentation/devicetree/bindings/arc/* F: Documentation/devicetree/bindings/interrupt-controller/snps,arc* F: arch/arc/ @@@ -19450,6 -19349,12 +19465,6 @@@ W: https://github.com/srcres258/linux-d T: git git://github.com/srcres258/linux-doc.git doc-zh-tw F: Documentation/translations/zh_TW/
-TRIVIAL PATCHES -M: Jiri Kosina trivial@kernel.org -S: Maintained -T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git -K: ^Subject:.*(?i)trivial - TTY LAYER M: Greg Kroah-Hartman gregkh@linuxfoundation.org M: Jiri Slaby jirislaby@kernel.org @@@ -19554,7 -19459,6 +19569,7 @@@ S: Supporte W: http://www.linux-mtd.infradead.org/doc/ubifs.html T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs.git next T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs.git fixes +F: Documentation/ABI/testing/sysfs-fs-ubifs F: Documentation/filesystems/ubifs-authentication.rst F: Documentation/filesystems/ubifs.rst F: fs/ubifs/ diff --combined arch/arm/boot/dts/qcom-sdx55.dtsi index 5d769b3f2d35,eee2f63b9bba..8ac0492c7659 --- a/arch/arm/boot/dts/qcom-sdx55.dtsi +++ b/arch/arm/boot/dts/qcom-sdx55.dtsi @@@ -8,7 -8,6 +8,7 @@@
#include <dt-bindings/clock/qcom,gcc-sdx55.h> #include <dt-bindings/clock/qcom,rpmh.h> +#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/interconnect/qcom,sdx55.h> #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/power/qcom-rpmpd.h> @@@ -310,41 -309,6 +310,41 @@@ status = "disabled"; };
+ pcie0_phy: phy@1c07000 { + compatible = "qcom,sdx55-qmp-pcie-phy"; + reg = <0x01c07000 0x1c4>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + clocks = <&gcc GCC_PCIE_AUX_PHY_CLK_SRC>, + <&gcc GCC_PCIE_CFG_AHB_CLK>, + <&gcc GCC_PCIE_0_CLKREF_CLK>, + <&gcc GCC_PCIE_RCHNG_PHY_CLK>; + clock-names = "aux", "cfg_ahb", "ref", "refgen"; + + resets = <&gcc GCC_PCIE_PHY_BCR>; + reset-names = "phy"; + + assigned-clocks = <&gcc GCC_PCIE_RCHNG_PHY_CLK>; + assigned-clock-rates = <100000000>; + + status = "disabled"; + + pcie0_lane: lanes@1c06000 { + reg = <0x01c06000 0x104>, /* tx0 */ + <0x01c06200 0x328>, /* rx0 */ + <0x01c07200 0x1e8>, /* pcs */ + <0x01c06800 0x104>, /* tx1 */ + <0x01c06a00 0x328>, /* rx1 */ + <0x01c07600 0x800>; /* pcs_misc */ + clocks = <&gcc GCC_PCIE_PIPE_CLK>; + clock-names = "pipe0"; + + #phy-cells = <0>; + clock-output-names = "pcie_pipe_clk"; + }; + }; + ipa: ipa@1e40000 { compatible = "qcom,sdx55-ipa";
@@@ -369,12 -333,10 +369,10 @@@ clocks = <&rpmhcc RPMH_IPA_CLK>; clock-names = "core";
- interconnects = <&system_noc MASTER_IPA &system_noc SLAVE_SNOC_MEM_NOC_GC>, - <&mem_noc MASTER_SNOC_GC_MEM_NOC &mc_virt SLAVE_EBI_CH0>, + interconnects = <&system_noc MASTER_IPA &mc_virt SLAVE_EBI_CH0>, <&system_noc MASTER_IPA &system_noc SLAVE_OCIMEM>, <&mem_noc MASTER_AMPSS_M0 &system_noc SLAVE_IPA_CFG>; - interconnect-names = "memory-a", - "memory-b", + interconnect-names = "memory", "imem", "config";
@@@ -392,11 -354,6 +390,11 @@@ #hwlock-cells = <1>; };
+ tcsr: syscon@1fcb000 { + compatible = "syscon"; + reg = <0x01fc0000 0x1000>; + }; + sdhc_1: sdhci@8804000 { compatible = "qcom,sdx55-sdhci", "qcom,sdhci-msm-v5"; reg = <0x08804000 0x1000>; @@@ -409,45 -366,6 +407,45 @@@ status = "disabled"; };
+ pcie_ep: pcie-ep@40000000 { + compatible = "qcom,sdx55-pcie-ep"; + reg = <0x01c00000 0x3000>, + <0x40000000 0xf1d>, + <0x40000f20 0xc8>, + <0x40001000 0x1000>, + <0x40002000 0x10000>, + <0x01c03000 0x3000>; + reg-names = "parf", "dbi", "elbi", "atu", "addr_space", + "mmio"; + + qcom,perst-regs = <&tcsr 0xb258 0xb270>; + + clocks = <&gcc GCC_PCIE_AUX_CLK>, + <&gcc GCC_PCIE_CFG_AHB_CLK>, + <&gcc GCC_PCIE_MSTR_AXI_CLK>, + <&gcc GCC_PCIE_SLV_AXI_CLK>, + <&gcc GCC_PCIE_SLV_Q2A_AXI_CLK>, + <&gcc GCC_PCIE_SLEEP_CLK>, + <&gcc GCC_PCIE_0_CLKREF_CLK>; + clock-names = "aux", "cfg", "bus_master", "bus_slave", + "slave_q2a", "sleep", "ref"; + + interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "global", "doorbell"; + reset-gpios = <&tlmm 57 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 53 GPIO_ACTIVE_LOW>; + resets = <&gcc GCC_PCIE_BCR>; + reset-names = "core"; + power-domains = <&gcc PCIE_GDSC>; + phys = <&pcie0_lane>; + phy-names = "pciephy"; + max-link-speed = <3>; + num-lanes = <2>; + + status = "disabled"; + }; + remoteproc_mpss: remoteproc@4080000 { compatible = "qcom,sdx55-mpss-pas"; reg = <0x04080000 0x4040>; diff --combined arch/arm/boot/dts/sun8i-r40.dtsi index f10436b7869c,c99c92f008a0..03d3e5f45a09 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi @@@ -511,6 -511,16 +511,16 @@@ #interrupt-cells = <3>; #gpio-cells = <3>;
+ can_ph_pins: can-ph-pins { + pins = "PH20", "PH21"; + function = "can"; + }; + + can_pa_pins: can-pa-pins { + pins = "PA16", "PA17"; + function = "can"; + }; + clk_out_a_pin: clk-out-a-pin { pins = "PI12"; function = "clk_out_a"; @@@ -926,6 -936,15 +936,15 @@@ #size-cells = <0>; };
+ can0: can@1c2bc00 { + compatible = "allwinner,sun8i-r40-can"; + reg = <0x01c2bc00 0x400>; + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_CAN>; + resets = <&ccu RST_BUS_CAN>; + status = "disabled"; + }; + i2c4: i2c@1c2c000 { compatible = "allwinner,sun6i-a31-i2c"; reg = <0x01c2c000 0x400>; @@@ -1212,8 -1231,8 +1231,8 @@@ reg-io-width = <1>; interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ccu CLK_BUS_HDMI0>, <&ccu CLK_HDMI_SLOW>, - <&ccu CLK_HDMI>; - clock-names = "iahb", "isfr", "tmds"; + <&ccu CLK_HDMI>, <&rtc 0>; + clock-names = "iahb", "isfr", "tmds", "cec"; resets = <&ccu RST_BUS_HDMI1>; reset-names = "ctrl"; phys = <&hdmi_phy>; diff --combined arch/powerpc/net/bpf_jit_comp32.c index d3a52cd42f53,8a4faa05f9e4..faaebd446cad --- a/arch/powerpc/net/bpf_jit_comp32.c +++ b/arch/powerpc/net/bpf_jit_comp32.c @@@ -221,13 -221,13 +221,13 @@@ static int bpf_jit_emit_tail_call(u32 * PPC_BCC(COND_GE, out);
/* - * if (tail_call_cnt > MAX_TAIL_CALL_CNT) + * if (tail_call_cnt >= MAX_TAIL_CALL_CNT) * goto out; */ EMIT(PPC_RAW_CMPLWI(_R0, MAX_TAIL_CALL_CNT)); /* tail_call_cnt++; */ EMIT(PPC_RAW_ADDIC(_R0, _R0, 1)); - PPC_BCC(COND_GT, out); + PPC_BCC(COND_GE, out);
/* prog = array->ptrs[index]; */ EMIT(PPC_RAW_RLWINM(_R3, b2p_index, 2, 0, 29)); @@@ -268,7 -268,7 +268,7 @@@
/* Assemble the body code between the prologue & epilogue */ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context *ctx, - u32 *addrs, bool extra_pass) + u32 *addrs, int pass) { const struct bpf_insn *insn = fp->insnsi; int flen = fp->len; @@@ -284,7 -284,6 +284,7 @@@ u32 src_reg = bpf_to_ppc(ctx, insn[i].src_reg); u32 src_reg_h = src_reg - 1; u32 tmp_reg = bpf_to_ppc(ctx, TMP_REG); + u32 size = BPF_SIZE(code); s16 off = insn[i].off; s32 imm = insn[i].imm; bool func_addr_fixed; @@@ -813,91 -812,23 +813,91 @@@ * BPF_LDX */ case BPF_LDX | BPF_MEM | BPF_B: /* dst = *(u8 *)(ul) (src + off) */ - EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off)); - if (!fp->aux->verifier_zext) - EMIT(PPC_RAW_LI(dst_reg_h, 0)); - break; + case BPF_LDX | BPF_PROBE_MEM | BPF_B: case BPF_LDX | BPF_MEM | BPF_H: /* dst = *(u16 *)(ul) (src + off) */ - EMIT(PPC_RAW_LHZ(dst_reg, src_reg, off)); - if (!fp->aux->verifier_zext) - EMIT(PPC_RAW_LI(dst_reg_h, 0)); - break; + case BPF_LDX | BPF_PROBE_MEM | BPF_H: case BPF_LDX | BPF_MEM | BPF_W: /* dst = *(u32 *)(ul) (src + off) */ - EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off)); - if (!fp->aux->verifier_zext) - EMIT(PPC_RAW_LI(dst_reg_h, 0)); - break; + case BPF_LDX | BPF_PROBE_MEM | BPF_W: case BPF_LDX | BPF_MEM | BPF_DW: /* dst = *(u64 *)(ul) (src + off) */ - EMIT(PPC_RAW_LWZ(dst_reg_h, src_reg, off)); - EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off + 4)); + case BPF_LDX | BPF_PROBE_MEM | BPF_DW: + /* + * As PTR_TO_BTF_ID that uses BPF_PROBE_MEM mode could either be a valid + * kernel pointer or NULL but not a userspace address, execute BPF_PROBE_MEM + * load only if addr is kernel address (see is_kernel_addr()), otherwise + * set dst_reg=0 and move on. + */ + if (BPF_MODE(code) == BPF_PROBE_MEM) { + PPC_LI32(_R0, TASK_SIZE - off); + EMIT(PPC_RAW_CMPLW(src_reg, _R0)); + PPC_BCC(COND_GT, (ctx->idx + 5) * 4); + EMIT(PPC_RAW_LI(dst_reg, 0)); + /* + * For BPF_DW case, "li reg_h,0" would be needed when + * !fp->aux->verifier_zext. Emit NOP otherwise. + * + * Note that "li reg_h,0" is emitted for BPF_B/H/W case, + * if necessary. So, jump there insted of emitting an + * additional "li reg_h,0" instruction. + */ + if (size == BPF_DW && !fp->aux->verifier_zext) + EMIT(PPC_RAW_LI(dst_reg_h, 0)); + else + EMIT(PPC_RAW_NOP()); + /* + * Need to jump two instructions instead of one for BPF_DW case + * as there are two load instructions for dst_reg_h & dst_reg + * respectively. + */ + if (size == BPF_DW) + PPC_JMP((ctx->idx + 3) * 4); + else + PPC_JMP((ctx->idx + 2) * 4); + } + + switch (size) { + case BPF_B: + EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off)); + break; + case BPF_H: + EMIT(PPC_RAW_LHZ(dst_reg, src_reg, off)); + break; + case BPF_W: + EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off)); + break; + case BPF_DW: + EMIT(PPC_RAW_LWZ(dst_reg_h, src_reg, off)); + EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off + 4)); + break; + } + + if (size != BPF_DW && !fp->aux->verifier_zext) + EMIT(PPC_RAW_LI(dst_reg_h, 0)); + + if (BPF_MODE(code) == BPF_PROBE_MEM) { + int insn_idx = ctx->idx - 1; + int jmp_off = 4; + + /* + * In case of BPF_DW, two lwz instructions are emitted, one + * for higher 32-bit and another for lower 32-bit. So, set + * ex->insn to the first of the two and jump over both + * instructions in fixup. + * + * Similarly, with !verifier_zext, two instructions are + * emitted for BPF_B/H/W case. So, set ex->insn to the + * instruction that could fault and skip over both + * instructions. + */ + if (size == BPF_DW || !fp->aux->verifier_zext) { + insn_idx -= 1; + jmp_off += 4; + } + + ret = bpf_add_extable_entry(fp, image, pass, ctx, insn_idx, + jmp_off, dst_reg); + if (ret) + return ret; + } break;
/* @@@ -931,7 -862,7 +931,7 @@@ case BPF_JMP | BPF_CALL: ctx->seen |= SEEN_FUNC;
- ret = bpf_jit_get_func_addr(fp, &insn[i], extra_pass, + ret = bpf_jit_get_func_addr(fp, &insn[i], false, &func_addr, &func_addr_fixed); if (ret < 0) return ret; diff --combined arch/powerpc/net/bpf_jit_comp64.c index 472d4a551945,8571aafcc9e1..9eae8d8ed340 --- a/arch/powerpc/net/bpf_jit_comp64.c +++ b/arch/powerpc/net/bpf_jit_comp64.c @@@ -228,12 -228,12 +228,12 @@@ static int bpf_jit_emit_tail_call(u32 * PPC_BCC(COND_GE, out);
/* - * if (tail_call_cnt > MAX_TAIL_CALL_CNT) + * if (tail_call_cnt >= MAX_TAIL_CALL_CNT) * goto out; */ PPC_BPF_LL(b2p[TMP_REG_1], 1, bpf_jit_stack_tailcallcnt(ctx)); EMIT(PPC_RAW_CMPLWI(b2p[TMP_REG_1], MAX_TAIL_CALL_CNT)); - PPC_BCC(COND_GT, out); + PPC_BCC(COND_GE, out);
/* * tail_call_cnt++; @@@ -297,7 -297,7 +297,7 @@@ asm
/* Assemble the body code between the prologue & epilogue */ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context *ctx, - u32 *addrs, bool extra_pass) + u32 *addrs, int pass) { enum stf_barrier_type stf_barrier = stf_barrier_type_get(); const struct bpf_insn *insn = fp->insnsi; @@@ -311,7 -311,6 +311,7 @@@ u32 code = insn[i].code; u32 dst_reg = b2p[insn[i].dst_reg]; u32 src_reg = b2p[insn[i].src_reg]; + u32 size = BPF_SIZE(code); s16 off = insn[i].off; s32 imm = insn[i].imm; bool func_addr_fixed; @@@ -779,66 -778,25 +779,66 @@@ emit_clear */ /* dst = *(u8 *)(ul) (src + off) */ case BPF_LDX | BPF_MEM | BPF_B: - EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off)); - if (insn_is_zext(&insn[i + 1])) - addrs[++i] = ctx->idx * 4; - break; + case BPF_LDX | BPF_PROBE_MEM | BPF_B: /* dst = *(u16 *)(ul) (src + off) */ case BPF_LDX | BPF_MEM | BPF_H: - EMIT(PPC_RAW_LHZ(dst_reg, src_reg, off)); - if (insn_is_zext(&insn[i + 1])) - addrs[++i] = ctx->idx * 4; - break; + case BPF_LDX | BPF_PROBE_MEM | BPF_H: /* dst = *(u32 *)(ul) (src + off) */ case BPF_LDX | BPF_MEM | BPF_W: - EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off)); - if (insn_is_zext(&insn[i + 1])) - addrs[++i] = ctx->idx * 4; - break; + case BPF_LDX | BPF_PROBE_MEM | BPF_W: /* dst = *(u64 *)(ul) (src + off) */ case BPF_LDX | BPF_MEM | BPF_DW: - PPC_BPF_LL(dst_reg, src_reg, off); + case BPF_LDX | BPF_PROBE_MEM | BPF_DW: + /* + * As PTR_TO_BTF_ID that uses BPF_PROBE_MEM mode could either be a valid + * kernel pointer or NULL but not a userspace address, execute BPF_PROBE_MEM + * load only if addr is kernel address (see is_kernel_addr()), otherwise + * set dst_reg=0 and move on. + */ + if (BPF_MODE(code) == BPF_PROBE_MEM) { + EMIT(PPC_RAW_ADDI(b2p[TMP_REG_1], src_reg, off)); + if (IS_ENABLED(CONFIG_PPC_BOOK3E_64)) + PPC_LI64(b2p[TMP_REG_2], 0x8000000000000000ul); + else /* BOOK3S_64 */ + PPC_LI64(b2p[TMP_REG_2], PAGE_OFFSET); + EMIT(PPC_RAW_CMPLD(b2p[TMP_REG_1], b2p[TMP_REG_2])); + PPC_BCC(COND_GT, (ctx->idx + 4) * 4); + EMIT(PPC_RAW_LI(dst_reg, 0)); + /* + * Check if 'off' is word aligned because PPC_BPF_LL() + * (BPF_DW case) generates two instructions if 'off' is not + * word-aligned and one instruction otherwise. + */ + if (BPF_SIZE(code) == BPF_DW && (off & 3)) + PPC_JMP((ctx->idx + 3) * 4); + else + PPC_JMP((ctx->idx + 2) * 4); + } + + switch (size) { + case BPF_B: + EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off)); + break; + case BPF_H: + EMIT(PPC_RAW_LHZ(dst_reg, src_reg, off)); + break; + case BPF_W: + EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off)); + break; + case BPF_DW: + PPC_BPF_LL(dst_reg, src_reg, off); + break; + } + + if (size != BPF_DW && insn_is_zext(&insn[i + 1])) + addrs[++i] = ctx->idx * 4; + + if (BPF_MODE(code) == BPF_PROBE_MEM) { + ret = bpf_add_extable_entry(fp, image, pass, ctx, ctx->idx - 1, + 4, dst_reg); + if (ret) + return ret; + } break;
/* @@@ -873,7 -831,7 +873,7 @@@ case BPF_JMP | BPF_CALL: ctx->seen |= SEEN_FUNC;
- ret = bpf_jit_get_func_addr(fp, &insn[i], extra_pass, + ret = bpf_jit_get_func_addr(fp, &insn[i], false, &func_addr, &func_addr_fixed); if (ret < 0) return ret; diff --combined drivers/infiniband/core/cache.c index 9194a23cf859,b79f816a7203..f6aa1a964573 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@@ -33,6 -33,7 +33,7 @@@ * SOFTWARE. */
+ #include <linux/if_vlan.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/slab.h> @@@ -955,7 -956,7 +956,7 @@@ int rdma_query_gid(struct ib_device *de { struct ib_gid_table *table; unsigned long flags; - int res = -EINVAL; + int res;
if (!rdma_is_port_valid(device, port_num)) return -EINVAL; @@@ -963,15 -964,9 +964,15 @@@ table = rdma_gid_table(device, port_num); read_lock_irqsave(&table->rwlock, flags);
- if (index < 0 || index >= table->sz || - !is_gid_entry_valid(table->data_vec[index])) + if (index < 0 || index >= table->sz) { + res = -EINVAL; goto done; + } + + if (!is_gid_entry_valid(table->data_vec[index])) { + res = -ENOENT; + goto done; + }
memcpy(gid, &table->data_vec[index]->attr.gid, sizeof(*gid)); res = 0; diff --combined drivers/net/ethernet/amazon/ena/ena_netdev.c index c72f0c7ff4aa,3b46f1df5609..05cadc4e66e0 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@@ -434,7 -434,7 +434,7 @@@ static int ena_xdp_execute(struct ena_r xdp_stat = &rx_ring->rx_stats.xdp_pass; break; default: - bpf_warn_invalid_xdp_action(verdict); + bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, verdict); xdp_stat = &rx_ring->rx_stats.xdp_invalid; }
@@@ -1288,22 -1288,26 +1288,22 @@@ static int handle_invalid_req_id(struc
static int validate_tx_req_id(struct ena_ring *tx_ring, u16 req_id) { - struct ena_tx_buffer *tx_info = NULL; + struct ena_tx_buffer *tx_info;
- if (likely(req_id < tx_ring->ring_size)) { - tx_info = &tx_ring->tx_buffer_info[req_id]; - if (likely(tx_info->skb)) - return 0; - } + tx_info = &tx_ring->tx_buffer_info[req_id]; + if (likely(tx_info->skb)) + return 0;
return handle_invalid_req_id(tx_ring, req_id, tx_info, false); }
static int validate_xdp_req_id(struct ena_ring *xdp_ring, u16 req_id) { - struct ena_tx_buffer *tx_info = NULL; + struct ena_tx_buffer *tx_info;
- if (likely(req_id < xdp_ring->ring_size)) { - tx_info = &xdp_ring->tx_buffer_info[req_id]; - if (likely(tx_info->xdpf)) - return 0; - } + tx_info = &xdp_ring->tx_buffer_info[req_id]; + if (likely(tx_info->xdpf)) + return 0;
return handle_invalid_req_id(xdp_ring, req_id, tx_info, true); } @@@ -1328,14 -1332,9 +1328,14 @@@ static int ena_clean_tx_irq(struct ena_
rc = ena_com_tx_comp_req_id_get(tx_ring->ena_com_io_cq, &req_id); - if (rc) + if (rc) { + if (unlikely(rc == -EINVAL)) + handle_invalid_req_id(tx_ring, req_id, NULL, + false); break; + }
+ /* validate that the request id points to a valid skb */ rc = validate_tx_req_id(tx_ring, req_id); if (rc) break; @@@ -1428,7 -1427,6 +1428,7 @@@ static struct sk_buff *ena_rx_skb(struc u16 *next_to_clean) { struct ena_rx_buffer *rx_info; + struct ena_adapter *adapter; u16 len, req_id, buf = 0; struct sk_buff *skb; void *page_addr; @@@ -1441,14 -1439,8 +1441,14 @@@ rx_info = &rx_ring->rx_buffer_info[req_id];
if (unlikely(!rx_info->page)) { - netif_err(rx_ring->adapter, rx_err, rx_ring->netdev, - "Page is NULL\n"); + adapter = rx_ring->adapter; + netif_err(adapter, rx_err, rx_ring->netdev, + "Page is NULL. qid %u req_id %u\n", rx_ring->qid, req_id); + ena_increase_stat(&rx_ring->rx_stats.bad_req_id, 1, &rx_ring->syncp); + adapter->reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; + /* Make sure reset reason is set before triggering the reset */ + smp_mb__before_atomic(); + set_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags); return NULL; }
@@@ -1904,14 -1896,9 +1904,14 @@@ static int ena_clean_xdp_irq(struct ena
rc = ena_com_tx_comp_req_id_get(xdp_ring->ena_com_io_cq, &req_id); - if (rc) + if (rc) { + if (unlikely(rc == -EINVAL)) + handle_invalid_req_id(xdp_ring, req_id, NULL, + true); break; + }
+ /* validate that the request id points to a valid xdp_frame */ rc = validate_xdp_req_id(xdp_ring, req_id); if (rc) break; @@@ -4026,6 -4013,10 +4026,6 @@@ static u32 ena_calc_max_io_queue_num(st max_num_io_queues = min_t(u32, max_num_io_queues, io_tx_cq_num); /* 1 IRQ for mgmnt and 1 IRQs for each IO direction */ max_num_io_queues = min_t(u32, max_num_io_queues, pci_msix_vec_count(pdev) - 1); - if (unlikely(!max_num_io_queues)) { - dev_err(&pdev->dev, "The device doesn't have io queues\n"); - return -EFAULT; - }
return max_num_io_queues; } diff --combined drivers/net/ethernet/realtek/r8169_main.c index 6b81f95698f0,7161a5b1c701..19e2621e0645 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@@ -615,6 -615,7 +615,7 @@@ struct rtl8169_private struct ring_info tx_skb[NUM_TX_DESC]; /* Tx data buffers */ u16 cp_cmd; u32 irq_mask; + int irq; struct clk *clk;
struct { @@@ -1873,7 -1874,9 +1874,9 @@@ static int rtl8169_set_eee(struct net_d }
static void rtl8169_get_ringparam(struct net_device *dev, - struct ethtool_ringparam *data) + struct ethtool_ringparam *data, + struct kernel_ethtool_ringparam *kernel_data, + struct netlink_ext_ack *extack) { data->rx_max_pending = NUM_RX_DESC; data->rx_pending = NUM_RX_DESC; @@@ -1969,8 -1972,11 +1972,11 @@@ static enum mac_version rtl8169_get_mac { 0x7cf, 0x641, RTL_GIGA_MAC_VER_63 },
/* 8125A family. */ - { 0x7cf, 0x608, RTL_GIGA_MAC_VER_60 }, - { 0x7c8, 0x608, RTL_GIGA_MAC_VER_61 }, + { 0x7cf, 0x609, RTL_GIGA_MAC_VER_61 }, + /* It seems only XID 609 made it to the mass market. + * { 0x7cf, 0x608, RTL_GIGA_MAC_VER_60 }, + * { 0x7c8, 0x608, RTL_GIGA_MAC_VER_61 }, + */
/* RTL8117 */ { 0x7cf, 0x54b, RTL_GIGA_MAC_VER_53 }, @@@ -1978,17 -1984,26 +1984,26 @@@
/* 8168EP family. */ { 0x7cf, 0x502, RTL_GIGA_MAC_VER_51 }, - { 0x7cf, 0x501, RTL_GIGA_MAC_VER_50 }, - { 0x7cf, 0x500, RTL_GIGA_MAC_VER_49 }, + /* It seems this chip version never made it to + * the wild. Let's disable detection. + * { 0x7cf, 0x501, RTL_GIGA_MAC_VER_50 }, + * { 0x7cf, 0x500, RTL_GIGA_MAC_VER_49 }, + */
/* 8168H family. */ { 0x7cf, 0x541, RTL_GIGA_MAC_VER_46 }, - { 0x7cf, 0x540, RTL_GIGA_MAC_VER_45 }, + /* It seems this chip version never made it to + * the wild. Let's disable detection. + * { 0x7cf, 0x540, RTL_GIGA_MAC_VER_45 }, + */
/* 8168G family. */ { 0x7cf, 0x5c8, RTL_GIGA_MAC_VER_44 }, { 0x7cf, 0x509, RTL_GIGA_MAC_VER_42 }, - { 0x7cf, 0x4c1, RTL_GIGA_MAC_VER_41 }, + /* It seems this chip version never made it to + * the wild. Let's disable detection. + * { 0x7cf, 0x4c1, RTL_GIGA_MAC_VER_41 }, + */ { 0x7cf, 0x4c0, RTL_GIGA_MAC_VER_40 },
/* 8168F family. */ @@@ -4698,7 -4713,7 +4713,7 @@@ static int rtl8169_close(struct net_dev
cancel_work_sync(&tp->wk.work);
- free_irq(pci_irq_vector(pdev, 0), tp); + free_irq(tp->irq, tp);
phy_disconnect(tp->phydev);
@@@ -4719,7 -4734,7 +4734,7 @@@ static void rtl8169_netpoll(struct net_ { struct rtl8169_private *tp = netdev_priv(dev);
- rtl8169_interrupt(pci_irq_vector(tp->pci_dev, 0), tp); + rtl8169_interrupt(tp->irq, tp); } #endif
@@@ -4753,8 -4768,7 +4768,7 @@@ static int rtl_open(struct net_device * rtl_request_firmware(tp);
irqflags = pci_dev_msi_enabled(pdev) ? IRQF_NO_THREAD : IRQF_SHARED; - retval = request_irq(pci_irq_vector(pdev, 0), rtl8169_interrupt, - irqflags, dev->name, tp); + retval = request_irq(tp->irq, rtl8169_interrupt, irqflags, dev->name, tp); if (retval < 0) goto err_release_fw_2;
@@@ -4771,7 -4785,7 +4785,7 @@@ out return retval;
err_free_irq: - free_irq(pci_irq_vector(pdev, 0), tp); + free_irq(tp->irq, tp); err_release_fw_2: rtl_release_firmware(tp); rtl8169_rx_clear(tp); @@@ -5272,12 -5286,6 +5286,6 @@@ static int rtl_init_one(struct pci_dev if (rc) return rc;
- /* Disable ASPM L1 as that cause random device stop working - * problems as well as full system hangs for some PCIe devices users. - */ - rc = pci_disable_link_state(pdev, PCIE_LINK_STATE_L1); - tp->aspm_manageable = !rc; - /* enable device (incl. PCI PM wakeup and hotplug setup) */ rc = pcim_enable_device(pdev); if (rc < 0) { @@@ -5320,6 -5328,17 +5328,17 @@@
tp->mac_version = chipset;
+ /* Disable ASPM L1 as that cause random device stop working + * problems as well as full system hangs for some PCIe devices users. + * Chips from RTL8168h partially have issues with L1.2, but seem + * to work fine with L1 and L1.1. + */ + if (tp->mac_version >= RTL_GIGA_MAC_VER_45) + rc = pci_disable_link_state(pdev, PCIE_LINK_STATE_L1_2); + else + rc = pci_disable_link_state(pdev, PCIE_LINK_STATE_L1); + tp->aspm_manageable = !rc; + tp->dash_type = rtl_check_dash(tp);
tp->cp_cmd = RTL_R16(tp, CPlusCmd) & CPCMD_MASK; @@@ -5341,6 -5360,7 +5360,7 @@@ dev_err(&pdev->dev, "Can't allocate interrupt\n"); return rc; } + tp->irq = pci_irq_vector(pdev, 0);
INIT_WORK(&tp->wk.work, rtl_task);
@@@ -5375,12 -5395,12 +5395,12 @@@ */ if (rtl_chip_supports_csum_v2(tp)) { dev->hw_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6; - dev->gso_max_size = RTL_GSO_MAX_SIZE_V2; - dev->gso_max_segs = RTL_GSO_MAX_SEGS_V2; + netif_set_gso_max_size(dev, RTL_GSO_MAX_SIZE_V2); + netif_set_gso_max_segs(dev, RTL_GSO_MAX_SEGS_V2); } else { dev->hw_features |= NETIF_F_SG | NETIF_F_TSO; - dev->gso_max_size = RTL_GSO_MAX_SIZE_V1; - dev->gso_max_segs = RTL_GSO_MAX_SEGS_V1; + netif_set_gso_max_size(dev, RTL_GSO_MAX_SIZE_V1); + netif_set_gso_max_segs(dev, RTL_GSO_MAX_SEGS_V1); }
dev->hw_features |= NETIF_F_RXALL; @@@ -5416,8 -5436,7 +5436,7 @@@ return rc;
netdev_info(dev, "%s, %pM, XID %03x, IRQ %d\n", - rtl_chip_infos[chipset].name, dev->dev_addr, xid, - pci_irq_vector(pdev, 0)); + rtl_chip_infos[chipset].name, dev->dev_addr, xid, tp->irq);
if (jumbo_max) netdev_info(dev, "jumbo features [frames: %d bytes, tx checksumming: %s]\n", @@@ -5441,9 -5460,7 +5460,9 @@@ static struct pci_driver rtl8169_pci_dr .probe = rtl_init_one, .remove = rtl_remove_one, .shutdown = rtl_shutdown, - .driver.pm = pm_ptr(&rtl8169_pm_ops), +#ifdef CONFIG_PM + .driver.pm = &rtl8169_pm_ops, +#endif };
module_pci_driver(rtl8169_pci_driver); diff --combined drivers/s390/net/qeth_core_main.c index fe2c4c699d37,c296e0556f49..29f0111f8e11 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@@ -194,9 -194,6 +194,6 @@@ static void qeth_clear_working_pool_lis &card->qdio.in_buf_pool.entry_list, list) list_del(&pool_entry->list);
- if (!queue) - return; - for (i = 0; i < ARRAY_SIZE(queue->bufs); i++) queue->bufs[i].pool_entry = NULL; } @@@ -275,8 -272,8 +272,8 @@@ int qeth_resize_buffer_pool(struct qeth
QETH_CARD_TEXT(card, 2, "realcbp");
- /* Defer until queue is allocated: */ - if (!card->qdio.in_q) + /* Defer until pool is allocated: */ + if (list_empty(&pool->entry_list)) goto out;
/* Remove entries from the pool: */ @@@ -355,8 -352,8 +352,8 @@@ static int qeth_cq_init(struct qeth_car qdio_reset_buffers(card->qdio.c_q->qdio_bufs, QDIO_MAX_BUFFERS_PER_Q); card->qdio.c_q->next_buf_to_init = 127; - rc = do_QDIO(CARD_DDEV(card), QDIO_FLAG_SYNC_INPUT, 1, 0, 127, - NULL); + + rc = qdio_add_bufs_to_input_queue(CARD_DDEV(card), 1, 0, 127); if (rc) { QETH_CARD_TEXT_(card, 2, "1err%d", rc); goto out; @@@ -2557,14 -2554,9 +2554,9 @@@ static int qeth_alloc_qdio_queues(struc QETH_QDIO_ALLOCATED) != QETH_QDIO_UNINITIALIZED) return 0;
- QETH_CARD_TEXT(card, 2, "inq"); - card->qdio.in_q = qeth_alloc_qdio_queue(); - if (!card->qdio.in_q) - goto out_nomem; - /* inbound buffer pool */ if (qeth_alloc_buffer_pool(card)) - goto out_freeinq; + goto out_buffer_pool;
/* outbound */ for (i = 0; i < card->qdio.no_out_queues; ++i) { @@@ -2605,10 -2597,7 +2597,7 @@@ out_freeoutq card->qdio.out_qs[i] = NULL; } qeth_free_buffer_pool(card); - out_freeinq: - qeth_free_qdio_queue(card->qdio.in_q); - card->qdio.in_q = NULL; - out_nomem: + out_buffer_pool: atomic_set(&card->qdio.state, QETH_QDIO_UNINITIALIZED); return -ENOMEM; } @@@ -2623,11 -2612,12 +2612,12 @@@ static void qeth_free_qdio_queues(struc
qeth_free_cq(card); for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) { - if (card->qdio.in_q->bufs[j].rx_skb) + if (card->qdio.in_q->bufs[j].rx_skb) { consume_skb(card->qdio.in_q->bufs[j].rx_skb); + card->qdio.in_q->bufs[j].rx_skb = NULL; + } } - qeth_free_qdio_queue(card->qdio.in_q); - card->qdio.in_q = NULL; + /* inbound buffer pool */ qeth_free_buffer_pool(card); /* free outbound qdio_qs */ @@@ -2926,7 -2916,8 +2916,7 @@@ static int qeth_init_qdio_queues(struc }
card->qdio.in_q->next_buf_to_init = QDIO_BUFNR(rx_bufs); - rc = do_QDIO(CARD_DDEV(card), QDIO_FLAG_SYNC_INPUT, 0, 0, rx_bufs, - NULL); + rc = qdio_add_bufs_to_input_queue(CARD_DDEV(card), 0, 0, rx_bufs); if (rc) { QETH_CARD_TEXT_(card, 2, "1err%d", rc); return rc; @@@ -3414,9 -3405,8 +3404,9 @@@ static unsigned int qeth_rx_refill_queu return 0; }
- rc = do_QDIO(CARD_DDEV(card), QDIO_FLAG_SYNC_INPUT, 0, - queue->next_buf_to_init, count, NULL); + rc = qdio_add_bufs_to_input_queue(CARD_DDEV(card), 0, + queue->next_buf_to_init, + count); if (rc) { QETH_CARD_TEXT(card, 2, "qinberr"); } @@@ -3588,8 -3578,8 +3578,8 @@@ static void qeth_flush_buffers(struct q }
QETH_TXQ_STAT_INC(queue, doorbell); - rc = do_QDIO(CARD_DDEV(card), QDIO_FLAG_SYNC_OUTPUT, queue->queue_no, - index, count, aob); + rc = qdio_add_bufs_to_output_queue(CARD_DDEV(card), queue->queue_no, + index, count, aob);
switch (rc) { case 0: @@@ -3645,12 -3635,10 +3635,10 @@@ static void qeth_check_outbound_queue(s if ((atomic_read(&queue->used_buffers) <= QETH_LOW_WATERMARK_PACK) || !atomic_read(&queue->set_pci_flags_count)) { unsigned int index, flush_cnt; - bool q_was_packing;
spin_lock(&queue->lock);
index = queue->next_buf_to_fill; - q_was_packing = queue->do_pack;
flush_cnt = qeth_switch_to_nonpacking_if_needed(queue); if (!flush_cnt && !atomic_read(&queue->set_pci_flags_count)) @@@ -3658,8 -3646,7 +3646,7 @@@
if (flush_cnt) { qeth_flush_buffers(queue, index, flush_cnt); - if (q_was_packing) - QETH_TXQ_STAT_ADD(queue, bufs_pack, flush_cnt); + QETH_TXQ_STAT_ADD(queue, bufs_pack, flush_cnt); }
spin_unlock(&queue->lock); @@@ -3739,8 -3726,8 +3726,8 @@@ static void qeth_qdio_cq_handler(struc } qeth_scrub_qdio_buffer(buffer, QDIO_MAX_ELEMENTS_PER_BUFFER); } - rc = do_QDIO(CARD_DDEV(card), QDIO_FLAG_SYNC_INPUT, queue, - cq->next_buf_to_init, count, NULL); + rc = qdio_add_bufs_to_input_queue(CARD_DDEV(card), queue, + cq->next_buf_to_init, count); if (rc) { dev_warn(&card->gdev->dev, "QDIO reported an error, rc=%i\n", rc); @@@ -3779,7 -3766,7 +3766,7 @@@ static void qeth_qdio_output_handler(st /* * Note: Function assumes that we have 4 outbound queues. */ - int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb) + static int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb) { struct vlan_ethhdr *veth = vlan_eth_hdr(skb); u8 tos; @@@ -3824,7 -3811,6 +3811,6 @@@ } return card->qdio.default_out_queue; } - EXPORT_SYMBOL_GPL(qeth_get_priority_queue);
/** * qeth_get_elements_for_frags() - find number of SBALEs for skb frags. @@@ -5585,29 -5571,9 +5571,9 @@@ static void qeth_l3_rebuild_skb(struct #endif
static void qeth_receive_skb(struct qeth_card *card, struct sk_buff *skb, - struct qeth_hdr *hdr, bool uses_frags) + bool uses_frags, bool is_cso) { struct napi_struct *napi = &card->napi; - bool is_cso; - - switch (hdr->hdr.l2.id) { - #if IS_ENABLED(CONFIG_QETH_L3) - case QETH_HEADER_TYPE_LAYER3: - qeth_l3_rebuild_skb(card, skb, hdr); - is_cso = hdr->hdr.l3.ext_flags & QETH_HDR_EXT_CSUM_TRANSP_REQ; - break; - #endif - case QETH_HEADER_TYPE_LAYER2: - is_cso = hdr->hdr.l2.flags[1] & QETH_HDR_EXT_CSUM_TRANSP_REQ; - break; - default: - /* never happens */ - if (uses_frags) - napi_free_frags(napi); - else - kfree_skb(skb); - return; - }
if (is_cso && (card->dev->features & NETIF_F_RXCSUM)) { skb->ip_summed = CHECKSUM_UNNECESSARY; @@@ -5664,6 -5630,7 +5630,7 @@@ static int qeth_extract_skb(struct qeth struct qeth_hdr *hdr; struct sk_buff *skb; int skb_len = 0; + bool is_cso;
element = &buffer->element[*element_no];
@@@ -5683,11 -5650,15 +5650,15 @@@ next_packet switch (hdr->hdr.l2.id) { case QETH_HEADER_TYPE_LAYER2: skb_len = hdr->hdr.l2.pkt_length; + is_cso = hdr->hdr.l2.flags[1] & QETH_HDR_EXT_CSUM_TRANSP_REQ; + linear_len = ETH_HLEN; headroom = 0; break; case QETH_HEADER_TYPE_LAYER3: skb_len = hdr->hdr.l3.length; + is_cso = hdr->hdr.l3.ext_flags & QETH_HDR_EXT_CSUM_TRANSP_REQ; + if (!IS_LAYER3(card)) { QETH_CARD_STAT_INC(card, rx_dropped_notsupp); goto walk_packet; @@@ -5814,7 -5785,12 +5785,12 @@@ walk_packet *element_no = element - &buffer->element[0]; *__offset = offset;
- qeth_receive_skb(card, skb, hdr, uses_frags); + #if IS_ENABLED(CONFIG_QETH_L3) + if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER3) + qeth_l3_rebuild_skb(card, skb, hdr); + #endif + + qeth_receive_skb(card, skb, uses_frags, is_cso); return 0; }
@@@ -5850,10 -5826,10 +5826,10 @@@ static unsigned int qeth_rx_poll(struc /* Fetch completed RX buffers: */ if (!card->rx.b_count) { card->rx.qdio_err = 0; - card->rx.b_count = qdio_inspect_queue(CARD_DDEV(card), - 0, true, - &card->rx.b_index, - &card->rx.qdio_err); + card->rx.b_count = + qdio_inspect_input_queue(CARD_DDEV(card), 0, + &card->rx.b_index, + &card->rx.qdio_err); if (card->rx.b_count <= 0) { card->rx.b_count = 0; break; @@@ -5900,8 -5876,8 +5876,8 @@@ static void qeth_cq_poll(struct qeth_ca unsigned int start, error; int completed;
- completed = qdio_inspect_queue(CARD_DDEV(card), 1, true, &start, - &error); + completed = qdio_inspect_input_queue(CARD_DDEV(card), 1, &start, + &error); if (completed <= 0) return;
@@@ -6038,8 -6014,8 +6014,8 @@@ static int qeth_tx_poll(struct napi_str return 0; }
- completed = qdio_inspect_queue(CARD_DDEV(card), queue_no, false, - &start, &error); + completed = qdio_inspect_output_queue(CARD_DDEV(card), queue_no, + &start, &error); if (completed <= 0) { /* Ensure we see TX completion for pending work: */ if (napi_complete_done(napi, 0) && @@@ -6447,6 -6423,12 +6423,12 @@@ static int qeth_core_probe_device(struc qeth_determine_capabilities(card); qeth_set_blkt_defaults(card);
+ card->qdio.in_q = qeth_alloc_qdio_queue(); + if (!card->qdio.in_q) { + rc = -ENOMEM; + goto err_rx_queue; + } + card->qdio.no_out_queues = card->dev->num_tx_queues; rc = qeth_update_from_chp_desc(card); if (rc) @@@ -6473,6 -6455,8 +6455,8 @@@
err_setup_disc: err_chp_desc: + qeth_free_qdio_queue(card->qdio.in_q); + err_rx_queue: free_netdev(card->dev); err_card: qeth_core_free_card(card); @@@ -6494,6 -6478,7 +6478,7 @@@ static void qeth_core_remove_device(str
qeth_free_qdio_queues(card);
+ qeth_free_qdio_queue(card->qdio.in_q); free_netdev(card->dev); qeth_core_free_card(card); put_device(&gdev->dev); @@@ -7089,6 -7074,18 +7074,18 @@@ u16 qeth_iqd_select_queue(struct net_de } EXPORT_SYMBOL_GPL(qeth_iqd_select_queue);
+ u16 qeth_osa_select_queue(struct net_device *dev, struct sk_buff *skb, + struct net_device *sb_dev) + { + struct qeth_card *card = dev->ml_priv; + + if (qeth_uses_tx_prio_queueing(card)) + return qeth_get_priority_queue(card, skb); + + return netdev_pick_tx(dev, skb, sb_dev); + } + EXPORT_SYMBOL_GPL(qeth_osa_select_queue); + int qeth_open(struct net_device *dev) { struct qeth_card *card = dev->ml_priv; diff --combined fs/nfs/dir.c index 9883f72fdb6f,347793626f19..f998a37b8e80 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@@ -18,6 -18,7 +18,7 @@@ * 6 Jun 1999 Cache readdir lookups in the page cache. -DaveM */
+ #include <linux/compat.h> #include <linux/module.h> #include <linux/time.h> #include <linux/errno.h> @@@ -2379,8 -2380,6 +2380,8 @@@ nfs_link(struct dentry *old_dentry, str
trace_nfs_link_enter(inode, dir, dentry); d_drop(dentry); + if (S_ISREG(inode->i_mode)) + nfs_sync_inode(inode); error = NFS_PROTO(dir)->link(inode, dir, &dentry->d_name); if (error == 0) { nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); @@@ -2470,8 -2469,6 +2471,8 @@@ int nfs_rename(struct user_namespace *m } }
+ if (S_ISREG(old_inode->i_mode)) + nfs_sync_inode(old_inode); task = nfs_async_rename(old_dir, new_dir, old_dentry, new_dentry, NULL); if (IS_ERR(task)) { error = PTR_ERR(task); @@@ -2532,7 -2529,7 +2533,7 @@@ MODULE_PARM_DESC(nfs_access_max_cachesi
static void nfs_access_free_entry(struct nfs_access_entry *entry) { - put_cred(entry->cred); + put_group_info(entry->group_info); kfree_rcu(entry, rcu_head); smp_mb__before_atomic(); atomic_long_dec(&nfs_access_nr_entries); @@@ -2658,43 -2655,6 +2659,43 @@@ void nfs_access_zap_cache(struct inode } EXPORT_SYMBOL_GPL(nfs_access_zap_cache);
+static int access_cmp(const struct cred *a, const struct nfs_access_entry *b) +{ + struct group_info *ga, *gb; + int g; + + if (uid_lt(a->fsuid, b->fsuid)) + return -1; + if (uid_gt(a->fsuid, b->fsuid)) + return 1; + + if (gid_lt(a->fsgid, b->fsgid)) + return -1; + if (gid_gt(a->fsgid, b->fsgid)) + return 1; + + ga = a->group_info; + gb = b->group_info; + if (ga == gb) + return 0; + if (ga == NULL) + return -1; + if (gb == NULL) + return 1; + if (ga->ngroups < gb->ngroups) + return -1; + if (ga->ngroups > gb->ngroups) + return 1; + + for (g = 0; g < ga->ngroups; g++) { + if (gid_lt(ga->gid[g], gb->gid[g])) + return -1; + if (gid_gt(ga->gid[g], gb->gid[g])) + return 1; + } + return 0; +} + static struct nfs_access_entry *nfs_access_search_rbtree(struct inode *inode, const struct cred *cred) { struct rb_node *n = NFS_I(inode)->access_cache.rb_node; @@@ -2702,7 -2662,7 +2703,7 @@@ while (n != NULL) { struct nfs_access_entry *entry = rb_entry(n, struct nfs_access_entry, rb_node); - int cmp = cred_fscmp(cred, entry->cred); + int cmp = access_cmp(cred, entry);
if (cmp < 0) n = n->rb_left; @@@ -2714,7 -2674,7 +2715,7 @@@ return NULL; }
-static int nfs_access_get_cached_locked(struct inode *inode, const struct cred *cred, struct nfs_access_entry *res, bool may_block) +static int nfs_access_get_cached_locked(struct inode *inode, const struct cred *cred, u32 *mask, bool may_block) { struct nfs_inode *nfsi = NFS_I(inode); struct nfs_access_entry *cache; @@@ -2744,7 -2704,8 +2745,7 @@@ spin_lock(&inode->i_lock); retry = false; } - res->cred = cache->cred; - res->mask = cache->mask; + *mask = cache->mask; list_move_tail(&cache->lru, &nfsi->access_cache_entry_lru); err = 0; out: @@@ -2756,7 -2717,7 +2757,7 @@@ out_zap return -ENOENT; }
-static int nfs_access_get_cached_rcu(struct inode *inode, const struct cred *cred, struct nfs_access_entry *res) +static int nfs_access_get_cached_rcu(struct inode *inode, const struct cred *cred, u32 *mask) { /* Only check the most recently returned cache entry, * but do it without locking. @@@ -2772,36 -2733,35 +2773,36 @@@ lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru)); cache = list_entry(lh, struct nfs_access_entry, lru); if (lh == &nfsi->access_cache_entry_lru || - cred_fscmp(cred, cache->cred) != 0) + access_cmp(cred, cache) != 0) cache = NULL; if (cache == NULL) goto out; if (nfs_check_cache_invalid(inode, NFS_INO_INVALID_ACCESS)) goto out; - res->cred = cache->cred; - res->mask = cache->mask; + *mask = cache->mask; err = 0; out: rcu_read_unlock(); return err; }
-int nfs_access_get_cached(struct inode *inode, const struct cred *cred, struct -nfs_access_entry *res, bool may_block) +int nfs_access_get_cached(struct inode *inode, const struct cred *cred, + u32 *mask, bool may_block) { int status;
- status = nfs_access_get_cached_rcu(inode, cred, res); + status = nfs_access_get_cached_rcu(inode, cred, mask); if (status != 0) - status = nfs_access_get_cached_locked(inode, cred, res, + status = nfs_access_get_cached_locked(inode, cred, mask, may_block);
return status; } EXPORT_SYMBOL_GPL(nfs_access_get_cached);
-static void nfs_access_add_rbtree(struct inode *inode, struct nfs_access_entry *set) +static void nfs_access_add_rbtree(struct inode *inode, + struct nfs_access_entry *set, + const struct cred *cred) { struct nfs_inode *nfsi = NFS_I(inode); struct rb_root *root_node = &nfsi->access_cache; @@@ -2814,7 -2774,7 +2815,7 @@@ while (*p != NULL) { parent = *p; entry = rb_entry(parent, struct nfs_access_entry, rb_node); - cmp = cred_fscmp(set->cred, entry->cred); + cmp = access_cmp(cred, entry);
if (cmp < 0) p = &parent->rb_left; @@@ -2836,16 -2796,13 +2837,16 @@@ found nfs_access_free_entry(entry); }
-void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set) +void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set, + const struct cred *cred) { struct nfs_access_entry *cache = kmalloc(sizeof(*cache), GFP_KERNEL); if (cache == NULL) return; RB_CLEAR_NODE(&cache->rb_node); - cache->cred = get_cred(set->cred); + cache->fsuid = cred->fsuid; + cache->fsgid = cred->fsgid; + cache->group_info = get_group_info(cred->group_info); cache->mask = set->mask;
/* The above field assignments must be visible @@@ -2853,7 -2810,7 +2854,7 @@@ * use rcu_assign_pointer, so just force the memory barrier. */ smp_wmb(); - nfs_access_add_rbtree(inode, cache); + nfs_access_add_rbtree(inode, cache, cred);
/* Update accounting */ smp_mb__before_atomic(); @@@ -2918,7 -2875,7 +2919,7 @@@ static int nfs_do_access(struct inode *
trace_nfs_access_enter(inode);
- status = nfs_access_get_cached(inode, cred, &cache, may_block); + status = nfs_access_get_cached(inode, cred, &cache.mask, may_block); if (status == 0) goto out_cached;
@@@ -2938,7 -2895,8 +2939,7 @@@ cache.mask |= NFS_ACCESS_DELETE | NFS_ACCESS_LOOKUP; else cache.mask |= NFS_ACCESS_EXECUTE; - cache.cred = cred; - status = NFS_PROTO(inode)->access(inode, &cache); + status = NFS_PROTO(inode)->access(inode, &cache, cred); if (status != 0) { if (status == -ESTALE) { if (!S_ISDIR(inode->i_mode)) @@@ -2948,7 -2906,7 +2949,7 @@@ } goto out; } - nfs_access_add_cache(inode, &cache); + nfs_access_add_cache(inode, &cache, cred); out_cached: cache_mask = nfs_access_calc_mask(cache.mask, inode->i_mode); if ((mask & ~cache_mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) != 0) diff --combined include/linux/perf_event.h index 411e34210fbf,4a021149eaf0..474eaecd63ba --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@@ -129,15 -129,6 +129,15 @@@ struct hw_perf_event_extra int idx; /* index in shared_regs->regs[] */ };
+/** + * hw_perf_event::flag values + * + * PERF_EVENT_FLAG_ARCH bits are reserved for architecture-specific + * usage. + */ +#define PERF_EVENT_FLAG_ARCH 0x0000ffff +#define PERF_EVENT_FLAG_USER_READ_CNT 0x80000000 + /** * struct hw_perf_event - performance event hardware details: */ @@@ -620,6 -611,7 +620,7 @@@ struct swevent_hlist #define PERF_ATTACH_SCHED_CB 0x20 #define PERF_ATTACH_CHILD 0x40
+ struct bpf_prog; struct perf_cgroup; struct perf_buffer;
@@@ -831,7 -823,6 +832,7 @@@ struct perf_event_context
int nr_events; int nr_active; + int nr_user; int is_active; int nr_stat; int nr_freq; diff --combined include/net/sctp/sctp.h index 3ae61ce2eabd,b4bfdd44e839..bf3716fe83e0 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@@ -112,7 -112,8 +112,7 @@@ struct sctp_transport *sctp_transport_g struct rhashtable_iter *iter); struct sctp_transport *sctp_transport_get_idx(struct net *net, struct rhashtable_iter *iter, int pos); -int sctp_transport_lookup_process(int (*cb)(struct sctp_transport *, void *), - struct net *net, +int sctp_transport_lookup_process(sctp_callback_t cb, struct net *net, const union sctp_addr *laddr, const union sctp_addr *paddr, void *p); int sctp_transport_traverse_process(sctp_callback_t cb, sctp_callback_t cb_done, @@@ -509,8 -510,8 +509,8 @@@ static inline int sctp_ep_hashfn(struc return (net_hash_mix(net) + lport) & (sctp_ep_hashsize - 1); }
- #define sctp_for_each_hentry(epb, head) \ - hlist_for_each_entry(epb, head, node) + #define sctp_for_each_hentry(ep, head) \ + hlist_for_each_entry(ep, head, node)
/* Is a socket of this style? */ #define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style)) diff --combined include/net/xfrm.h index 55e574511af5,83b46da8873d..2c72e1b85713 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@@ -128,6 -128,7 +128,7 @@@ struct xfrm_state_walk
struct xfrm_state_offload { struct net_device *dev; + netdevice_tracker dev_tracker; struct net_device *real_dev; unsigned long offload_handle; unsigned int num_exthdrs; @@@ -1162,7 -1163,7 +1163,7 @@@ static inline int xfrm_route_forward(st { struct net *net = dev_net(skb->dev);
- if (xfrm_default_allow(net, XFRM_POLICY_FWD)) + if (xfrm_default_allow(net, XFRM_POLICY_OUT)) return !net->xfrm.policy_count[XFRM_POLICY_OUT] || (skb_dst(skb)->flags & DST_NOXFRM) || __xfrm_route_forward(skb, family); @@@ -1913,7 -1914,7 +1914,7 @@@ static inline void xfrm_dev_state_free( if (dev->xfrmdev_ops->xdo_dev_state_free) dev->xfrmdev_ops->xdo_dev_state_free(x); xso->dev = NULL; - dev_put(dev); + dev_put_track(dev, &xso->dev_tracker); } } #else diff --combined net/ipv4/fib_semantics.c index 92c29ab3d042,3cad543dc747..828de171708f --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@@ -208,7 -208,7 +208,7 @@@ static void rt_fibinfo_free_cpus(struc
void fib_nh_common_release(struct fib_nh_common *nhc) { - dev_put(nhc->nhc_dev); + dev_put_track(nhc->nhc_dev, &nhc->nhc_dev_tracker); lwtstate_put(nhc->nhc_lwtstate); rt_fibinfo_free_cpus(nhc->nhc_pcpu_rth_output); rt_fibinfo_free(&nhc->nhc_rth_input); @@@ -662,19 -662,6 +662,19 @@@ static int fib_count_nexthops(struct rt return nhs; }
+static int fib_gw_from_attr(__be32 *gw, struct nlattr *nla, + struct netlink_ext_ack *extack) +{ + if (nla_len(nla) < sizeof(*gw)) { + NL_SET_ERR_MSG(extack, "Invalid IPv4 address in RTA_GATEWAY"); + return -EINVAL; + } + + *gw = nla_get_in_addr(nla); + + return 0; +} + /* only called when fib_nh is integrated into fib_info */ static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh, int remaining, struct fib_config *cfg, @@@ -717,11 -704,7 +717,11 @@@ return -EINVAL; } if (nla) { - fib_cfg.fc_gw4 = nla_get_in_addr(nla); + ret = fib_gw_from_attr(&fib_cfg.fc_gw4, nla, + extack); + if (ret) + goto errout; + if (fib_cfg.fc_gw4) fib_cfg.fc_gw_family = AF_INET; } else if (nlav) { @@@ -731,18 -714,10 +731,18 @@@ }
nla = nla_find(attrs, attrlen, RTA_FLOW); - if (nla) + if (nla) { + if (nla_len(nla) < sizeof(u32)) { + NL_SET_ERR_MSG(extack, "Invalid RTA_FLOW"); + return -EINVAL; + } fib_cfg.fc_flow = nla_get_u32(nla); + }
fib_cfg.fc_encap = nla_find(attrs, attrlen, RTA_ENCAP); + /* RTA_ENCAP_TYPE length checked in + * lwtunnel_valid_encap_type_attr + */ nla = nla_find(attrs, attrlen, RTA_ENCAP_TYPE); if (nla) fib_cfg.fc_encap_type = nla_get_u16(nla); @@@ -927,7 -902,6 +927,7 @@@ int fib_nh_match(struct net *net, struc attrlen = rtnh_attrlen(rtnh); if (attrlen > 0) { struct nlattr *nla, *nlav, *attrs = rtnh_attrs(rtnh); + int err;
nla = nla_find(attrs, attrlen, RTA_GATEWAY); nlav = nla_find(attrs, attrlen, RTA_VIA); @@@ -938,17 -912,12 +938,17 @@@ }
if (nla) { + __be32 gw; + + err = fib_gw_from_attr(&gw, nla, extack); + if (err) + return err; + if (nh->fib_nh_gw_family != AF_INET || - nla_get_in_addr(nla) != nh->fib_nh_gw4) + gw != nh->fib_nh_gw4) return 1; } else if (nlav) { struct fib_config cfg2; - int err;
err = fib_gw_from_via(&cfg2, nlav, extack); if (err) @@@ -971,14 -940,8 +971,14 @@@
#ifdef CONFIG_IP_ROUTE_CLASSID nla = nla_find(attrs, attrlen, RTA_FLOW); - if (nla && nla_get_u32(nla) != nh->nh_tclassid) - return 1; + if (nla) { + if (nla_len(nla) < sizeof(u32)) { + NL_SET_ERR_MSG(extack, "Invalid RTA_FLOW"); + return -EINVAL; + } + if (nla_get_u32(nla) != nh->nh_tclassid) + return 1; + } #endif }
@@@ -1043,7 -1006,7 +1043,7 @@@ static int fib_check_nh_v6_gw(struct ne err = ipv6_stub->fib6_nh_init(net, &fib6_nh, &cfg, GFP_KERNEL, extack); if (!err) { nh->fib_nh_dev = fib6_nh.fib_nh_dev; - dev_hold(nh->fib_nh_dev); + dev_hold_track(nh->fib_nh_dev, &nh->fib_nh_dev_tracker, GFP_KERNEL); nh->fib_nh_oif = nh->fib_nh_dev->ifindex; nh->fib_nh_scope = RT_SCOPE_LINK;
@@@ -1127,7 -1090,7 +1127,7 @@@ static int fib_check_nh_v4_gw(struct ne if (!netif_carrier_ok(dev)) nh->fib_nh_flags |= RTNH_F_LINKDOWN; nh->fib_nh_dev = dev; - dev_hold(dev); + dev_hold_track(dev, &nh->fib_nh_dev_tracker, GFP_ATOMIC); nh->fib_nh_scope = RT_SCOPE_LINK; return 0; } @@@ -1181,7 -1144,7 +1181,7 @@@ "No egress device for nexthop gateway"); goto out; } - dev_hold(dev); + dev_hold_track(dev, &nh->fib_nh_dev_tracker, GFP_ATOMIC); if (!netif_carrier_ok(dev)) nh->fib_nh_flags |= RTNH_F_LINKDOWN; err = (dev->flags & IFF_UP) ? 0 : -ENETDOWN; @@@ -1215,7 -1178,7 +1215,7 @@@ static int fib_check_nh_nongw(struct ne }
nh->fib_nh_dev = in_dev->dev; - dev_hold(nh->fib_nh_dev); + dev_hold_track(nh->fib_nh_dev, &nh->fib_nh_dev_tracker, GFP_ATOMIC); nh->fib_nh_scope = RT_SCOPE_HOST; if (!netif_carrier_ok(nh->fib_nh_dev)) nh->fib_nh_flags |= RTNH_F_LINKDOWN; @@@ -1545,6 -1508,8 +1545,8 @@@ struct fib_info *fib_create_info(struc err = -ENODEV; if (!nh->fib_nh_dev) goto failure; + netdev_tracker_alloc(nh->fib_nh_dev, &nh->fib_nh_dev_tracker, + GFP_KERNEL); } else { int linkdown = 0;
diff --combined net/ipv6/ip6_gre.c index f5a511c57aa2,110839a88bc2..8753e9cec326 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@@ -403,7 -403,7 +403,7 @@@ static void ip6erspan_tunnel_uninit(str ip6erspan_tunnel_unlink_md(ign, t); ip6gre_tunnel_unlink(ign, t); dst_cache_reset(&t->dst_cache); - dev_put(dev); + dev_put_track(dev, &t->dev_tracker); }
static void ip6gre_tunnel_uninit(struct net_device *dev) @@@ -416,7 -416,7 +416,7 @@@ if (ign->fb_tunnel_dev == dev) WRITE_ONCE(ign->fb_tunnel_dev, NULL); dst_cache_reset(&t->dst_cache); - dev_put(dev); + dev_put_track(dev, &t->dev_tracker); }
@@@ -755,7 -755,6 +755,7 @@@ static netdev_tx_t __gre6_xmit(struct s fl6->daddr = key->u.ipv6.dst; fl6->flowlabel = key->label; fl6->flowi6_uid = sock_net_uid(dev_net(dev), NULL); + fl6->fl6_gre_key = tunnel_id_to_key32(key->tun_id);
dsfield = key->tos; flags = key->tun_flags & @@@ -991,7 -990,6 +991,7 @@@ static netdev_tx_t ip6erspan_tunnel_xmi fl6.daddr = key->u.ipv6.dst; fl6.flowlabel = key->label; fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL); + fl6.fl6_gre_key = tunnel_id_to_key32(key->tun_id);
dsfield = key->tos; if (!(tun_info->key.tun_flags & TUNNEL_ERSPAN_OPT)) @@@ -1100,7 -1098,6 +1100,7 @@@ static void ip6gre_tnl_link_config_comm fl6->flowi6_oif = p->link; fl6->flowlabel = 0; fl6->flowi6_proto = IPPROTO_GRE; + fl6->fl6_gre_key = t->parms.o_key;
if (!(p->flags&IP6_TNL_F_USE_ORIG_TCLASS)) fl6->flowlabel |= IPV6_TCLASS_MASK & p->flowinfo; @@@ -1499,7 -1496,7 +1499,7 @@@ static int ip6gre_tunnel_init_common(st } ip6gre_tnl_init_features(dev);
- dev_hold(dev); + dev_hold_track(dev, &tunnel->dev_tracker, GFP_KERNEL); return 0;
cleanup_dst_cache_init: @@@ -1547,7 -1544,7 +1547,7 @@@ static void ip6gre_fb_tunnel_init(struc static struct inet6_protocol ip6gre_protocol __read_mostly = { .handler = gre_rcv, .err_handler = ip6gre_err, - .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, + .flags = INET6_PROTO_FINAL, };
static void ip6gre_destroy_tunnels(struct net *net, struct list_head *head) @@@ -1891,7 -1888,7 +1891,7 @@@ static int ip6erspan_tap_init(struct ne dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; ip6erspan_tnl_link_config(tunnel, 1);
- dev_hold(dev); + dev_hold_track(dev, &tunnel->dev_tracker, GFP_KERNEL); return 0;
cleanup_dst_cache_init: diff --combined net/ipv6/route.c index 1deb6297aab6,03be0e6b4826..e6de94203c13 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@@ -182,8 -182,9 +182,9 @@@ static void rt6_uncached_list_flush_dev
if (rt_dev == dev) { rt->dst.dev = blackhole_netdev; - dev_hold(rt->dst.dev); - dev_put(rt_dev); + dev_replace_track(rt_dev, blackhole_netdev, + &rt->dst.dev_tracker, + GFP_ATOMIC); } } spin_unlock_bh(&ul->lock); @@@ -328,9 -329,7 +329,7 @@@ static const struct rt6_info ip6_blk_ho
static void rt6_info_init(struct rt6_info *rt) { - struct dst_entry *dst = &rt->dst; - - memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); + memset_after(rt, 0, dst); INIT_LIST_HEAD(&rt->rt6i_uncached); }
@@@ -594,6 -593,7 +593,7 @@@ struct __rt6_probe_work struct work_struct work; struct in6_addr target; struct net_device *dev; + netdevice_tracker dev_tracker; };
static void rt6_probe_deferred(struct work_struct *w) @@@ -604,7 -604,7 +604,7 @@@
addrconf_addr_solict_mult(&work->target, &mcaddr); ndisc_send_ns(work->dev, &work->target, &mcaddr, NULL, 0); - dev_put(work->dev); + dev_put_track(work->dev, &work->dev_tracker); kfree(work); }
@@@ -658,7 -658,7 +658,7 @@@ static void rt6_probe(struct fib6_nh *f } else { INIT_WORK(&work->work, rt6_probe_deferred); work->target = *nh_gw; - dev_hold(dev); + dev_hold_track(dev, &work->dev_tracker, GFP_ATOMIC); work->dev = dev; schedule_work(&work->work); } @@@ -1485,7 -1485,7 +1485,7 @@@ static void rt6_exception_remove_oldest static u32 rt6_exception_hash(const struct in6_addr *dst, const struct in6_addr *src) { - static siphash_key_t rt6_exception_key __read_mostly; + static siphash_aligned_key_t rt6_exception_key; struct { struct in6_addr dst; struct in6_addr src; @@@ -3628,6 -3628,8 +3628,8 @@@ pcpu_alloc }
fib6_nh->fib_nh_dev = dev; + netdev_tracker_alloc(dev, &fib6_nh->fib_nh_dev_tracker, gfp_flags); + fib6_nh->fib_nh_oif = dev->ifindex; err = 0; out: @@@ -3658,24 -3660,8 +3660,8 @@@ void fib6_nh_release(struct fib6_nh *fi
rcu_read_unlock();
- if (fib6_nh->rt6i_pcpu) { - int cpu; - - for_each_possible_cpu(cpu) { - struct rt6_info **ppcpu_rt; - struct rt6_info *pcpu_rt; - - ppcpu_rt = per_cpu_ptr(fib6_nh->rt6i_pcpu, cpu); - pcpu_rt = *ppcpu_rt; - if (pcpu_rt) { - dst_dev_put(&pcpu_rt->dst); - dst_release(&pcpu_rt->dst); - *ppcpu_rt = NULL; - } - } - - free_percpu(fib6_nh->rt6i_pcpu); - } + fib6_nh_release_dsts(fib6_nh); + free_percpu(fib6_nh->rt6i_pcpu);
fib_nh_common_release(&fib6_nh->nh_common); } @@@ -5224,19 -5210,6 +5210,19 @@@ out return should_notify; }
+static int fib6_gw_from_attr(struct in6_addr *gw, struct nlattr *nla, + struct netlink_ext_ack *extack) +{ + if (nla_len(nla) < sizeof(*gw)) { + NL_SET_ERR_MSG(extack, "Invalid IPv6 address in RTA_GATEWAY"); + return -EINVAL; + } + + *gw = nla_get_in6_addr(nla); + + return 0; +} + static int ip6_route_multipath_add(struct fib6_config *cfg, struct netlink_ext_ack *extack) { @@@ -5277,18 -5250,10 +5263,18 @@@
nla = nla_find(attrs, attrlen, RTA_GATEWAY); if (nla) { - r_cfg.fc_gateway = nla_get_in6_addr(nla); + err = fib6_gw_from_attr(&r_cfg.fc_gateway, nla, + extack); + if (err) + goto cleanup; + r_cfg.fc_flags |= RTF_GATEWAY; } r_cfg.fc_encap = nla_find(attrs, attrlen, RTA_ENCAP); + + /* RTA_ENCAP_TYPE length checked in + * lwtunnel_valid_encap_type_attr + */ nla = nla_find(attrs, attrlen, RTA_ENCAP_TYPE); if (nla) r_cfg.fc_encap_type = nla_get_u16(nla); @@@ -5455,13 -5420,7 +5441,13 @@@ static int ip6_route_multipath_del(stru
nla = nla_find(attrs, attrlen, RTA_GATEWAY); if (nla) { - nla_memcpy(&r_cfg.fc_gateway, nla, 16); + err = fib6_gw_from_attr(&r_cfg.fc_gateway, nla, + extack); + if (err) { + last_err = err; + goto next_rtnh; + } + r_cfg.fc_flags |= RTF_GATEWAY; } } @@@ -5469,7 -5428,6 +5455,7 @@@ if (err) last_err = err;
+next_rtnh: rtnh = rtnh_next(rtnh, &remaining); }
diff --combined net/ipv6/seg6_local.c index ef88489c71f5,a5eea182149d..9fbe243a0e81 --- a/net/ipv6/seg6_local.c +++ b/net/ipv6/seg6_local.c @@@ -7,6 -7,7 +7,7 @@@ * eBPF support: Mathieu Xhonneux m.xhonneux@gmail.com */
+ #include <linux/filter.h> #include <linux/types.h> #include <linux/skbuff.h> #include <linux/net.h> @@@ -150,11 -151,40 +151,11 @@@ static struct seg6_local_lwt *seg6_loca return (struct seg6_local_lwt *)lwt->data; }
-static struct ipv6_sr_hdr *get_srh(struct sk_buff *skb, int flags) -{ - struct ipv6_sr_hdr *srh; - int len, srhoff = 0; - - if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, &flags) < 0) - return NULL; - - if (!pskb_may_pull(skb, srhoff + sizeof(*srh))) - return NULL; - - srh = (struct ipv6_sr_hdr *)(skb->data + srhoff); - - len = (srh->hdrlen + 1) << 3; - - if (!pskb_may_pull(skb, srhoff + len)) - return NULL; - - /* note that pskb_may_pull may change pointers in header; - * for this reason it is necessary to reload them when needed. - */ - srh = (struct ipv6_sr_hdr *)(skb->data + srhoff); - - if (!seg6_validate_srh(srh, len, true)) - return NULL; - - return srh; -} - static struct ipv6_sr_hdr *get_and_validate_srh(struct sk_buff *skb) { struct ipv6_sr_hdr *srh;
- srh = get_srh(skb, IP6_FH_F_SKIP_RH); + srh = seg6_get_srh(skb, IP6_FH_F_SKIP_RH); if (!srh) return NULL;
@@@ -171,7 -201,7 +172,7 @@@ static bool decap_and_validate(struct s struct ipv6_sr_hdr *srh; unsigned int off = 0;
- srh = get_srh(skb, 0); + srh = seg6_get_srh(skb, 0); if (srh && srh->segments_left > 0) return false;
diff --combined net/ipv6/udp.c index a0871c212741,1accc06abc54..df216268cb02 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@@ -17,6 -17,7 +17,7 @@@ * YOSHIFUJI Hideaki @USAGI: convert /proc/net/udp6 to seq_file. */
+ #include <linux/bpf-cgroup.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/socket.h> @@@ -40,7 -41,6 +41,7 @@@ #include <net/transp_v6.h> #include <net/ip6_route.h> #include <net/raw.h> +#include <net/seg6.h> #include <net/tcp_states.h> #include <net/ip6_checksum.h> #include <net/ip6_tunnel.h> @@@ -196,7 -196,7 +197,7 @@@ static inline struct sock *udp6_lookup_ const struct in6_addr *saddr, __be16 sport, const struct in6_addr *daddr, - u16 hnum) + u16 hnum, const int dif) { struct sock *sk, *reuse_sk; bool no_reuseport; @@@ -204,8 -204,8 +205,8 @@@ if (udptable != &udp_table) return NULL; /* only UDP is supported */
- no_reuseport = bpf_sk_lookup_run_v6(net, IPPROTO_UDP, - saddr, sport, daddr, hnum, &sk); + no_reuseport = bpf_sk_lookup_run_v6(net, IPPROTO_UDP, saddr, sport, + daddr, hnum, dif, &sk); if (no_reuseport || IS_ERR_OR_NULL(sk)) return sk;
@@@ -241,7 -241,7 +242,7 @@@ struct sock *__udp6_lib_lookup(struct n /* Lookup redirect from BPF */ if (static_branch_unlikely(&bpf_sk_lookup_enabled)) { sk = udp6_lookup_run_bpf(net, udptable, skb, - saddr, sport, daddr, hnum); + saddr, sport, daddr, hnum, dif); if (sk) { result = sk; goto done; @@@ -562,7 -562,7 +563,7 @@@ int __udp6_lib_err(struct sk_buff *skb struct ipv6_pinfo *np; const struct ipv6hdr *hdr = (const struct ipv6hdr *)skb->data; const struct in6_addr *saddr = &hdr->saddr; - const struct in6_addr *daddr = &hdr->daddr; + const struct in6_addr *daddr = seg6_get_daddr(skb, opt) ? : &hdr->daddr; struct udphdr *uh = (struct udphdr *)(skb->data+offset); bool tunnel = false; struct sock *sk; diff --combined net/mac80211/ieee80211_i.h index 482c98ede19b,08c0542c93a3..330ea62231fa --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@@ -647,26 -647,6 +647,26 @@@ struct mesh_csa_settings struct cfg80211_csa_settings settings; };
+/** + * struct mesh_table + * + * @known_gates: list of known mesh gates and their mpaths by the station. The + * gate's mpath may or may not be resolved and active. + * @gates_lock: protects updates to known_gates + * @rhead: the rhashtable containing struct mesh_paths, keyed by dest addr + * @walk_head: linked list containing all mesh_path objects + * @walk_lock: lock protecting walk_head + * @entries: number of entries in the table + */ +struct mesh_table { + struct hlist_head known_gates; + spinlock_t gates_lock; + struct rhashtable rhead; + struct hlist_head walk_head; + spinlock_t walk_lock; + atomic_t entries; /* Up to MAX_MESH_NEIGHBOURS */ +}; + struct ieee80211_if_mesh { struct timer_list housekeeping_timer; struct timer_list mesh_path_timer; @@@ -741,8 -721,8 +741,8 @@@ /* offset from skb->data while building IE */ int meshconf_offset;
- struct mesh_table *mesh_paths; - struct mesh_table *mpp_paths; /* Store paths for MPP&MAP */ + struct mesh_table mesh_paths; + struct mesh_table mpp_paths; /* Store paths for MPP&MAP */ int mesh_paths_generation; int mpp_paths_generation; }; @@@ -1483,7 -1463,7 +1483,7 @@@ struct ieee80211_local };
static inline struct ieee80211_sub_if_data * - IEEE80211_DEV_TO_SUB_IF(struct net_device *dev) + IEEE80211_DEV_TO_SUB_IF(const struct net_device *dev) { return netdev_priv(dev); } diff --combined net/mac80211/mlme.c index 3147ca89f608,95935dee9ac4..1eeabdf10052 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@@ -164,12 -164,15 +164,15 @@@ ieee80211_determine_chantype(struct iee chandef->freq1_offset = channel->freq_offset;
if (channel->band == NL80211_BAND_6GHZ) { - if (!ieee80211_chandef_he_6ghz_oper(sdata, he_oper, chandef)) + if (!ieee80211_chandef_he_6ghz_oper(sdata, he_oper, chandef)) { + mlme_dbg(sdata, + "bad 6 GHz operation, disabling HT/VHT/HE\n"); ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_VHT | IEEE80211_STA_DISABLE_HE; - else + } else { ret = 0; + } vht_chandef = *chandef; goto out; } else if (sband->band == NL80211_BAND_S1GHZ) { @@@ -190,6 -193,7 +193,7 @@@ ieee80211_apply_htcap_overrides(sdata, &sta_ht_cap);
if (!ht_oper || !sta_ht_cap.ht_supported) { + mlme_dbg(sdata, "HT operation missing / HT not supported\n"); ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_VHT | IEEE80211_STA_DISABLE_HE; @@@ -223,6 -227,7 +227,7 @@@ if (sta_ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) { ieee80211_chandef_ht_oper(ht_oper, chandef); } else { + mlme_dbg(sdata, "40 MHz not supported\n"); /* 40 MHz (and 80 MHz) must be supported for VHT */ ret = IEEE80211_STA_DISABLE_VHT; /* also mark 40 MHz disabled */ @@@ -231,6 -236,7 +236,7 @@@ }
if (!vht_oper || !sband->vht_cap.vht_supported) { + mlme_dbg(sdata, "VHT operation missing / VHT not supported\n"); ret = IEEE80211_STA_DISABLE_VHT; goto out; } @@@ -253,7 -259,7 +259,7 @@@ &vht_chandef)) { if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE)) sdata_info(sdata, - "HE AP VHT information is invalid, disable HE\n"); + "HE AP VHT information is invalid, disabling HE\n"); ret = IEEE80211_STA_DISABLE_HE; goto out; } @@@ -263,7 -269,7 +269,7 @@@ &vht_chandef)) { if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) sdata_info(sdata, - "AP VHT information is invalid, disable VHT\n"); + "AP VHT information is invalid, disabling VHT\n"); ret = IEEE80211_STA_DISABLE_VHT; goto out; } @@@ -271,7 -277,7 +277,7 @@@ if (!cfg80211_chandef_valid(&vht_chandef)) { if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) sdata_info(sdata, - "AP VHT information is invalid, disable VHT\n"); + "AP VHT information is invalid, disabling VHT\n"); ret = IEEE80211_STA_DISABLE_VHT; goto out; } @@@ -284,7 -290,7 +290,7 @@@ if (!cfg80211_chandef_compatible(chandef, &vht_chandef)) { if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) sdata_info(sdata, - "AP VHT information doesn't match HT, disable VHT\n"); + "AP VHT information doesn't match HT, disabling VHT\n"); ret = IEEE80211_STA_DISABLE_VHT; goto out; } @@@ -649,10 -655,6 +655,6 @@@ static void ieee80211_add_he_ie(struct if (!he_cap || !reg_cap) return;
- /* - * TODO: the 1 added is because this temporarily is under the EXTENSION - * IE. Get rid of it when it moves. - */ he_cap_size = 2 + 1 + sizeof(he_cap->he_cap_elem) + ieee80211_he_mcs_nss_size(&he_cap->he_cap_elem) + @@@ -3741,6 -3743,10 +3743,10 @@@ static void ieee80211_rx_mgmt_assoc_res elems->timeout_int && elems->timeout_int->type == WLAN_TIMEOUT_ASSOC_COMEBACK) { u32 tu, ms; + + cfg80211_assoc_comeback(sdata->dev, assoc_data->bss, + le32_to_cpu(elems->timeout_int->value)); + tu = le32_to_cpu(elems->timeout_int->value); ms = tu * 1024 / 1000; sdata_info(sdata, @@@ -4900,7 -4906,7 +4906,7 @@@ static u8 ieee80211_ht_vht_rx_chains(st struct cfg80211_bss *cbss) { struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; - const u8 *ht_cap_ie, *vht_cap_ie; + const struct element *ht_cap_elem, *vht_cap_elem; const struct ieee80211_ht_cap *ht_cap; const struct ieee80211_vht_cap *vht_cap; u8 chains = 1; @@@ -4908,9 -4914,9 +4914,9 @@@ if (ifmgd->flags & IEEE80211_STA_DISABLE_HT) return chains;
- ht_cap_ie = ieee80211_bss_get_ie(cbss, WLAN_EID_HT_CAPABILITY); - if (ht_cap_ie && ht_cap_ie[1] >= sizeof(*ht_cap)) { - ht_cap = (void *)(ht_cap_ie + 2); + ht_cap_elem = ieee80211_bss_get_elem(cbss, WLAN_EID_HT_CAPABILITY); + if (ht_cap_elem && ht_cap_elem->datalen >= sizeof(*ht_cap)) { + ht_cap = (void *)ht_cap_elem->data; chains = ieee80211_mcs_to_chains(&ht_cap->mcs); /* * TODO: use "Tx Maximum Number Spatial Streams Supported" and @@@ -4921,12 -4927,12 +4927,12 @@@ if (ifmgd->flags & IEEE80211_STA_DISABLE_VHT) return chains;
- vht_cap_ie = ieee80211_bss_get_ie(cbss, WLAN_EID_VHT_CAPABILITY); - if (vht_cap_ie && vht_cap_ie[1] >= sizeof(*vht_cap)) { + vht_cap_elem = ieee80211_bss_get_elem(cbss, WLAN_EID_VHT_CAPABILITY); + if (vht_cap_elem && vht_cap_elem->datalen >= sizeof(*vht_cap)) { u8 nss; u16 tx_mcs_map;
- vht_cap = (void *)(vht_cap_ie + 2); + vht_cap = (void *)vht_cap_elem->data; tx_mcs_map = le16_to_cpu(vht_cap->supp_mcs.tx_mcs_map); for (nss = 8; nss > 0; nss--) { if (((tx_mcs_map >> (2 * (nss - 1))) & 3) != @@@ -5043,19 -5049,23 +5049,23 @@@ static int ieee80211_prep_channel(struc
/* disable HT/VHT/HE if we don't support them */ if (!sband->ht_cap.ht_supported && !is_6ghz) { + mlme_dbg(sdata, "HT not supported, disabling HT/VHT/HE\n"); ifmgd->flags |= IEEE80211_STA_DISABLE_HT; ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; ifmgd->flags |= IEEE80211_STA_DISABLE_HE; }
if (!sband->vht_cap.vht_supported && is_5ghz) { + mlme_dbg(sdata, "VHT not supported, disabling VHT/HE\n"); ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; ifmgd->flags |= IEEE80211_STA_DISABLE_HE; }
if (!ieee80211_get_he_iftype_cap(sband, - ieee80211_vif_type_p2p(&sdata->vif))) + ieee80211_vif_type_p2p(&sdata->vif))) { + mlme_dbg(sdata, "HE not supported, disabling it\n"); ifmgd->flags |= IEEE80211_STA_DISABLE_HE; + }
if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT) && !is_6ghz) { ht_oper = elems->ht_operation; @@@ -5079,6 -5089,8 +5089,8 @@@ }
if (!elems->vht_cap_elem) { + sdata_info(sdata, + "bad VHT capabilities, disabling VHT\n"); ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; vht_oper = NULL; } @@@ -5126,8 -5138,10 +5138,10 @@@ break; }
- if (!have_80mhz) + if (!have_80mhz) { + sdata_info(sdata, "80 MHz not supported, disabling VHT\n"); ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; + }
if (sband->band == NL80211_BAND_S1GHZ) { s1g_oper = elems->s1g_oper; @@@ -5265,7 -5279,7 +5279,7 @@@ static int ieee80211_prep_connection(st */ if (new_sta) { u32 rates = 0, basic_rates = 0; - bool have_higher_than_11mbit; + bool have_higher_than_11mbit = false; int min_rate = INT_MAX, min_rate_index = -1; const struct cfg80211_bss_ies *ies; int shift = ieee80211_vif_get_shift(&sdata->vif); @@@ -5691,12 -5705,14 +5705,14 @@@ int ieee80211_mgd_assoc(struct ieee8021 else if (!is_6ghz) ifmgd->flags |= IEEE80211_STA_DISABLE_HT; vht_elem = ieee80211_bss_get_elem(req->bss, WLAN_EID_VHT_CAPABILITY); - if (vht_elem && vht_elem->datalen >= sizeof(struct ieee80211_vht_cap)) + if (vht_elem && vht_elem->datalen >= sizeof(struct ieee80211_vht_cap)) { memcpy(&assoc_data->ap_vht_cap, vht_elem->data, sizeof(struct ieee80211_vht_cap)); - else if (is_5ghz) + } else if (is_5ghz) { + sdata_info(sdata, "VHT capa missing/short, disabling VHT/HE\n"); ifmgd->flags |= IEEE80211_STA_DISABLE_VHT | IEEE80211_STA_DISABLE_HE; + } rcu_read_unlock();
if (WARN((sdata->vif.driver_flags & IEEE80211_VIF_SUPPORTS_UAPSD) && @@@ -5770,16 -5786,21 +5786,21 @@@ }
if (req->flags & ASSOC_REQ_DISABLE_HT) { + mlme_dbg(sdata, "HT disabled by flag, disabling HT/VHT/HE\n"); ifmgd->flags |= IEEE80211_STA_DISABLE_HT; ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; ifmgd->flags |= IEEE80211_STA_DISABLE_HE; }
- if (req->flags & ASSOC_REQ_DISABLE_VHT) + if (req->flags & ASSOC_REQ_DISABLE_VHT) { + mlme_dbg(sdata, "VHT disabled by flag, disabling VHT\n"); ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; + }
- if (req->flags & ASSOC_REQ_DISABLE_HE) + if (req->flags & ASSOC_REQ_DISABLE_HE) { + mlme_dbg(sdata, "HE disabled by flag, disabling VHT\n"); ifmgd->flags |= IEEE80211_STA_DISABLE_HE; + }
err = ieee80211_prep_connection(sdata, req->bss, true, override); if (err) diff --combined net/sctp/socket.c index da08671a3f80,f548c67c7cff..3e1a9600be5e --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@@ -5068,12 -5068,9 +5068,9 @@@ static int sctp_init_sock(struct sock *
SCTP_DBG_OBJCNT_INC(sock);
- local_bh_disable(); sk_sockets_allocated_inc(sk); sock_prot_inuse_add(net, sk->sk_prot, 1);
- local_bh_enable(); - return 0; }
@@@ -5099,10 -5096,8 +5096,8 @@@ static void sctp_destroy_sock(struct so list_del(&sp->auto_asconf_list); } sctp_endpoint_free(sp->ep); - local_bh_disable(); sk_sockets_allocated_dec(sk); sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); - local_bh_enable(); }
/* Triggered when there are no references on the socket anymore */ @@@ -5299,14 -5294,14 +5294,14 @@@ int sctp_for_each_endpoint(int (*cb)(st void *p) { int err = 0; int hash = 0; - struct sctp_ep_common *epb; + struct sctp_endpoint *ep; struct sctp_hashbucket *head;
for (head = sctp_ep_hashtable; hash < sctp_ep_hashsize; hash++, head++) { read_lock_bh(&head->lock); - sctp_for_each_hentry(epb, &head->chain) { - err = cb(sctp_ep(epb), p); + sctp_for_each_hentry(ep, &head->chain) { + err = cb(ep, p); if (err) break; } @@@ -5317,31 -5312,23 +5312,31 @@@ } EXPORT_SYMBOL_GPL(sctp_for_each_endpoint);
-int sctp_transport_lookup_process(int (*cb)(struct sctp_transport *, void *), - struct net *net, +int sctp_transport_lookup_process(sctp_callback_t cb, struct net *net, const union sctp_addr *laddr, const union sctp_addr *paddr, void *p) { struct sctp_transport *transport; - int err; + struct sctp_endpoint *ep; + int err = -ENOENT;
rcu_read_lock(); transport = sctp_addrs_lookup_transport(net, laddr, paddr); + if (!transport) { + rcu_read_unlock(); + return err; + } + ep = transport->asoc->ep; + if (!sctp_endpoint_hold(ep)) { /* asoc can be peeled off */ + sctp_transport_put(transport); + rcu_read_unlock(); + return err; + } rcu_read_unlock(); - if (!transport) - return -ENOENT;
- err = cb(transport, p); + err = cb(ep, transport, p); + sctp_endpoint_put(ep); sctp_transport_put(transport); - return err; } EXPORT_SYMBOL_GPL(sctp_transport_lookup_process); diff --combined net/xdp/xsk.c index f16074eb53c7,e3d35850fdea..28ef3f4465ae --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@@ -677,8 -677,6 +677,8 @@@ static __poll_t xsk_poll(struct file *f struct xdp_sock *xs = xdp_sk(sk); struct xsk_buff_pool *pool;
+ sock_poll_wait(file, sock, wait); + if (unlikely(!xsk_is_bound(xs))) return mask;
@@@ -690,6 -688,8 +690,6 @@@ else /* Poll needs to drive Tx also in copy mode */ __xsk_sendmsg(sk); - } else { - sock_poll_wait(file, sock, wait); }
if (xs->rx && !xskq_prod_is_empty(xs->rx)) @@@ -794,9 -794,7 +794,7 @@@ static int xsk_release(struct socket *s sk_del_node_init_rcu(sk); mutex_unlock(&net->xdp.lock);
- local_bh_disable(); sock_prot_inuse_add(net, sk->sk_prot, -1); - local_bh_enable();
xsk_delete_from_maps(xs); mutex_lock(&xs->mutex); @@@ -1396,9 -1394,7 +1394,7 @@@ static int xsk_create(struct net *net, sk_add_node_rcu(sk, &net->xdp.list); mutex_unlock(&net->xdp.lock);
- local_bh_disable(); sock_prot_inuse_add(net, &xsk_proto, 1); - local_bh_enable();
return 0; } diff --combined net/xfrm/xfrm_user.c index b571892fe10f,e3e26f4da6c2..d6e0d8f650f9 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@@ -11,6 -11,7 +11,7 @@@ * */
+ #include <linux/compat.h> #include <linux/crypto.h> #include <linux/module.h> #include <linux/kernel.h> @@@ -621,13 -622,8 +622,13 @@@ static struct xfrm_state *xfrm_state_co
xfrm_smark_init(attrs, &x->props.smark);
- if (attrs[XFRMA_IF_ID]) + if (attrs[XFRMA_IF_ID]) { x->if_id = nla_get_u32(attrs[XFRMA_IF_ID]); + if (!x->if_id) { + err = -EINVAL; + goto error; + } + }
err = __xfrm_init_state(x, false, attrs[XFRMA_OFFLOAD_DEV]); if (err) @@@ -1418,13 -1414,8 +1419,13 @@@ static int xfrm_alloc_userspi(struct sk
mark = xfrm_mark_get(attrs, &m);
- if (attrs[XFRMA_IF_ID]) + if (attrs[XFRMA_IF_ID]) { if_id = nla_get_u32(attrs[XFRMA_IF_ID]); + if (!if_id) { + err = -EINVAL; + goto out_noput; + } + }
if (p->info.seq) { x = xfrm_find_acq_byseq(net, mark, p->info.seq); @@@ -1737,13 -1728,8 +1738,13 @@@ static struct xfrm_policy *xfrm_policy_
xfrm_mark_get(attrs, &xp->mark);
- if (attrs[XFRMA_IF_ID]) + if (attrs[XFRMA_IF_ID]) { xp->if_id = nla_get_u32(attrs[XFRMA_IF_ID]); + if (!xp->if_id) { + err = -EINVAL; + goto error; + } + }
return xp; error: @@@ -3073,7 -3059,7 +3074,7 @@@ static inline unsigned int xfrm_sa_len( if (x->props.extra_flags) l += nla_total_size(sizeof(x->props.extra_flags)); if (x->xso.dev) - l += nla_total_size(sizeof(x->xso)); + l += nla_total_size(sizeof(struct xfrm_user_offload)); if (x->props.smark.v | x->props.smark.m) { l += nla_total_size(sizeof(x->props.smark.v)); l += nla_total_size(sizeof(x->props.smark.m)); diff --combined tools/perf/builtin-trace.c index 94d62a92f1a1,97121fb45842..8163e428c683 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@@ -3257,10 -3257,21 +3257,21 @@@ static void trace__set_bpf_map_syscalls
static struct bpf_program *trace__find_bpf_program_by_title(struct trace *trace, const char *name) { + struct bpf_program *pos, *prog = NULL; + const char *sec_name; + if (trace->bpf_obj == NULL) return NULL;
- return bpf_object__find_program_by_title(trace->bpf_obj, name); + bpf_object__for_each_program(pos, trace->bpf_obj) { + sec_name = bpf_program__section_name(pos); + if (sec_name && !strcmp(sec_name, name)) { + prog = pos; + break; + } + } + + return prog; }
static struct bpf_program *trace__find_syscall_bpf_prog(struct trace *trace, struct syscall *sc, @@@ -3950,9 -3961,6 +3961,9 @@@ static int trace__run(struct trace *tra evlist__add(evlist, pgfault_min); }
+ /* Enable ignoring missing threads when -u/-p option is defined. */ + trace->opts.ignore_missing_thread = trace->opts.target.uid != UINT_MAX || trace->opts.target.pid; + if (trace->sched && evlist__add_newtp(evlist, "sched", "sched_stat_runtime", trace__sched_stat_runtime)) goto out_error_sched_stat_runtime; diff --combined tools/perf/util/bpf-loader.c index 22662fc85cc9,528aeb0ab79d..7ecfaac7536a --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c @@@ -29,6 -29,9 +29,9 @@@
#include <internal/xyarray.h>
+ /* temporarily disable libbpf deprecation warnings */ + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" + static int libbpf_perf_print(enum libbpf_print_level level __attribute__((unused)), const char *fmt, va_list args) { @@@ -421,7 -424,7 +424,7 @@@ preproc_gen_prologue(struct bpf_progra size_t prologue_cnt = 0; int i, err;
- if (IS_ERR(priv) || !priv || priv->is_tp) + if (IS_ERR_OR_NULL(priv) || priv->is_tp) goto errout;
pev = &priv->pev; @@@ -570,7 -573,7 +573,7 @@@ static int hook_load_preprocessor(struc bool need_prologue = false; int err, i;
- if (IS_ERR(priv) || !priv) { + if (IS_ERR_OR_NULL(priv)) { pr_debug("Internal error when hook preprocessor\n"); return -BPF_LOADER_ERRNO__INTERNAL; } @@@ -642,11 -645,8 +645,11 @@@ int bpf__probe(struct bpf_object *obj goto out;
priv = bpf_program__priv(prog); - if (IS_ERR(priv) || !priv) { - err = PTR_ERR(priv); + if (IS_ERR_OR_NULL(priv)) { + if (!priv) + err = -BPF_LOADER_ERRNO__INTERNAL; + else + err = PTR_ERR(priv); goto out; }
@@@ -696,7 -696,7 +699,7 @@@ int bpf__unprobe(struct bpf_object *obj struct bpf_prog_priv *priv = bpf_program__priv(prog); int i;
- if (IS_ERR(priv) || !priv || priv->is_tp) + if (IS_ERR_OR_NULL(priv) || priv->is_tp) continue;
for (i = 0; i < priv->pev.ntevs; i++) { @@@ -754,7 -754,7 +757,7 @@@ int bpf__foreach_event(struct bpf_objec struct perf_probe_event *pev; int i, fd;
- if (IS_ERR(priv) || !priv) { + if (IS_ERR_OR_NULL(priv)) { pr_debug("bpf: failed to get private field\n"); return -BPF_LOADER_ERRNO__INTERNAL; }
linux-merge@lists.open-mesh.org