1. 09 Feb, 2023 3 commits
    • Douglas Anderson's avatar
      HID: i2c-hid: goodix: Add mainboard-vddio-supply · eb16f59e
      Douglas Anderson authored
      As talked about in the patch ("dt-bindings: HID: i2c-hid: goodix: Add
      mainboard-vddio-supply") we may need to power up a 1.8V rail on the
      host associated with touchscreen IO. Let's add support in the driver
      for it.
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Reviewed-by: default avatarMatthias Kaehlcke <mka@chromium.org>
      Link: https://lore.kernel.org/r/20230206184744.6.Ic234b931025d1f920ce9e06fff294643943a65ad@changeidSigned-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      eb16f59e
    • Douglas Anderson's avatar
      dt-bindings: HID: i2c-hid: goodix: Add mainboard-vddio-supply · 1d18c1f3
      Douglas Anderson authored
      The goodix i2c-hid bindings currently support two models of
      touchscreen: GT7375P and GT7986U. The datasheets of both touchscreens
      show the following things:
      * The mainboard that the touchscreen is connected to is only expected
        to supply one voltage to the touchscreen: 3.3V.
      * The touchscreen, depending on stuffing options, can accept IO to the
        touchscreen as either 3.3V or 1.8V. Presumably this means that the
        touchscreen has its own way internally to make or deal with 1.8V
        signals when it's configured for 1.8V IO.
      
      NOTE: you've got to look very carefully at the datasheet for the
      touchscreen to see that the above bullets are true. Specifically, the
      datasheet shows a signal called VDDIO and one might think that this is
      where a mainboard would provide VDDIO to the touchscreen. Upon closer
      inspection, however, a footnote can be found that says "When VDDIO is
      left floating, the logic level is 1.8V [...]; when VDDIO is connected
      to AVDD, the logic level is AVDD.". Thus the VDDIO pin on the
      touchscreen IC is actually a selector and not a pin whre the mainboard
      would pass a reference voltage.
      
      The fact that the touchscreen isn't supplied 1.8V by the mainboard
      means that when I originally submitted bindings for these touchscreens
      I only listed the 3.3V rail in the bindings. It can be noted that the
      original bindings and driver were added for sc7180-trogdor boards and
      these boards all use 3.3V IO via a level shifter on the mainboard.
      
      It turns out that with sc7280-herobrine-evoker, we've got a bit of a
      strange monkey on our hands. Due to some very interesting but
      (unfortunately) set-in-stone hardware design, we are doing 1.8V IO to
      the touchscreen but we _also_ have some extra buffers on the mainboard
      that need to be powered up to make the IO lines work. After much
      pondering about this, it seems like the best way to handle this is to
      add an optional "mainboard-vddio" rail to the bindings that is used to
      power up the buffers. Specifically, the fact that the touchscreen
      datasheet documents that its IOs can be at a different voltage level
      than its main power rail means that there truly are two voltage rails
      associated with the touchscreen, even if we don't actually provide the
      IO rail to it. Thus it doesn't feel absurd for the DT node on the host
      to have a 1.8V rail to power up anything related to its 1.8V logic.
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20230206184744.5.Ia77a96c6c5564f9cc25e6220b5a9171d5c2639e8@changeidSigned-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      1d18c1f3
    • Douglas Anderson's avatar
      HID: i2c-hid: goodix: Stop tying the reset line to the regulator · 557e05fa
      Douglas Anderson authored
      In commit 18eeef46 ("HID: i2c-hid: goodix: Tie the reset line to
      true state of the regulator"), we started tying the reset line of
      Goodix touchscreens to the regulator.
      
      The primary motivation for that patch was some pre-production hardware
      (specifically sc7180-trogdor-homestar) where it was proposed to hook
      the touchscreen's main 3.3V power rail to an always-on supply. In such
      a case, when we turned "off" the touchscreen in Linux it was bad to
      assert the "reset" GPIO because that was causing a power drain. The
      patch accomplished that goal and did it in a general sort of way that
      didn't require special properties to be added in the device tree for
      homestar.
      
      It turns out that the design of using an always-on power rail for the
      touchscreen was rejected soon after the patch was written and long
      before sc7180-trogdor-homestar went into production. The final design
      of homestar actually fully separates the rail for the touchscreen and
      the display panel and both can be powered off and on. That means that
      the original motivation for the feature is gone.
      
      There are 3 other users of the goodix i2c-hid driver in mainline.
      
      I'll first talk about 2 of the other users in mainline: coachz and
      mrbland. On both coachz and mrbland the touchscreen power and panel
      power _are_ shared. That means that the patch to tie the reset line to
      the true state of the regulator _is_ doing something on those
      boards. Specifically, the patch reduced power consumption by tens of
      mA in the case where we turned the touchscreen off but left the panel
      on. Other than saving a small bit of power, the patch wasn't truly
      necessary. That being said, even though a small bit of power was saved
      in the state of "panel on + touchscreen off", that's not actually a
      state we ever expect to be in, except perhaps for very short periods
      of time at boot or during suspend/resume. Thus, the patch is truly not
      necessary. It should be further noted that, as documented in the
      original patch, the current code still didn't optimize power for every
      corner case of the "shared rail" situation.
      
      The last user in mainline was very recently added: evoker. Evoker is
      actually the motivation for me removing this bit of code. It turns out
      that for evoker we need to manage a second power rail for IO to the
      touchscreen. Trying to fit the management of this IO rail into the
      regulator notifiers turns out to be extremely hard. To avoid lockdep
      splats you shouldn't enable/disable other regulators in regulator
      notifiers and trying to find a way around this was going to be fairly
      difficult.
      
      Given the lack of any true motivation to tie the reset line to the
      regulator, lets go back to the simpler days and remove the code. This
      is, effectively, a revert of commit bdbc65eb77ee ("HID: i2c-hid:
      goodix: Fix a lockdep splat"), commit 25ddd7cf ("HID: i2c-hid:
      goodix: Use the devm variant of regulator_register_notifier()"), and
      commit 18eeef46 ("HID: i2c-hid: goodix: Tie the reset line to true
      state of the regulator").
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarMatthias Kaehlcke <mka@chromium.org>
      Reviewed-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Link: https://lore.kernel.org/r/20230206184744.4.I085b32b6140c7d1ac4e7e97b712bff9dd5962b62@changeidSigned-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      557e05fa
  2. 18 Jan, 2023 4 commits
  3. 21 Dec, 2022 12 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus-2022122101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · d264dd3b
      Linus Torvalds authored
      Pull HID updates from Benjamin Tissoires:
      
       - Four potential NULL pointers dereferences (Bastien Nocera, Enrik
         Berkhan, Jiasheng Jiang and Roderick Colenbrander)
      
       - Allow Wacom devices in bootloader mode to be flashed (Jason Gerecke)
      
       - Some assorted devices quirks (José Expósito and Terry Junge)
      
      * tag 'for-linus-2022122101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: sony: Fix unused function warning
        HID: plantronics: Additional PIDs for double volume key presses quirk
        HID: multitouch: fix Asus ExpertBook P2 P2451FA trackpoint
        HID: Ignore HP Envy x360 eu0009nv stylus battery
        HID: wacom: Ensure bootloader PID is usable in hidraw mode
        HID: amd_sfh: Add missing check for dma_alloc_coherent
        HID: playstation: fix free of uninialized pointer for DS4 in Bluetooth.
        HID: mcp2221: don't connect hidraw
        HID: logitech-hidpp: Guard FF init code against non-USB devices
      d264dd3b
    • Linus Torvalds's avatar
      Merge tag 'media/v6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · 5461e079
      Linus Torvalds authored
      Pull media fixes from Mauro Carvalho Chehab:
      
       - A regression at V4L2 core breaking string controls
      
       - Build warning fixes on sun6i drivers when building with clang
      
      * tag 'media/v6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
        media: sun6i-isp: params: Unregister pending buffer on cleanup
        media: sun6i-isp: params: Fix incorrect indentation
        media: sun6i-isp: capture: Fix uninitialized variable use
        media: sun6i-isp: proc: Declare subdev ops as static
        media: sun6i-isp: proc: Error out on invalid port to fix warning
        media: sun6i-isp: proc: Fix return code handling in stream off path
        media: sun8i-a83t-mipi-csi2: Clarify return code handling in stream off path
        media: sun6i-mipi-csi2: Clarify return code handling in stream off path
        media: sun6i-csi: capture: Remove useless ret initialization
        media: sun6i-csi: bridge: Error out on invalid port to fix warning
        media: v4l2-ctrls-api.c: add back dropped ctrl->is_new = 1
      5461e079
    • Linus Torvalds's avatar
      Merge tag 'pwm/for-6.2-rc1' of... · 7a693ea7
      Linus Torvalds authored
      Merge tag 'pwm/for-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
      
      Pull pwm updates from Thierry Reding:
       "Various changes across the board, mostly improvements and cleanups"
      
      * tag 'pwm/for-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (42 commits)
        pwm: pca9685: Convert to i2c's .probe_new()
        pwm: sun4i: Propagate errors in .get_state() to the caller
        pwm: Handle .get_state() failures
        pwm: sprd: Propagate errors in .get_state() to the caller
        pwm: rockchip: Propagate errors in .get_state() to the caller
        pwm: mtk-disp: Propagate errors in .get_state() to the caller
        pwm: imx27: Propagate errors in .get_state() to the caller
        pwm: cros-ec: Propagate errors in .get_state() to the caller
        pwm: crc: Propagate errors in .get_state() to the caller
        leds: qcom-lpg: Propagate errors in .get_state() to the caller
        drm/bridge: ti-sn65dsi86: Propagate errors in .get_state() to the caller
        pwm/tracing: Also record trace events for failed API calls
        pwm: Make .get_state() callback return an error code
        pwm: pxa: Enable for MMP platform
        pwm: pxa: Add reference manual link and limitations
        pwm: pxa: Use abrupt shutdown mode
        pwm: pxa: Remove clk enable/disable from pxa_pwm_config
        pwm: pxa: Set duty cycle to 0 when disabling PWM
        pwm: pxa: Remove pxa_pwm_enable/disable
        pwm: mediatek: Add support for MT7986
        ...
      7a693ea7
    • Linus Torvalds's avatar
      Merge tag 'rproc-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux · 9cf5b508
      Linus Torvalds authored
      Pull remoteproc updates from Bjorn Andersson:
       "rproc-virtio device names are now auto generated, to avoid conflicts
        between remoteproc instances.
      
        The imx_rproc driver is extended with support for communicating with
        and attaching to a running M4 on i.MX8QXP, as well as support for
        attaching to the M4 after self-recovering from a crash. Support is
        added for i.MX8QM and mailbox channels are reconnected during the
        recovery process, in order to avoid data corruption.
      
        The Xilinx Zynqmp firmware interface is extended and support for the
        Xilinx R5 RPU is introduced.
      
        Various resources leaks, primarily in error paths, throughout the
        Qualcomm drivers are corrected.
      
        Lastly a fix to ensure that pm_relax is invoked even if the remoteproc
        instance is stopped between a crash is being reported and the recovery
        handler is scheduled"
      
      * tag 'rproc-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (25 commits)
        remoteproc: core: Do pm_relax when in RPROC_OFFLINE state
        remoteproc: qcom: q6v5: Fix missing clk_disable_unprepare() in q6v5_wcss_qcs404_power_on()
        remoteproc: qcom_q6v5_pas: Fix missing of_node_put() in adsp_alloc_memory_region()
        remoteproc: qcom_q6v5_pas: detach power domains on remove
        remoteproc: qcom_q6v5_pas: disable wakeup on probe fail or remove
        remoteproc: qcom: q6v5: Fix potential null-ptr-deref in q6v5_wcss_init_mmio()
        remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev()
        remoteproc: sysmon: Make QMI message rules const
        drivers: remoteproc: Add Xilinx r5 remoteproc driver
        firmware: xilinx: Add RPU configuration APIs
        firmware: xilinx: Add shutdown/wakeup APIs
        firmware: xilinx: Add ZynqMP firmware ioctl enums for RPU configuration.
        arm64: dts: xilinx: zynqmp: Add RPU subsystem device node
        dt-bindings: remoteproc: Add Xilinx RPU subsystem bindings
        remoteproc: core: Use device_match_of_node()
        remoteproc: imx_rproc: Correct i.MX93 DRAM mapping
        remoteproc: imx_rproc: Enable attach recovery for i.MX8QM/QXP
        remoteproc: imx_rproc: Request mbox channel later
        remoteproc: imx_rproc: Support i.MX8QM
        remoteproc: imx_rproc: Support kicking Mcore from Linux for i.MX8QXP
        ...
      9cf5b508
    • Linus Torvalds's avatar
      Merge tag 'mailbox-v6.2' of git://git.linaro.org/landing-teams/working/fujitsu/integration · f2855eec
      Linus Torvalds authored
      Pull mailbox updates from Jassi Brar:
      
       - qcom: enable sc8280xp, sm8550 and sm4250 support
      
       - ti: default to ARCH_K3 for msg manager
      
       - mediatek:
          - add mt8188 and mt8186 support
          - request irq only after got ready
      
       - zynq-ipi: fix error handling after device_register
      
       - mpfs: check sys-con status
      
       - rockchip: simplify by using device_get_match_data
      
      * tag 'mailbox-v6.2' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
        dt-bindings: mailbox: qcom-ipcc: Add compatible for SM8550
        mailbox: mtk-cmdq: Do not request irq until we are ready
        mailbox: zynq-ipi: fix error handling while device_register() fails
        mailbox: mtk-cmdq-mailbox: Use platform data directly instead of copying
        mailbox: arm_mhuv2: Fix return value check in mhuv2_probe()
        dt-bindings: mailbox: mediatek,gce-mailbox: add mt8188 compatible name
        dt-bindings: mailbox: add GCE header file for mt8188
        mailbox: mpfs: read the system controller's status
        mailbox: mtk-cmdq: add MT8186 support
        mailbox: mtk-cmdq: add gce ddr enable support flow
        mailbox: mtk-cmdq: add gce software ddr enable private data
        mailbox: mtk-cmdq: Use GCE_CTRL_BY_SW definition instead of number
        mailbox: rockchip: Use device_get_match_data() to simplify the code
        dt-bindings: mailbox: qcom-ipcc: Add sc8280xp compatible
        mailbox: config: ti-msgmgr: Default set to ARCH_K3 for TI msg manager
        mailbox: qcom-apcs-ipc: Add SM4250 APCS IPC support
        dt-bindings: mailbox: qcom: Add SM4250 APCS compatible
      f2855eec
    • Linus Torvalds's avatar
      Merge tag 'backlight-next-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight · ec34c2b4
      Linus Torvalds authored
      Pull backlight update from Lee Jones:
       "Convert a bunch of I2C class drivers over to .probe_new()"
      
      * tag 'backlight-next-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
        backlight: tosa: Convert to i2c's .probe_new()
        backlight: lv5207lp: Convert to i2c's .probe_new()
        backlight: lp855x: Convert to i2c's .probe_new()
        backlight: lm3639: Convert to i2c's .probe_new()
        backlight: lm3630a: Convert to i2c's .probe_new()
        backlight: bd6107: Convert to i2c's .probe_new()
        backlight: arcxcnn: Convert to i2c's .probe_new()
        backlight: adp8870: Convert to i2c's .probe_new()
        backlight: adp8860: Convert to i2c's .probe_new()
      ec34c2b4
    • Linus Torvalds's avatar
      Merge tag 'mfd-next-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd · 7406fd75
      Linus Torvalds authored
      Pull MFD updates from Lee Jones:
       "New Drivers:
         - Add support for Ampere Computing SMpro
         - Add support for TI TPS65219 PMIC
      
        New Functionality:
         - Add support for multiple devices of the same type; rk808
      
        Fix-ups:
         - Convert a bunch of I2C class drivers over to .probe_new()
         - Remove superfluous includes; mc13xxx-*, palmas, timberdale
         - Use correct includes for GPIO handling; madera-core
         - Convert to GPIOD; twl6040
         - Remove unused platform data handling; twl6040
         - Device Tree changes; many
         - Remove unused drivers; dm355evm_msp, davinci_voicecodec, htc-i2cpld
         - Add support for modules; palmas
         - Enable COMPILE_TEST support; intel_soc_pmic*
         - Trivial: spelling / whitespace fixes; mc13xxx-spi
         - Replace old PM helpers with new ones; many
         - Convert deprecated mask_invert usage to unmask_base; many
         - Use devm_*() calls; qcom_rpm
         - MAINTAINER fix-ups
         - Make use of improved / replaced APIs; palmas, fsl-imx25-tsadc,
           stm32-lptimer, qcom_rpm, rohm-*
      
        Bug Fixes:
         - Add bounds / error checking; mt6360-core
         - No sleeping inside critical sections; axp20x
         - Fix missing dependencies; ROHM_BD957XMUF
         - Repair error paths; qcom-pm8008"
      
      * tag 'mfd-next-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (161 commits)
        dt-bindings: mfd: da9062: Correct file name for watchdog
        mfd: pm8008: Fix return value check in pm8008_probe()
        mfd: rohm: Use dev_err_probe()
        mfd: Drop obsolete dependencies on COMPILE_TEST
        dt-bindings: mfd: da9062: Move IRQ to optional properties
        mfd: qcom_rpm: Use devm_of_platform_populate() to simplify code
        mfd: qcom_rpm: Fix an error handling path in qcom_rpm_probe()
        mfd: stm32-lptimer: Use devm_platform_get_and_ioremap_resource()
        mfd: rohm-bd9576: Convert to i2c's .probe_new()
        mfd: fsl-imx25-tsadc: Use devm_platform_get_and_ioremap_resource()
        dt-bindings: Fix maintainer email for a few ROHM ICs
        mfd: palmas: Use device_get_match_data() to simplify the code
        Input: Add tps65219 interrupt driven powerbutton
        mfd: tps65219: Add driver for TI TPS65219 PMIC
        mfd: bd957x: Fix Kconfig dependency on REGMAP_IRQ
        mfd: wcd934x: Convert irq chip to config regs
        mfd: tps65090: Replace irqchip mask_invert with unmask_base
        mfd: sun4i-gpadc: Replace irqchip mask_invert with unmask_base
        mfd: stpmic1: Fix swapped mask/unmask in irq chip
        mfd: sprd-sc27xx-spi: Replace irqchip mask_invert with unmask_base
        ...
      7406fd75
    • Linus Torvalds's avatar
      m68k: remove broken strcmp implementation · 7c084612
      Linus Torvalds authored
      The m68 hand-written assembler version of strcmp() has always been
      broken: it returns the difference between the first non-matching byte
      done as a 8-bit subtraction.
      
      That is _almost_ right, but is broken for the overflow case.  The
      strcmp() function should indeed return the sign of the difference
      between the first byte that differs, but the subtraction needs to be
      done in a wider type than 'char'.  Otherwise the ordering isn't actually
      stable.
      
      This went unnoticed for basically forever, because nobody ever cares
      about non-US-ASCII orderings in the kernel (in fact, most users only
      care about "exact match or not"), so overflows don't really happen in
      practice, even if it was very very wrong.
      
      But that mostly unnoticeable bug becomes very noticeable by the recent
      change to make 'char' be unsigned in the kernel across all architectures
      (commit 3bc753c0: "kbuild: treat char as always unsigned"). Because
      the code not only did the subtraction in the wrong type width, it also
      used 'char' to then make the compiler expand the result from an 8-bit
      difference to the 'int' return value.
      
      So now with an unsigned char that incorrect arithmetic width was then
      not even sign-expanded, and always returned just a positive integer.
      
      We could re-instate the old broken code by just turning the 'char' into
      'signed char' as has been done elsewhere where people depended on the
      signedness of 'char', but since the whole function was broken to begin
      with, and we have a non-broken default fallback implementation, let's
      just remove this broken function entirely.
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Link: https://lore.kernel.org/lkml/20221221145332.GA2399037@roeck-us.net/
      Cc: Jason Donenfeld <Jason@zx2c4.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7c084612
    • Linus Torvalds's avatar
      Merge tag 'net-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 609d3bc6
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from bpf, netfilter and can.
      
        Current release - regressions:
      
         - bpf: synchronize dispatcher update with bpf_dispatcher_xdp_func
      
         - rxrpc:
            - fix security setting propagation
            - fix null-deref in rxrpc_unuse_local()
            - fix switched parameters in peer tracing
      
        Current release - new code bugs:
      
         - rxrpc:
            - fix I/O thread startup getting skipped
            - fix locking issues in rxrpc_put_peer_locked()
            - fix I/O thread stop
            - fix uninitialised variable in rxperf server
            - fix the return value of rxrpc_new_incoming_call()
      
         - microchip: vcap: fix initialization of value and mask
      
         - nfp: fix unaligned io read of capabilities word
      
        Previous releases - regressions:
      
         - stop in-kernel socket users from corrupting socket's task_frag
      
         - stream: purge sk_error_queue in sk_stream_kill_queues()
      
         - openvswitch: fix flow lookup to use unmasked key
      
         - dsa: mv88e6xxx: avoid reg_lock deadlock in mv88e6xxx_setup_port()
      
         - devlink:
            - hold region lock when flushing snapshots
            - protect devlink dump by the instance lock
      
        Previous releases - always broken:
      
         - bpf:
            - prevent leak of lsm program after failed attach
            - resolve fext program type when checking map compatibility
      
         - skbuff: account for tail adjustment during pull operations
      
         - macsec: fix net device access prior to holding a lock
      
         - bonding: switch back when high prio link up
      
         - netfilter: flowtable: really fix NAT IPv6 offload
      
         - enetc: avoid buffer leaks on xdp_do_redirect() failure
      
         - unix: fix race in SOCK_SEQPACKET's unix_dgram_sendmsg()
      
         - dsa: microchip: remove IRQF_TRIGGER_FALLING in
           request_threaded_irq"
      
      * tag 'net-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (64 commits)
        net: fec: check the return value of build_skb()
        net: simplify sk_page_frag
        Treewide: Stop corrupting socket's task_frag
        net: Introduce sk_use_task_frag in struct sock.
        mctp: Remove device type check at unregister
        net: dsa: microchip: remove IRQF_TRIGGER_FALLING in request_threaded_irq
        can: kvaser_usb: hydra: help gcc-13 to figure out cmd_len
        can: flexcan: avoid unbalanced pm_runtime_enable warning
        Documentation: devlink: add missing toc entry for etas_es58x devlink doc
        mctp: serial: Fix starting value for frame check sequence
        nfp: fix unaligned io read of capabilities word
        net: stream: purge sk_error_queue in sk_stream_kill_queues()
        myri10ge: Fix an error handling path in myri10ge_probe()
        net: microchip: vcap: Fix initialization of value and mask
        rxrpc: Fix the return value of rxrpc_new_incoming_call()
        rxrpc: rxperf: Fix uninitialised variable
        rxrpc: Fix I/O thread stop
        rxrpc: Fix switched parameters in peer tracing
        rxrpc: Fix locking issues in rxrpc_put_peer_locked()
        rxrpc: Fix I/O thread startup getting skipped
        ...
      609d3bc6
    • Linus Torvalds's avatar
      Merge tag 'fs.vfsuid.ima.v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping · 878cf96f
      Linus Torvalds authored
      Pull vfsuid cleanup from Christian Brauner:
       "This moves the ima specific vfs{g,u}id_t comparison helpers out of the
        header and into the one file in ima where they are used.
      
        We shouldn't incentivize people to use them by placing them into the
        header. As discussed and suggested by Linus in [1] let's just define
        them locally in the one file in ima where they are used"
      
      Link: https://lore.kernel.org/lkml/CAHk-=wj4BpEwUd=OkTv1F9uykvSrsBNZJVHMp+p_+e2kiV71_A@mail.gmail.com [1]
      
      * tag 'fs.vfsuid.ima.v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping:
        mnt_idmapping: move ima-only helpers to ima
      878cf96f
    • Linus Torvalds's avatar
      Merge tag 'random-6.2-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random · 222882c2
      Linus Torvalds authored
      Pull more random number generator updates from Jason Donenfeld:
       "Two remaining changes that are now possible after you merged a few
        other trees:
      
         - #include <asm/archrandom.h> can be removed from random.h now,
           making the direct use of the arch_random_* API more of a private
           implementation detail between the archs and random.c, rather than
           something for general consumers.
      
         - Two additional uses of prandom_u32_max() snuck in during the
           initial phase of pulls, so these have been converted to
           get_random_u32_below(), and now the deprecated prandom_u32_max()
           alias -- which was just a wrapper around get_random_u32_below() --
           can be removed.
      
        In addition, there is one fix:
      
         - Check efi_rt_services_supported() before attempting to use an EFI
           runtime function.
      
           This affected EFI systems that disable runtime services yet still
           boot via EFI (e.g. the reporter's Lenovo Thinkpad X13s laptop), as
           well systems where EFI runtime services have been forcibly
           disabled, such as on PREEMPT_RT.
      
           On those machines, a very early and hard to diagnose crash would
           happen, preventing boot"
      
      * tag 'random-6.2-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random:
        prandom: remove prandom_u32_max()
        efi: random: fix NULL-deref when refreshing seed
        random: do not include <asm/archrandom.h> from random.h
      222882c2
    • Linus Torvalds's avatar
      Merge tag 'rcu-urgent.2022.12.17a' of... · 19822e3e
      Linus Torvalds authored
      Merge tag 'rcu-urgent.2022.12.17a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
      
      Pull RCU fix from Paul McKenney:
       "This fixes a lockdep false positive in synchronize_rcu() that can
        otherwise occur during early boot.
      
        The fix simply avoids invoking lockdep if the scheduler has not yet
        been initialized, that is, during that portion of boot when interrupts
        are disabled"
      
      * tag 'rcu-urgent.2022.12.17a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu:
        rcu: Don't assert interrupts enabled too early in boot
      19822e3e
  4. 20 Dec, 2022 21 commits
    • Wei Fang's avatar
      net: fec: check the return value of build_skb() · 19e72b06
      Wei Fang authored
      The build_skb might return a null pointer but there is no check on the
      return value in the fec_enet_rx_queue(). So a null pointer dereference
      might occur. To avoid this, we check the return value of build_skb. If
      the return value is a null pointer, the driver will recycle the page and
      update the statistic of ndev. Then jump to rx_processing_done to clear
      the status flags of the BD so that the hardware can recycle the BD.
      
      Fixes: 95698ff6 ("net: fec: using page pool to manage RX buffers")
      Signed-off-by: default avatarWei Fang <wei.fang@nxp.com>
      Reviewed-by: default avatarShenwei Wang <Shenwei.wang@nxp.com>
      Reviewed-by: default avatarAlexander Duyck <alexanderduyck@fb.com>
      Link: https://lore.kernel.org/r/20221219022755.1047573-1-wei.fang@nxp.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      19e72b06
    • Linus Torvalds's avatar
      Merge tag 'm68knommu-for-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · b6bb9676
      Linus Torvalds authored
      Pull m68knommu update from Greg Ungerer:
       "Only a single change to use the safer strscpy() instead of strncpy()
        when setting up the cmdline"
      
      * tag 'm68knommu-for-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68k: use strscpy() to instead of strncpy()
      b6bb9676
    • Linus Torvalds's avatar
      Merge tag 'spdx-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx · 32d528c4
      Linus Torvalds authored
      Pull SPDX/License additions from Greg KH:
       "Here are two small updates for LICENSES and some kernel files that add
        the Copyleft-next license and use it in a SPDX tag as a dual-license
        for some kernel files.
      
        These have been discussed thoroughly in public on the linux-spdx
        mailing list, and have the needed acks on them, as well as having been
        in linux-next with no reported issues for quite some time"
      
      * tag 'spdx-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx:
        testing: use the copyleft-next-0.3.1 SPDX tag
        LICENSES: Add the copyleft-next-0.3.1 license
      32d528c4
    • Linus Torvalds's avatar
      Merge tag 'devicetree-for-6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 3e0caea7
      Linus Torvalds authored
      Pull more devicetree updates from Rob Herring:
       "This is mostly a treewide clean-up from Krzysztof. There's also a
        couple of fixes and things that fell thru the cracks.
      
        I must say this has been a nice merge window without bindings dumped
        in at the last minute introducing warnings.
      
        Summary:
      
         - Treewide dropping of redundant 'binding' or 'schema' from schema
           titles. This will be followed up with a automated check to catch
           these.
      
         - Re-sort vendor-prefies
      
         - Convert GPIO based watchdog to schema
      
         - Handle all the variations for clocks, resets, power domains in i.MX
           PCIe binding
      
         - Document missing 'power-domains' property in mxsfb
      
         - Fix error with path references in Tegra XUSB example
      
         - Honor CONFIG_CMDLINE* even without /chosen node"
      
      * tag 'devicetree-for-6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt-bindings: drop redundant part of title (manual)
        dt-bindings: clock: drop redundant part of title
        dt-bindings: drop redundant part of title (beginning)
        dt-bindings: drop redundant part of title (end, part three)
        dt-bindings: drop redundant part of title (end, part two)
        dt-bindings: drop redundant part of title (end)
        dt-bindings: clock: st,stm32mp1-rcc: add proper title
        dt-bindings: memory-controllers: ti,gpmc-child: drop redundant part of title
        dt-bindings: drop redundant part of title of shared bindings
        dt-bindings: watchdog: gpio: Convert bindings to YAML
        dt-bindings: imx6q-pcie: Handle more resets on legacy platforms
        dt-bindings: imx6q-pcie: Handle various PD configurations
        dt-bindings: imx6q-pcie: Handle various clock configurations
        dt-bindings: hwmon: ntc-thermistor: drop Naveen Krishna Chatradhi from maintainers
        dt-bindings: mxsfb: Document i.MX8M/i.MX6SX/i.MX6SL power-domains property
        dt-bindings: vendor-prefixes: sort entries alphabetically
        dt-bindings: usb: tegra-xusb: Remove path references
        of: fdt: Honor CONFIG_CMDLINE* even without /chosen node
      3e0caea7
    • Linus Torvalds's avatar
      Merge tag 'parisc-for-6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · 35f79d0e
      Linus Torvalds authored
      Pull parisc updates from Helge Deller:
       "There is one noteable patch, which allows the parisc kernel to use the
        same MADV_xxx constants as the other architectures going forward. With
        that change only alpha has one entry left (MADV_DONTNEED is 6 vs 4 on
        others) which is different. To prevent an ABI breakage, a wrapper is
        included which translates old MADV values to the new ones, so existing
        userspace isn't affected. Reason for that patch is, that some
        applications wrongly used the standard MADV_xxx values even on some
        non-x86 platforms and as such those programs failed to run correctly
        on parisc (examples are qemu-user, tor browser and boringssl).
      
        Then the kgdb console and the LED code received some fixes, and some
        0-day warnings are now gone. Finally, the very last compile warning
        which was visible during a kernel build is now fixed too (in the vDSO
        code).
      
        The majority of the patches are tagged for stable series and in
        summary this patchset is quite small and drops more code than it adds:
      
      Fixes:
         - Fix potential null-ptr-deref in start_task()
         - Fix kgdb console on serial port
         - Add missing FORCE prerequisites in Makefile
         - Drop PMD_SHIFT from calculation in pgtable.h
      
        Enhancements:
         - Implement a wrapper to align madvise() MADV_* constants with other
           architectures
         - If machine supports running MPE/XL, show the MPE model string
      
        Cleanups:
         - Drop duplicate kgdb console code
         - Indenting fixes in setup_cmdline()"
      
      * tag 'parisc-for-6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Show MPE/iX model string at bootup
        parisc: Add missing FORCE prerequisites in Makefile
        parisc: Move pdc_result struct to firmware.c
        parisc: Drop locking in pdc console code
        parisc: Drop duplicate kgdb_pdc console
        parisc: Fix locking in pdc_iodc_print() firmware call
        parisc: Drop PMD_SHIFT from calculation in pgtable.h
        parisc: Align parisc MADV_XXX constants with all other architectures
        parisc: led: Fix potential null-ptr-deref in start_task()
        parisc: Fix inconsistent indenting in setup_cmdline()
      35f79d0e
    • José Expósito's avatar
      HID: sony: Fix unused function warning · 54f27dc5
      José Expósito authored
      Compiling this driver without setting "CONFIG_SONY_FF" generates the
      following warning:
      
      	drivers/hid/hid-sony.c:2358:20: warning: unused function
      	'sony_send_output_report' [-Wunused-function]
      	static inline void sony_send_output_report(struct sony_sc *sc)
      	                   ^
      	1 warning generated.
      
      Add the missing preprocessor check to fix it.
      Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      54f27dc5
    • Terry Junge's avatar
      HID: plantronics: Additional PIDs for double volume key presses quirk · 3d57f36c
      Terry Junge authored
      I no longer work for Plantronics (aka Poly, aka HP) and do not have
      access to the headsets in order to test. However, as noted by Maxim,
      the other 32xx models that share the same base code set as the 3220
      would need the same quirk. This patch adds the PIDs for the rest of
      the Blackwire 32XX product family that require the quirk.
      
      Plantronics Blackwire 3210 Series (047f:c055)
      Plantronics Blackwire 3215 Series (047f:c057)
      Plantronics Blackwire 3225 Series (047f:c058)
      
      Quote from previous patch by Maxim Mikityanskiy
      Plantronics Blackwire 3220 Series (047f:c056) sends HID reports twice
      for each volume key press. This patch adds a quirk to hid-plantronics
      for this product ID, which will ignore the second volume key press if
      it happens within 5 ms from the last one that was handled.
      
      The patch was tested on the mentioned model only, it shouldn't affect
      other models, however, this quirk might be needed for them too.
      Auto-repeat (when a key is held pressed) is not affected, because the
      rate is about 3 times per second, which is far less frequent than once
      in 5 ms.
      End quote
      Signed-off-by: default avatarTerry Junge <linuxhid@cosmicgizmosystems.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      3d57f36c
    • José Expósito's avatar
      HID: multitouch: fix Asus ExpertBook P2 P2451FA trackpoint · 4eab1c2f
      José Expósito authored
      The HID descriptor of this device contains two mouse collections, one
      for mouse emulation and the other for the trackpoint.
      
      Both collections get merged and, because the first one defines X and Y,
      the movemenent events reported by the trackpoint collection are
      ignored.
      
      Set the MT_CLS_WIN_8_FORCE_MULTI_INPUT class for this device to be able
      to receive its reports.
      
      This fix is similar to/based on commit 40d5bb87 ("HID: multitouch:
      enable multi-input as a quirk for some devices").
      
      Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/825Reported-by: default avatarAkito <the@akito.ooo>
      Tested-by: default avatarAkito <the@akito.ooo>
      Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4eab1c2f
    • José Expósito's avatar
      HID: Ignore HP Envy x360 eu0009nv stylus battery · cec827d6
      José Expósito authored
      Battery status is reported for the HP Envy x360 eu0009nv stylus even
      though it does not have battery.
      
      Prevent it from always reporting the battery as low (1%).
      
      Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/823Reported-by: default avatarIoannis Iliopoulos <jxftw2424@gmail.com>
      Tested-by: default avatarIoannis Iliopoulos <jxftw2424@gmail.com>
      Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      cec827d6
    • Linus Torvalds's avatar
      Merge tag 'asm-generic-6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic · 70b07bec
      Linus Torvalds authored
      Pull asm-generic updates from Arnd Bergmann:
       "There are only three fairly simple patches.
      
        The #include change to linux/swab.h addresses a userspace build issue,
        and the change to the mmio tracing logic helps provide more useful
        traces"
      
      * tag 'asm-generic-6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
        uapi: Add missing _UAPI prefix to <asm-generic/types.h> include guard
        asm-generic/io: Add _RET_IP_ to MMIO trace for more accurate debug info
        include/uapi/linux/swab: Fix potentially missing __always_inline
      70b07bec
    • Jason Gerecke's avatar
      HID: wacom: Ensure bootloader PID is usable in hidraw mode · 1db1f392
      Jason Gerecke authored
      Some Wacom devices have a special "bootloader" mode that is used for
      firmware flashing. When operating in this mode, the device cannot be
      used for input, and the HID descriptor is not able to be processed by
      the driver. The driver generates an "Unknown device_type" warning and
      then returns an error code from wacom_probe(). This is a problem because
      userspace still needs to be able to interact with the device via hidraw
      to perform the firmware flash.
      
      This commit adds a non-generic device definition for 056a:0094 which
      is used when devices are in "bootloader" mode. It marks the devices
      with a special BOOTLOADER type that is recognized by wacom_probe() and
      wacom_raw_event(). When we see this type we ensure a hidraw device is
      created and otherwise keep our hands off so that userspace is in full
      control.
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      Tested-by: default avatarTatsunosuke Tobita <tatsunosuke.tobita@wacom.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      1db1f392
    • Jiasheng Jiang's avatar
      HID: amd_sfh: Add missing check for dma_alloc_coherent · 53ffa6a9
      Jiasheng Jiang authored
      Add check for the return value of the dma_alloc_coherent since
      it may return NULL pointer if allocation fails.
      
      Fixes: 4b2c53d9 ("SFH:Transport Driver to add support of AMD Sensor Fusion Hub (SFH)")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Acked-by: default avatarBasavaraj Natikar <Basavaraj.Natikar@amd.com>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Link: https://lore.kernel.org/r/20221220024921.21992-1-jiasheng@iscas.ac.cn
      53ffa6a9
    • Jason A. Donenfeld's avatar
      prandom: remove prandom_u32_max() · 3c202d14
      Jason A. Donenfeld authored
      Convert the final two users of prandom_u32_max() that slipped in during
      6.2-rc1 to use get_random_u32_below().
      
      Then, with no more users left, we can finally remove the deprecated
      function.
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      3c202d14
    • Johan Hovold's avatar
      efi: random: fix NULL-deref when refreshing seed · 41a15855
      Johan Hovold authored
      Do not try to refresh the RNG seed in case the firmware does not support
      setting variables.
      
      This is specifically needed to prevent a NULL-pointer dereference on the
      Lenovo X13s with some firmware revisions, or more generally, whenever
      the runtime services have been disabled (e.g. efi=noruntime or with
      PREEMPT_RT).
      
      Fixes: e7b813b3 ("efi: random: refresh non-volatile random seed when RNG is initialized")
      Reported-by: default avatarSteev Klimaszewski <steev@kali.org>
      Reported-by: default avatarBjorn Andersson <andersson@kernel.org>
      Tested-by: default avatarSteev Klimaszewski <steev@kali.org>
      Tested-by: Andrew Halaney <ahalaney@redhat.com> # sc8280xp-lenovo-thinkpad-x13s
      Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      41a15855
    • Jason A. Donenfeld's avatar
      random: do not include <asm/archrandom.h> from random.h · 6bb20c15
      Jason A. Donenfeld authored
      The <asm/archrandom.h> header is a random.c private detail, not
      something to be called by other code. As such, don't make it
      automatically available by way of random.h.
      
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Reviewed-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      6bb20c15
    • Jakub Kicinski's avatar
      Merge tag 'linux-can-fixes-for-6.2-20221219' of... · 4be84df3
      Jakub Kicinski authored
      Merge tag 'linux-can-fixes-for-6.2-20221219' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can 2022-12-19
      
      The first patch is by Vincent Mailhol and adds the etas_es58x
      devlink documentation to the index.
      
      Haibo Chen's patch for the flexcan driver fixes a unbalanced
      pm_runtime_enable warning.
      
      The last patch is by me, targets the kvaser_usb driver and fixes
      an error occurring with gcc-13.
      
      * tag 'linux-can-fixes-for-6.2-20221219' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
        can: kvaser_usb: hydra: help gcc-13 to figure out cmd_len
        can: flexcan: avoid unbalanced pm_runtime_enable warning
        Documentation: devlink: add missing toc entry for etas_es58x devlink doc
      ====================
      
      Link: https://lore.kernel.org/r/20221219155210.1143439-1-mkl@pengutronix.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4be84df3
    • Jakub Kicinski's avatar
      Merge branch 'stop-corrupting-socket-s-task_frag' · 918fb1aa
      Jakub Kicinski authored
      Benjamin Coddington says:
      
      ====================
      Stop corrupting socket's task_frag
      
      The networking code uses flags in sk_allocation to determine if it can use
      current->task_frag, however in-kernel users of sockets may stop setting
      sk_allocation when they convert to the preferred memalloc_nofs_save/restore,
      as SUNRPC has done in commit a1231fda ("SUNRPC: Set memalloc_nofs_save()
      on all rpciod/xprtiod jobs").
      
      This will cause corruption in current->task_frag when recursing into the
      network layer for those subsystems during page fault or reclaim.  The
      corruption is difficult to diagnose because stack traces may not contain the
      offending subsystem at all.  The corruption is unlikely to show up in
      testing because it requires memory pressure, and so subsystems that
      convert to memalloc_nofs_save/restore are likely to continue to run into
      this issue.
      
      Previous reports and proposed fixes:
      https://lore.kernel.org/netdev/96a18bd00cbc6cb554603cc0d6ef1c551965b078.1663762494.git.gnault@redhat.com/
      https://lore.kernel.org/netdev/b4d8cb09c913d3e34f853736f3f5628abfd7f4b6.1656699567.git.gnault@redhat.com/
      https://lore.kernel.org/linux-nfs/de6d99321d1dcaa2ad456b92b3680aa77c07a747.1665401788.git.gnault@redhat.com/
      
      Guilluame Nault has done all of the hard work tracking this problem down and
      finding the best fix for this issue.  I'm just taking a turn posting another
      fix.
      ====================
      
      Link: https://lore.kernel.org/r/cover.1671194454.git.bcodding@redhat.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      918fb1aa
    • Benjamin Coddington's avatar
      net: simplify sk_page_frag · 08f65892
      Benjamin Coddington authored
      Now that in-kernel socket users that may recurse during reclaim have benn
      converted to sk_use_task_frag = false, we can have sk_page_frag() simply
      check that value.
      Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
      Reviewed-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      08f65892
    • Benjamin Coddington's avatar
      Treewide: Stop corrupting socket's task_frag · 98123866
      Benjamin Coddington authored
      Since moving to memalloc_nofs_save/restore, SUNRPC has stopped setting the
      GFP_NOIO flag on sk_allocation which the networking system uses to decide
      when it is safe to use current->task_frag.  The results of this are
      unexpected corruption in task_frag when SUNRPC is involved in memory
      reclaim.
      
      The corruption can be seen in crashes, but the root cause is often
      difficult to ascertain as a crashing machine's stack trace will have no
      evidence of being near NFS or SUNRPC code.  I believe this problem to
      be much more pervasive than reports to the community may indicate.
      
      Fix this by having kernel users of sockets that may corrupt task_frag due
      to reclaim set sk_use_task_frag = false.  Preemptively correcting this
      situation for users that still set sk_allocation allows them to convert to
      memalloc_nofs_save/restore without the same unexpected corruptions that are
      sure to follow, unlikely to show up in testing, and difficult to bisect.
      
      CC: Philipp Reisner <philipp.reisner@linbit.com>
      CC: Lars Ellenberg <lars.ellenberg@linbit.com>
      CC: "Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>
      CC: Jens Axboe <axboe@kernel.dk>
      CC: Josef Bacik <josef@toxicpanda.com>
      CC: Keith Busch <kbusch@kernel.org>
      CC: Christoph Hellwig <hch@lst.de>
      CC: Sagi Grimberg <sagi@grimberg.me>
      CC: Lee Duncan <lduncan@suse.com>
      CC: Chris Leech <cleech@redhat.com>
      CC: Mike Christie <michael.christie@oracle.com>
      CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
      CC: "Martin K. Petersen" <martin.petersen@oracle.com>
      CC: Valentina Manea <valentina.manea.m@gmail.com>
      CC: Shuah Khan <shuah@kernel.org>
      CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      CC: David Howells <dhowells@redhat.com>
      CC: Marc Dionne <marc.dionne@auristor.com>
      CC: Steve French <sfrench@samba.org>
      CC: Christine Caulfield <ccaulfie@redhat.com>
      CC: David Teigland <teigland@redhat.com>
      CC: Mark Fasheh <mark@fasheh.com>
      CC: Joel Becker <jlbec@evilplan.org>
      CC: Joseph Qi <joseph.qi@linux.alibaba.com>
      CC: Eric Van Hensbergen <ericvh@gmail.com>
      CC: Latchesar Ionkov <lucho@ionkov.net>
      CC: Dominique Martinet <asmadeus@codewreck.org>
      CC: Ilya Dryomov <idryomov@gmail.com>
      CC: Xiubo Li <xiubli@redhat.com>
      CC: Chuck Lever <chuck.lever@oracle.com>
      CC: Jeff Layton <jlayton@kernel.org>
      CC: Trond Myklebust <trond.myklebust@hammerspace.com>
      CC: Anna Schumaker <anna@kernel.org>
      CC: Steffen Klassert <steffen.klassert@secunet.com>
      CC: Herbert Xu <herbert@gondor.apana.org.au>
      Suggested-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
      Reviewed-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      98123866
    • Guillaume Nault's avatar
      net: Introduce sk_use_task_frag in struct sock. · fb87bd47
      Guillaume Nault authored
      Sockets that can be used while recursing into memory reclaim, like
      those used by network block devices and file systems, mustn't use
      current->task_frag: if the current process is already using it, then
      the inner memory reclaim call would corrupt the task_frag structure.
      
      To avoid this, sk_page_frag() uses ->sk_allocation to detect sockets
      that mustn't use current->task_frag, assuming that those used during
      memory reclaim had their allocation constraints reflected in
      ->sk_allocation.
      
      This unfortunately doesn't cover all cases: in an attempt to remove all
      usage of GFP_NOFS and GFP_NOIO, sunrpc stopped setting these flags in
      ->sk_allocation, and used memalloc_nofs critical sections instead.
      This breaks the sk_page_frag() heuristic since the allocation
      constraints are now stored in current->flags, which sk_page_frag()
      can't read without risking triggering a cache miss and slowing down
      TCP's fast path.
      
      This patch creates a new field in struct sock, named sk_use_task_frag,
      which sockets with memory reclaim constraints can set to false if they
      can't safely use current->task_frag. In such cases, sk_page_frag() now
      always returns the socket's page_frag (->sk_frag). The first user is
      sunrpc, which needs to avoid using current->task_frag but can keep
      ->sk_allocation set to GFP_KERNEL otherwise.
      
      Eventually, it might be possible to simplify sk_page_frag() by only
      testing ->sk_use_task_frag and avoid relying on the ->sk_allocation
      heuristic entirely (assuming other sockets will set ->sk_use_task_frag
      according to their constraints in the future).
      
      The new ->sk_use_task_frag field is placed in a hole in struct sock and
      belongs to a cache line shared with ->sk_shutdown. Therefore it should
      be hot and shouldn't have negative performance impacts on TCP's fast
      path (sk_shutdown is tested just before the while() loop in
      tcp_sendmsg_locked()).
      
      Link: https://lore.kernel.org/netdev/b4d8cb09c913d3e34f853736f3f5628abfd7f4b6.1656699567.git.gnault@redhat.com/Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
      Reviewed-by: default avatarBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      fb87bd47
    • Matt Johnston's avatar
      mctp: Remove device type check at unregister · b389a902
      Matt Johnston authored
      The unregister check could be incorrectly triggered if a netdev
      changes its type after register. That is possible for a tun device
      using TUNSETLINK ioctl, resulting in mctp unregister failing
      and the netdev unregister waiting forever.
      
      This was encountered by https://github.com/openthread/openthread/issues/8523
      
      Neither check at register or unregister is required. They were added in
      an attempt to track down mctp_ptr being set unexpectedly, which should
      not happen in normal operation.
      
      Fixes: 7b1871af ("mctp: Warn if pointer is set for a wrong dev type")
      Signed-off-by: default avatarMatt Johnston <matt@codeconstruct.com.au>
      Link: https://lore.kernel.org/r/20221215054933.2403401-1-matt@codeconstruct.com.auSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b389a902