···168168Johan Hovold <johan@kernel.org> <johan@hovoldconsulting.com>169169John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>170170John Stultz <johnstul@us.ibm.com>171171+Jordan Crouse <jordan@cosmicpenguin.net> <jcrouse@codeaurora.org>171172<josh@joshtriplett.org> <josh@freedesktop.org>172173<josh@joshtriplett.org> <josh@kernel.org>173174<josh@joshtriplett.org> <josht@linux.vnet.ibm.com>···254253Morten Welinder <welinder@darter.rentec.com>255254Morten Welinder <welinder@troll.com>256255Mythri P K <mythripk@ti.com>256256+Nadia Yvette Chambers <nyc@holomorphy.com> William Lee Irwin III <wli@holomorphy.com>257257Nathan Chancellor <nathan@kernel.org> <natechancellor@gmail.com>258258Nguyen Anh Quynh <aquynh@gmail.com>259259+Nicholas Piggin <npiggin@gmail.com> <npiggen@suse.de>260260+Nicholas Piggin <npiggin@gmail.com> <npiggin@kernel.dk>261261+Nicholas Piggin <npiggin@gmail.com> <npiggin@suse.de>262262+Nicholas Piggin <npiggin@gmail.com> <nickpiggin@yahoo.com.au>263263+Nicholas Piggin <npiggin@gmail.com> <piggin@cyberone.com.au>259264Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com>260265Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org>261266Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org>
+2-2
Documentation/ABI/testing/debugfs-moxtet
···11What: /sys/kernel/debug/moxtet/input22Date: March 201933KernelVersion: 5.344-Contact: Marek Behún <marek.behun@nic.cz>44+Contact: Marek Behún <kabel@kernel.org>55Description: (Read) Read input from the shift registers, in hexadecimal.66 Returns N+1 bytes, where N is the number of Moxtet connected77 modules. The first byte is from the CPU board itself.···1919What: /sys/kernel/debug/moxtet/output2020Date: March 20192121KernelVersion: 5.32222-Contact: Marek Behún <marek.behun@nic.cz>2222+Contact: Marek Behún <kabel@kernel.org>2323Description: (RW) Read last written value to the shift registers, in2424 hexadecimal, or write values to the shift registers, also2525 in hexadecimal.
+1-1
Documentation/ABI/testing/debugfs-turris-mox-rwtm
···11What: /sys/kernel/debug/turris-mox-rwtm/do_sign22Date: Jun 202033KernelVersion: 5.844-Contact: Marek Behún <marek.behun@nic.cz>44+Contact: Marek Behún <kabel@kernel.org>55Description:6677 ======= ===========================================================
···11What: /sys/class/leds/<led>/device/brightness22Date: July 202033KernelVersion: 5.944-Contact: Marek Behún <marek.behun@nic.cz>44+Contact: Marek Behún <kabel@kernel.org>55Description: (RW) On the front panel of the Turris Omnia router there is also66 a button which can be used to control the intensity of all the77 LEDs at once, so that if they are too bright, user can dim them.
···11What: /sys/firmware/turris-mox-rwtm/board_version22Date: August 201933KernelVersion: 5.444-Contact: Marek Behún <marek.behun@nic.cz>44+Contact: Marek Behún <kabel@kernel.org>55Description: (Read) Board version burned into eFuses of this Turris Mox board.66 Format: %i7788What: /sys/firmware/turris-mox-rwtm/mac_address*99Date: August 20191010KernelVersion: 5.41111-Contact: Marek Behún <marek.behun@nic.cz>1111+Contact: Marek Behún <kabel@kernel.org>1212Description: (Read) MAC addresses burned into eFuses of this Turris Mox board.1313 Format: %pM14141515What: /sys/firmware/turris-mox-rwtm/pubkey1616Date: August 20191717KernelVersion: 5.41818-Contact: Marek Behún <marek.behun@nic.cz>1818+Contact: Marek Behún <kabel@kernel.org>1919Description: (Read) ECDSA public key (in pubkey hex compressed form) computed2020 as pair to the ECDSA private key burned into eFuses of this2121 Turris Mox Board.···2424What: /sys/firmware/turris-mox-rwtm/ram_size2525Date: August 20192626KernelVersion: 5.42727-Contact: Marek Behún <marek.behun@nic.cz>2727+Contact: Marek Behún <kabel@kernel.org>2828Description: (Read) RAM size in MiB of this Turris Mox board as was detected2929 during manufacturing and burned into eFuses. Can be 512 or 1024.3030 Format: %i···3232What: /sys/firmware/turris-mox-rwtm/serial_number3333Date: August 20193434KernelVersion: 5.43535-Contact: Marek Behún <marek.behun@nic.cz>3535+Contact: Marek Behún <kabel@kernel.org>3636Description: (Read) Serial number burned into eFuses of this Turris Mox device.3737 Format: %016X
···3232- "#thermal-sensor-cells" Used to expose itself to thermal fw.33333434Read more about iio bindings at3535- Documentation/devicetree/bindings/iio/iio-bindings.txt3535+ https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/36363737Example:3838 ncp15wb473@0 {
···77title: Freescale Inter IC (I2C) and High Speed Inter IC (HS-I2C) for i.MX8899maintainers:1010- - Wolfram Sang <wolfram@the-dreams.de>1010+ - Oleksij Rempel <o.rempel@pengutronix.de>11111212allOf:1313 - $ref: /schemas/i2c/i2c-controller.yaml#
···1414 Industrial I/O subsystem bindings for ADC controller found in1515 Ingenic JZ47xx SoCs.16161717- ADC clients must use the format described in iio-bindings.txt, giving1818- a phandle and IIO specifier pair ("io-channels") to the ADC controller.1717+ ADC clients must use the format described in1818+ https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml,1919+ giving a phandle and IIO specifier pair ("io-channels") to the ADC controller.19202021properties:2122 compatible:
···2424 description: >2525 List of phandle and IIO specifier pairs.2626 Each pair defines one ADC channel to which a joystick axis is connected.2727- See Documentation/devicetree/bindings/iio/iio-bindings.txt for details.2727+ See2828+ https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml2929+ for details.28302931 '#address-cells':3032 const: 1
···55 - compatible: must be "resistive-adc-touch"66The device must be connected to an ADC device that provides channels for77position measurement and optional pressure.88-Refer to ../iio/iio-bindings.txt for details88+Refer to99+https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml1010+for details1111+912 - iio-channels: must have at least two channels connected to an ADC device.1013These should correspond to the channels exposed by the ADC device and should1114have the right index as the ADC device registers them. These channels
···77title: CZ.NIC's Turris Omnia LEDs driver8899maintainers:1010- - Marek Behún <marek.behun@nic.cz>1010+ - Marek Behún <kabel@kernel.org>11111212description:1313 This module adds support for the RGB LEDs found on the front panel of the
+3-1
Documentation/devicetree/bindings/mfd/ab8500.txt
···7272 pwm|regulator|rtc|sysctrl|usb]";73737474 A few child devices require ADC channels from the GPADC node. Those follow the7575- standard bindings from iio/iio-bindings.txt and iio/adc/adc.txt7575+ standard bindings from7676+ https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml7777+ and Documentation/devicetree/bindings/iio/adc/adc.yaml76787779 abx500-temp : io-channels "aux1" and "aux2" for measuring external7880 temperatures.
···1616The sub-functions of CPCAP get their own node with their own compatible values,1717which are described in the following files:18181919-- ../power/supply/cpcap-battery.txt2020-- ../power/supply/cpcap-charger.txt2121-- ../regulator/cpcap-regulator.txt2222-- ../phy/phy-cpcap-usb.txt2323-- ../input/cpcap-pwrbutton.txt2424-- ../rtc/cpcap-rtc.txt2525-- ../leds/leds-cpcap.txt2626-- ../iio/adc/cpcap-adc.txt1919+- Documentation/devicetree/bindings/power/supply/cpcap-battery.txt2020+- Documentation/devicetree/bindings/power/supply/cpcap-charger.txt2121+- Documentation/devicetree/bindings/regulator/cpcap-regulator.txt2222+- Documentation/devicetree/bindings/phy/phy-cpcap-usb.txt2323+- Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt2424+- Documentation/devicetree/bindings/rtc/cpcap-rtc.txt2525+- Documentation/devicetree/bindings/leds/leds-cpcap.txt2626+- Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml27272828The only exception is the audio codec. Instead of a compatible value its2929node must be named "audio-codec".
···4949 description:5050 Reference to an nvmem node for the MAC address51515252- nvmem-cells-names:5252+ nvmem-cell-names:5353 const: mac-address54545555 phy-connection-type:
···6565 step is 60ps. The default value is the neutral setting, so setting6666 rxc-skew-ps=<0> actually results in -900 picoseconds adjustment.67676868+ The KSZ9031 hardware supports a range of skew values from negative to6969+ positive, where the specific range is property dependent. All values7070+ specified in the devicetree are offset by the minimum value so they7171+ can be represented as positive integers in the devicetree since it's7272+ difficult to represent a negative number in the devictree.7373+7474+ The following 5-bit values table apply to rxc-skew-ps and txc-skew-ps.7575+7676+ Pad Skew Value Delay (ps) Devicetree Value7777+ ------------------------------------------------------7878+ 0_0000 -900ps 07979+ 0_0001 -840ps 608080+ 0_0010 -780ps 1208181+ 0_0011 -720ps 1808282+ 0_0100 -660ps 2408383+ 0_0101 -600ps 3008484+ 0_0110 -540ps 3608585+ 0_0111 -480ps 4208686+ 0_1000 -420ps 4808787+ 0_1001 -360ps 5408888+ 0_1010 -300ps 6008989+ 0_1011 -240ps 6609090+ 0_1100 -180ps 7209191+ 0_1101 -120ps 7809292+ 0_1110 -60ps 8409393+ 0_1111 0ps 9009494+ 1_0000 60ps 9609595+ 1_0001 120ps 10209696+ 1_0010 180ps 10809797+ 1_0011 240ps 11409898+ 1_0100 300ps 12009999+ 1_0101 360ps 1260100100+ 1_0110 420ps 1320101101+ 1_0111 480ps 1380102102+ 1_1000 540ps 1440103103+ 1_1001 600ps 1500104104+ 1_1010 660ps 1560105105+ 1_1011 720ps 1620106106+ 1_1100 780ps 1680107107+ 1_1101 840ps 1740108108+ 1_1110 900ps 1800109109+ 1_1111 960ps 1860110110+111111+ The following 4-bit values table apply to the txdX-skew-ps, rxdX-skew-ps112112+ data pads, and the rxdv-skew-ps, txen-skew-ps control pads.113113+114114+ Pad Skew Value Delay (ps) Devicetree Value115115+ ------------------------------------------------------116116+ 0000 -420ps 0117117+ 0001 -360ps 60118118+ 0010 -300ps 120119119+ 0011 -240ps 180120120+ 0100 -180ps 240121121+ 0101 -120ps 300122122+ 0110 -60ps 360123123+ 0111 0ps 420124124+ 1000 60ps 480125125+ 1001 120ps 540126126+ 1010 180ps 600127127+ 1011 240ps 660128128+ 1100 300ps 720129129+ 1101 360ps 780130130+ 1110 420ps 840131131+ 1111 480ps 900132132+68133 Optional properties:6913470135 Maximum value of 1860, default value 900:···185120186121Examples:187122123123+ /* Attach to an Ethernet device with autodetected PHY */124124+ &enet {125125+ rxc-skew-ps = <1800>;126126+ rxdv-skew-ps = <0>;127127+ txc-skew-ps = <1800>;128128+ txen-skew-ps = <0>;129129+ status = "okay";130130+ };131131+132132+ /* Attach to an explicitly-specified PHY */188133 mdio {189134 phy0: ethernet-phy@0 {190190- rxc-skew-ps = <3000>;135135+ rxc-skew-ps = <1800>;191136 rxdv-skew-ps = <0>;192192- txc-skew-ps = <3000>;137137+ txc-skew-ps = <1800>;193138 txen-skew-ps = <0>;194139 reg = <0>;195140 };···208133 phy = <&phy0>;209134 phy-mode = "rgmii-id";210135 };136136+137137+References138138+139139+ Micrel ksz9021rl/rn Data Sheet, Revision 1.2. Dated 2/13/2014.140140+ http://www.micrel.com/_PDF/Ethernet/datasheets/ksz9021rl-rn_ds.pdf141141+142142+ Micrel ksz9031rnx Data Sheet, Revision 2.1. Dated 11/20/2014.143143+ http://www.micrel.com/_PDF/Ethernet/datasheets/KSZ9031RNX.pdf144144+145145+Notes:146146+147147+ Note that a previous version of the Micrel ksz9021rl/rn Data Sheet148148+ was missing extended register 106 (transmit data pad skews), and149149+ incorrectly specified the ps per step as 200ps/step instead of150150+ 120ps/step. The latest update to this document reflects the latest151151+ revision of the Micrel specification even though usage in the kernel152152+ still reflects that incorrect document.
+5-5
Documentation/networking/ethtool-netlink.rst
···976976977977978978PAUSE_GET979979-============979979+=========980980981981-Gets channel counts like ``ETHTOOL_GPAUSE`` ioctl request.981981+Gets pause frame settings like ``ETHTOOL_GPAUSEPARAM`` ioctl request.982982983983Request contents:984984···10071007Each member has a corresponding attribute defined.1008100810091009PAUSE_SET10101010-============10101010+=========1011101110121012Sets pause parameters like ``ETHTOOL_GPAUSEPARAM`` ioctl request.10131013···10241024EEE_GET10251025=======1026102610271027-Gets channel counts like ``ETHTOOL_GEEE`` ioctl request.10271027+Gets Energy Efficient Ethernet settings like ``ETHTOOL_GEEE`` ioctl request.1028102810291029Request contents:10301030···10541054EEE_SET10551055=======1056105610571057-Sets pause parameters like ``ETHTOOL_GEEEPARAM`` ioctl request.10571057+Sets Energy Efficient Ethernet parameters like ``ETHTOOL_SEEE`` ioctl request.1058105810591059Request contents:10601060
···99 */10101111#include <linux/arm-smccc.h>1212+#include <linux/cpu_pm.h>1213#include <linux/kernel.h>1314#include <linux/init.h>1415#include <linux/io.h>···21202221#include "common.h"2322#include "omap-secure.h"2323+#include "soc.h"24242525static phys_addr_t omap_secure_memblock_base;2626···215213{216214 omap_optee_init_check();217215}216216+217217+/*218218+ * Dummy dispatcher call after core OSWR and MPU off. Updates the ROM return219219+ * address after MMU has been re-enabled after CPU1 has been woken up again.220220+ * Otherwise the ROM code will attempt to use the earlier physical return221221+ * address that got set with MMU off when waking up CPU1. Only used on secure222222+ * devices.223223+ */224224+static int cpu_notifier(struct notifier_block *nb, unsigned long cmd, void *v)225225+{226226+ switch (cmd) {227227+ case CPU_CLUSTER_PM_EXIT:228228+ omap_secure_dispatcher(OMAP4_PPA_SERVICE_0,229229+ FLAG_START_CRITICAL,230230+ 0, 0, 0, 0, 0);231231+ break;232232+ default:233233+ break;234234+ }235235+236236+ return NOTIFY_OK;237237+}238238+239239+static struct notifier_block secure_notifier_block = {240240+ .notifier_call = cpu_notifier,241241+};242242+243243+static int __init secure_pm_init(void)244244+{245245+ if (omap_type() == OMAP2_DEVICE_TYPE_GP || !soc_is_omap44xx())246246+ return 0;247247+248248+ cpu_pm_register_notifier(&secure_notifier_block);249249+250250+ return 0;251251+}252252+omap_arch_initcall(secure_pm_init);
···11// SPDX-License-Identifier: (GPL-2.0+ OR MIT)22/*33 * Device Tree file for CZ.NIC Turris Mox Board44- * 2019 by Marek Behun <marek.behun@nic.cz>44+ * 2019 by Marek Behún <kabel@kernel.org>55 */6677/dts-v1/;
···55 * Floating-point emulation code66 * Copyright (C) 2001 Hewlett-Packard (Paul Bame) <bame@debian.org>77 */88-/*99- * BEGIN_DESC1010- * 1111- * File: 1212- * @(#) pa/fp/fpu.h $Revision: 1.1 $1313- * 1414- * Purpose:1515- * <<please update with a synopis of the functionality provided by this file>>1616- * 1717- * 1818- * END_DESC 1919-*/2020-2121-#ifdef __NO_PA_HDRS2222- PA header file -- do not include this header file for non-PA builds.2323-#endif2424-258269#ifndef _MACHINE_FPU_INCLUDED /* allows multiple inclusion */2710#define _MACHINE_FPU_INCLUDED2828-2929-#if 03030-#ifndef _SYS_STDSYMS_INCLUDED3131-# include <sys/stdsyms.h>3232-#endif /* _SYS_STDSYMS_INCLUDED */3333-#include <machine/pdc/pdc_rqsts.h>3434-#endif35113612#define PA83_FPU_FLAG 0x000000013713#define PA89_FPU_FLAG 0x00000002···1943#define COPR_FP 0x00000080 /* Floating point -- Coprocessor 0 */2044#define SFU_MPY_DIVIDE 0x00008000 /* Multiply/Divide __ SFU 0 */21452222-2346#define EM_FPU_TYPE_OFFSET 27224472548/* version of EMULATION software for COPR,0,0 instruction */2649#define EMULATION_VERSION 427502851/*2929- * The only was to differeniate between TIMEX and ROLEX (or PCX-S and PCX-T)3030- * is thorough the potential type field from the PDC_MODEL call. The 3131- * following flags are used at assist this differeniation.5252+ * The only way to differentiate between TIMEX and ROLEX (or PCX-S and PCX-T)5353+ * is through the potential type field from the PDC_MODEL call.5454+ * The following flags are used to assist this differentiation.3255 */33563457#define ROLEX_POTENTIAL_KEY_FLAGS PDC_MODEL_CPU_KEY_WORD_TO_IO3558#define TIMEX_POTENTIAL_KEY_FLAGS (PDC_MODEL_CPU_KEY_QUAD_STORE | \3659 PDC_MODEL_CPU_KEY_RECIP_SQRT)3737-38603961#endif /* ! _MACHINE_FPU_INCLUDED */
+4
arch/powerpc/kernel/Makefile
···191191targets += prom_init_check192192193193clean-files := vmlinux.lds194194+195195+# Force dependency (incbin is bad)196196+$(obj)/vdso32_wrapper.o : $(obj)/vdso32/vdso32.so.dbg197197+$(obj)/vdso64_wrapper.o : $(obj)/vdso64/vdso64.so.dbg
···16891689 }1690169016911691 if (image) {16921692- if (unlikely(proglen + ilen > oldproglen)) {16921692+ /*16931693+ * When populating the image, assert that:16941694+ *16951695+ * i) We do not write beyond the allocated space, and16961696+ * ii) addrs[i] did not change from the prior run, in order16971697+ * to validate assumptions made for computing branch16981698+ * displacements.16991699+ */17001700+ if (unlikely(proglen + ilen > oldproglen ||17011701+ proglen + ilen != addrs[i])) {16931702 pr_err("bpf_jit: fatal error\n");16941703 return -EFAULT;16951704 }
+10-1
arch/x86/net/bpf_jit_comp32.c
···22762276 }2277227722782278 if (image) {22792279- if (unlikely(proglen + ilen > oldproglen)) {22792279+ /*22802280+ * When populating the image, assert that:22812281+ *22822282+ * i) We do not write beyond the allocated space, and22832283+ * ii) addrs[i] did not change from the prior run, in order22842284+ * to validate assumptions made for computing branch22852285+ * displacements.22862286+ */22872287+ if (unlikely(proglen + ilen > oldproglen ||22882288+ proglen + ilen != addrs[i])) {22802289 pr_err("bpf_jit: fatal error\n");22812290 return -EFAULT;22822291 }
+1-3
drivers/acpi/processor_idle.c
···544544 return -ENODEV;545545546546#if defined(CONFIG_X86) && defined(CONFIG_HOTPLUG_CPU)547547- /* If NMI wants to wake up CPU0, start CPU0. */548548- if (wakeup_cpu0())549549- start_cpu0();547547+ cond_wakeup_cpu0();550548#endif551549 }552550
···22/*33 * Turris Mox module configuration bus driver44 *55- * Copyright (C) 2019 Marek Behun <marek.behun@nic.cz>55+ * Copyright (C) 2019 Marek Behún <kabel@kernel.org>66 */7788#include <dt-bindings/bus/moxtet.h>···879879}880880module_exit(moxtet_exit);881881882882-MODULE_AUTHOR("Marek Behun <marek.behun@nic.cz>");882882+MODULE_AUTHOR("Marek Behun <kabel@kernel.org>");883883MODULE_DESCRIPTION("CZ.NIC's Turris Mox module configuration bus");884884MODULE_LICENSE("GPL v2");
+1-1
drivers/bus/mvebu-mbus.c
···618618 * This part of the memory is above 4 GB, so we don't619619 * care for the MBus bridge hole.620620 */621621- if (reg_start >= 0x100000000ULL)621621+ if ((u64)reg_start >= 0x100000000ULL)622622 continue;623623624624 /*
+1-1
drivers/char/agp/Kconfig
···125125126126config AGP_PARISC127127 tristate "HP Quicksilver AGP support"128128- depends on AGP && PARISC && 64BIT128128+ depends on AGP && PARISC && 64BIT && IOMMU_SBA129129 help130130 This option gives you AGP GART support for the HP Quicksilver131131 AGP bus adapter on HP PA-RISC machines (Ok, just on the C8000
+8-1
drivers/clk/clk-fixed-factor.c
···66666767static void devm_clk_hw_register_fixed_factor_release(struct device *dev, void *res)6868{6969- clk_hw_unregister_fixed_factor(&((struct clk_fixed_factor *)res)->hw);6969+ struct clk_fixed_factor *fix = res;7070+7171+ /*7272+ * We can not use clk_hw_unregister_fixed_factor, since it will kfree()7373+ * the hw, resulting in double free. Just unregister the hw and let7474+ * devres code kfree() it.7575+ */7676+ clk_hw_unregister(&fix->hw);7077}71787279static struct clk_hw *
+22-27
drivers/clk/clk.c
···43574357 /* search the list of notifiers for this clk */43584358 list_for_each_entry(cn, &clk_notifier_list, node)43594359 if (cn->clk == clk)43604360- break;43604360+ goto found;4361436143624362 /* if clk wasn't in the notifier list, allocate new clk_notifier */43634363- if (cn->clk != clk) {43644364- cn = kzalloc(sizeof(*cn), GFP_KERNEL);43654365- if (!cn)43664366- goto out;43634363+ cn = kzalloc(sizeof(*cn), GFP_KERNEL);43644364+ if (!cn)43654365+ goto out;4367436643684368- cn->clk = clk;43694369- srcu_init_notifier_head(&cn->notifier_head);43674367+ cn->clk = clk;43684368+ srcu_init_notifier_head(&cn->notifier_head);4370436943714371- list_add(&cn->node, &clk_notifier_list);43724372- }43704370+ list_add(&cn->node, &clk_notifier_list);4373437143724372+found:43744373 ret = srcu_notifier_chain_register(&cn->notifier_head, nb);4375437443764375 clk->core->notifier_count++;···43944395 */43954396int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb)43964397{43974397- struct clk_notifier *cn = NULL;43984398- int ret = -EINVAL;43984398+ struct clk_notifier *cn;43994399+ int ret = -ENOENT;4399440044004401 if (!clk || !nb)44014402 return -EINVAL;4402440344034404 clk_prepare_lock();4404440544054405- list_for_each_entry(cn, &clk_notifier_list, node)44064406- if (cn->clk == clk)44064406+ list_for_each_entry(cn, &clk_notifier_list, node) {44074407+ if (cn->clk == clk) {44084408+ ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb);44094409+44104410+ clk->core->notifier_count--;44114411+44124412+ /* XXX the notifier code should handle this better */44134413+ if (!cn->notifier_head.head) {44144414+ srcu_cleanup_notifier_head(&cn->notifier_head);44154415+ list_del(&cn->node);44164416+ kfree(cn);44174417+ }44074418 break;44084408-44094409- if (cn->clk == clk) {44104410- ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb);44114411-44124412- clk->core->notifier_count--;44134413-44144414- /* XXX the notifier code should handle this better */44154415- if (!cn->notifier_head.head) {44164416- srcu_cleanup_notifier_head(&cn->notifier_head);44174417- list_del(&cn->node);44184418- kfree(cn);44194419 }44204420-44214421- } else {44224422- ret = -ENOENT;44234420 }4424442144254422 clk_prepare_unlock();
···9999 val = readl(socfpgaclk->div_reg) >> socfpgaclk->shift;100100 val &= GENMASK(socfpgaclk->width - 1, 0);101101 /* Check for GPIO_DB_CLK by its offset */102102- if ((int) socfpgaclk->div_reg & SOCFPGA_GPIO_DB_CLK_OFFSET)102102+ if ((uintptr_t) socfpgaclk->div_reg & SOCFPGA_GPIO_DB_CLK_OFFSET)103103 div = val + 1;104104 else105105 div = (1 << val);
+2-2
drivers/firmware/turris-mox-rwtm.c
···22/*33 * Turris Mox rWTM firmware driver44 *55- * Copyright (C) 2019 Marek Behun <marek.behun@nic.cz>55+ * Copyright (C) 2019 Marek Behún <kabel@kernel.org>66 */7788#include <linux/armada-37xx-rwtm-mailbox.h>···547547548548MODULE_LICENSE("GPL v2");549549MODULE_DESCRIPTION("Turris Mox rWTM firmware driver");550550-MODULE_AUTHOR("Marek Behun <marek.behun@nic.cz>");550550+MODULE_AUTHOR("Marek Behun <kabel@kernel.org>");
+2-2
drivers/gpio/gpio-moxtet.c
···22/*33 * Turris Mox Moxtet GPIO expander44 *55- * Copyright (C) 2018 Marek Behun <marek.behun@nic.cz>55+ * Copyright (C) 2018 Marek Behún <kabel@kernel.org>66 */7788#include <linux/bitops.h>···174174};175175module_moxtet_driver(moxtet_gpio_driver);176176177177-MODULE_AUTHOR("Marek Behun <marek.behun@nic.cz>");177177+MODULE_AUTHOR("Marek Behun <kabel@kernel.org>");178178MODULE_DESCRIPTION("Turris Mox Moxtet GPIO expander");179179MODULE_LICENSE("GPL v2");
+1-1
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
···906906907907 /* Allocate an SG array and squash pages into it */908908 r = sg_alloc_table_from_pages(ttm->sg, ttm->pages, ttm->num_pages, 0,909909- ttm->num_pages << PAGE_SHIFT,909909+ (u64)ttm->num_pages << PAGE_SHIFT,910910 GFP_KERNEL);911911 if (r)912912 goto release_sg;
···567567 } else {568568 /*569569 * a650 tier targets don't need whereami but still need to be570570- * equal to or newer than 1.95 for other security fixes570570+ * equal to or newer than 0.95 for other security fixes571571 */572572 if (adreno_is_a650(adreno_gpu)) {573573- if ((buf[0] & 0xfff) >= 0x195) {573573+ if ((buf[0] & 0xfff) >= 0x095) {574574 ret = true;575575 goto out;576576 }577577578578 DRM_DEV_ERROR(&gpu->pdev->dev,579579 "a650 SQE ucode is too old. Have version %x need at least %x\n",580580- buf[0] & 0xfff, 0x195);580580+ buf[0] & 0xfff, 0x095);581581 }582582583583 /*···12281228 /* Force the GPU power on so we can read this register */12291229 a6xx_gmu_set_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET);1230123012311231- *value = gpu_read64(gpu, REG_A6XX_RBBM_PERFCTR_CP_0_LO,12321232- REG_A6XX_RBBM_PERFCTR_CP_0_HI);12311231+ *value = gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO,12321232+ REG_A6XX_CP_ALWAYS_ON_COUNTER_HI);1233123312341234 a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET);12351235 mutex_unlock(&perfcounter_oob);···14061406 int ret;1407140714081408 ret = nvmem_cell_read_u16(dev, "speed_bin", &speedbin);14091409- if (ret) {14091409+ /*14101410+ * -ENOENT means that the platform doesn't support speedbin which is14111411+ * fine14121412+ */14131413+ if (ret == -ENOENT) {14141414+ return 0;14151415+ } else if (ret) {14101416 DRM_DEV_ERROR(dev,14111417 "failed to read speed-bin (%d). Some OPPs may not be supported by hardware",14121418 ret);
···364364 if (gtt->userflags & RADEON_GEM_USERPTR_ANONONLY) {365365 /* check that we only pin down anonymous memory366366 to prevent problems with writeback */367367- unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE;367367+ unsigned long end = gtt->userptr + (u64)ttm->num_pages * PAGE_SIZE;368368 struct vm_area_struct *vma;369369 vma = find_vma(gtt->usermm, gtt->userptr);370370 if (!vma || vma->vm_file || vma->vm_end < end)···386386 } while (pinned < ttm->num_pages);387387388388 r = sg_alloc_table_from_pages(ttm->sg, ttm->pages, ttm->num_pages, 0,389389- ttm->num_pages << PAGE_SHIFT,389389+ (u64)ttm->num_pages << PAGE_SHIFT,390390 GFP_KERNEL);391391 if (r)392392 goto release_sg;
+17
drivers/gpu/drm/vc4/vc4_crtc.c
···210210{211211 const struct vc4_crtc_data *crtc_data = vc4_crtc_to_vc4_crtc_data(vc4_crtc);212212 const struct vc4_pv_data *pv_data = vc4_crtc_to_vc4_pv_data(vc4_crtc);213213+ struct vc4_dev *vc4 = to_vc4_dev(vc4_crtc->base.dev);213214 u32 fifo_len_bytes = pv_data->fifo_depth;214215215216 /*···238237 */239238 if (crtc_data->hvs_output == 5)240239 return 32;240240+241241+ /*242242+ * It looks like in some situations, we will overflow243243+ * the PixelValve FIFO (with the bit 10 of PV stat being244244+ * set) and stall the HVS / PV, eventually resulting in245245+ * a page flip timeout.246246+ *247247+ * Displaying the video overlay during a playback with248248+ * Kodi on an RPi3 seems to be a great solution with a249249+ * failure rate around 50%.250250+ *251251+ * Removing 1 from the FIFO full level however252252+ * seems to completely remove that issue.253253+ */254254+ if (!vc4->hvs->hvs5)255255+ return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX - 1;241256242257 return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX;243258 }
···11// SPDX-License-Identifier: GPL-2.0-or-later22/*33 * Copyright (c) 2014 Linaro Ltd.44- * Copyright (c) 2014 Hisilicon Limited.44+ * Copyright (c) 2014 HiSilicon Limited.55 *66 * Now only support 7 bit address.77 */
+2-2
drivers/i2c/busses/i2c-jz4780.c
···525525 i2c_sta = jz4780_i2c_readw(i2c, JZ4780_I2C_STA);526526 data = *i2c->wbuf;527527 data &= ~JZ4780_I2C_DC_READ;528528- if ((!i2c->stop_hold) && (i2c->cdata->version >=529529- ID_X1000))528528+ if ((i2c->wt_len == 1) && (!i2c->stop_hold) &&529529+ (i2c->cdata->version >= ID_X1000))530530 data |= X1000_I2C_DC_STOP;531531 jz4780_i2c_writew(i2c, JZ4780_I2C_DC, data);532532 i2c->wbuf++;
+1-1
drivers/i2c/busses/i2c-stm32f4.c
···534534 default:535535 /*536536 * N-byte reception:537537- * Enable ACK, reset POS (ACK postion) and clear ADDR flag.537537+ * Enable ACK, reset POS (ACK position) and clear ADDR flag.538538 * In that way, ACK will be sent as soon as the current byte539539 * will be received in the shift register540540 */
+4-3
drivers/i2c/i2c-core-base.c
···378378static int i2c_init_recovery(struct i2c_adapter *adap)379379{380380 struct i2c_bus_recovery_info *bri = adap->bus_recovery_info;381381- char *err_str;381381+ char *err_str, *err_level = KERN_ERR;382382383383 if (!bri)384384 return 0;···387387 return -EPROBE_DEFER;388388389389 if (!bri->recover_bus) {390390- err_str = "no recover_bus() found";390390+ err_str = "no suitable method provided";391391+ err_level = KERN_DEBUG;391392 goto err;392393 }393394···415414416415 return 0;417416 err:418418- dev_err(&adap->dev, "Not using recovery: %s\n", err_str);417417+ dev_printk(err_level, &adap->dev, "Not using recovery: %s\n", err_str);419418 adap->bus_recovery_info = NULL;420419421420 return -EINVAL;
···632632 */633633int hfi1_dev_affinity_init(struct hfi1_devdata *dd)634634{635635- int node = pcibus_to_node(dd->pcidev->bus);636635 struct hfi1_affinity_node *entry;637636 const struct cpumask *local_mask;638637 int curr_cpu, possible, i, ret;639638 bool new_entry = false;640640-641641- /*642642- * If the BIOS does not have the NUMA node information set, select643643- * NUMA 0 so we get consistent performance.644644- */645645- if (node < 0) {646646- dd_dev_err(dd, "Invalid PCI NUMA node. Performance may be affected\n");647647- node = 0;648648- }649649- dd->node = node;650639651640 local_mask = cpumask_of_node(dd->node);652641 if (cpumask_first(local_mask) >= nr_cpu_ids)···649660 * create an entry in the global affinity structure and initialize it.650661 */651662 if (!entry) {652652- entry = node_affinity_allocate(node);663663+ entry = node_affinity_allocate(dd->node);653664 if (!entry) {654665 dd_dev_err(dd,655666 "Unable to allocate global affinity node\n");···740751 if (new_entry)741752 node_affinity_add_tail(entry);742753754754+ dd->affinity_entry = entry;743755 mutex_unlock(&node_affinity.lock);744756745757 return 0;···756766{757767 struct hfi1_affinity_node *entry;758768759759- if (dd->node < 0)760760- return;761761-762769 mutex_lock(&node_affinity.lock);770770+ if (!dd->affinity_entry)771771+ goto unlock;763772 entry = node_affinity_lookup(dd->node);764773 if (!entry)765774 goto unlock;···769780 */770781 _dev_comp_vect_cpu_mask_clean_up(dd, entry);771782unlock:783783+ dd->affinity_entry = NULL;772784 mutex_unlock(&node_affinity.lock);773773- dd->node = NUMA_NO_NODE;774785}775786776787/*
···12771277 dd->pport = (struct hfi1_pportdata *)(dd + 1);12781278 dd->pcidev = pdev;12791279 pci_set_drvdata(pdev, dd);12801280- dd->node = NUMA_NO_NODE;1281128012821281 ret = xa_alloc_irq(&hfi1_dev_table, &dd->unit, dd, xa_limit_32b,12831282 GFP_KERNEL);···12861287 goto bail;12871288 }12881289 rvt_set_ibdev_name(&dd->verbs_dev.rdi, "%s_%d", class_name(), dd->unit);12901290+ /*12911291+ * If the BIOS does not have the NUMA node information set, select12921292+ * NUMA 0 so we get consistent performance.12931293+ */12941294+ dd->node = pcibus_to_node(pdev->bus);12951295+ if (dd->node == NUMA_NO_NODE) {12961296+ dd_dev_err(dd, "Invalid PCI NUMA node. Performance may be affected\n");12971297+ dd->node = 0;12981298+ }1289129912901300 /*12911301 * Initialize all locks for the device. This needs to be as early as
···2720272027212721 /* Now it is safe to iterate over all paths without locks */27222722 list_for_each_entry_safe(sess, tmp, &clt->paths_list, s.entry) {27232723- rtrs_clt_destroy_sess_files(sess, NULL);27242723 rtrs_clt_close_conns(sess, true);27242724+ rtrs_clt_destroy_sess_files(sess, NULL);27252725 kobject_put(&sess->kobj);27262726 }27272727 free_clt(clt);
+2-2
drivers/leds/leds-turris-omnia.c
···22/*33 * CZ.NIC's Turris Omnia LEDs driver44 *55- * 2020 by Marek Behun <marek.behun@nic.cz>55+ * 2020 by Marek Behún <kabel@kernel.org>66 */7788#include <linux/i2c.h>···287287288288module_i2c_driver(omnia_leds_driver);289289290290-MODULE_AUTHOR("Marek Behun <marek.behun@nic.cz>");290290+MODULE_AUTHOR("Marek Behun <kabel@kernel.org>");291291MODULE_DESCRIPTION("CZ.NIC's Turris Omnia LEDs");292292MODULE_LICENSE("GPL v2");
+2-2
drivers/mailbox/armada-37xx-rwtm-mailbox.c
···22/*33 * rWTM BIU Mailbox driver for Armada 37xx44 *55- * Author: Marek Behun <marek.behun@nic.cz>55+ * Author: Marek Behún <kabel@kernel.org>66 */7788#include <linux/device.h>···203203204204MODULE_LICENSE("GPL v2");205205MODULE_DESCRIPTION("rWTM BIU Mailbox driver for Armada 37xx");206206-MODULE_AUTHOR("Marek Behun <marek.behun@nic.cz>");206206+MODULE_AUTHOR("Marek Behun <kabel@kernel.org>");
···857857 if (dev->adapter->dev_set_bus) {858858 err = dev->adapter->dev_set_bus(dev, 0);859859 if (err)860860- goto lbl_unregister_candev;860860+ goto adap_dev_free;861861 }862862863863 /* get device number early */···868868 peak_usb_adapter->name, ctrl_idx, dev->device_number);869869870870 return 0;871871+872872+adap_dev_free:873873+ if (dev->adapter->dev_free)874874+ dev->adapter->dev_free(dev);871875872876lbl_unregister_candev:873877 unregister_candev(netdev);
+172-21
drivers/net/dsa/lantiq_gswip.c
···93939494/* GSWIP MII Registers */9595#define GSWIP_MII_CFGp(p) (0x2 * (p))9696+#define GSWIP_MII_CFG_RESET BIT(15)9697#define GSWIP_MII_CFG_EN BIT(14)9898+#define GSWIP_MII_CFG_ISOLATE BIT(13)9799#define GSWIP_MII_CFG_LDCLKDIS BIT(12)100100+#define GSWIP_MII_CFG_RGMII_IBS BIT(8)101101+#define GSWIP_MII_CFG_RMII_CLK BIT(7)98102#define GSWIP_MII_CFG_MODE_MIIP 0x099103#define GSWIP_MII_CFG_MODE_MIIM 0x1100104#define GSWIP_MII_CFG_MODE_RMIIP 0x2···194190#define GSWIP_PCE_DEFPVID(p) (0x486 + ((p) * 0xA))195191196192#define GSWIP_MAC_FLEN 0x8C5193193+#define GSWIP_MAC_CTRL_0p(p) (0x903 + ((p) * 0xC))194194+#define GSWIP_MAC_CTRL_0_PADEN BIT(8)195195+#define GSWIP_MAC_CTRL_0_FCS_EN BIT(7)196196+#define GSWIP_MAC_CTRL_0_FCON_MASK 0x0070197197+#define GSWIP_MAC_CTRL_0_FCON_AUTO 0x0000198198+#define GSWIP_MAC_CTRL_0_FCON_RX 0x0010199199+#define GSWIP_MAC_CTRL_0_FCON_TX 0x0020200200+#define GSWIP_MAC_CTRL_0_FCON_RXTX 0x0030201201+#define GSWIP_MAC_CTRL_0_FCON_NONE 0x0040202202+#define GSWIP_MAC_CTRL_0_FDUP_MASK 0x000C203203+#define GSWIP_MAC_CTRL_0_FDUP_AUTO 0x0000204204+#define GSWIP_MAC_CTRL_0_FDUP_EN 0x0004205205+#define GSWIP_MAC_CTRL_0_FDUP_DIS 0x000C206206+#define GSWIP_MAC_CTRL_0_GMII_MASK 0x0003207207+#define GSWIP_MAC_CTRL_0_GMII_AUTO 0x0000208208+#define GSWIP_MAC_CTRL_0_GMII_MII 0x0001209209+#define GSWIP_MAC_CTRL_0_GMII_RGMII 0x0002197210#define GSWIP_MAC_CTRL_2p(p) (0x905 + ((p) * 0xC))198211#define GSWIP_MAC_CTRL_2_MLEN BIT(3) /* Maximum Untagged Frame Lnegth */199212···674653 GSWIP_SDMA_PCTRLp(port));675654676655 if (!dsa_is_cpu_port(ds, port)) {677677- u32 macconf = GSWIP_MDIO_PHY_LINK_AUTO |678678- GSWIP_MDIO_PHY_SPEED_AUTO |679679- GSWIP_MDIO_PHY_FDUP_AUTO |680680- GSWIP_MDIO_PHY_FCONTX_AUTO |681681- GSWIP_MDIO_PHY_FCONRX_AUTO |682682- (phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK);656656+ u32 mdio_phy = 0;683657684684- gswip_mdio_w(priv, macconf, GSWIP_MDIO_PHYp(port));685685- /* Activate MDIO auto polling */686686- gswip_mdio_mask(priv, 0, BIT(port), GSWIP_MDIO_MDC_CFG0);658658+ if (phydev)659659+ mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK;660660+661661+ gswip_mdio_mask(priv, GSWIP_MDIO_PHY_ADDR_MASK, mdio_phy,662662+ GSWIP_MDIO_PHYp(port));687663 }688664689665 return 0;···692674693675 if (!dsa_is_user_port(ds, port))694676 return;695695-696696- if (!dsa_is_cpu_port(ds, port)) {697697- gswip_mdio_mask(priv, GSWIP_MDIO_PHY_LINK_DOWN,698698- GSWIP_MDIO_PHY_LINK_MASK,699699- GSWIP_MDIO_PHYp(port));700700- /* Deactivate MDIO auto polling */701701- gswip_mdio_mask(priv, BIT(port), 0, GSWIP_MDIO_MDC_CFG0);702702- }703677704678 gswip_switch_mask(priv, GSWIP_FDMA_PCTRL_EN, 0,705679 GSWIP_FDMA_PCTRLp(port));···804794 gswip_switch_w(priv, BIT(cpu_port), GSWIP_PCE_PMAP2);805795 gswip_switch_w(priv, BIT(cpu_port), GSWIP_PCE_PMAP3);806796807807- /* disable PHY auto polling */797797+ /* Deactivate MDIO PHY auto polling. Some PHYs as the AR8030 have an798798+ * interoperability problem with this auto polling mechanism because799799+ * their status registers think that the link is in a different state800800+ * than it actually is. For the AR8030 it has the BMSR_ESTATEN bit set801801+ * as well as ESTATUS_1000_TFULL and ESTATUS_1000_XFULL. This makes the802802+ * auto polling state machine consider the link being negotiated with803803+ * 1Gbit/s. Since the PHY itself is a Fast Ethernet RMII PHY this leads804804+ * to the switch port being completely dead (RX and TX are both not805805+ * working).806806+ * Also with various other PHY / port combinations (PHY11G GPHY, PHY22F807807+ * GPHY, external RGMII PEF7071/7072) any traffic would stop. Sometimes808808+ * it would work fine for a few minutes to hours and then stop, on809809+ * other device it would no traffic could be sent or received at all.810810+ * Testing shows that when PHY auto polling is disabled these problems811811+ * go away.812812+ */808813 gswip_mdio_w(priv, 0x0, GSWIP_MDIO_MDC_CFG0);814814+809815 /* Configure the MDIO Clock 2.5 MHz */810816 gswip_mdio_mask(priv, 0xff, 0x09, GSWIP_MDIO_MDC_CFG1);811817812812- /* Disable the xMII link */818818+ /* Disable the xMII interface and clear it's isolation bit */813819 for (i = 0; i < priv->hw_info->max_ports; i++)814814- gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, i);820820+ gswip_mii_mask_cfg(priv,821821+ GSWIP_MII_CFG_EN | GSWIP_MII_CFG_ISOLATE,822822+ 0, i);815823816824 /* enable special tag insertion on cpu port */817825 gswip_switch_mask(priv, 0, GSWIP_FDMA_PCTRL_STEN,···14781450 return;14791451}1480145214531453+static void gswip_port_set_link(struct gswip_priv *priv, int port, bool link)14541454+{14551455+ u32 mdio_phy;14561456+14571457+ if (link)14581458+ mdio_phy = GSWIP_MDIO_PHY_LINK_UP;14591459+ else14601460+ mdio_phy = GSWIP_MDIO_PHY_LINK_DOWN;14611461+14621462+ gswip_mdio_mask(priv, GSWIP_MDIO_PHY_LINK_MASK, mdio_phy,14631463+ GSWIP_MDIO_PHYp(port));14641464+}14651465+14661466+static void gswip_port_set_speed(struct gswip_priv *priv, int port, int speed,14671467+ phy_interface_t interface)14681468+{14691469+ u32 mdio_phy = 0, mii_cfg = 0, mac_ctrl_0 = 0;14701470+14711471+ switch (speed) {14721472+ case SPEED_10:14731473+ mdio_phy = GSWIP_MDIO_PHY_SPEED_M10;14741474+14751475+ if (interface == PHY_INTERFACE_MODE_RMII)14761476+ mii_cfg = GSWIP_MII_CFG_RATE_M50;14771477+ else14781478+ mii_cfg = GSWIP_MII_CFG_RATE_M2P5;14791479+14801480+ mac_ctrl_0 = GSWIP_MAC_CTRL_0_GMII_MII;14811481+ break;14821482+14831483+ case SPEED_100:14841484+ mdio_phy = GSWIP_MDIO_PHY_SPEED_M100;14851485+14861486+ if (interface == PHY_INTERFACE_MODE_RMII)14871487+ mii_cfg = GSWIP_MII_CFG_RATE_M50;14881488+ else14891489+ mii_cfg = GSWIP_MII_CFG_RATE_M25;14901490+14911491+ mac_ctrl_0 = GSWIP_MAC_CTRL_0_GMII_MII;14921492+ break;14931493+14941494+ case SPEED_1000:14951495+ mdio_phy = GSWIP_MDIO_PHY_SPEED_G1;14961496+14971497+ mii_cfg = GSWIP_MII_CFG_RATE_M125;14981498+14991499+ mac_ctrl_0 = GSWIP_MAC_CTRL_0_GMII_RGMII;15001500+ break;15011501+ }15021502+15031503+ gswip_mdio_mask(priv, GSWIP_MDIO_PHY_SPEED_MASK, mdio_phy,15041504+ GSWIP_MDIO_PHYp(port));15051505+ gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_RATE_MASK, mii_cfg, port);15061506+ gswip_switch_mask(priv, GSWIP_MAC_CTRL_0_GMII_MASK, mac_ctrl_0,15071507+ GSWIP_MAC_CTRL_0p(port));15081508+}15091509+15101510+static void gswip_port_set_duplex(struct gswip_priv *priv, int port, int duplex)15111511+{15121512+ u32 mac_ctrl_0, mdio_phy;15131513+15141514+ if (duplex == DUPLEX_FULL) {15151515+ mac_ctrl_0 = GSWIP_MAC_CTRL_0_FDUP_EN;15161516+ mdio_phy = GSWIP_MDIO_PHY_FDUP_EN;15171517+ } else {15181518+ mac_ctrl_0 = GSWIP_MAC_CTRL_0_FDUP_DIS;15191519+ mdio_phy = GSWIP_MDIO_PHY_FDUP_DIS;15201520+ }15211521+15221522+ gswip_switch_mask(priv, GSWIP_MAC_CTRL_0_FDUP_MASK, mac_ctrl_0,15231523+ GSWIP_MAC_CTRL_0p(port));15241524+ gswip_mdio_mask(priv, GSWIP_MDIO_PHY_FDUP_MASK, mdio_phy,15251525+ GSWIP_MDIO_PHYp(port));15261526+}15271527+15281528+static void gswip_port_set_pause(struct gswip_priv *priv, int port,15291529+ bool tx_pause, bool rx_pause)15301530+{15311531+ u32 mac_ctrl_0, mdio_phy;15321532+15331533+ if (tx_pause && rx_pause) {15341534+ mac_ctrl_0 = GSWIP_MAC_CTRL_0_FCON_RXTX;15351535+ mdio_phy = GSWIP_MDIO_PHY_FCONTX_EN |15361536+ GSWIP_MDIO_PHY_FCONRX_EN;15371537+ } else if (tx_pause) {15381538+ mac_ctrl_0 = GSWIP_MAC_CTRL_0_FCON_TX;15391539+ mdio_phy = GSWIP_MDIO_PHY_FCONTX_EN |15401540+ GSWIP_MDIO_PHY_FCONRX_DIS;15411541+ } else if (rx_pause) {15421542+ mac_ctrl_0 = GSWIP_MAC_CTRL_0_FCON_RX;15431543+ mdio_phy = GSWIP_MDIO_PHY_FCONTX_DIS |15441544+ GSWIP_MDIO_PHY_FCONRX_EN;15451545+ } else {15461546+ mac_ctrl_0 = GSWIP_MAC_CTRL_0_FCON_NONE;15471547+ mdio_phy = GSWIP_MDIO_PHY_FCONTX_DIS |15481548+ GSWIP_MDIO_PHY_FCONRX_DIS;15491549+ }15501550+15511551+ gswip_switch_mask(priv, GSWIP_MAC_CTRL_0_FCON_MASK,15521552+ mac_ctrl_0, GSWIP_MAC_CTRL_0p(port));15531553+ gswip_mdio_mask(priv,15541554+ GSWIP_MDIO_PHY_FCONTX_MASK |15551555+ GSWIP_MDIO_PHY_FCONRX_MASK,15561556+ mdio_phy, GSWIP_MDIO_PHYp(port));15571557+}15581558+14811559static void gswip_phylink_mac_config(struct dsa_switch *ds, int port,14821560 unsigned int mode,14831561 const struct phylink_link_state *state)···16031469 break;16041470 case PHY_INTERFACE_MODE_RMII:16051471 miicfg |= GSWIP_MII_CFG_MODE_RMIIM;14721472+14731473+ /* Configure the RMII clock as output: */14741474+ miicfg |= GSWIP_MII_CFG_RMII_CLK;16061475 break;16071476 case PHY_INTERFACE_MODE_RGMII:16081477 case PHY_INTERFACE_MODE_RGMII_ID:···16181481 "Unsupported interface: %d\n", state->interface);16191482 return;16201483 }16211621- gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_MODE_MASK, miicfg, port);14841484+14851485+ gswip_mii_mask_cfg(priv,14861486+ GSWIP_MII_CFG_MODE_MASK | GSWIP_MII_CFG_RMII_CLK |14871487+ GSWIP_MII_CFG_RGMII_IBS | GSWIP_MII_CFG_LDCLKDIS,14881488+ miicfg, port);1622148916231490 switch (state->interface) {16241491 case PHY_INTERFACE_MODE_RGMII_ID:···16471506 struct gswip_priv *priv = ds->priv;1648150716491508 gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, port);15091509+15101510+ if (!dsa_is_cpu_port(ds, port))15111511+ gswip_port_set_link(priv, port, false);16501512}1651151316521514static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port,···16601516 bool tx_pause, bool rx_pause)16611517{16621518 struct gswip_priv *priv = ds->priv;15191519+15201520+ if (!dsa_is_cpu_port(ds, port)) {15211521+ gswip_port_set_link(priv, port, true);15221522+ gswip_port_set_speed(priv, port, speed, interface);15231523+ gswip_port_set_duplex(priv, port, duplex);15241524+ gswip_port_set_pause(priv, port, tx_pause, rx_pause);15251525+ }1663152616641527 gswip_mii_mask_cfg(priv, 0, GSWIP_MII_CFG_EN, port);16651528}
+3-2
drivers/net/ethernet/amd/pcnet32.c
···15341534 }15351535 pci_set_master(pdev);1536153615371537- ioaddr = pci_resource_start(pdev, 0);15381538- if (!ioaddr) {15371537+ if (!pci_resource_len(pdev, 0)) {15391538 if (pcnet32_debug & NETIF_MSG_PROBE)15401539 pr_err("card has no PCI IO resources, aborting\n");15411540 err = -ENODEV;···15471548 pr_err("architecture does not support 32bit PCI busmaster DMA\n");15481549 goto err_disable_dev;15491550 }15511551+15521552+ ioaddr = pci_resource_start(pdev, 0);15501553 if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) {15511554 if (pcnet32_debug & NETIF_MSG_PROBE)15521555 pr_err("io address range already allocated\n");
···39663966 * normalcy is to reset.39673967 * 2. A new reset request from the stack due to timeout39683968 *39693969- * For the first case,error event might not have ae handle available.39703969 * check if this is a new reset request and we are not here just because39713970 * last reset attempt did not succeed and watchdog hit us again. We will39723971 * know this if last reset request did not occur very recently (watchdog···39753976 * want to make sure we throttle the reset request. Therefore, we will39763977 * not allow it again before 3*HZ times.39773978 */39783978- if (!handle)39793979- handle = &hdev->vport[0].nic;3980397939813980 if (time_before(jiffies, (hdev->last_reset_time +39823981 HCLGE_RESET_INTERVAL))) {39833982 mod_timer(&hdev->reset_timer, jiffies + HCLGE_RESET_INTERVAL);39843983 return;39853985- } else if (hdev->default_reset_request) {39843984+ }39853985+39863986+ if (hdev->default_reset_request) {39863987 hdev->reset_level =39873988 hclge_get_reset_level(ae_dev,39883989 &hdev->default_reset_request);···1121011211 if (ret)1121111212 return ret;11212112131121311213- /* RSS indirection table has been configuared by user */1121411214+ /* RSS indirection table has been configured by user */1121411215 if (rxfh_configured)1121511216 goto out;1121611217
···2193219321942194 if (test_and_clear_bit(HCLGEVF_RESET_PENDING,21952195 &hdev->reset_state)) {21962196- /* PF has initmated that it is about to reset the hardware.21962196+ /* PF has intimated that it is about to reset the hardware.21972197 * We now have to poll & check if hardware has actually21982198 * completed the reset sequence. On hardware reset completion,21992199 * VF needs to reset the client and ae device.···26242624{26252625 struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);2626262626272627+ clear_bit(HCLGEVF_STATE_DOWN, &hdev->state);26282628+26272629 hclgevf_reset_tqp_stats(handle);2628263026292631 hclgevf_request_link_info(hdev);2630263226312633 hclgevf_update_link_mode(hdev);26322632-26332633- clear_bit(HCLGEVF_STATE_DOWN, &hdev->state);2634263426352635 return 0;26362636}···34973497 if (ret)34983498 return ret;3499349935003500- /* RSS indirection table has been configuared by user */35003500+ /* RSS indirection table has been configured by user */35013501 if (rxfh_configured)35023502 goto out;35033503
+1
drivers/net/ethernet/intel/i40e/i40e.h
···142142 __I40E_VIRTCHNL_OP_PENDING,143143 __I40E_RECOVERY_MODE,144144 __I40E_VF_RESETS_DISABLED, /* disable resets during i40e_remove */145145+ __I40E_VFS_RELEASING,145146 /* This must be last as it determines the size of the BITMAP */146147 __I40E_STATE_SIZE__,147148};
+3
drivers/net/ethernet/intel/i40e/i40e_debugfs.c
···578578 case RING_TYPE_XDP:579579 ring = kmemdup(vsi->xdp_rings[ring_id], sizeof(*ring), GFP_KERNEL);580580 break;581581+ default:582582+ ring = NULL;583583+ break;581584 }582585 if (!ring)583586 return;
+48-7
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
···232232 I40E_STAT(struct i40e_vsi, _name, _stat)233233#define I40E_VEB_STAT(_name, _stat) \234234 I40E_STAT(struct i40e_veb, _name, _stat)235235+#define I40E_VEB_TC_STAT(_name, _stat) \236236+ I40E_STAT(struct i40e_cp_veb_tc_stats, _name, _stat)235237#define I40E_PFC_STAT(_name, _stat) \236238 I40E_STAT(struct i40e_pfc_stats, _name, _stat)237239#define I40E_QUEUE_STAT(_name, _stat) \···268266 I40E_VEB_STAT("veb.rx_unknown_protocol", stats.rx_unknown_protocol),269267};270268269269+struct i40e_cp_veb_tc_stats {270270+ u64 tc_rx_packets;271271+ u64 tc_rx_bytes;272272+ u64 tc_tx_packets;273273+ u64 tc_tx_bytes;274274+};275275+271276static const struct i40e_stats i40e_gstrings_veb_tc_stats[] = {272272- I40E_VEB_STAT("veb.tc_%u_tx_packets", tc_stats.tc_tx_packets),273273- I40E_VEB_STAT("veb.tc_%u_tx_bytes", tc_stats.tc_tx_bytes),274274- I40E_VEB_STAT("veb.tc_%u_rx_packets", tc_stats.tc_rx_packets),275275- I40E_VEB_STAT("veb.tc_%u_rx_bytes", tc_stats.tc_rx_bytes),277277+ I40E_VEB_TC_STAT("veb.tc_%u_tx_packets", tc_tx_packets),278278+ I40E_VEB_TC_STAT("veb.tc_%u_tx_bytes", tc_tx_bytes),279279+ I40E_VEB_TC_STAT("veb.tc_%u_rx_packets", tc_rx_packets),280280+ I40E_VEB_TC_STAT("veb.tc_%u_rx_bytes", tc_rx_bytes),276281};277282278283static const struct i40e_stats i40e_gstrings_misc_stats[] = {···1110110111111102 /* Set flow control settings */11121103 ethtool_link_ksettings_add_link_mode(ks, supported, Pause);11041104+ ethtool_link_ksettings_add_link_mode(ks, supported, Asym_Pause);1113110511141106 switch (hw->fc.requested_mode) {11151107 case I40E_FC_FULL:···22272217}2228221822292219/**22202220+ * i40e_get_veb_tc_stats - copy VEB TC statistics to formatted structure22212221+ * @tc: the TC statistics in VEB structure (veb->tc_stats)22222222+ * @i: the index of traffic class in (veb->tc_stats) structure to copy22232223+ *22242224+ * Copy VEB TC statistics from structure of arrays (veb->tc_stats) to22252225+ * one dimensional structure i40e_cp_veb_tc_stats.22262226+ * Produce formatted i40e_cp_veb_tc_stats structure of the VEB TC22272227+ * statistics for the given TC.22282228+ **/22292229+static struct i40e_cp_veb_tc_stats22302230+i40e_get_veb_tc_stats(struct i40e_veb_tc_stats *tc, unsigned int i)22312231+{22322232+ struct i40e_cp_veb_tc_stats veb_tc = {22332233+ .tc_rx_packets = tc->tc_rx_packets[i],22342234+ .tc_rx_bytes = tc->tc_rx_bytes[i],22352235+ .tc_tx_packets = tc->tc_tx_packets[i],22362236+ .tc_tx_bytes = tc->tc_tx_bytes[i],22372237+ };22382238+22392239+ return veb_tc;22402240+}22412241+22422242+/**22302243 * i40e_get_pfc_stats - copy HW PFC statistics to formatted structure22312244 * @pf: the PF device structure22322245 * @i: the priority value to copy···23332300 i40e_gstrings_veb_stats);2334230123352302 for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)23362336- i40e_add_ethtool_stats(&data, veb_stats ? veb : NULL,23372337- i40e_gstrings_veb_tc_stats);23032303+ if (veb_stats) {23042304+ struct i40e_cp_veb_tc_stats veb_tc =23052305+ i40e_get_veb_tc_stats(&veb->tc_stats, i);23062306+23072307+ i40e_add_ethtool_stats(&data, &veb_tc,23082308+ i40e_gstrings_veb_tc_stats);23092309+ } else {23102310+ i40e_add_ethtool_stats(&data, NULL,23112311+ i40e_gstrings_veb_tc_stats);23122312+ }2338231323392314 i40e_add_ethtool_stats(&data, pf, i40e_gstrings_stats);23402315···5480543954815440 status = i40e_aq_get_phy_register(hw,54825441 I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE,54835483- true, addr, offset, &value, NULL);54425442+ addr, true, offset, &value, NULL);54845443 if (status)54855444 return -EIO;54865445 data[i] = value;
+16-14
drivers/net/ethernet/intel/i40e/i40e_main.c
···25602560 i40e_stat_str(hw, aq_ret),25612561 i40e_aq_str(hw, hw->aq.asq_last_status));25622562 } else {25632563- dev_info(&pf->pdev->dev, "%s is %s allmulti mode.\n",25642564- vsi->netdev->name,25632563+ dev_info(&pf->pdev->dev, "%s allmulti mode.\n",25652564 cur_multipromisc ? "entering" : "leaving");25662565 }25672566 }···67376738 set_bit(__I40E_CLIENT_SERVICE_REQUESTED, pf->state);67386739 set_bit(__I40E_CLIENT_L2_CHANGE, pf->state);67396740 }67406740- /* registers are set, lets apply */67416741- if (pf->hw_features & I40E_HW_USE_SET_LLDP_MIB)67426742- ret = i40e_hw_set_dcb_config(pf, new_cfg);67416741+ /* registers are set, lets apply */67426742+ if (pf->hw_features & I40E_HW_USE_SET_LLDP_MIB)67436743+ ret = i40e_hw_set_dcb_config(pf, new_cfg);67436744 }6744674567456746err:···1057210573 goto end_core_reset;1057310574 }10574105751057510575- if (!lock_acquired)1057610576- rtnl_lock();1057710577- ret = i40e_setup_pf_switch(pf, reinit);1057810578- if (ret)1057910579- goto end_unlock;1058010580-1058110576#ifdef CONFIG_I40E_DCB1058210577 /* Enable FW to write a default DCB config on link-up1058310578 * unless I40E_FLAG_TC_MQPRIO was enabled or DCB···1058610593 i40e_aq_set_dcb_parameters(hw, false, NULL);1058710594 dev_warn(&pf->pdev->dev,1058810595 "DCB is not supported for X710-T*L 2.5/5G speeds\n");1058910589- pf->flags &= ~I40E_FLAG_DCB_CAPABLE;1059610596+ pf->flags &= ~I40E_FLAG_DCB_CAPABLE;1059010597 } else {1059110598 i40e_aq_set_dcb_parameters(hw, true, NULL);1059210599 ret = i40e_init_pf_dcb(pf);···1060010607 }10601106081060210609#endif /* CONFIG_I40E_DCB */1061010610+ if (!lock_acquired)1061110611+ rtnl_lock();1061210612+ ret = i40e_setup_pf_switch(pf, reinit);1061310613+ if (ret)1061410614+ goto end_unlock;10603106151060410616 /* The driver only wants link up/down and module qualification1060510617 * reports from firmware. Note the negative logic.···1513815140 * in order to register the netdev1513915141 */1514015142 v_idx = i40e_vsi_mem_alloc(pf, I40E_VSI_MAIN);1514115141- if (v_idx < 0)1514315143+ if (v_idx < 0) {1514415144+ err = v_idx;1514215145 goto err_switch_setup;1514615146+ }1514315147 pf->lan_vsi = v_idx;1514415148 vsi = pf->vsi[v_idx];1514515145- if (!vsi)1514915149+ if (!vsi) {1515015150+ err = -EFAULT;1514615151 goto err_switch_setup;1515215152+ }1514715153 vsi->alloc_queue_pairs = 1;1514815154 err = i40e_config_netdev(vsi);1514915155 if (err)
+5-7
drivers/net/ethernet/intel/i40e/i40e_txrx.c
···22952295 * @rx_ring: Rx ring being processed22962296 * @xdp: XDP buffer containing the frame22972297 **/22982298-static struct sk_buff *i40e_run_xdp(struct i40e_ring *rx_ring,22992299- struct xdp_buff *xdp)22982298+static int i40e_run_xdp(struct i40e_ring *rx_ring, struct xdp_buff *xdp)23002299{23012300 int err, result = I40E_XDP_PASS;23022301 struct i40e_ring *xdp_ring;···23342335 }23352336xdp_out:23362337 rcu_read_unlock();23372337- return ERR_PTR(-result);23382338+ return result;23382339}2339234023402341/**···24472448 unsigned int xdp_xmit = 0;24482449 bool failure = false;24492450 struct xdp_buff xdp;24512451+ int xdp_res = 0;2450245224512453#if (PAGE_SIZE < 8192)24522454 frame_sz = i40e_rx_frame_truesize(rx_ring, 0);···25132513 /* At larger PAGE_SIZE, frame_sz depend on len size */25142514 xdp.frame_sz = i40e_rx_frame_truesize(rx_ring, size);25152515#endif25162516- skb = i40e_run_xdp(rx_ring, &xdp);25162516+ xdp_res = i40e_run_xdp(rx_ring, &xdp);25172517 }2518251825192519- if (IS_ERR(skb)) {25202520- unsigned int xdp_res = -PTR_ERR(skb);25212521-25192519+ if (xdp_res) {25222520 if (xdp_res & (I40E_XDP_TX | I40E_XDP_REDIR)) {25232521 xdp_xmit |= xdp_res;25242522 i40e_rx_buffer_flip(rx_ring, rx_buffer, size);
···137137 **/138138static inline void i40e_vc_disable_vf(struct i40e_vf *vf)139139{140140+ struct i40e_pf *pf = vf->pf;140141 int i;141142142143 i40e_vc_notify_vf_reset(vf);···148147 * ensure a reset.149148 */150149 for (i = 0; i < 20; i++) {150150+ /* If PF is in VFs releasing state reset VF is impossible,151151+ * so leave it.152152+ */153153+ if (test_bit(__I40E_VFS_RELEASING, pf->state))154154+ return;151155 if (i40e_reset_vf(vf, false))152156 return;153157 usleep_range(10000, 20000);···1580157415811575 if (!pf->vf)15821576 return;15771577+15781578+ set_bit(__I40E_VFS_RELEASING, pf->state);15831579 while (test_and_set_bit(__I40E_VF_DISABLE, pf->state))15841580 usleep_range(1000, 2000);15851581···16391631 }16401632 }16411633 clear_bit(__I40E_VF_DISABLE, pf->state);16341634+ clear_bit(__I40E_VFS_RELEASING, pf->state);16421635}1643163616441637#ifdef CONFIG_PCI_IOV
···196196 __ICE_NEEDS_RESTART,197197 __ICE_PREPARED_FOR_RESET, /* set by driver when prepared */198198 __ICE_RESET_OICR_RECV, /* set by driver after rcv reset OICR */199199- __ICE_DCBNL_DEVRESET, /* set by dcbnl devreset */200199 __ICE_PFR_REQ, /* set by driver and peers */201200 __ICE_CORER_REQ, /* set by driver and peers */202201 __ICE_GLOBR_REQ, /* set by driver and peers */···623624void ice_print_link_msg(struct ice_vsi *vsi, bool isup);624625const char *ice_stat_str(enum ice_status stat_err);625626const char *ice_aq_str(enum ice_aq_err aq_err);626626-bool ice_is_wol_supported(struct ice_pf *pf);627627+bool ice_is_wol_supported(struct ice_hw *hw);627628int628629ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add,629630 bool is_tun);···641642int ice_aq_wait_for_event(struct ice_pf *pf, u16 opcode, unsigned long timeout,642643 struct ice_rq_event_info *event);643644int ice_open(struct net_device *netdev);645645+int ice_open_internal(struct net_device *netdev);644646int ice_stop(struct net_device *netdev);645647void ice_service_task_schedule(struct ice_pf *pf);646648
+1-1
drivers/net/ethernet/intel/ice/ice_common.c
···717717718718 if (!data) {719719 data = devm_kcalloc(ice_hw_to_dev(hw),720720- sizeof(*data),721720 ICE_AQC_FW_LOG_ID_MAX,721721+ sizeof(*data),722722 GFP_KERNEL);723723 if (!data)724724 return ICE_ERR_NO_MEMORY;
+2-2
drivers/net/ethernet/intel/ice/ice_controlq.h
···3131 ICE_CTL_Q_MAILBOX,3232};33333434-/* Control Queue timeout settings - max delay 250ms */3535-#define ICE_CTL_Q_SQ_CMD_TIMEOUT 2500 /* Count 2500 times */3434+/* Control Queue timeout settings - max delay 1s */3535+#define ICE_CTL_Q_SQ_CMD_TIMEOUT 10000 /* Count 10000 times */3636#define ICE_CTL_Q_SQ_CMD_USEC 100 /* Check every 100usec */3737#define ICE_CTL_Q_ADMIN_INIT_TIMEOUT 10 /* Count 10 times */3838#define ICE_CTL_Q_ADMIN_INIT_MSEC 100 /* Check every 100msec */
+29-9
drivers/net/ethernet/intel/ice/ice_dcb.c
···738738/**739739 * ice_cee_to_dcb_cfg740740 * @cee_cfg: pointer to CEE configuration struct741741- * @dcbcfg: DCB configuration struct741741+ * @pi: port information structure742742 *743743 * Convert CEE configuration from firmware to DCB configuration744744 */745745static void746746ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg,747747- struct ice_dcbx_cfg *dcbcfg)747747+ struct ice_port_info *pi)748748{749749 u32 status, tlv_status = le32_to_cpu(cee_cfg->tlv_status);750750 u32 ice_aqc_cee_status_mask, ice_aqc_cee_status_shift;751751+ u8 i, j, err, sync, oper, app_index, ice_app_sel_type;751752 u16 app_prio = le16_to_cpu(cee_cfg->oper_app_prio);752752- u8 i, err, sync, oper, app_index, ice_app_sel_type;753753 u16 ice_aqc_cee_app_mask, ice_aqc_cee_app_shift;754754+ struct ice_dcbx_cfg *cmp_dcbcfg, *dcbcfg;754755 u16 ice_app_prot_id_type;755756756756- /* CEE PG data to ETS config */757757+ dcbcfg = &pi->qos_cfg.local_dcbx_cfg;758758+ dcbcfg->dcbx_mode = ICE_DCBX_MODE_CEE;759759+ dcbcfg->tlv_status = tlv_status;760760+761761+ /* CEE PG data */757762 dcbcfg->etscfg.maxtcs = cee_cfg->oper_num_tc;758763759764 /* Note that the FW creates the oper_prio_tc nibbles reversed···785780 }786781 }787782788788- /* CEE PFC data to ETS config */783783+ /* CEE PFC data */789784 dcbcfg->pfc.pfcena = cee_cfg->oper_pfc_en;790785 dcbcfg->pfc.pfccap = ICE_MAX_TRAFFIC_CLASS;786786+787787+ /* CEE APP TLV data */788788+ if (dcbcfg->app_mode == ICE_DCBX_APPS_NON_WILLING)789789+ cmp_dcbcfg = &pi->qos_cfg.desired_dcbx_cfg;790790+ else791791+ cmp_dcbcfg = &pi->qos_cfg.remote_dcbx_cfg;791792792793 app_index = 0;793794 for (i = 0; i < 3; i++) {···813802 ice_aqc_cee_app_shift = ICE_AQC_CEE_APP_ISCSI_S;814803 ice_app_sel_type = ICE_APP_SEL_TCPIP;815804 ice_app_prot_id_type = ICE_APP_PROT_ID_ISCSI;805805+806806+ for (j = 0; j < cmp_dcbcfg->numapps; j++) {807807+ u16 prot_id = cmp_dcbcfg->app[j].prot_id;808808+ u8 sel = cmp_dcbcfg->app[j].selector;809809+810810+ if (sel == ICE_APP_SEL_TCPIP &&811811+ (prot_id == ICE_APP_PROT_ID_ISCSI ||812812+ prot_id == ICE_APP_PROT_ID_ISCSI_860)) {813813+ ice_app_prot_id_type = prot_id;814814+ break;815815+ }816816+ }816817 } else {817818 /* FIP APP */818819 ice_aqc_cee_status_mask = ICE_AQC_CEE_FIP_STATUS_M;···915892 ret = ice_aq_get_cee_dcb_cfg(pi->hw, &cee_cfg, NULL);916893 if (!ret) {917894 /* CEE mode */918918- dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg;919919- dcbx_cfg->dcbx_mode = ICE_DCBX_MODE_CEE;920920- dcbx_cfg->tlv_status = le32_to_cpu(cee_cfg.tlv_status);921921- ice_cee_to_dcb_cfg(&cee_cfg, dcbx_cfg);922895 ret = ice_get_ieee_or_cee_dcb_cfg(pi, ICE_DCBX_MODE_CEE);896896+ ice_cee_to_dcb_cfg(&cee_cfg, pi);923897 } else if (pi->hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT) {924898 /* CEE mode not enabled try querying IEEE data */925899 dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg;
···34723472 netdev_warn(netdev, "Wake on LAN is not supported on this interface!\n");3473347334743474 /* Get WoL settings based on the HW capability */34753475- if (ice_is_wol_supported(pf)) {34753475+ if (ice_is_wol_supported(&pf->hw)) {34763476 wol->supported = WAKE_MAGIC;34773477 wol->wolopts = pf->wol_ena ? WAKE_MAGIC : 0;34783478 } else {···34923492 struct ice_vsi *vsi = np->vsi;34933493 struct ice_pf *pf = vsi->back;3494349434953495- if (vsi->type != ICE_VSI_PF || !ice_is_wol_supported(pf))34953495+ if (vsi->type != ICE_VSI_PF || !ice_is_wol_supported(&pf->hw))34963496 return -EOPNOTSUPP;3497349734983498 /* only magic packet is supported */
+2-3
drivers/net/ethernet/intel/ice/ice_lib.c
···26202620 if (!locked)26212621 rtnl_lock();2622262226232623- err = ice_open(vsi->netdev);26232623+ err = ice_open_internal(vsi->netdev);2624262426252625 if (!locked)26262626 rtnl_unlock();···26492649 if (!locked)26502650 rtnl_lock();2651265126522652- ice_stop(vsi->netdev);26522652+ ice_vsi_close(vsi);2653265326542654 if (!locked)26552655 rtnl_unlock();···30783078bool ice_is_reset_in_progress(unsigned long *state)30793079{30803080 return test_bit(__ICE_RESET_OICR_RECV, state) ||30813081- test_bit(__ICE_DCBNL_DEVRESET, state) ||30823081 test_bit(__ICE_PFR_REQ, state) ||30833082 test_bit(__ICE_CORER_REQ, state) ||30843083 test_bit(__ICE_GLOBR_REQ, state);
+39-14
drivers/net/ethernet/intel/ice/ice_main.c
···35373537}3538353835393539/**35403540- * ice_is_wol_supported - get NVM state of WoL35413541- * @pf: board private structure35403540+ * ice_is_wol_supported - check if WoL is supported35413541+ * @hw: pointer to hardware info35423542 *35433543 * Check if WoL is supported based on the HW configuration.35443544 * Returns true if NVM supports and enables WoL for this port, false otherwise35453545 */35463546-bool ice_is_wol_supported(struct ice_pf *pf)35463546+bool ice_is_wol_supported(struct ice_hw *hw)35473547{35483548- struct ice_hw *hw = &pf->hw;35493548 u16 wol_ctrl;3550354935513550 /* A bit set to 1 in the NVM Software Reserved Word 2 (WoL control···35533554 if (ice_read_sr_word(hw, ICE_SR_NVM_WOL_CFG, &wol_ctrl))35543555 return false;3555355635563556- return !(BIT(hw->pf_id) & wol_ctrl);35573557+ return !(BIT(hw->port_info->lport) & wol_ctrl);35573558}3558355935593560/**···41914192 goto err_send_version_unroll;41924193 }4193419441954195+ /* not a fatal error if this fails */41944196 err = ice_init_nvm_phy_type(pf->hw.port_info);41954195- if (err) {41974197+ if (err)41964198 dev_err(dev, "ice_init_nvm_phy_type failed: %d\n", err);41974197- goto err_send_version_unroll;41984198- }4199419942004200+ /* not a fatal error if this fails */42004201 err = ice_update_link_info(pf->hw.port_info);42014201- if (err) {42024202+ if (err)42024203 dev_err(dev, "ice_update_link_info failed: %d\n", err);42034203- goto err_send_version_unroll;42044204- }4205420442064205 ice_init_link_dflt_override(pf->hw.port_info);4207420642084207 /* if media available, initialize PHY settings */42094208 if (pf->hw.port_info->phy.link_info.link_info &42104209 ICE_AQ_MEDIA_AVAILABLE) {42104210+ /* not a fatal error if this fails */42114211 err = ice_init_phy_user_cfg(pf->hw.port_info);42124212- if (err) {42124212+ if (err)42134213 dev_err(dev, "ice_init_phy_user_cfg failed: %d\n", err);42144214- goto err_send_version_unroll;42154215- }4216421442174215 if (!test_bit(ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, pf->flags)) {42184216 struct ice_vsi *vsi = ice_get_main_vsi(pf);···45644568 continue;45654569 ice_vsi_free_q_vectors(pf->vsi[v]);45664570 }45714571+ ice_free_cpu_rx_rmap(ice_get_main_vsi(pf));45674572 ice_clear_interrupt_scheme(pf);4568457345694574 pci_save_state(pdev);···66346637int ice_open(struct net_device *netdev)66356638{66366639 struct ice_netdev_priv *np = netdev_priv(netdev);66406640+ struct ice_pf *pf = np->vsi->back;66416641+66426642+ if (ice_is_reset_in_progress(pf->state)) {66436643+ netdev_err(netdev, "can't open net device while reset is in progress");66446644+ return -EBUSY;66456645+ }66466646+66476647+ return ice_open_internal(netdev);66486648+}66496649+66506650+/**66516651+ * ice_open_internal - Called when a network interface becomes active66526652+ * @netdev: network interface device structure66536653+ *66546654+ * Internal ice_open implementation. Should not be used directly except for ice_open and reset66556655+ * handling routine66566656+ *66576657+ * Returns 0 on success, negative value on failure66586658+ */66596659+int ice_open_internal(struct net_device *netdev)66606660+{66616661+ struct ice_netdev_priv *np = netdev_priv(netdev);66376662 struct ice_vsi *vsi = np->vsi;66386663 struct ice_pf *pf = vsi->back;66396664 struct ice_port_info *pi;···67346715{67356716 struct ice_netdev_priv *np = netdev_priv(netdev);67366717 struct ice_vsi *vsi = np->vsi;67186718+ struct ice_pf *pf = vsi->back;67196719+67206720+ if (ice_is_reset_in_progress(pf->state)) {67216721+ netdev_err(netdev, "can't stop net device while reset is in progress");67226722+ return -EBUSY;67236723+ }6737672467386725 ice_vsi_close(vsi);67396726
+9-6
drivers/net/ethernet/intel/ice/ice_switch.c
···12381238 ice_create_vsi_list_map(hw, &vsi_handle_arr[0], 2,12391239 vsi_list_id);1240124012411241+ if (!m_entry->vsi_list_info)12421242+ return ICE_ERR_NO_MEMORY;12431243+12411244 /* If this entry was large action then the large action needs12421245 * to be updated to point to FWD to VSI list12431246 */···22232220 return ((fm_entry->fltr_info.fltr_act == ICE_FWD_TO_VSI &&22242221 fm_entry->fltr_info.vsi_handle == vsi_handle) ||22252222 (fm_entry->fltr_info.fltr_act == ICE_FWD_TO_VSI_LIST &&22232223+ fm_entry->vsi_list_info &&22262224 (test_bit(vsi_handle, fm_entry->vsi_list_info->vsi_map))));22272225}22282226···22962292 return ICE_ERR_PARAM;2297229322982294 list_for_each_entry(fm_entry, lkup_list_head, list_entry) {22992299- struct ice_fltr_info *fi;23002300-23012301- fi = &fm_entry->fltr_info;23022302- if (!fi || !ice_vsi_uses_fltr(fm_entry, vsi_handle))22952295+ if (!ice_vsi_uses_fltr(fm_entry, vsi_handle))23032296 continue;2304229723052298 status = ice_add_entry_to_vsi_fltr_list(hw, vsi_handle,23062306- vsi_list_head, fi);22992299+ vsi_list_head,23002300+ &fm_entry->fltr_info);23072301 if (status)23082302 return status;23092303 }···26242622 &remove_list_head);26252623 mutex_unlock(rule_lock);26262624 if (status)26272627- return;26252625+ goto free_fltr_list;2628262626292627 switch (lkup) {26302628 case ICE_SW_LKUP_MAC:···26472645 break;26482646 }2649264726482648+free_fltr_list:26502649 list_for_each_entry_safe(fm_entry, tmp, &remove_list_head, list_entry) {26512650 list_del(&fm_entry->list_entry);26522651 devm_kfree(ice_hw_to_dev(hw), fm_entry);
···10091009 struct netlink_ext_ack *extack = NULL;10101010 struct nfp_fl_payload *merge_flow;10111011 struct nfp_fl_key_ls merge_key_ls;10121012+ struct nfp_merge_info *merge_info;10131013+ u64 parent_ctx = 0;10121014 int err;1013101510141016 ASSERT_RTNL();···10201018 nfp_flower_is_merge_flow(sub_flow1) ||10211019 nfp_flower_is_merge_flow(sub_flow2))10221020 return -EINVAL;10211021+10221022+ /* check if the two flows are already merged */10231023+ parent_ctx = (u64)(be32_to_cpu(sub_flow1->meta.host_ctx_id)) << 32;10241024+ parent_ctx |= (u64)(be32_to_cpu(sub_flow2->meta.host_ctx_id));10251025+ if (rhashtable_lookup_fast(&priv->merge_table,10261026+ &parent_ctx, merge_table_params)) {10271027+ nfp_flower_cmsg_warn(app, "The two flows are already merged.\n");10281028+ return 0;10291029+ }1023103010241031 err = nfp_flower_can_merge(sub_flow1, sub_flow2);10251032 if (err)···10711060 if (err)10721061 goto err_release_metadata;1073106210631063+ merge_info = kmalloc(sizeof(*merge_info), GFP_KERNEL);10641064+ if (!merge_info) {10651065+ err = -ENOMEM;10661066+ goto err_remove_rhash;10671067+ }10681068+ merge_info->parent_ctx = parent_ctx;10691069+ err = rhashtable_insert_fast(&priv->merge_table, &merge_info->ht_node,10701070+ merge_table_params);10711071+ if (err)10721072+ goto err_destroy_merge_info;10731073+10741074 err = nfp_flower_xmit_flow(app, merge_flow,10751075 NFP_FLOWER_CMSG_TYPE_FLOW_MOD);10761076 if (err)10771077- goto err_remove_rhash;10771077+ goto err_remove_merge_info;1078107810791079 merge_flow->in_hw = true;10801080 sub_flow1->in_hw = false;1081108110821082 return 0;1083108310841084+err_remove_merge_info:10851085+ WARN_ON_ONCE(rhashtable_remove_fast(&priv->merge_table,10861086+ &merge_info->ht_node,10871087+ merge_table_params));10881088+err_destroy_merge_info:10891089+ kfree(merge_info);10841090err_remove_rhash:10851091 WARN_ON_ONCE(rhashtable_remove_fast(&priv->flow_table,10861092 &merge_flow->fl_node,···13871359{13881360 struct nfp_flower_priv *priv = app->priv;13891361 struct nfp_fl_payload_link *link, *temp;13621362+ struct nfp_merge_info *merge_info;13901363 struct nfp_fl_payload *origin;13641364+ u64 parent_ctx = 0;13911365 bool mod = false;13921366 int err;13931367···14261396err_free_links:14271397 /* Clean any links connected with the merged flow. */14281398 list_for_each_entry_safe(link, temp, &merge_flow->linked_flows,14291429- merge_flow.list)13991399+ merge_flow.list) {14001400+ u32 ctx_id = be32_to_cpu(link->sub_flow.flow->meta.host_ctx_id);14011401+14021402+ parent_ctx = (parent_ctx << 32) | (u64)(ctx_id);14301403 nfp_flower_unlink_flow(link);14041404+ }14051405+14061406+ merge_info = rhashtable_lookup_fast(&priv->merge_table,14071407+ &parent_ctx,14081408+ merge_table_params);14091409+ if (merge_info) {14101410+ WARN_ON_ONCE(rhashtable_remove_fast(&priv->merge_table,14111411+ &merge_info->ht_node,14121412+ merge_table_params));14131413+ kfree(merge_info);14141414+ }1431141514321416 kfree(merge_flow->action_data);14331417 kfree(merge_flow->mask_data);
+12
drivers/net/ethernet/xilinx/xilinx_axienet.h
···504504 return axienet_ior(lp, XAE_MDIO_MCR_OFFSET);505505}506506507507+static inline void axienet_lock_mii(struct axienet_local *lp)508508+{509509+ if (lp->mii_bus)510510+ mutex_lock(&lp->mii_bus->mdio_lock);511511+}512512+513513+static inline void axienet_unlock_mii(struct axienet_local *lp)514514+{515515+ if (lp->mii_bus)516516+ mutex_unlock(&lp->mii_bus->mdio_lock);517517+}518518+507519/**508520 * axienet_iow - Memory mapped Axi Ethernet register write509521 * @lp: Pointer to axienet local structure
+6-6
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
···10531053 * including the MDIO. MDIO must be disabled before resetting.10541054 * Hold MDIO bus lock to avoid MDIO accesses during the reset.10551055 */10561056- mutex_lock(&lp->mii_bus->mdio_lock);10561056+ axienet_lock_mii(lp);10571057 ret = axienet_device_reset(ndev);10581058- mutex_unlock(&lp->mii_bus->mdio_lock);10581058+ axienet_unlock_mii(lp);1059105910601060 ret = phylink_of_phy_connect(lp->phylink, lp->dev->of_node, 0);10611061 if (ret) {···11481148 }1149114911501150 /* Do a reset to ensure DMA is really stopped */11511151- mutex_lock(&lp->mii_bus->mdio_lock);11511151+ axienet_lock_mii(lp);11521152 __axienet_device_reset(lp);11531153- mutex_unlock(&lp->mii_bus->mdio_lock);11531153+ axienet_unlock_mii(lp);1154115411551155 cancel_work_sync(&lp->dma_err_task);11561156···17091709 * including the MDIO. MDIO must be disabled before resetting.17101710 * Hold MDIO bus lock to avoid MDIO accesses during the reset.17111711 */17121712- mutex_lock(&lp->mii_bus->mdio_lock);17121712+ axienet_lock_mii(lp);17131713 __axienet_device_reset(lp);17141714- mutex_unlock(&lp->mii_bus->mdio_lock);17141714+ axienet_unlock_mii(lp);1715171517161716 for (i = 0; i < lp->tx_bd_num; i++) {17171717 cur_p = &lp->tx_bd_v[i];
···369369370370int bcm_phy_set_eee(struct phy_device *phydev, bool enable)371371{372372- int val;372372+ int val, mask = 0;373373374374 /* Enable EEE at PHY level */375375 val = phy_read_mmd(phydev, MDIO_MMD_AN, BRCM_CL45VEN_EEE_CONTROL);···388388 if (val < 0)389389 return val;390390391391+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,392392+ phydev->supported))393393+ mask |= MDIO_EEE_1000T;394394+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT,395395+ phydev->supported))396396+ mask |= MDIO_EEE_100TX;397397+391398 if (enable)392392- val |= (MDIO_EEE_100TX | MDIO_EEE_1000T);399399+ val |= mask;393400 else394394- val &= ~(MDIO_EEE_100TX | MDIO_EEE_1000T);401401+ val &= ~mask;395402396403 phy_write_mmd(phydev, MDIO_MMD_AN, BCM_CL45VEN_EEE_ADV, (u32)val);397404
+48
drivers/net/tun.c
···6969#include <linux/bpf.h>7070#include <linux/bpf_trace.h>7171#include <linux/mutex.h>7272+#include <linux/ieee802154.h>7373+#include <linux/if_ltalk.h>7474+#include <uapi/linux/if_fddi.h>7575+#include <uapi/linux/if_hippi.h>7676+#include <uapi/linux/if_fc.h>7777+#include <net/ax25.h>7878+#include <net/rose.h>7979+#include <net/6lowpan.h>72807381#include <linux/uaccess.h>7482#include <linux/proc_fs.h>···29272919 return __tun_set_ebpf(tun, prog_p, prog);29282920}2929292129222922+/* Return correct value for tun->dev->addr_len based on tun->dev->type. */29232923+static unsigned char tun_get_addr_len(unsigned short type)29242924+{29252925+ switch (type) {29262926+ case ARPHRD_IP6GRE:29272927+ case ARPHRD_TUNNEL6:29282928+ return sizeof(struct in6_addr);29292929+ case ARPHRD_IPGRE:29302930+ case ARPHRD_TUNNEL:29312931+ case ARPHRD_SIT:29322932+ return 4;29332933+ case ARPHRD_ETHER:29342934+ return ETH_ALEN;29352935+ case ARPHRD_IEEE802154:29362936+ case ARPHRD_IEEE802154_MONITOR:29372937+ return IEEE802154_EXTENDED_ADDR_LEN;29382938+ case ARPHRD_PHONET_PIPE:29392939+ case ARPHRD_PPP:29402940+ case ARPHRD_NONE:29412941+ return 0;29422942+ case ARPHRD_6LOWPAN:29432943+ return EUI64_ADDR_LEN;29442944+ case ARPHRD_FDDI:29452945+ return FDDI_K_ALEN;29462946+ case ARPHRD_HIPPI:29472947+ return HIPPI_ALEN;29482948+ case ARPHRD_IEEE802:29492949+ return FC_ALEN;29502950+ case ARPHRD_ROSE:29512951+ return ROSE_ADDR_LEN;29522952+ case ARPHRD_NETROM:29532953+ return AX25_ADDR_LEN;29542954+ case ARPHRD_LOCALTLK:29552955+ return LTALK_ALEN;29562956+ default:29572957+ return 0;29582958+ }29592959+}29602960+29302961static long __tun_chr_ioctl(struct file *file, unsigned int cmd,29312962 unsigned long arg, int ifreq_len)29322963{···31293082 break;31303083 }31313084 tun->dev->type = (int) arg;30853085+ tun->dev->addr_len = tun_get_addr_len(tun->dev->type);31323086 netif_info(tun, drv, tun->dev, "linktype set to %d\n",31333087 tun->dev->type);31343088 call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE,
+12-21
drivers/net/usb/hso.c
···611611 return serial;612612}613613614614-static int get_free_serial_index(void)614614+static int obtain_minor(struct hso_serial *serial)615615{616616 int index;617617 unsigned long flags;···619619 spin_lock_irqsave(&serial_table_lock, flags);620620 for (index = 0; index < HSO_SERIAL_TTY_MINORS; index++) {621621 if (serial_table[index] == NULL) {622622+ serial_table[index] = serial->parent;623623+ serial->minor = index;622624 spin_unlock_irqrestore(&serial_table_lock, flags);623623- return index;625625+ return 0;624626 }625627 }626628 spin_unlock_irqrestore(&serial_table_lock, flags);···631629 return -1;632630}633631634634-static void set_serial_by_index(unsigned index, struct hso_serial *serial)632632+static void release_minor(struct hso_serial *serial)635633{636634 unsigned long flags;637635638636 spin_lock_irqsave(&serial_table_lock, flags);639639- if (serial)640640- serial_table[index] = serial->parent;641641- else642642- serial_table[index] = NULL;637637+ serial_table[serial->minor] = NULL;643638 spin_unlock_irqrestore(&serial_table_lock, flags);644639}645640···22292230static void hso_serial_tty_unregister(struct hso_serial *serial)22302231{22312232 tty_unregister_device(tty_drv, serial->minor);22332233+ release_minor(serial);22322234}2233223522342236static void hso_serial_common_free(struct hso_serial *serial)···22532253static int hso_serial_common_create(struct hso_serial *serial, int num_urbs,22542254 int rx_size, int tx_size)22552255{22562256- int minor;22572256 int i;2258225722592258 tty_port_init(&serial->port);2260225922612261- minor = get_free_serial_index();22622262- if (minor < 0)22602260+ if (obtain_minor(serial))22632261 goto exit2;2264226222652263 /* register our minor number */22662264 serial->parent->dev = tty_port_register_device_attr(&serial->port,22672267- tty_drv, minor, &serial->parent->interface->dev,22652265+ tty_drv, serial->minor, &serial->parent->interface->dev,22682266 serial->parent, hso_serial_dev_groups);22692269- if (IS_ERR(serial->parent->dev))22672267+ if (IS_ERR(serial->parent->dev)) {22682268+ release_minor(serial);22702269 goto exit2;22702270+ }2271227122722272- /* fill in specific data for later use */22732273- serial->minor = minor;22742272 serial->magic = HSO_SERIAL_MAGIC;22752273 spin_lock_init(&serial->serial_lock);22762274 serial->num_rx_urbs = num_urbs;···2665266726662668 serial->write_data = hso_std_serial_write_data;2667266926682668- /* and record this serial */26692669- set_serial_by_index(serial->minor, serial);26702670-26712670 /* setup the proc dirs and files if needed */26722671 hso_log_port(hso_dev);26732672···27202725 mutex_lock(&serial->shared_int->shared_int_lock);27212726 serial->shared_int->ref_count++;27222727 mutex_unlock(&serial->shared_int->shared_int_lock);27232723-27242724- /* and record this serial */27252725- set_serial_by_index(serial->minor, serial);2726272827272729 /* setup the proc dirs and files if needed */27282730 hso_log_port(hso_dev);···31053113 cancel_work_sync(&serial_table[i]->async_get_intf);31063114 hso_serial_tty_unregister(serial);31073115 kref_put(&serial_table[i]->ref, hso_serial_ref_free);31083108- set_serial_by_index(i, NULL);31093116 }31103117 }31113118
+7-3
drivers/net/virtio_net.c
···406406 offset += hdr_padded_len;407407 p += hdr_padded_len;408408409409- copy = len;410410- if (copy > skb_tailroom(skb))411411- copy = skb_tailroom(skb);409409+ /* Copy all frame if it fits skb->head, otherwise410410+ * we let virtio_net_hdr_to_skb() and GRO pull headers as needed.411411+ */412412+ if (len <= skb_tailroom(skb))413413+ copy = len;414414+ else415415+ copy = ETH_HLEN + metasize;412416 skb_put_data(skb, p, copy);413417414418 if (metasize) {
···17861786 return -EINVAL;1787178717881788 /* value zero triggers re-sending the default table to the device */17891789- if (!op_id)17891789+ if (!op_id) {17901790+ mutex_lock(&mvm->mutex);17901791 ret = iwl_rfi_send_config_cmd(mvm, NULL);17911791- else17921792+ mutex_unlock(&mvm->mutex);17931793+ } else {17921794 ret = -EOPNOTSUPP; /* in the future a new table will be added */17951795+ }1793179617941797 return ret ?: count;17951798}
+3-3
drivers/net/wireless/intel/iwlwifi/mvm/rfi.c
···11// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause22/*33- * Copyright (C) 2020 Intel Corporation33+ * Copyright (C) 2020 - 2021 Intel Corporation44 */5566#include "mvm.h"···6666 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_RFIM_SUPPORT))6767 return -EOPNOTSUPP;68686969+ lockdep_assert_held(&mvm->mutex);7070+6971 /* in case no table is passed, use the default one */7072 if (!rfi_table) {7173 memcpy(cmd.table, iwl_rfi_table, sizeof(cmd.table));···7775 cmd.oem = 1;7876 }79778080- mutex_lock(&mvm->mutex);8178 ret = iwl_mvm_send_cmd(mvm, &hcmd);8282- mutex_unlock(&mvm->mutex);83798480 if (ret)8581 IWL_ERR(mvm, "Failed to send RFI config cmd %d\n", ret);
+12-5
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
···272272 rx_status->chain_signal[2] = S8_MIN;273273}274274275275-static int iwl_mvm_rx_mgmt_crypto(struct ieee80211_sta *sta,276276- struct ieee80211_hdr *hdr,277277- struct iwl_rx_mpdu_desc *desc,278278- u32 status)275275+static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,276276+ struct ieee80211_hdr *hdr,277277+ struct iwl_rx_mpdu_desc *desc,278278+ u32 status)279279{280280 struct iwl_mvm_sta *mvmsta;281281 struct iwl_mvm_vif *mvmvif;···284284 struct ieee80211_key_conf *key;285285 u32 len = le16_to_cpu(desc->mpdu_len);286286 const u8 *frame = (void *)hdr;287287+288288+ if ((status & IWL_RX_MPDU_STATUS_SEC_MASK) == IWL_RX_MPDU_STATUS_SEC_NONE)289289+ return 0;287290288291 /*289292 * For non-beacon, we don't really care. But beacons may···359356 IWL_RX_MPDU_STATUS_SEC_UNKNOWN && !mvm->monitor_on)360357 return -1;361358359359+ if (unlikely(ieee80211_is_mgmt(hdr->frame_control) &&360360+ !ieee80211_has_protected(hdr->frame_control)))361361+ return iwl_mvm_rx_mgmt_prot(sta, hdr, desc, status);362362+362363 if (!ieee80211_has_protected(hdr->frame_control) ||363364 (status & IWL_RX_MPDU_STATUS_SEC_MASK) ==364365 IWL_RX_MPDU_STATUS_SEC_NONE)···418411 stats->flag |= RX_FLAG_DECRYPTED;419412 return 0;420413 case RX_MPDU_RES_STATUS_SEC_CMAC_GMAC_ENC:421421- return iwl_mvm_rx_mgmt_crypto(sta, hdr, desc, status);414414+ break;422415 default:423416 /*424417 * Sometimes we can get frames that were not decrypted
···11// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause22/*33 * Copyright (C) 2017 Intel Deutschland GmbH44- * Copyright (C) 2018-2020 Intel Corporation44+ * Copyright (C) 2018-2021 Intel Corporation55 */66#include "iwl-trans.h"77#include "iwl-fh.h"···240240241241 /* kick FW self load */242242 iwl_write64(trans, CSR_CTXT_INFO_BA, trans_pcie->ctxt_info_dma_addr);243243- iwl_write_prph(trans, UREG_CPU_INIT_RUN, 1);244243245244 /* Context info will be released upon alive or failure to get one */246245
···205205 *pprev = NULL;206206}207207208208-static bool populate_node(const void *blob,208208+static int populate_node(const void *blob,209209 int offset,210210 void **mem,211211 struct device_node *dad,···214214{215215 struct device_node *np;216216 const char *pathp;217217- unsigned int l, allocl;217217+ int len;218218219219- pathp = fdt_get_name(blob, offset, &l);219219+ pathp = fdt_get_name(blob, offset, &len);220220 if (!pathp) {221221 *pnp = NULL;222222- return false;222222+ return len;223223 }224224225225- allocl = ++l;225225+ len++;226226227227- np = unflatten_dt_alloc(mem, sizeof(struct device_node) + allocl,227227+ np = unflatten_dt_alloc(mem, sizeof(struct device_node) + len,228228 __alignof__(struct device_node));229229 if (!dryrun) {230230 char *fn;231231 of_node_init(np);232232 np->full_name = fn = ((char *)np) + sizeof(*np);233233234234- memcpy(fn, pathp, l);234234+ memcpy(fn, pathp, len);235235236236 if (dad != NULL) {237237 np->parent = dad;···295295 struct device_node *nps[FDT_MAX_DEPTH];296296 void *base = mem;297297 bool dryrun = !base;298298+ int ret;298299299300 if (nodepp)300301 *nodepp = NULL;···323322 !of_fdt_device_is_available(blob, offset))324323 continue;325324326326- if (!populate_node(blob, offset, &mem, nps[depth],327327- &nps[depth+1], dryrun))328328- return mem - base;325325+ ret = populate_node(blob, offset, &mem, nps[depth],326326+ &nps[depth+1], dryrun);327327+ if (ret < 0)328328+ return ret;329329330330 if (!dryrun && nodepp && !*nodepp)331331 *nodepp = nps[depth+1];···374372{375373 int size;376374 void *mem;375375+ int ret;376376+377377+ if (mynodes)378378+ *mynodes = NULL;377379378380 pr_debug(" -> unflatten_device_tree()\n");379381···398392399393 /* First pass, scan for size */400394 size = unflatten_dt_nodes(blob, NULL, dad, NULL);401401- if (size < 0)395395+ if (size <= 0)402396 return NULL;403397404398 size = ALIGN(size, 4);···416410 pr_debug(" unflattening %p...\n", mem);417411418412 /* Second pass, do actual unflattening */419419- unflatten_dt_nodes(blob, mem, dad, mynodes);413413+ ret = unflatten_dt_nodes(blob, mem, dad, mynodes);414414+420415 if (be32_to_cpup(mem + size) != 0xdeadbeef)421416 pr_warn("End of tree marker overwritten: %08x\n",422417 be32_to_cpup(mem + size));423418424424- if (detached && mynodes) {419419+ if (ret <= 0)420420+ return NULL;421421+422422+ if (detached && mynodes && *mynodes) {425423 of_node_set_flag(*mynodes, OF_DETACHED);426424 pr_debug("unflattened tree is detached\n");427425 }
+2
drivers/of/of_private.h
···88 * Copyright (C) 1996-2005 Paul Mackerras.99 */10101111+#define FDT_ALIGN_SIZE 81212+1113/**1214 * struct alias_prop - Alias property in 'aliases' node1315 * @link: List node to link the structure in aliases_lookup list
+15-9
drivers/of/overlay.c
···5757 * struct overlay_changeset5858 * @id: changeset identifier5959 * @ovcs_list: list on which we are located6060- * @fdt: FDT that was unflattened to create @overlay_tree6060+ * @fdt: base of memory allocated to hold aligned FDT that was unflattened to create @overlay_tree6161 * @overlay_tree: expanded device tree that contains the fragment nodes6262 * @count: count of fragment structures6363 * @fragments: fragment nodes in the overlay expanded device tree···719719/**720720 * init_overlay_changeset() - initialize overlay changeset from overlay tree721721 * @ovcs: Overlay changeset to build722722- * @fdt: the FDT that was unflattened to create @tree723723- * @tree: Contains all the overlay fragments and overlay fixup nodes722722+ * @fdt: base of memory allocated to hold aligned FDT that was unflattened to create @tree723723+ * @tree: Contains the overlay fragments and overlay fixup nodes724724 *725725 * Initialize @ovcs. Populate @ovcs->fragments with node information from726726 * the top level of @tree. The relevant top level nodes are the fragment···873873 * internal documentation874874 *875875 * of_overlay_apply() - Create and apply an overlay changeset876876- * @fdt: the FDT that was unflattened to create @tree876876+ * @fdt: base of memory allocated to hold the aligned FDT877877 * @tree: Expanded overlay device tree878878 * @ovcs_id: Pointer to overlay changeset id879879 *···953953 /*954954 * after overlay_notify(), ovcs->overlay_tree related pointers may have955955 * leaked to drivers, so can not kfree() tree, aka ovcs->overlay_tree;956956- * and can not free fdt, aka ovcs->fdt956956+ * and can not free memory containing aligned fdt. The aligned fdt957957+ * is contained within the memory at ovcs->fdt, possibly at an offset958958+ * from ovcs->fdt.957959 */958960 ret = overlay_notify(ovcs, OF_OVERLAY_PRE_APPLY);959961 if (ret) {···10161014int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size,10171015 int *ovcs_id)10181016{10191019- const void *new_fdt;10171017+ void *new_fdt;10181018+ void *new_fdt_align;10201019 int ret;10211020 u32 size;10221022- struct device_node *overlay_root;10211021+ struct device_node *overlay_root = NULL;1023102210241023 *ovcs_id = 0;10251024 ret = 0;···10391036 * Must create permanent copy of FDT because of_fdt_unflatten_tree()10401037 * will create pointers to the passed in FDT in the unflattened tree.10411038 */10421042- new_fdt = kmemdup(overlay_fdt, size, GFP_KERNEL);10391039+ new_fdt = kmalloc(size + FDT_ALIGN_SIZE, GFP_KERNEL);10431040 if (!new_fdt)10441041 return -ENOMEM;1045104210461046- of_fdt_unflatten_tree(new_fdt, NULL, &overlay_root);10431043+ new_fdt_align = PTR_ALIGN(new_fdt, FDT_ALIGN_SIZE);10441044+ memcpy(new_fdt_align, overlay_fdt, size);10451045+10461046+ of_fdt_unflatten_tree(new_fdt_align, NULL, &overlay_root);10471047 if (!overlay_root) {10481048 pr_err("unable to unflatten overlay_fdt\n");10491049 ret = -EINVAL;
···2222#include <linux/slab.h>2323#include <linux/device.h>2424#include <linux/platform_device.h>2525+#include <linux/kernel.h>25262627#include <linux/i2c.h>2728#include <linux/i2c-mux.h>···14091408static int __init unittest_data_add(void)14101409{14111410 void *unittest_data;14121412- struct device_node *unittest_data_node, *np;14111411+ void *unittest_data_align;14121412+ struct device_node *unittest_data_node = NULL, *np;14131413 /*14141414 * __dtb_testcases_begin[] and __dtb_testcases_end[] are magically14151415 * created by cmd_dt_S_dtb in scripts/Makefile.lib···14191417 extern uint8_t __dtb_testcases_end[];14201418 const int size = __dtb_testcases_end - __dtb_testcases_begin;14211419 int rc;14201420+ void *ret;1422142114231422 if (!size) {14241424- pr_warn("%s: No testcase data to attach; not running tests\n",14251425- __func__);14231423+ pr_warn("%s: testcases is empty\n", __func__);14261424 return -ENODATA;14271425 }1428142614291427 /* creating copy */14301430- unittest_data = kmemdup(__dtb_testcases_begin, size, GFP_KERNEL);14281428+ unittest_data = kmalloc(size + FDT_ALIGN_SIZE, GFP_KERNEL);14311429 if (!unittest_data)14321430 return -ENOMEM;1433143114341434- of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node);14321432+ unittest_data_align = PTR_ALIGN(unittest_data, FDT_ALIGN_SIZE);14331433+ memcpy(unittest_data_align, __dtb_testcases_begin, size);14341434+14351435+ ret = of_fdt_unflatten_tree(unittest_data_align, NULL, &unittest_data_node);14361436+ if (!ret) {14371437+ pr_warn("%s: unflatten testcases tree failed\n", __func__);14381438+ kfree(unittest_data);14391439+ return -ENODATA;14401440+ }14351441 if (!unittest_data_node) {14361436- pr_warn("%s: No tree to attach; not running tests\n", __func__);14421442+ pr_warn("%s: testcases tree is empty\n", __func__);14371443 kfree(unittest_data);14381444 return -ENODATA;14391445 }
+9-7
drivers/platform/x86/intel-hid.c
···483483 goto wakeup;484484485485 /*486486- * Switch events will wake the device and report the new switch487487- * position to the input subsystem.486486+ * Some devices send (duplicate) tablet-mode events when moved487487+ * around even though the mode has not changed; and they do this488488+ * even when suspended.489489+ * Update the switch state in case it changed and then return490490+ * without waking up to avoid spurious wakeups.488491 */489489- if (priv->switches && (event == 0xcc || event == 0xcd))490490- goto wakeup;492492+ if (event == 0xcc || event == 0xcd) {493493+ report_tablet_mode_event(priv->switches, event);494494+ return;495495+ }491496492497 /* Wake up on 5-button array events only. */493498 if (event == 0xc0 || !priv->array)···505500506501wakeup:507502 pm_wakeup_hard_event(&device->dev);508508-509509- if (report_tablet_mode_event(priv->switches, event))510510- return;511503512504 return;513505 }
+12-3
drivers/ras/cec.c
···309309 return ret;310310}311311312312+/**313313+ * cec_add_elem - Add an element to the CEC array.314314+ * @pfn: page frame number to insert315315+ *316316+ * Return values:317317+ * - <0: on error318318+ * - 0: on success319319+ * - >0: when the inserted pfn was offlined320320+ */312321static int cec_add_elem(u64 pfn)313322{314323 struct ce_array *ca = &ce_arr;324324+ int count, err, ret = 0;315325 unsigned int to = 0;316316- int count, ret = 0;317326318327 /*319328 * We can be called very early on the identify_cpu() path where we are···339330 if (ca->n == MAX_ELEMS)340331 WARN_ON(!del_lru_elem_unlocked(ca));341332342342- ret = find_elem(ca, pfn, &to);343343- if (ret < 0) {333333+ err = find_elem(ca, pfn, &to);334334+ if (err < 0) {344335 /*345336 * Shift range [to-end] to make room for one more element.346337 */
···450450 if (len == 0)451451 return NULL;452452453453+ /*454454+ * GNU binutils do not support multiple address spaces. The GNU455455+ * linker's default linker script places IRAM at an arbitrary high456456+ * offset, in order to differentiate it from DRAM. Hence we need to457457+ * strip the artificial offset in the IRAM addresses coming from the458458+ * ELF file.459459+ *460460+ * The TI proprietary linker would never set those higher IRAM address461461+ * bits anyway. PRU architecture limits the program counter to 16-bit462462+ * word-address range. This in turn corresponds to 18-bit IRAM463463+ * byte-address range for ELF.464464+ *465465+ * Two more bits are added just in case to make the final 20-bit mask.466466+ * Idea is to have a safeguard in case TI decides to add banking467467+ * in future SoCs.468468+ */469469+ da &= 0xfffff;470470+453471 if (da >= PRU_IRAM_DA &&454472 da + len <= PRU_IRAM_DA + pru->mem_regions[PRU_IOMEM_IRAM].size) {455473 offset = da - PRU_IRAM_DA;···603585 break;604586 }605587606606- if (pru->data->is_k3 && is_iram) {588588+ if (pru->data->is_k3) {607589 ret = pru_rproc_memcpy(ptr, elf_data + phdr->p_offset,608590 filesz);609591 if (ret) {
···223223 PM8001_EVENT_LOG_SIZE;224224 pm8001_ha->main_cfg_tbl.pm8001_tbl.iop_event_log_option = 0x01;225225 pm8001_ha->main_cfg_tbl.pm8001_tbl.fatal_err_interrupt = 0x01;226226- for (i = 0; i < PM8001_MAX_INB_NUM; i++) {226226+ for (i = 0; i < pm8001_ha->max_q_num; i++) {227227 pm8001_ha->inbnd_q_tbl[i].element_pri_size_cnt =228228 PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16) | (0x00<<30);229229 pm8001_ha->inbnd_q_tbl[i].upper_base_addr =···249249 pm8001_ha->inbnd_q_tbl[i].producer_idx = 0;250250 pm8001_ha->inbnd_q_tbl[i].consumer_index = 0;251251 }252252- for (i = 0; i < PM8001_MAX_OUTB_NUM; i++) {252252+ for (i = 0; i < pm8001_ha->max_q_num; i++) {253253 pm8001_ha->outbnd_q_tbl[i].element_size_cnt =254254 PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16) | (0x01<<30);255255 pm8001_ha->outbnd_q_tbl[i].upper_base_addr =···671671 read_outbnd_queue_table(pm8001_ha);672672 /* update main config table ,inbound table and outbound table */673673 update_main_config_table(pm8001_ha);674674- for (i = 0; i < PM8001_MAX_INB_NUM; i++)674674+ for (i = 0; i < pm8001_ha->max_q_num; i++)675675 update_inbnd_queue_table(pm8001_ha, i);676676- for (i = 0; i < PM8001_MAX_OUTB_NUM; i++)676676+ for (i = 0; i < pm8001_ha->max_q_num; i++)677677 update_outbnd_queue_table(pm8001_ha, i);678678 /* 8081 controller donot require these operations */679679 if (deviceid != 0x8081 && deviceid != 0x0042) {
+1-1
drivers/scsi/scsi_transport_srp.c
···541541 res = mutex_lock_interruptible(&rport->mutex);542542 if (res)543543 goto out;544544- if (rport->state != SRP_RPORT_FAIL_FAST)544544+ if (rport->state != SRP_RPORT_FAIL_FAST && rport->state != SRP_RPORT_LOST)545545 /*546546 * sdev state must be SDEV_TRANSPORT_OFFLINE, transition547547 * to SDEV_BLOCK is illegal. Calling scsi_target_unblock()
+14-17
drivers/scsi/ufs/ufshcd.c
···63866386 DECLARE_COMPLETION_ONSTACK(wait);63876387 struct request *req;63886388 unsigned long flags;63896389- int free_slot, task_tag, err;63896389+ int task_tag, err;6390639063916391 /*63926392- * Get free slot, sleep if slots are unavailable.63936393- * Even though we use wait_event() which sleeps indefinitely,63946394- * the maximum wait time is bounded by %TM_CMD_TIMEOUT.63926392+ * blk_get_request() is used here only to get a free tag.63956393 */63966394 req = blk_get_request(q, REQ_OP_DRV_OUT, 0);63976395 if (IS_ERR(req))63986396 return PTR_ERR(req);6399639764006398 req->end_io_data = &wait;64016401- free_slot = req->tag;64026402- WARN_ON_ONCE(free_slot < 0 || free_slot >= hba->nutmrs);64036399 ufshcd_hold(hba, false);6404640064056401 spin_lock_irqsave(host->host_lock, flags);64066406- task_tag = hba->nutrs + free_slot;64026402+ blk_mq_start_request(req);6407640364046404+ task_tag = req->tag;64086405 treq->req_header.dword_0 |= cpu_to_be32(task_tag);6409640664106410- memcpy(hba->utmrdl_base_addr + free_slot, treq, sizeof(*treq));64116411- ufshcd_vops_setup_task_mgmt(hba, free_slot, tm_function);64076407+ memcpy(hba->utmrdl_base_addr + task_tag, treq, sizeof(*treq));64086408+ ufshcd_vops_setup_task_mgmt(hba, task_tag, tm_function);6412640964136410 /* send command to the controller */64146414- __set_bit(free_slot, &hba->outstanding_tasks);64116411+ __set_bit(task_tag, &hba->outstanding_tasks);6415641264166413 /* Make sure descriptors are ready before ringing the task doorbell */64176414 wmb();6418641564196419- ufshcd_writel(hba, 1 << free_slot, REG_UTP_TASK_REQ_DOOR_BELL);64166416+ ufshcd_writel(hba, 1 << task_tag, REG_UTP_TASK_REQ_DOOR_BELL);64206417 /* Make sure that doorbell is committed immediately */64216418 wmb();64226419···64336436 ufshcd_add_tm_upiu_trace(hba, task_tag, UFS_TM_ERR);64346437 dev_err(hba->dev, "%s: task management cmd 0x%.2x timed-out\n",64356438 __func__, tm_function);64366436- if (ufshcd_clear_tm_cmd(hba, free_slot))64376437- dev_WARN(hba->dev, "%s: unable clear tm cmd (slot %d) after timeout\n",64386438- __func__, free_slot);64396439+ if (ufshcd_clear_tm_cmd(hba, task_tag))64406440+ dev_WARN(hba->dev, "%s: unable to clear tm cmd (slot %d) after timeout\n",64416441+ __func__, task_tag);64396442 err = -ETIMEDOUT;64406443 } else {64416444 err = 0;64426442- memcpy(treq, hba->utmrdl_base_addr + free_slot, sizeof(*treq));64456445+ memcpy(treq, hba->utmrdl_base_addr + task_tag, sizeof(*treq));6443644664446447 ufshcd_add_tm_upiu_trace(hba, task_tag, UFS_TM_COMP);64456448 }6446644964476450 spin_lock_irqsave(hba->host->host_lock, flags);64486448- __clear_bit(free_slot, &hba->outstanding_tasks);64516451+ __clear_bit(task_tag, &hba->outstanding_tasks);64496452 spin_unlock_irqrestore(hba->host->host_lock, flags);6450645364546454+ ufshcd_release(hba);64516455 blk_put_request(req);6452645664536453- ufshcd_release(hba);64546457 return err;64556458}64566459
+1-1
drivers/soc/fsl/qbman/qman.c
···186186 __be32 tag;187187 struct qm_fd fd;188188 u8 __reserved3[32];189189-} __packed;189189+} __packed __aligned(8);190190#define QM_EQCR_VERB_VBIT 0x80191191#define QM_EQCR_VERB_CMD_MASK 0x61 /* but only one value; */192192#define QM_EQCR_VERB_CMD_ENQUEUE 0x01
+1-2
drivers/target/iscsi/iscsi_target.c
···1166116611671167 target_get_sess_cmd(&cmd->se_cmd, true);1168116811691169+ cmd->se_cmd.tag = (__force u32)cmd->init_task_tag;11691170 cmd->sense_reason = target_cmd_init_cdb(&cmd->se_cmd, hdr->cdb);11701171 if (cmd->sense_reason) {11711172 if (cmd->sense_reason == TCM_OUT_OF_RESOURCES) {···11811180 if (cmd->sense_reason)11821181 goto attach_cmd;1183118211841184- /* only used for printks or comparing with ->ref_task_tag */11851185- cmd->se_cmd.tag = (__force u32)cmd->init_task_tag;11861183 cmd->sense_reason = target_cmd_parse_cdb(&cmd->se_cmd);11871184 if (cmd->sense_reason)11881185 goto attach_cmd;
+2-2
drivers/thunderbolt/retimer.c
···347347 ret = tb_retimer_nvm_add(rt);348348 if (ret) {349349 dev_err(&rt->dev, "failed to add NVM devices: %d\n", ret);350350- device_del(&rt->dev);350350+ device_unregister(&rt->dev);351351 return ret;352352 }353353···406406 */407407int tb_retimer_scan(struct tb_port *port)408408{409409- u32 status[TB_MAX_RETIMER_INDEX] = {};409409+ u32 status[TB_MAX_RETIMER_INDEX + 1] = {};410410 int ret, i, last_idx = 0;411411412412 if (!port->cap_usb4)
+4
drivers/usb/cdns3/cdnsp-gadget.c
···11281128 return -ESHUTDOWN;11291129 }1130113011311131+ /* Requests has been dequeued during disabling endpoint. */11321132+ if (!(pep->ep_state & EP_ENABLED))11331133+ return 0;11341134+11311135 spin_lock_irqsave(&pdev->lock, flags);11321136 ret = cdnsp_ep_dequeue(pep, to_cdnsp_request(request));11331137 spin_unlock_irqrestore(&pdev->lock, flags);
···263263 /* lock for status */264264 spinlock_t lock;265265266266+ /* mutex for synchronizing sysfs store paths */267267+ struct mutex sysfs_lock;268268+266269 int sockfd;267270 struct socket *tcp_socket;268271
+2
drivers/usb/usbip/usbip_event.c
···7070 while ((ud = get_event()) != NULL) {7171 usbip_dbg_eh("pending event %lx\n", ud->event);72727373+ mutex_lock(&ud->sysfs_lock);7374 /*7475 * NOTE: shutdown must come first.7576 * Shutdown the device.···9190 ud->eh_ops.unusable(ud);9291 unset_event(ud, USBIP_EH_UNUSABLE);9392 }9393+ mutex_unlock(&ud->sysfs_lock);94949595 wake_up(&ud->eh_waitq);9696 }
···820820 MLX5_SET(virtio_q, vq_ctx, event_qpn_or_msix, mvq->fwqp.mqp.qpn);821821 MLX5_SET(virtio_q, vq_ctx, queue_size, mvq->num_ent);822822 MLX5_SET(virtio_q, vq_ctx, virtio_version_1_0,823823- !!(ndev->mvdev.actual_features & VIRTIO_F_VERSION_1));823823+ !!(ndev->mvdev.actual_features & BIT_ULL(VIRTIO_F_VERSION_1)));824824 MLX5_SET64(virtio_q, vq_ctx, desc_addr, mvq->desc_addr);825825 MLX5_SET64(virtio_q, vq_ctx, used_addr, mvq->device_addr);826826 MLX5_SET64(virtio_q, vq_ctx, available_addr, mvq->driver_addr);···11691169 return;11701170 }11711171 mvq->avail_idx = attr.available_index;11721172+ mvq->used_idx = attr.used_index;11721173}1173117411741175static void suspend_vqs(struct mlx5_vdpa_net *ndev)···14271426 return -EINVAL;14281427 }1429142814291429+ mvq->used_idx = state->avail_index;14301430 mvq->avail_idx = state->avail_index;14311431 return 0;14321432}···14451443 * that cares about emulating the index after vq is stopped.14461444 */14471445 if (!mvq->initialized) {14481448- state->avail_index = mvq->avail_idx;14461446+ /* Firmware returns a wrong value for the available index.14471447+ * Since both values should be identical, we take the value of14481448+ * used_idx which is reported correctly.14491449+ */14501450+ state->avail_index = mvq->used_idx;14491451 return 0;14501452 }14511453···14581452 mlx5_vdpa_warn(mvdev, "failed to query virtqueue\n");14591453 return err;14601454 }14611461- state->avail_index = attr.available_index;14551455+ state->avail_index = attr.used_index;14621456 return 0;14631457}14641458···15461540 }15471541}1548154215491549-static void clear_virtqueues(struct mlx5_vdpa_net *ndev)15501550-{15511551- int i;15521552-15531553- for (i = ndev->mvdev.max_vqs - 1; i >= 0; i--) {15541554- ndev->vqs[i].avail_idx = 0;15551555- ndev->vqs[i].used_idx = 0;15561556- }15571557-}15581558-15591543/* TODO: cross-endian support */15601544static inline bool mlx5_vdpa_is_little_endian(struct mlx5_vdpa_dev *mvdev)15611545{15621546 return virtio_legacy_is_little_endian() ||15631563- (mvdev->actual_features & (1ULL << VIRTIO_F_VERSION_1));15471547+ (mvdev->actual_features & BIT_ULL(VIRTIO_F_VERSION_1));15641548}1565154915661550static __virtio16 cpu_to_mlx5vdpa16(struct mlx5_vdpa_dev *mvdev, u16 val)···17811785 if (!status) {17821786 mlx5_vdpa_info(mvdev, "performing device reset\n");17831787 teardown_driver(ndev);17841784- clear_virtqueues(ndev);17851788 mlx5_vdpa_destroy_mr(&ndev->mvdev);17861789 ndev->mvdev.status = 0;17871790 ndev->mvdev.mlx_features = 0;···19021907 .free = mlx5_vdpa_free,19031908};1904190919101910+static int query_mtu(struct mlx5_core_dev *mdev, u16 *mtu)19111911+{19121912+ u16 hw_mtu;19131913+ int err;19141914+19151915+ err = mlx5_query_nic_vport_mtu(mdev, &hw_mtu);19161916+ if (err)19171917+ return err;19181918+19191919+ *mtu = hw_mtu - MLX5V_ETH_HARD_MTU;19201920+ return 0;19211921+}19221922+19051923static int alloc_resources(struct mlx5_vdpa_net *ndev)19061924{19071925 struct mlx5_vdpa_net_resources *res = &ndev->res;···20001992 init_mvqs(ndev);20011993 mutex_init(&ndev->reslock);20021994 config = &ndev->config;20032003- err = mlx5_query_nic_vport_mtu(mdev, &ndev->mtu);19951995+ err = query_mtu(mdev, &ndev->mtu);20041996 if (err)20051997 goto err_mtu;20061998
+2-2
drivers/watchdog/armada_37xx_wdt.c
···22/*33 * Watchdog driver for Marvell Armada 37xx SoCs44 *55- * Author: Marek Behun <marek.behun@nic.cz>55+ * Author: Marek Behún <kabel@kernel.org>66 */7788#include <linux/clk.h>···366366367367module_platform_driver(armada_37xx_wdt_driver);368368369369-MODULE_AUTHOR("Marek Behun <marek.behun@nic.cz>");369369+MODULE_AUTHOR("Marek Behun <kabel@kernel.org>");370370MODULE_DESCRIPTION("Armada 37xx CPU Watchdog");371371372372MODULE_LICENSE("GPL v2");
+6-6
drivers/xen/events/events_base.c
···110110 unsigned short eoi_cpu; /* EOI must happen on this cpu-1 */111111 unsigned int irq_epoch; /* If eoi_cpu valid: irq_epoch of event */112112 u64 eoi_time; /* Time in jiffies when to EOI. */113113- spinlock_t lock;113113+ raw_spinlock_t lock;114114115115 union {116116 unsigned short virq;···312312 info->evtchn = evtchn;313313 info->cpu = cpu;314314 info->mask_reason = EVT_MASK_REASON_EXPLICIT;315315- spin_lock_init(&info->lock);315315+ raw_spin_lock_init(&info->lock);316316317317 ret = set_evtchn_to_irq(evtchn, irq);318318 if (ret < 0)···472472{473473 unsigned long flags;474474475475- spin_lock_irqsave(&info->lock, flags);475475+ raw_spin_lock_irqsave(&info->lock, flags);476476477477 if (!info->mask_reason)478478 mask_evtchn(info->evtchn);479479480480 info->mask_reason |= reason;481481482482- spin_unlock_irqrestore(&info->lock, flags);482482+ raw_spin_unlock_irqrestore(&info->lock, flags);483483}484484485485static void do_unmask(struct irq_info *info, u8 reason)486486{487487 unsigned long flags;488488489489- spin_lock_irqsave(&info->lock, flags);489489+ raw_spin_lock_irqsave(&info->lock, flags);490490491491 info->mask_reason &= ~reason;492492493493 if (!info->mask_reason)494494 unmask_evtchn(info->evtchn);495495496496- spin_unlock_irqrestore(&info->lock, flags);496496+ raw_spin_unlock_irqrestore(&info->lock, flags);497497}498498499499#ifdef CONFIG_X86
+42-11
fs/btrfs/zoned.c
···2121/* Pseudo write pointer value for conventional zone */2222#define WP_CONVENTIONAL ((u64)-2)23232424+/*2525+ * Location of the first zone of superblock logging zone pairs.2626+ *2727+ * - primary superblock: 0B (zone 0)2828+ * - first copy: 512G (zone starting at that offset)2929+ * - second copy: 4T (zone starting at that offset)3030+ */3131+#define BTRFS_SB_LOG_PRIMARY_OFFSET (0ULL)3232+#define BTRFS_SB_LOG_FIRST_OFFSET (512ULL * SZ_1G)3333+#define BTRFS_SB_LOG_SECOND_OFFSET (4096ULL * SZ_1G)3434+3535+#define BTRFS_SB_LOG_FIRST_SHIFT const_ilog2(BTRFS_SB_LOG_FIRST_OFFSET)3636+#define BTRFS_SB_LOG_SECOND_SHIFT const_ilog2(BTRFS_SB_LOG_SECOND_OFFSET)3737+2438/* Number of superblock log zones */2539#define BTRFS_NR_SB_LOG_ZONES 24040+4141+/*4242+ * Maximum supported zone size. Currently, SMR disks have a zone size of4343+ * 256MiB, and we are expecting ZNS drives to be in the 1-4GiB range. We do not4444+ * expect the zone size to become larger than 8GiB in the near future.4545+ */4646+#define BTRFS_MAX_ZONE_SIZE SZ_8G26472748static int copy_zone_info_cb(struct blk_zone *zone, unsigned int idx, void *data)2849{···132111}133112134113/*135135- * The following zones are reserved as the circular buffer on ZONED btrfs.136136- * - The primary superblock: zones 0 and 1137137- * - The first copy: zones 16 and 17138138- * - The second copy: zones 1024 or zone at 256GB which is minimum, and139139- * the following one114114+ * Get the first zone number of the superblock mirror140115 */141116static inline u32 sb_zone_number(int shift, int mirror)142117{143143- ASSERT(mirror < BTRFS_SUPER_MIRROR_MAX);118118+ u64 zone;144119120120+ ASSERT(mirror < BTRFS_SUPER_MIRROR_MAX);145121 switch (mirror) {146146- case 0: return 0;147147- case 1: return 16;148148- case 2: return min_t(u64, btrfs_sb_offset(mirror) >> shift, 1024);122122+ case 0: zone = 0; break;123123+ case 1: zone = 1ULL << (BTRFS_SB_LOG_FIRST_SHIFT - shift); break;124124+ case 2: zone = 1ULL << (BTRFS_SB_LOG_SECOND_SHIFT - shift); break;149125 }150126151151- return 0;127127+ ASSERT(zone <= U32_MAX);128128+129129+ return (u32)zone;152130}153131154132/*···320300 zone_sectors = bdev_zone_sectors(bdev);321301 }322302323323- nr_sectors = bdev_nr_sectors(bdev);324303 /* Check if it's power of 2 (see is_power_of_2) */325304 ASSERT(zone_sectors != 0 && (zone_sectors & (zone_sectors - 1)) == 0);326305 zone_info->zone_size = zone_sectors << SECTOR_SHIFT;306306+307307+ /* We reject devices with a zone size larger than 8GB */308308+ if (zone_info->zone_size > BTRFS_MAX_ZONE_SIZE) {309309+ btrfs_err_in_rcu(fs_info,310310+ "zoned: %s: zone size %llu larger than supported maximum %llu",311311+ rcu_str_deref(device->name),312312+ zone_info->zone_size, BTRFS_MAX_ZONE_SIZE);313313+ ret = -EINVAL;314314+ goto out;315315+ }316316+317317+ nr_sectors = bdev_nr_sectors(bdev);327318 zone_info->zone_size_shift = ilog2(zone_info->zone_size);328319 zone_info->max_zone_append_size =329320 (u64)queue_max_zone_append_sectors(queue) << SECTOR_SHIFT;
+1-2
fs/cifs/Kconfig
···1818 select CRYPTO_AES1919 select CRYPTO_LIB_DES2020 select KEYS2121+ select DNS_RESOLVER2122 help2223 This is the client VFS module for the SMB3 family of NAS protocols,2324 (including support for the most recent, most secure dialect SMB3.1.1)···113112config CIFS_UPCALL114113 bool "Kerberos/SPNEGO advanced session setup"115114 depends on CIFS116116- select DNS_RESOLVER117115 help118116 Enables an upcall mechanism for CIFS which accesses userspace helper119117 utilities to provide SPNEGO packaged (RFC 4178) Kerberos tickets···179179config CIFS_DFS_UPCALL180180 bool "DFS feature support"181181 depends on CIFS182182- select DNS_RESOLVER183182 help184183 Distributed File System (DFS) support is used to access shares185184 transparently in an enterprise name space, even if the share
···8787 *8888 * This should be called with server->srv_mutex held.8989 */9090-#ifdef CONFIG_CIFS_DFS_UPCALL9190static int reconn_set_ipaddr_from_hostname(struct TCP_Server_Info *server)9291{9392 int rc;···123124 return !rc ? -1 : 0;124125}125126127127+#ifdef CONFIG_CIFS_DFS_UPCALL126128/* These functions must be called with server->srv_mutex held */127129static void reconn_set_next_dfs_target(struct TCP_Server_Info *server,128130 struct cifs_sb_info *cifs_sb,···321321#endif322322323323#ifdef CONFIG_CIFS_DFS_UPCALL324324+ if (cifs_sb && cifs_sb->origin_fullpath)324325 /*325326 * Set up next DFS target server (if any) for reconnect. If DFS326327 * feature is disabled, then we will retry last server we327328 * connected to before.328329 */329330 reconn_set_next_dfs_target(server, cifs_sb, &tgt_list, &tgt_it);331331+ else {330332#endif333333+ /*334334+ * Resolve the hostname again to make sure that IP address is up-to-date.335335+ */336336+ rc = reconn_set_ipaddr_from_hostname(server);337337+ if (rc) {338338+ cifs_dbg(FYI, "%s: failed to resolve hostname: %d\n",339339+ __func__, rc);340340+ }341341+342342+#ifdef CONFIG_CIFS_DFS_UPCALL343343+ }344344+#endif345345+331346332347#ifdef CONFIG_CIFS_SWN_UPCALL333348 }
+3-2
fs/direct-io.c
···812812 struct buffer_head *map_bh)813813{814814 int ret = 0;815815+ int boundary = sdio->boundary; /* dio_send_cur_page may clear it */815816816817 if (dio->op == REQ_OP_WRITE) {817818 /*···851850 sdio->cur_page_fs_offset = sdio->block_in_file << sdio->blkbits;852851out:853852 /*854854- * If sdio->boundary then we want to schedule the IO now to853853+ * If boundary then we want to schedule the IO now to855854 * avoid metadata seeks.856855 */857857- if (sdio->boundary) {856856+ if (boundary) {858857 ret = dio_send_cur_page(dio, sdio, map_bh);859858 if (sdio->bio)860859 dio_bio_submit(dio, sdio);
+17-4
fs/file.c
···629629}630630EXPORT_SYMBOL(close_fd); /* for ksys_close() */631631632632+/**633633+ * last_fd - return last valid index into fd table634634+ * @cur_fds: files struct635635+ *636636+ * Context: Either rcu read lock or files_lock must be held.637637+ *638638+ * Returns: Last valid index into fdtable.639639+ */640640+static inline unsigned last_fd(struct fdtable *fdt)641641+{642642+ return fdt->max_fds - 1;643643+}644644+632645static inline void __range_cloexec(struct files_struct *cur_fds,633646 unsigned int fd, unsigned int max_fd)634647{635648 struct fdtable *fdt;636649637637- if (fd > max_fd)638638- return;639639-650650+ /* make sure we're using the correct maximum value */640651 spin_lock(&cur_fds->file_lock);641652 fdt = files_fdtable(cur_fds);642642- bitmap_set(fdt->close_on_exec, fd, max_fd - fd + 1);653653+ max_fd = min(last_fd(fdt), max_fd);654654+ if (fd <= max_fd)655655+ bitmap_set(fdt->close_on_exec, fd, max_fd - fd + 1);643656 spin_unlock(&cur_fds->file_lock);644657}645658
···27622762{27632763 struct io_kiocb *req = container_of(kiocb, struct io_kiocb, rw.kiocb);27642764 struct io_async_rw *io = req->async_data;27652765+ bool check_reissue = kiocb->ki_complete == io_complete_rw;2765276627662767 /* add previously done IO, if any */27672768 if (io && io->bytes_done > 0) {···27782777 __io_complete_rw(req, ret, 0, issue_flags);27792778 else27802779 io_rw_done(kiocb, ret);27802780+27812781+ if (check_reissue && req->flags & REQ_F_REISSUE) {27822782+ req->flags &= ~REQ_F_REISSUE;27832783+ if (!io_rw_reissue(req)) {27842784+ int cflags = 0;27852785+27862786+ req_set_fail_links(req);27872787+ if (req->flags & REQ_F_BUFFER_SELECTED)27882788+ cflags = io_put_rw_kbuf(req);27892789+ __io_req_complete(req, issue_flags, ret, cflags);27902790+ }27912791+ }27812792}2782279327832794static int io_import_fixed(struct io_kiocb *req, int rw, struct iov_iter *iter)···33073294 ret = io_iter_do_read(req, iter);3308329533093296 if (ret == -EAGAIN || (req->flags & REQ_F_REISSUE)) {32973297+ req->flags &= ~REQ_F_REISSUE;33103298 /* IOPOLL retry should happen for io-wq threads */33113299 if (!force_nonblock && !(req->ctx->flags & IORING_SETUP_IOPOLL))33123300 goto done;···34313417 else34323418 ret2 = -EINVAL;3433341934343434- if (req->flags & REQ_F_REISSUE)34203420+ if (req->flags & REQ_F_REISSUE) {34213421+ req->flags &= ~REQ_F_REISSUE;34353422 ret2 = -EAGAIN;34233423+ }3436342434373425 /*34383426 * Raw bdev writes will return -EOPNOTSUPP for IOCB_NOWAIT. Just···61896173 ret = -ECANCELED;6190617461916175 if (!ret) {61926192- req->flags &= ~REQ_F_REISSUE;61936176 do {61946177 ret = io_issue_sqe(req, 0);61956178 /*
+8-6
fs/namei.c
···579579 p->stack = p->internal;580580 p->dfd = dfd;581581 p->name = name;582582+ p->path.mnt = NULL;583583+ p->path.dentry = NULL;582584 p->total_link_count = old ? old->total_link_count : 0;583585 p->saved = old;584586 current->nameidata = p;···654652 rcu_read_unlock();655653 }656654 nd->depth = 0;655655+ nd->path.mnt = NULL;656656+ nd->path.dentry = NULL;657657}658658659659/* path_put is needed afterwards regardless of success or failure */···23262322 }2327232323282324 nd->root.mnt = NULL;23292329- nd->path.mnt = NULL;23302330- nd->path.dentry = NULL;2331232523322326 /* Absolute pathname -- fetch the root (LOOKUP_IN_ROOT uses nd->dfd). */23332327 if (*s == '/' && !(flags & LOOKUP_IN_ROOT)) {···24212419 while (!(err = link_path_walk(s, nd)) &&24222420 (s = lookup_last(nd)) != NULL)24232421 ;24222422+ if (!err && unlikely(nd->flags & LOOKUP_MOUNTPOINT)) {24232423+ err = handle_lookup_down(nd);24242424+ nd->flags &= ~LOOKUP_JUMPED; // no d_weak_revalidate(), please...24252425+ }24242426 if (!err)24252427 err = complete_walk(nd);2426242824272429 if (!err && nd->flags & LOOKUP_DIRECTORY)24282430 if (!d_can_lookup(nd->path.dentry))24292431 err = -ENOTDIR;24302430- if (!err && unlikely(nd->flags & LOOKUP_MOUNTPOINT)) {24312431- err = handle_lookup_down(nd);24322432- nd->flags &= ~LOOKUP_JUMPED; // no d_weak_revalidate(), please...24332433- }24342432 if (!err) {24352433 *path = nd->path;24362434 nd->path.mnt = NULL;
+1-10
fs/ocfs2/aops.c
···22952295 struct ocfs2_alloc_context *meta_ac = NULL;22962296 handle_t *handle = NULL;22972297 loff_t end = offset + bytes;22982298- int ret = 0, credits = 0, locked = 0;22982298+ int ret = 0, credits = 0;2299229923002300 ocfs2_init_dealloc_ctxt(&dealloc);23012301···23052305 end <= i_size_read(inode) &&23062306 !dwc->dw_orphaned)23072307 goto out;23082308-23092309- /* ocfs2_file_write_iter will get i_mutex, so we need not lock if we23102310- * are in that context. */23112311- if (dwc->dw_writer_pid != task_pid_nr(current)) {23122312- inode_lock(inode);23132313- locked = 1;23142314- }2315230823162309 ret = ocfs2_inode_lock(inode, &di_bh, 1);23172310 if (ret < 0) {···23862393 if (meta_ac)23872394 ocfs2_free_alloc_context(meta_ac);23882395 ocfs2_run_deallocs(osb, &dealloc);23892389- if (locked)23902390- inode_unlock(inode);23912396 ocfs2_dio_free_write_ctx(inode, dwc);2392239723932398 return ret;
+6-2
fs/ocfs2/file.c
···12451245 goto bail_unlock;12461246 }12471247 }12481248+ down_write(&OCFS2_I(inode)->ip_alloc_sem);12481249 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS +12491250 2 * ocfs2_quota_trans_credits(sb));12501251 if (IS_ERR(handle)) {12511252 status = PTR_ERR(handle);12521253 mlog_errno(status);12531253- goto bail_unlock;12541254+ goto bail_unlock_alloc;12541255 }12551256 status = __dquot_transfer(inode, transfer_to);12561257 if (status < 0)12571258 goto bail_commit;12581259 } else {12601260+ down_write(&OCFS2_I(inode)->ip_alloc_sem);12591261 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);12601262 if (IS_ERR(handle)) {12611263 status = PTR_ERR(handle);12621264 mlog_errno(status);12631263- goto bail_unlock;12651265+ goto bail_unlock_alloc;12641266 }12651267 }12661268···1275127312761274bail_commit:12771275 ocfs2_commit_trans(osb, handle);12761276+bail_unlock_alloc:12771277+ up_write(&OCFS2_I(inode)->ip_alloc_sem);12781278bail_unlock:12791279 if (status && inode_locked) {12801280 ocfs2_inode_unlock_tracker(inode, 1, &oh, had_lock);
+1-1
include/dt-bindings/bus/moxtet.h
···22/*33 * Constant for device tree bindings for Turris Mox module configuration bus44 *55- * Copyright (C) 2019 Marek Behun <marek.behun@nic.cz>55+ * Copyright (C) 2019 Marek Behún <kabel@kernel.org>66 */7788#ifndef _DT_BINDINGS_BUS_MOXTET_H
+1-1
include/linux/armada-37xx-rwtm-mailbox.h
···22/*33 * rWTM BIU Mailbox driver for Armada 37xx44 *55- * Author: Marek Behun <marek.behun@nic.cz>55+ * Author: Marek Behún <kabel@kernel.org>66 */7788#ifndef _LINUX_ARMADA_37XX_RWTM_MAILBOX_H_
···8787int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *eti);888889899090-/**9191- * struct ethtool_link_ext_state_info - link extended state and substate.9292- */9090+/* Link extended state and substate. */9391struct ethtool_link_ext_state_info {9492 enum ethtool_link_ext_state link_ext_state;9593 union {···127129 __ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising);128130 } link_modes;129131 u32 lanes;130130- enum ethtool_link_mode_bit_indices link_mode;131132};132133133134/**···289292 * do not attach ext_substate attribute to netlink message). If link_ext_state290293 * and link_ext_substate are unknown, return -ENODATA. If not implemented,291294 * link_ext_state and link_ext_substate will not be sent to userspace.295295+ * @get_eeprom_len: Read range of EEPROM addresses for validation of296296+ * @get_eeprom and @set_eeprom requests.297297+ * Returns 0 if device does not support EEPROM access.292298 * @get_eeprom: Read data from the device EEPROM.293299 * Should fill in the magic field. Don't need to check len for zero294300 * or wraparound. Fill in the data argument with the eeprom values···384384 * @get_module_eeprom: Get the eeprom information from the plug-in module385385 * @get_eee: Get Energy-Efficient (EEE) supported and status.386386 * @set_eee: Set EEE status (enable/disable) as well as LPI timers.387387+ * @get_tunable: Read the value of a driver / device tunable.388388+ * @set_tunable: Set the value of a driver / device tunable.387389 * @get_per_queue_coalesce: Get interrupt coalescing parameters per queue.388390 * It must check that the given queue number is valid. If neither a RX nor389391 * a TX queue has this number, return -EINVAL. If only a RX queue or a TX···549547 * @get_sset_count: Get number of strings that @get_strings will write.550548 * @get_strings: Return a set of strings that describe the requested objects551549 * @get_stats: Return extended statistics about the PHY device.552552- * @start_cable_test - Start a cable test553553- * @start_cable_test_tdr - Start a Time Domain Reflectometry cable test550550+ * @start_cable_test: Start a cable test551551+ * @start_cable_test_tdr: Start a Time Domain Reflectometry cable test554552 *555553 * All operations are optional (i.e. the function pointer may be set to %NULL)556554 * and callers must take this into account. Callers must hold the RTNL lock.···573571 */574572void ethtool_set_ethtool_phy_ops(const struct ethtool_phy_ops *ops);575573574574+/*575575+ * ethtool_params_from_link_mode - Derive link parameters from a given link mode576576+ * @link_ksettings: Link parameters to be derived from the link mode577577+ * @link_mode: Link mode578578+ */579579+void580580+ethtool_params_from_link_mode(struct ethtool_link_ksettings *link_ksettings,581581+ enum ethtool_link_mode_bit_indices link_mode);576582#endif /* _LINUX_ETHTOOL_H */
···22/*33 * Turris Mox module configuration bus driver44 *55- * Copyright (C) 2019 Marek Behun <marek.behun@nic.cz>55+ * Copyright (C) 2019 Marek Behún <kabel@kernel.org>66 */7788#ifndef __LINUX_MOXTET_H
+6-1
include/linux/skmsg.h
···349349static inline void sk_psock_restore_proto(struct sock *sk,350350 struct sk_psock *psock)351351{352352- sk->sk_prot->unhash = psock->saved_unhash;353352 if (inet_csk_has_ulp(sk)) {353353+ /* TLS does not have an unhash proto in SW cases, but we need354354+ * to ensure we stop using the sock_map unhash routine because355355+ * the associated psock is being removed. So use the original356356+ * unhash handler.357357+ */358358+ WRITE_ONCE(sk->sk_prot->unhash, psock->saved_unhash);354359 tcp_update_ulp(sk, psock->sk_proto, psock->saved_write_space);355360 } else {356361 sk->sk_write_space = psock->saved_write_space;
+11-5
include/linux/virtio_net.h
···6262 return -EINVAL;6363 }64646565+ skb_reset_mac_header(skb);6666+6567 if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {6666- u16 start = __virtio16_to_cpu(little_endian, hdr->csum_start);6767- u16 off = __virtio16_to_cpu(little_endian, hdr->csum_offset);6868+ u32 start = __virtio16_to_cpu(little_endian, hdr->csum_start);6969+ u32 off = __virtio16_to_cpu(little_endian, hdr->csum_offset);7070+ u32 needed = start + max_t(u32, thlen, off + sizeof(__sum16));7171+7272+ if (!pskb_may_pull(skb, needed))7373+ return -EINVAL;68746975 if (!skb_partial_csum_set(skb, start, off))7076 return -EINVAL;71777278 p_off = skb_transport_offset(skb) + thlen;7373- if (p_off > skb_headlen(skb))7979+ if (!pskb_may_pull(skb, p_off))7480 return -EINVAL;7581 } else {7682 /* gso packets without NEEDS_CSUM do not set transport_offset.···106100 }107101108102 p_off = keys.control.thoff + thlen;109109- if (p_off > skb_headlen(skb) ||103103+ if (!pskb_may_pull(skb, p_off) ||110104 keys.basic.ip_proto != ip_proto)111105 return -EINVAL;112106113107 skb_set_transport_header(skb, keys.control.thoff);114108 } else if (gso_type) {115109 p_off = thlen;116116- if (p_off > skb_headlen(skb))110110+ if (!pskb_may_pull(skb, p_off))117111 return -EINVAL;118112 }119113 }
···2626 * have the same layout for 32-bit and 64-bit userland.2727 */28282929+/* Note on reserved space.3030+ * Reserved fields must not be accessed directly by user space because3131+ * they may be replaced by a different field in the future. They must3232+ * be initialized to zero before making the request, e.g. via memset3333+ * of the entire structure or implicitly by not being set in a structure3434+ * initializer.3535+ */3636+2937/**3038 * struct ethtool_cmd - DEPRECATED, link control and status3139 * This structure is DEPRECATED, please use struct ethtool_link_settings.···7567 * and other link features that the link partner advertised7668 * through autonegotiation; 0 if unknown or not applicable.7769 * Read-only.7070+ * @reserved: Reserved for future use; see the note on reserved space.7871 *7972 * The link speed in Mbps is split between @speed and @speed_hi. Use8073 * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to···164155 * @bus_info: Device bus address. This should match the dev_name()165156 * string for the underlying bus device, if there is one. May be166157 * an empty string.158158+ * @reserved2: Reserved for future use; see the note on reserved space.167159 * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and168160 * %ETHTOOL_SPFLAGS commands; also the number of strings in the169161 * %ETH_SS_PRIV_FLAGS set···366356 * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting367357 * its tx lpi (after reaching 'idle' state). Effective only when eee368358 * was negotiated and tx_lpi_enabled was set.359359+ * @reserved: Reserved for future use; see the note on reserved space.369360 */370361struct ethtool_eee {371362 __u32 cmd;···385374 * @cmd: %ETHTOOL_GMODULEINFO386375 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx387376 * @eeprom_len: Length of the eeprom377377+ * @reserved: Reserved for future use; see the note on reserved space.388378 *389379 * This structure is used to return the information to390380 * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.···591579 __u32 tx_pause;592580};593581594594-/**595595- * enum ethtool_link_ext_state - link extended state596596- */582582+/* Link extended state */597583enum ethtool_link_ext_state {598584 ETHTOOL_LINK_EXT_STATE_AUTONEG,599585 ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE,···605595 ETHTOOL_LINK_EXT_STATE_OVERHEAT,606596};607597608608-/**609609- * enum ethtool_link_ext_substate_autoneg - more information in addition to610610- * ETHTOOL_LINK_EXT_STATE_AUTONEG.611611- */598598+/* More information in addition to ETHTOOL_LINK_EXT_STATE_AUTONEG. */612599enum ethtool_link_ext_substate_autoneg {613600 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 1,614601 ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED,···615608 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD,616609};617610618618-/**619619- * enum ethtool_link_ext_substate_link_training - more information in addition to620620- * ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE.611611+/* More information in addition to ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE.621612 */622613enum ethtool_link_ext_substate_link_training {623614 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 1,···624619 ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT,625620};626621627627-/**628628- * enum ethtool_link_ext_substate_logical_mismatch - more information in addition629629- * to ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH.622622+/* More information in addition to ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH.630623 */631624enum ethtool_link_ext_substate_link_logical_mismatch {632625 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 1,···634631 ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED,635632};636633637637-/**638638- * enum ethtool_link_ext_substate_bad_signal_integrity - more information in639639- * addition to ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY.634634+/* More information in addition to ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY.640635 */641636enum ethtool_link_ext_substate_bad_signal_integrity {642637 ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 1,643638 ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE,644639};645640646646-/**647647- * enum ethtool_link_ext_substate_cable_issue - more information in648648- * addition to ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE.649649- */641641+/* More information in addition to ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE. */650642enum ethtool_link_ext_substate_cable_issue {651643 ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 1,652644 ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE,···659661 * now deprecated660662 * @ETH_SS_FEATURES: Device feature names661663 * @ETH_SS_RSS_HASH_FUNCS: RSS hush function names664664+ * @ETH_SS_TUNABLES: tunable names662665 * @ETH_SS_PHY_STATS: Statistic names, for use with %ETHTOOL_GPHYSTATS663666 * @ETH_SS_PHY_TUNABLES: PHY tunable names664667 * @ETH_SS_LINK_MODES: link mode names···669670 * @ETH_SS_TS_TX_TYPES: timestamping Tx types670671 * @ETH_SS_TS_RX_FILTERS: timestamping Rx filters671672 * @ETH_SS_UDP_TUNNEL_TYPES: UDP tunnel types673673+ *674674+ * @ETH_SS_COUNT: number of defined string sets672675 */673676enum ethtool_stringset {674677 ETH_SS_TEST = 0,···716715/**717716 * struct ethtool_sset_info - string set information718717 * @cmd: Command number = %ETHTOOL_GSSET_INFO718718+ * @reserved: Reserved for future use; see the note on reserved space.719719 * @sset_mask: On entry, a bitmask of string sets to query, with bits720720 * numbered according to &enum ethtool_stringset. On return, a721721 * bitmask of those string sets queried that are supported.···761759 * @flags: A bitmask of flags from &enum ethtool_test_flags. Some762760 * flags may be set by the user on entry; others may be set by763761 * the driver on return.762762+ * @reserved: Reserved for future use; see the note on reserved space.764763 * @len: On return, the number of test results765764 * @data: Array of test results766765 *···962959 * @vlan_etype: VLAN EtherType963960 * @vlan_tci: VLAN tag control information964961 * @data: user defined data962962+ * @padding: Reserved for future use; see the note on reserved space.965963 *966964 * Note, @vlan_etype, @vlan_tci, and @data are only valid if %FLOW_EXT967965 * is set in &struct ethtool_rx_flow_spec @flow_type.···11381134 * hardware hash key.11391135 * @hfunc: Defines the current RSS hash function used by HW (or to be set to).11401136 * Valid values are one of the %ETH_RSS_HASH_*.11411141- * @rsvd: Reserved for future extensions.11371137+ * @rsvd8: Reserved for future use; see the note on reserved space.11381138+ * @rsvd32: Reserved for future use; see the note on reserved space.11421139 * @rss_config: RX ring/queue index for each hash value i.e., indirection table11431140 * of @indir_size __u32 elements, followed by hash key of @key_size11441141 * bytes.···13071302 * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags13081303 * @phc_index: device index of the associated PHC, or -1 if there is none13091304 * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values13051305+ * @tx_reserved: Reserved for future use; see the note on reserved space.13101306 * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values13071307+ * @rx_reserved: Reserved for future use; see the note on reserved space.13111308 *13121309 * The bits in the 'tx_types' and 'rx_filters' fields correspond to13131310 * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,···19651958 * autonegotiation; 0 if unknown or not applicable. Read-only.19661959 * @transceiver: Used to distinguish different possible PHY types,19671960 * reported consistently by PHYLIB. Read-only.19611961+ * @master_slave_cfg: Master/slave port mode.19621962+ * @master_slave_state: Master/slave port state.19631963+ * @reserved: Reserved for future use; see the note on reserved space.19641964+ * @reserved1: Reserved for future use; see the note on reserved space.19651965+ * @link_mode_masks: Variable length bitmaps.19681966 *19691967 * If autonegotiation is disabled, the speed and @duplex represent the19701968 * fixed link mode and are writable if the driver supports multiple
+69-13
include/uapi/linux/rfkill.h
···8686 * @op: operation code8787 * @hard: hard state (0/1)8888 * @soft: soft state (0/1)8989- * @hard_block_reasons: valid if hard is set. One or several reasons from9090- * &enum rfkill_hard_block_reasons.9189 *9290 * Structure used for userspace communication on /dev/rfkill,9391 * used for events from the kernel and control to the kernel.···9698 __u8 op;9799 __u8 soft;98100 __u8 hard;101101+} __attribute__((packed));102102+103103+/**104104+ * struct rfkill_event_ext - events for userspace on /dev/rfkill105105+ * @idx: index of dev rfkill106106+ * @type: type of the rfkill struct107107+ * @op: operation code108108+ * @hard: hard state (0/1)109109+ * @soft: soft state (0/1)110110+ * @hard_block_reasons: valid if hard is set. One or several reasons from111111+ * &enum rfkill_hard_block_reasons.112112+ *113113+ * Structure used for userspace communication on /dev/rfkill,114114+ * used for events from the kernel and control to the kernel.115115+ *116116+ * See the extensibility docs below.117117+ */118118+struct rfkill_event_ext {119119+ __u32 idx;120120+ __u8 type;121121+ __u8 op;122122+ __u8 soft;123123+ __u8 hard;124124+125125+ /*126126+ * older kernels will accept/send only up to this point,127127+ * and if extended further up to any chunk marked below128128+ */129129+99130 __u8 hard_block_reasons;100131} __attribute__((packed));101132102102-/*103103- * We are planning to be backward and forward compatible with changes104104- * to the event struct, by adding new, optional, members at the end.105105- * When reading an event (whether the kernel from userspace or vice106106- * versa) we need to accept anything that's at least as large as the107107- * version 1 event size, but might be able to accept other sizes in108108- * the future.133133+/**134134+ * DOC: Extensibility109135 *110110- * One exception is the kernel -- we already have two event sizes in111111- * that we've made the 'hard' member optional since our only option112112- * is to ignore it anyway.136136+ * Originally, we had planned to allow backward and forward compatible137137+ * changes by just adding fields at the end of the structure that are138138+ * then not reported on older kernels on read(), and not written to by139139+ * older kernels on write(), with the kernel reporting the size it did140140+ * accept as the result.141141+ *142142+ * This would have allowed userspace to detect on read() and write()143143+ * which kernel structure version it was dealing with, and if was just144144+ * recompiled it would have gotten the new fields, but obviously not145145+ * accessed them, but things should've continued to work.146146+ *147147+ * Unfortunately, while actually exercising this mechanism to add the148148+ * hard block reasons field, we found that userspace (notably systemd)149149+ * did all kinds of fun things not in line with this scheme:150150+ *151151+ * 1. treat the (expected) short writes as an error;152152+ * 2. ask to read sizeof(struct rfkill_event) but then compare the153153+ * actual return value to RFKILL_EVENT_SIZE_V1 and treat any154154+ * mismatch as an error.155155+ *156156+ * As a consequence, just recompiling with a new struct version caused157157+ * things to no longer work correctly on old and new kernels.158158+ *159159+ * Hence, we've rolled back &struct rfkill_event to the original version160160+ * and added &struct rfkill_event_ext. This effectively reverts to the161161+ * old behaviour for all userspace, unless it explicitly opts in to the162162+ * rules outlined here by using the new &struct rfkill_event_ext.163163+ *164164+ * Userspace using &struct rfkill_event_ext must adhere to the following165165+ * rules166166+ *167167+ * 1. accept short writes, optionally using them to detect that it's168168+ * running on an older kernel;169169+ * 2. accept short reads, knowing that this means it's running on an170170+ * older kernel;171171+ * 3. treat reads that are as long as requested as acceptable, not172172+ * checking against RFKILL_EVENT_SIZE_V1 or such.113173 */114114-#define RFKILL_EVENT_SIZE_V1 8174174+#define RFKILL_EVENT_SIZE_V1 sizeof(struct rfkill_event)115175116176/* ioctl for turning off rfkill-input (if present) */117177#define RFKILL_IOC_MAGIC 'R'
···705705706706 printk(KERN_CONT " (");707707 __print_lock_name(class);708708- printk(KERN_CONT "){%s}-{%hd:%hd}", usage,708708+ printk(KERN_CONT "){%s}-{%d:%d}", usage,709709 class->wait_type_outer ?: class->wait_type_inner,710710 class->wait_type_inner);711711}···930930 /* Debug-check: all keys must be persistent! */931931 debug_locks_off();932932 pr_err("INFO: trying to register non-static key.\n");933933- pr_err("the code is fine but needs lockdep annotation.\n");933933+ pr_err("The code is fine but needs lockdep annotation, or maybe\n");934934+ pr_err("you didn't initialize this object before use?\n");934935 pr_err("turning off the locking correctness validator.\n");935936 dump_stack();936937 return false;
+3-2
kernel/watchdog.c
···278278 * update as well, the only side effect might be a cycle delay for279279 * the softlockup check.280280 */281281- for_each_cpu(cpu, &watchdog_allowed_mask)281281+ for_each_cpu(cpu, &watchdog_allowed_mask) {282282 per_cpu(watchdog_touch_ts, cpu) = SOFTLOCKUP_RESET;283283- wq_watchdog_touch(-1);283283+ wq_watchdog_touch(cpu);284284+ }284285}285286286287void touch_softlockup_watchdog_sync(void)
+7-12
kernel/workqueue.c
···14121412 */14131413 lockdep_assert_irqs_disabled();1414141414151415- debug_work_activate(work);1416141514171416 /* if draining, only works from the same workqueue are allowed */14181417 if (unlikely(wq->flags & __WQ_DRAINING) &&···14931494 worklist = &pwq->delayed_works;14941495 }1495149614971497+ debug_work_activate(work);14961498 insert_work(pwq, work, worklist, work_flags);1497149914981500out:···57875787 continue;5788578857895789 /* get the latest of pool and touched timestamps */57905790+ if (pool->cpu >= 0)57915791+ touched = READ_ONCE(per_cpu(wq_watchdog_touched_cpu, pool->cpu));57925792+ else57935793+ touched = READ_ONCE(wq_watchdog_touched);57905794 pool_ts = READ_ONCE(pool->watchdog_ts);57915791- touched = READ_ONCE(wq_watchdog_touched);5792579557935796 if (time_after(pool_ts, touched))57945797 ts = pool_ts;57955798 else57965799 ts = touched;57975797-57985798- if (pool->cpu >= 0) {57995799- unsigned long cpu_touched =58005800- READ_ONCE(per_cpu(wq_watchdog_touched_cpu,58015801- pool->cpu));58025802- if (time_after(cpu_touched, ts))58035803- ts = cpu_touched;58045804- }5805580058065801 /* did we stall? */58075802 if (time_after(jiffies, ts + thresh)) {···58215826{58225827 if (cpu >= 0)58235828 per_cpu(wq_watchdog_touched_cpu, cpu) = jiffies;58245824- else58255825- wq_watchdog_touched = jiffies;58295829+58305830+ wq_watchdog_touched = jiffies;58265831}5827583258285833static void wq_watchdog_set_thresh(unsigned long thresh)
+3-3
lib/Kconfig.debug
···13631363 bool13641364 depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT13651365 select STACKTRACE13661366- select FRAME_POINTER if !MIPS && !PPC && !ARM && !S390 && !MICROBLAZE && !ARC && !X8613661366+ depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X8613671367 select KALLSYMS13681368 select KALLSYMS_ALL13691369···16651665 depends on DEBUG_KERNEL16661666 depends on STACKTRACE_SUPPORT16671667 depends on PROC_FS16681668- select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X8616681668+ depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X8616691669 select KALLSYMS16701670 select KALLSYMS_ALL16711671 select STACKTRACE···19181918 depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT19191919 depends on !X86_6419201920 select STACKTRACE19211921- select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X8619211921+ depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X8619221922 help19231923 Provide stacktrace filter for fault-injection capabilities19241924
+1-1
lib/test_kasan_module.c
···2222 char *kmem;2323 char __user *usermem;2424 size_t size = 10;2525- int unused;2525+ int __maybe_unused unused;26262727 kmem = kmalloc(size, GFP_KERNEL);2828 if (!kmem)
···9797 set_page_count(page, 1);9898}9999100100+/*101101+ * When kernel touch the user page, the user page may be have been marked102102+ * poison but still mapped in user space, if without this page, the kernel103103+ * can guarantee the data integrity and operation success, the kernel is104104+ * better to check the posion status and avoid touching it, be good not to105105+ * panic, coredump for process fatal signal is a sample case matching this106106+ * scenario. Or if kernel can't guarantee the data integrity, it's better107107+ * not to call this function, let kernel touch the poison page and get to108108+ * panic.109109+ */110110+static inline bool is_page_poisoned(struct page *page)111111+{112112+ if (PageHWPoison(page))113113+ return true;114114+ else if (PageHuge(page) && PageHWPoison(compound_head(page)))115115+ return true;116116+117117+ return false;118118+}119119+100120extern unsigned long highest_memmap_pfn;101121102122/*
+3-1
mm/page_poison.c
···7777 void *addr;78787979 addr = kmap_atomic(page);8080+ kasan_disable_current();8081 /*8182 * Page poisoning when enabled poisons each and every page8283 * that is freed to buddy. Thus no extra check is done to8384 * see if a page was poisoned.8485 */8585- check_poison_mem(addr, PAGE_SIZE);8686+ check_poison_mem(kasan_reset_tag(addr), PAGE_SIZE);8787+ kasan_enable_current();8688 kunmap_atomic(addr);8789}8890
+1-1
mm/percpu-internal.h
···87878888extern struct list_head *pcpu_chunk_lists;8989extern int pcpu_nr_slots;9090-extern int pcpu_nr_empty_pop_pages;9090+extern int pcpu_nr_empty_pop_pages[];91919292extern struct pcpu_chunk *pcpu_first_chunk;9393extern struct pcpu_chunk *pcpu_reserved_chunk;
+7-2
mm/percpu-stats.c
···145145 int slot, max_nr_alloc;146146 int *buffer;147147 enum pcpu_chunk_type type;148148+ int nr_empty_pop_pages;148149149150alloc_buffer:150151 spin_lock_irq(&pcpu_lock);···166165 goto alloc_buffer;167166 }168167169169-#define PL(X) \168168+ nr_empty_pop_pages = 0;169169+ for (type = 0; type < PCPU_NR_CHUNK_TYPES; type++)170170+ nr_empty_pop_pages += pcpu_nr_empty_pop_pages[type];171171+172172+#define PL(X) \170173 seq_printf(m, " %-20s: %12lld\n", #X, (long long int)pcpu_stats_ai.X)171174172175 seq_printf(m,···201196 PU(nr_max_chunks);202197 PU(min_alloc_size);203198 PU(max_alloc_size);204204- P("empty_pop_pages", pcpu_nr_empty_pop_pages);199199+ P("empty_pop_pages", nr_empty_pop_pages);205200 seq_putc(m, '\n');206201207202#undef PU
+7-7
mm/percpu.c
···173173static LIST_HEAD(pcpu_map_extend_chunks);174174175175/*176176- * The number of empty populated pages, protected by pcpu_lock. The177177- * reserved chunk doesn't contribute to the count.176176+ * The number of empty populated pages by chunk type, protected by pcpu_lock.177177+ * The reserved chunk doesn't contribute to the count.178178 */179179-int pcpu_nr_empty_pop_pages;179179+int pcpu_nr_empty_pop_pages[PCPU_NR_CHUNK_TYPES];180180181181/*182182 * The number of populated pages in use by the allocator, protected by···556556{557557 chunk->nr_empty_pop_pages += nr;558558 if (chunk != pcpu_reserved_chunk)559559- pcpu_nr_empty_pop_pages += nr;559559+ pcpu_nr_empty_pop_pages[pcpu_chunk_type(chunk)] += nr;560560}561561562562/*···18321832 mutex_unlock(&pcpu_alloc_mutex);18331833 }1834183418351835- if (pcpu_nr_empty_pop_pages < PCPU_EMPTY_POP_PAGES_LOW)18351835+ if (pcpu_nr_empty_pop_pages[type] < PCPU_EMPTY_POP_PAGES_LOW)18361836 pcpu_schedule_balance_work();1837183718381838 /* clear the areas and return address relative to base address */···20002000 pcpu_atomic_alloc_failed = false;20012001 } else {20022002 nr_to_pop = clamp(PCPU_EMPTY_POP_PAGES_HIGH -20032003- pcpu_nr_empty_pop_pages,20032003+ pcpu_nr_empty_pop_pages[type],20042004 0, PCPU_EMPTY_POP_PAGES_HIGH);20052005 }20062006···2580258025812581 /* link the first chunk in */25822582 pcpu_first_chunk = chunk;25832583- pcpu_nr_empty_pop_pages = pcpu_first_chunk->nr_empty_pop_pages;25832583+ pcpu_nr_empty_pop_pages[PCPU_CHUNK_ROOT] = pcpu_first_chunk->nr_empty_pop_pages;25842584 pcpu_chunk_relocate(pcpu_first_chunk, -1);2585258525862586 /* include all regions of the first chunk */
···8686MODULE_AUTHOR("Oliver Hartkopp <oliver.hartkopp@volkswagen.de>");8787MODULE_ALIAS("can-proto-2");88888989+#define BCM_MIN_NAMELEN CAN_REQUIRED_SIZE(struct sockaddr_can, can_ifindex)9090+8991/*9092 * easy access to the first 64 bit of can(fd)_frame payload. cp->data is9193 * 64 bit aligned so the offset has to be multiples of 8 which is ensured···12941292 /* no bound device as default => check msg_name */12951293 DECLARE_SOCKADDR(struct sockaddr_can *, addr, msg->msg_name);1296129412971297- if (msg->msg_namelen < CAN_REQUIRED_SIZE(*addr, can_ifindex))12951295+ if (msg->msg_namelen < BCM_MIN_NAMELEN)12981296 return -EINVAL;1299129713001298 if (addr->can_family != AF_CAN)···15361534 struct net *net = sock_net(sk);15371535 int ret = 0;1538153615391539- if (len < CAN_REQUIRED_SIZE(*addr, can_ifindex))15371537+ if (len < BCM_MIN_NAMELEN)15401538 return -EINVAL;1541153915421540 lock_sock(sk);···16181616 sock_recv_ts_and_drops(msg, sk, skb);1619161716201618 if (msg->msg_name) {16211621- __sockaddr_check_size(sizeof(struct sockaddr_can));16221622- msg->msg_namelen = sizeof(struct sockaddr_can);16191619+ __sockaddr_check_size(BCM_MIN_NAMELEN);16201620+ msg->msg_namelen = BCM_MIN_NAMELEN;16231621 memcpy(msg->msg_name, skb->cb, msg->msg_namelen);16241622 }16251623
+7-4
net/can/isotp.c
···7777MODULE_AUTHOR("Oliver Hartkopp <socketcan@hartkopp.net>");7878MODULE_ALIAS("can-proto-6");79798080+#define ISOTP_MIN_NAMELEN CAN_REQUIRED_SIZE(struct sockaddr_can, can_addr.tp)8181+8082#define SINGLE_MASK(id) (((id) & CAN_EFF_FLAG) ? \8183 (CAN_EFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG) : \8284 (CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG))···988986 sock_recv_timestamp(msg, sk, skb);989987990988 if (msg->msg_name) {991991- msg->msg_namelen = sizeof(struct sockaddr_can);989989+ __sockaddr_check_size(ISOTP_MIN_NAMELEN);990990+ msg->msg_namelen = ISOTP_MIN_NAMELEN;992991 memcpy(msg->msg_name, skb->cb, msg->msg_namelen);993992 }994993···10591056 int notify_enetdown = 0;10601057 int do_rx_reg = 1;1061105810621062- if (len < CAN_REQUIRED_SIZE(struct sockaddr_can, can_addr.tp))10591059+ if (len < ISOTP_MIN_NAMELEN)10631060 return -EINVAL;1064106110651062 /* do not register frame reception for functional addressing */···11551152 if (peer)11561153 return -EOPNOTSUPP;1157115411581158- memset(addr, 0, sizeof(*addr));11551155+ memset(addr, 0, ISOTP_MIN_NAMELEN);11591156 addr->can_family = AF_CAN;11601157 addr->can_ifindex = so->ifindex;11611158 addr->can_addr.tp.rx_id = so->rxid;11621159 addr->can_addr.tp.tx_id = so->txid;1163116011641164- return sizeof(*addr);11611161+ return ISOTP_MIN_NAMELEN;11651162}1166116311671164static int isotp_setsockopt(struct socket *sock, int level, int optname,
+8-6
net/can/raw.c
···6060MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>");6161MODULE_ALIAS("can-proto-1");62626363+#define RAW_MIN_NAMELEN CAN_REQUIRED_SIZE(struct sockaddr_can, can_ifindex)6464+6365#define MASK_ALL 064666567/* A raw socket has a list of can_filters attached to it, each receiving···396394 int err = 0;397395 int notify_enetdown = 0;398396399399- if (len < CAN_REQUIRED_SIZE(*addr, can_ifindex))397397+ if (len < RAW_MIN_NAMELEN)400398 return -EINVAL;401399 if (addr->can_family != AF_CAN)402400 return -EINVAL;···477475 if (peer)478476 return -EOPNOTSUPP;479477480480- memset(addr, 0, sizeof(*addr));478478+ memset(addr, 0, RAW_MIN_NAMELEN);481479 addr->can_family = AF_CAN;482480 addr->can_ifindex = ro->ifindex;483481484484- return sizeof(*addr);482482+ return RAW_MIN_NAMELEN;485483}486484487485static int raw_setsockopt(struct socket *sock, int level, int optname,···741739 if (msg->msg_name) {742740 DECLARE_SOCKADDR(struct sockaddr_can *, addr, msg->msg_name);743741744744- if (msg->msg_namelen < CAN_REQUIRED_SIZE(*addr, can_ifindex))742742+ if (msg->msg_namelen < RAW_MIN_NAMELEN)745743 return -EINVAL;746744747745 if (addr->can_family != AF_CAN)···834832 sock_recv_ts_and_drops(msg, sk, skb);835833836834 if (msg->msg_name) {837837- __sockaddr_check_size(sizeof(struct sockaddr_can));838838- msg->msg_namelen = sizeof(struct sockaddr_can);835835+ __sockaddr_check_size(RAW_MIN_NAMELEN);836836+ msg->msg_namelen = RAW_MIN_NAMELEN;839837 memcpy(msg->msg_name, skb->cb, msg->msg_namelen);840838 }841839
+2-1
net/core/dev.c
···6992699269936993 set_current_state(TASK_INTERRUPTIBLE);6994699469956995- while (!kthread_should_stop() && !napi_disable_pending(napi)) {69956995+ while (!kthread_should_stop()) {69966996 /* Testing SCHED_THREADED bit here to make sure the current69976997 * kthread owns this napi and could poll on this napi.69986998 * Testing SCHED bit is not enough because SCHED bit might be···70107010 set_current_state(TASK_INTERRUPTIBLE);70117011 }70127012 __set_current_state(TASK_RUNNING);70137013+70137014 return -1;70147015}70157016
+1-1
net/core/neighbour.c
···13791379 * we can reinject the packet there.13801380 */13811381 n2 = NULL;13821382- if (dst) {13821382+ if (dst && dst->obsolete != DST_OBSOLETE_DEAD) {13831383 n2 = dst_neigh_lookup_skb(dst, skb);13841384 if (n2)13851385 n1 = n2;
···488488 if (unlikely(!msg))489489 return -EAGAIN;490490 sk_msg_init(msg);491491+ skb_set_owner_r(skb, sk);491492 return sk_psock_skb_ingress_enqueue(skb, psock, sk, msg);492493}493494···791790{792791 switch (verdict) {793792 case __SK_REDIRECT:794794- skb_set_owner_r(skb, sk);795793 sk_psock_skb_redirect(skb);796794 break;797795 case __SK_PASS:···808808 rcu_read_lock();809809 prog = READ_ONCE(psock->progs.skb_verdict);810810 if (likely(prog)) {811811- /* We skip full set_owner_r here because if we do a SK_PASS812812- * or SK_DROP we can skip skb memory accounting and use the813813- * TLS context.814814- */815811 skb->sk = psock->sk;816812 tcp_skb_bpf_redirect_clear(skb);817813 ret = sk_psock_bpf_run(psock, prog, skb);···876880 kfree_skb(skb);877881 goto out;878882 }879879- skb_set_owner_r(skb, sk);880883 prog = READ_ONCE(psock->progs.skb_verdict);881884 if (likely(prog)) {885885+ skb->sk = sk;882886 tcp_skb_bpf_redirect_clear(skb);883887 ret = sk_psock_bpf_run(psock, prog, skb);884888 ret = sk_psock_map_verd(ret, tcp_skb_bpf_redirect_fetch(skb));889889+ skb->sk = NULL;885890 }886891 sk_psock_verdict_apply(psock, skb, ret);887892out:···953956 kfree_skb(skb);954957 goto out;955958 }956956- skb_set_owner_r(skb, sk);957959 prog = READ_ONCE(psock->progs.skb_verdict);958960 if (likely(prog)) {961961+ skb->sk = sk;959962 tcp_skb_bpf_redirect_clear(skb);960963 ret = sk_psock_bpf_run(psock, prog, skb);961964 ret = sk_psock_map_verd(ret, tcp_skb_bpf_redirect_fetch(skb));965965+ skb->sk = NULL;962966 }963967 sk_psock_verdict_apply(psock, skb, ret);964968out:
+3-9
net/core/sock.c
···21322132 if (skb_is_tcp_pure_ack(skb))21332133 return;2134213421352135- if (can_skb_orphan_partial(skb)) {21362136- struct sock *sk = skb->sk;21372137-21382138- if (refcount_inc_not_zero(&sk->sk_refcnt)) {21392139- WARN_ON(refcount_sub_and_test(skb->truesize, &sk->sk_wmem_alloc));21402140- skb->destructor = sock_efree;21412141- }21422142- } else {21352135+ if (can_skb_orphan_partial(skb))21362136+ skb_set_owner_sk_safe(skb, skb->sk);21372137+ else21432138 skb_orphan(skb);21442144- }21452139}21462140EXPORT_SYMBOL(skb_orphan_partial);21472141
+2-1
net/core/xdp.c
···350350 /* mem->id is valid, checked in xdp_rxq_info_reg_mem_model() */351351 xa = rhashtable_lookup(mem_id_ht, &mem->id, mem_id_rht_params);352352 page = virt_to_head_page(data);353353- napi_direct &= !xdp_return_frame_no_direct();353353+ if (napi_direct && xdp_return_frame_no_direct())354354+ napi_direct = false;354355 page_pool_put_full_page(xa->page_pool, page, napi_direct);355356 rcu_read_unlock();356357 break;
+7-1
net/dsa/dsa2.c
···795795796796 list_for_each_entry(dp, &dst->ports, list) {797797 err = dsa_port_setup(dp);798798- if (err)798798+ if (err) {799799+ dsa_port_devlink_teardown(dp);800800+ dp->type = DSA_PORT_TYPE_UNUSED;801801+ err = dsa_port_devlink_setup(dp);802802+ if (err)803803+ goto teardown;799804 continue;805805+ }800806 }801807802808 return 0;
+9-6
net/dsa/switch.c
···107107 bool unset_vlan_filtering = br_vlan_enabled(info->br);108108 struct dsa_switch_tree *dst = ds->dst;109109 struct netlink_ext_ack extack = {0};110110- int err, i;110110+ int err, port;111111112112 if (dst->index == info->tree_index && ds->index == info->sw_index &&113113 ds->ops->port_bridge_join)···124124 * it. That is a good thing, because that lets us handle it and also125125 * handle the case where the switch's vlan_filtering setting is global126126 * (not per port). When that happens, the correct moment to trigger the127127- * vlan_filtering callback is only when the last port left this bridge.127127+ * vlan_filtering callback is only when the last port leaves the last128128+ * VLAN-aware bridge.128129 */129130 if (unset_vlan_filtering && ds->vlan_filtering_is_global) {130130- for (i = 0; i < ds->num_ports; i++) {131131- if (i == info->port)132132- continue;133133- if (dsa_to_port(ds, i)->bridge_dev == info->br) {131131+ for (port = 0; port < ds->num_ports; port++) {132132+ struct net_device *bridge_dev;133133+134134+ bridge_dev = dsa_to_port(ds, port)->bridge_dev;135135+136136+ if (bridge_dev && br_vlan_enabled(bridge_dev)) {134137 unset_vlan_filtering = false;135138 break;136139 }
···27542754 val = up->gso_size;27552755 break;2756275627572757+ case UDP_GRO:27582758+ val = up->gro_enabled;27592759+ break;27602760+27572761 /* The following two cannot be changed on UDP sockets, the return is27582762 * always 0 (which corresponds to the full checksum coverage of UDP). */27592763 case UDPLITE_SEND_CSCOV:
+26-6
net/ipv6/addrconf.c
···56695669 return 0;56705670}5671567156725672-static int inet6_set_iftoken(struct inet6_dev *idev, struct in6_addr *token)56725672+static int inet6_set_iftoken(struct inet6_dev *idev, struct in6_addr *token,56735673+ struct netlink_ext_ack *extack)56735674{56745675 struct inet6_ifaddr *ifp;56755676 struct net_device *dev = idev->dev;···5681568056825681 if (!token)56835682 return -EINVAL;56845684- if (dev->flags & (IFF_LOOPBACK | IFF_NOARP))56835683+56845684+ if (dev->flags & IFF_LOOPBACK) {56855685+ NL_SET_ERR_MSG_MOD(extack, "Device is loopback");56855686 return -EINVAL;56865686- if (!ipv6_accept_ra(idev))56875687+ }56885688+56895689+ if (dev->flags & IFF_NOARP) {56905690+ NL_SET_ERR_MSG_MOD(extack,56915691+ "Device does not do neighbour discovery");56875692 return -EINVAL;56885688- if (idev->cnf.rtr_solicits == 0)56935693+ }56945694+56955695+ if (!ipv6_accept_ra(idev)) {56965696+ NL_SET_ERR_MSG_MOD(extack,56975697+ "Router advertisement is disabled on device");56895698 return -EINVAL;56995699+ }57005700+57015701+ if (idev->cnf.rtr_solicits == 0) {57025702+ NL_SET_ERR_MSG(extack,57035703+ "Router solicitation is disabled on device");57045704+ return -EINVAL;57055705+ }5690570656915707 write_lock_bh(&idev->lock);56925708···58115793 return 0;58125794}5813579558145814-static int inet6_set_link_af(struct net_device *dev, const struct nlattr *nla)57965796+static int inet6_set_link_af(struct net_device *dev, const struct nlattr *nla,57975797+ struct netlink_ext_ack *extack)58155798{58165799 struct inet6_dev *idev = __in6_dev_get(dev);58175800 struct nlattr *tb[IFLA_INET6_MAX + 1];···58255806 BUG();5826580758275808 if (tb[IFLA_INET6_TOKEN]) {58285828- err = inet6_set_iftoken(idev, nla_data(tb[IFLA_INET6_TOKEN]));58095809+ err = inet6_set_iftoken(idev, nla_data(tb[IFLA_INET6_TOKEN]),58105810+ extack);58295811 if (err)58305812 return err;58315813 }
···52095209 * nexthops have been replaced by first new, the rest should52105210 * be added to it.52115211 */52125212- cfg->fc_nlinfo.nlh->nlmsg_flags &= ~(NLM_F_EXCL |52135213- NLM_F_REPLACE);52145214- cfg->fc_nlinfo.nlh->nlmsg_flags |= NLM_F_CREATE;52125212+ if (cfg->fc_nlinfo.nlh) {52135213+ cfg->fc_nlinfo.nlh->nlmsg_flags &= ~(NLM_F_EXCL |52145214+ NLM_F_REPLACE);52155215+ cfg->fc_nlinfo.nlh->nlmsg_flags |= NLM_F_CREATE;52165216+ }52155217 nhn++;52165218 }52175219
+3-1
net/mac80211/cfg.c
···17881788 }1789178917901790 if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&17911791- sta->sdata->u.vlan.sta)17911791+ sta->sdata->u.vlan.sta) {17921792+ ieee80211_clear_fast_rx(sta);17921793 RCU_INIT_POINTER(sta->sdata->u.vlan.sta, NULL);17941794+ }1793179517941796 if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))17951797 ieee80211_vif_dec_num_mcast(sta->sdata);
+4-1
net/mac80211/mlme.c
···47074707 timeout = sta->rx_stats.last_rx;47084708 timeout += IEEE80211_CONNECTION_IDLE_TIME;4709470947104710- if (time_is_before_jiffies(timeout)) {47104710+ /* If timeout is after now, then update timer to fire at47114711+ * the later date, but do not actually probe at this time.47124712+ */47134713+ if (time_is_after_jiffies(timeout)) {47114714 mod_timer(&ifmgd->conn_mon_timer, round_jiffies_up(timeout));47124715 return;47134716 }
+1-1
net/mac80211/tx.c
···35733573 test_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txqi->flags))35743574 goto out;3575357535763576- if (vif->txqs_stopped[ieee80211_ac_from_tid(txq->tid)]) {35763576+ if (vif->txqs_stopped[txq->ac]) {35773577 set_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txqi->flags);35783578 goto out;35793579 }
+1-1
net/mac802154/llsec.c
···152152 crypto_free_sync_skcipher(key->tfm0);153153err_tfm:154154 for (i = 0; i < ARRAY_SIZE(key->tfm); i++)155155- if (key->tfm[i])155155+ if (!IS_ERR_OR_NULL(key->tfm[i]))156156 crypto_free_aead(key->tfm[i]);157157158158 kfree_sensitive(key);
+47-53
net/mptcp/protocol.c
···1111#include <linux/netdevice.h>1212#include <linux/sched/signal.h>1313#include <linux/atomic.h>1414-#include <linux/igmp.h>1514#include <net/sock.h>1615#include <net/inet_common.h>1716#include <net/inet_hashtables.h>···1920#include <net/tcp_states.h>2021#if IS_ENABLED(CONFIG_MPTCP_IPV6)2122#include <net/transp_v6.h>2222-#include <net/addrconf.h>2323#endif2424#include <net/mptcp.h>2525#include <net/xfrm.h>···28762878 return ret;28772879}2878288028812881+static bool mptcp_unsupported(int level, int optname)28822882+{28832883+ if (level == SOL_IP) {28842884+ switch (optname) {28852885+ case IP_ADD_MEMBERSHIP:28862886+ case IP_ADD_SOURCE_MEMBERSHIP:28872887+ case IP_DROP_MEMBERSHIP:28882888+ case IP_DROP_SOURCE_MEMBERSHIP:28892889+ case IP_BLOCK_SOURCE:28902890+ case IP_UNBLOCK_SOURCE:28912891+ case MCAST_JOIN_GROUP:28922892+ case MCAST_LEAVE_GROUP:28932893+ case MCAST_JOIN_SOURCE_GROUP:28942894+ case MCAST_LEAVE_SOURCE_GROUP:28952895+ case MCAST_BLOCK_SOURCE:28962896+ case MCAST_UNBLOCK_SOURCE:28972897+ case MCAST_MSFILTER:28982898+ return true;28992899+ }29002900+ return false;29012901+ }29022902+ if (level == SOL_IPV6) {29032903+ switch (optname) {29042904+ case IPV6_ADDRFORM:29052905+ case IPV6_ADD_MEMBERSHIP:29062906+ case IPV6_DROP_MEMBERSHIP:29072907+ case IPV6_JOIN_ANYCAST:29082908+ case IPV6_LEAVE_ANYCAST:29092909+ case MCAST_JOIN_GROUP:29102910+ case MCAST_LEAVE_GROUP:29112911+ case MCAST_JOIN_SOURCE_GROUP:29122912+ case MCAST_LEAVE_SOURCE_GROUP:29132913+ case MCAST_BLOCK_SOURCE:29142914+ case MCAST_UNBLOCK_SOURCE:29152915+ case MCAST_MSFILTER:29162916+ return true;29172917+ }29182918+ return false;29192919+ }29202920+ return false;29212921+}29222922+28792923static int mptcp_setsockopt(struct sock *sk, int level, int optname,28802924 sockptr_t optval, unsigned int optlen)28812925{···29252885 struct sock *ssk;2926288629272887 pr_debug("msk=%p", msk);28882888+28892889+ if (mptcp_unsupported(level, optname))28902890+ return -ENOPROTOOPT;2928289129292892 if (level == SOL_SOCKET)29302893 return mptcp_setsockopt_sol_socket(msk, optname, optval, optlen);···34623419 return mask;34633420}3464342134653465-static int mptcp_release(struct socket *sock)34663466-{34673467- struct mptcp_subflow_context *subflow;34683468- struct sock *sk = sock->sk;34693469- struct mptcp_sock *msk;34703470-34713471- if (!sk)34723472- return 0;34733473-34743474- lock_sock(sk);34753475-34763476- msk = mptcp_sk(sk);34773477-34783478- mptcp_for_each_subflow(msk, subflow) {34793479- struct sock *ssk = mptcp_subflow_tcp_sock(subflow);34803480-34813481- ip_mc_drop_socket(ssk);34823482- }34833483-34843484- release_sock(sk);34853485-34863486- return inet_release(sock);34873487-}34883488-34893422static const struct proto_ops mptcp_stream_ops = {34903423 .family = PF_INET,34913424 .owner = THIS_MODULE,34923492- .release = mptcp_release,34253425+ .release = inet_release,34933426 .bind = mptcp_bind,34943427 .connect = mptcp_stream_connect,34953428 .socketpair = sock_no_socketpair,···35573538}3558353935593540#if IS_ENABLED(CONFIG_MPTCP_IPV6)35603560-static int mptcp6_release(struct socket *sock)35613561-{35623562- struct mptcp_subflow_context *subflow;35633563- struct mptcp_sock *msk;35643564- struct sock *sk = sock->sk;35653565-35663566- if (!sk)35673567- return 0;35683568-35693569- lock_sock(sk);35703570-35713571- msk = mptcp_sk(sk);35723572-35733573- mptcp_for_each_subflow(msk, subflow) {35743574- struct sock *ssk = mptcp_subflow_tcp_sock(subflow);35753575-35763576- ip_mc_drop_socket(ssk);35773577- ipv6_sock_mc_close(ssk);35783578- ipv6_sock_ac_close(ssk);35793579- }35803580-35813581- release_sock(sk);35823582- return inet6_release(sock);35833583-}35843584-35853541static const struct proto_ops mptcp_v6_stream_ops = {35863542 .family = PF_INET6,35873543 .owner = THIS_MODULE,35883588- .release = mptcp6_release,35443544+ .release = inet6_release,35893545 .bind = mptcp_bind,35903546 .connect = mptcp_stream_connect,35913547 .socketpair = sock_no_socketpair,
···16751675 cl->parent->common.classid,16761676 NULL);16771677 if (q->offload) {16781678- if (new_q)16781678+ if (new_q) {16791679 htb_set_lockdep_class_child(new_q);16801680- htb_parent_to_leaf_offload(sch, dev_queue, new_q);16801680+ htb_parent_to_leaf_offload(sch, dev_queue, new_q);16811681+ }16811682 }16821683 }16831684
+3
net/sched/sch_teql.c
···134134 struct teql_sched_data *dat = qdisc_priv(sch);135135 struct teql_master *master = dat->m;136136137137+ if (!master)138138+ return;139139+137140 prev = master->slaves;138141 if (prev) {139142 do {
+3-4
net/sctp/ipv6.c
···664664 if (!(type & IPV6_ADDR_UNICAST))665665 return 0;666666667667- return sp->inet.freebind || net->ipv6.sysctl.ip_nonlocal_bind ||668668- ipv6_chk_addr(net, in6, NULL, 0);667667+ return ipv6_can_nonlocal_bind(net, &sp->inet) ||668668+ ipv6_chk_addr(net, in6, NULL, 0);669669}670670671671/* This function checks if the address is a valid address to be used for···954954 net = sock_net(&opt->inet.sk);955955 rcu_read_lock();956956 dev = dev_get_by_index_rcu(net, addr->v6.sin6_scope_id);957957- if (!dev || !(opt->inet.freebind ||958958- net->ipv6.sysctl.ip_nonlocal_bind ||957957+ if (!dev || !(ipv6_can_nonlocal_bind(net, &opt->inet) ||959958 ipv6_chk_addr(net, &addr->v6.sin6_addr,960959 dev, 0))) {961960 rcu_read_unlock();
+3-3
net/tipc/bearer.h
···154154 * care of initializing all other fields.155155 */156156struct tipc_bearer {157157- void __rcu *media_ptr; /* initalized by media */158158- u32 mtu; /* initalized by media */159159- struct tipc_media_addr addr; /* initalized by media */157157+ void __rcu *media_ptr; /* initialized by media */158158+ u32 mtu; /* initialized by media */159159+ struct tipc_media_addr addr; /* initialized by media */160160 char name[TIPC_MAX_BEARER_NAME];161161 struct tipc_media *media;162162 struct tipc_media_addr bcast_addr;
···8989 * - A spin lock to protect the registry of kernel/driver users (reg.c)9090 * - A global spin_lock (tipc_port_lock), which only task is to ensure9191 * consistency where more than one port is involved in an operation,9292- * i.e., whe a port is part of a linked list of ports.9292+ * i.e., when a port is part of a linked list of ports.9393 * There are two such lists; 'port_list', which is used for management,9494 * and 'wait_list', which is used to queue ports during congestion.9595 *
+1-1
net/tipc/node.c
···17341734}1735173517361736/* tipc_node_xmit_skb(): send single buffer to destination17371737- * Buffers sent via this functon are generally TIPC_SYSTEM_IMPORTANCE17371737+ * Buffers sent via this function are generally TIPC_SYSTEM_IMPORTANCE17381738 * messages, which will not be rejected17391739 * The only exception is datagram messages rerouted after secondary17401740 * lookup, which are rare and safe to dispose of anyway.
···15711571 return -ENOMEM;15721572 kctl->id.device = dev;15731573 kctl->id.subdevice = substr;15741574+15751575+ /* Add the control before copying the id so that15761576+ * the numid field of the id is set in the copy.15771577+ */15781578+ err = snd_ctl_add(card, kctl);15791579+ if (err < 0)15801580+ return err;15811581+15741582 switch (idx) {15751583 case ACTIVE_IDX:15761584 setup->active_id = kctl->id;···15951587 default:15961588 break;15971589 }15981598- err = snd_ctl_add(card, kctl);15991599- if (err < 0)16001600- return err;16011590 }16021591 }16031592 }
···13481348 &cygnus_ssp_dai[active_port_count]);1349134913501350 /* negative is err, 0 is active and good, 1 is disabled */13511351- if (err < 0)13511351+ if (err < 0) {13521352+ of_node_put(child_node);13521353 return err;13541354+ }13531355 else if (!err) {13541356 dev_dbg(dev, "Activating DAI: %s\n",13551357 cygnus_ssp_dai[active_port_count].name);
+1-1
sound/soc/codecs/lpass-rx-macro.c
···3551355135523552 /* set MCLK and NPL rates */35533553 clk_set_rate(rx->clks[2].clk, MCLK_FREQ);35543554- clk_set_rate(rx->clks[3].clk, MCLK_FREQ);35543554+ clk_set_rate(rx->clks[3].clk, 2 * MCLK_FREQ);3555355535563556 ret = clk_bulk_prepare_enable(RX_NUM_CLKS_MAX, rx->clks);35573557 if (ret)
+1-1
sound/soc/codecs/lpass-tx-macro.c
···1811181118121812 /* set MCLK and NPL rates */18131813 clk_set_rate(tx->clks[2].clk, MCLK_FREQ);18141814- clk_set_rate(tx->clks[3].clk, MCLK_FREQ);18141814+ clk_set_rate(tx->clks[3].clk, 2 * MCLK_FREQ);1815181518161816 ret = clk_bulk_prepare_enable(TX_NUM_CLKS_MAX, tx->clks);18171817 if (ret)
+1
sound/soc/codecs/max98373-i2c.c
···446446 case MAX98373_R2054_MEAS_ADC_PVDD_CH_READBACK:447447 case MAX98373_R2055_MEAS_ADC_THERM_CH_READBACK:448448 case MAX98373_R20B6_BDE_CUR_STATE_READBACK:449449+ case MAX98373_R20FF_GLOBAL_SHDN:449450 case MAX98373_R21FF_REV_ID:450451 return true;451452 default:
+1
sound/soc/codecs/max98373-sdw.c
···220220 case MAX98373_R2054_MEAS_ADC_PVDD_CH_READBACK:221221 case MAX98373_R2055_MEAS_ADC_THERM_CH_READBACK:222222 case MAX98373_R20B6_BDE_CUR_STATE_READBACK:223223+ case MAX98373_R20FF_GLOBAL_SHDN:223224 case MAX98373_R21FF_REV_ID:224225 /* SoundWire Control Port Registers */225226 case MAX98373_R0040_SCP_INIT_STAT_1 ... MAX98373_R0070_SCP_FRAME_CTLR:
···707707 best_freq_out = -EINVAL;708708 *sysclk_idx = *dac_idx = *bclk_idx = -1;709709710710- for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) {710710+ /*711711+ * From Datasheet, the PLL performs best when f2 is between712712+ * 90MHz and 100MHz, the desired sysclk output is 11.2896MHz713713+ * or 12.288MHz, then sysclkdiv = 2 is the best choice.714714+ * So search sysclk_divs from 2 to 1 other than from 1 to 2.715715+ */716716+ for (i = ARRAY_SIZE(sysclk_divs) - 1; i >= 0; --i) {711717 if (sysclk_divs[i] == -1)712718 continue;713719 for (j = 0; j < ARRAY_SIZE(dac_divs); ++j) {
+5-3
sound/soc/fsl/fsl_esai.c
···519519 ESAI_SAICR_SYNC, esai_priv->synchronous ?520520 ESAI_SAICR_SYNC : 0);521521522522- /* Set a default slot number -- 2 */522522+ /* Set slots count */523523 regmap_update_bits(esai_priv->regmap, REG_ESAI_TCCR,524524- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2));524524+ ESAI_xCCR_xDC_MASK,525525+ ESAI_xCCR_xDC(esai_priv->slots));525526 regmap_update_bits(esai_priv->regmap, REG_ESAI_RCCR,526526- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2));527527+ ESAI_xCCR_xDC_MASK,528528+ ESAI_xCCR_xDC(esai_priv->slots));527529 }528530529531 return 0;