1. 14 Mar, 2022 1 commit
    • Gwendal Grignou's avatar
      HID: intel-ish-hid: Use dma_alloc_coherent for firmware update · f97ec5d7
      Gwendal Grignou authored
      Allocating memory with kmalloc and GPF_DMA32 is not allowed, the
      allocator will ignore the attribute.
      
      Instead, use dma_alloc_coherent() API as we allocate a small amount of
      memory to transfer firmware fragment to the ISH.
      
      On Arcada chromebook, after the patch the warning:
      "Unexpected gfp: 0x4 (GFP_DMA32). Fixing up to gfp: 0xcc0 (GFP_KERNEL).  Fix your code!"
      is gone. The ISH firmware is loaded properly and we can interact with
      the ISH:
      > ectool  --name cros_ish version
      ...
      Build info:    arcada_ish_v2.0.3661+3c1a1c1ae0 2022-02-08 05:37:47 @localhost
      Tool version:  v2.0.12300-900b03ec7f 2022-02-08 10:01:48 @localhost
      
      Fixes: commit 91b22810 ("HID: intel-ish-hid: ISH firmware loader client driver")
      Signed-off-by: default avatarGwendal Grignou <gwendal@chromium.org>
      Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      f97ec5d7
  2. 01 Mar, 2022 2 commits
  3. 21 Feb, 2022 1 commit
    • Pavel Skripkin's avatar
      HID: hid-thrustmaster: fix OOB read in thrustmaster_interrupts · fc3ef2e3
      Pavel Skripkin authored
      Syzbot reported an slab-out-of-bounds Read in thrustmaster_probe() bug.
      The root case is in missing validation check of actual number of endpoints.
      
      Code should not blindly access usb_host_interface::endpoint array, since
      it may contain less endpoints than code expects.
      
      Fix it by adding missing validaion check and print an error if
      number of endpoints do not match expected number
      
      Fixes: c49c3363 ("HID: support for initialization of some Thrustmaster wheels")
      Reported-and-tested-by: syzbot+35eebd505e97d315d01c@syzkaller.appspotmail.com
      Signed-off-by: default avatarPavel Skripkin <paskripkin@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      fc3ef2e3
  4. 17 Feb, 2022 1 commit
  5. 16 Feb, 2022 2 commits
  6. 14 Feb, 2022 5 commits
  7. 05 Feb, 2022 1 commit
  8. 02 Feb, 2022 3 commits
    • Basavaraj Natikar's avatar
      HID: amd_sfh: Add illuminance mask to limit ALS max value · 91aaea52
      Basavaraj Natikar authored
      ALS illuminance value present only in first 15 bits from SFH firmware
      for V2 platforms. Hence added a mask of 15 bit to limit ALS max
      illuminance values to get correct illuminance value.
      
      Fixes: 0aad9c95 ("HID: amd_sfh: Extend ALS support for newer AMD platform")
      Signed-off-by: default avatarBasavaraj Natikar <Basavaraj.Natikar@amd.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      91aaea52
    • Basavaraj Natikar's avatar
      HID: amd_sfh: Increase sensor command timeout · a7072c01
      Basavaraj Natikar authored
      HPD sensors take more time to initialize. Hence increasing sensor
      command timeout to get response with status within a max timeout.
      
      Fixes: 173709f5 ("HID: amd_sfh: Add command response to check command status")
      Signed-off-by: default avatarBasavaraj Natikar <Basavaraj.Natikar@amd.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      a7072c01
    • Daniel Thompson's avatar
      HID: i2c-hid: goodix: Fix a lockdep splat · 2787710f
      Daniel Thompson authored
      I'm was on the receiving end of a lockdep splat from this driver and after
      scratching my head I couldn't be entirely sure it was a false positive
      given we would also have to think about whether the regulator locking is
      safe (since the notifier is called whilst holding regulator locks which
      are also needed for regulator_is_enabled() ).
      
      Regardless of whether it is a real bug or not, the mutex isn't needed.
      We can use reference counting tricks instead to avoid races with the
      notifier calls.
      
      The observed splat follows:
      
      ------------------------------------------------------
      kworker/u16:3/127 is trying to acquire lock:
      ffff00008021fb20 (&ihid_goodix->regulator_mutex){+.+.}-{4:4}, at: ihid_goodix_vdd_notify+0x30/0x94
      
      but task is already holding lock:
      ffff0000835c60c0 (&(&rdev->notifier)->rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x30/0x70
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #1 (&(&rdev->notifier)->rwsem){++++}-{4:4}:
             down_write+0x68/0x8c
             blocking_notifier_chain_register+0x54/0x70
             regulator_register_notifier+0x1c/0x24
             devm_regulator_register_notifier+0x58/0x98
             i2c_hid_of_goodix_probe+0xdc/0x158
             i2c_device_probe+0x25d/0x270
             really_probe+0x174/0x2cc
             __driver_probe_device+0xc0/0xd8
             driver_probe_device+0x50/0xe4
             __device_attach_driver+0xa8/0xc0
             bus_for_each_drv+0x9c/0xc0
             __device_attach_async_helper+0x6c/0xbc
             async_run_entry_fn+0x38/0x100
             process_one_work+0x294/0x438
             worker_thread+0x180/0x258
             kthread+0x120/0x130
             ret_from_fork+0x10/0x20
      
      -> #0 (&ihid_goodix->regulator_mutex){+.+.}-{4:4}:
             __lock_acquire+0xd24/0xfe8
             lock_acquire+0x288/0x2f4
             __mutex_lock+0xa0/0x338
             mutex_lock_nested+0x3c/0x5c
             ihid_goodix_vdd_notify+0x30/0x94
             notifier_call_chain+0x6c/0x8c
             blocking_notifier_call_chain+0x48/0x70
             _notifier_call_chain.isra.0+0x18/0x20
             _regulator_enable+0xc0/0x178
             regulator_enable+0x40/0x7c
             goodix_i2c_hid_power_up+0x18/0x20
             i2c_hid_core_power_up.isra.0+0x1c/0x2c
             i2c_hid_core_probe+0xd8/0x3d4
             i2c_hid_of_goodix_probe+0x14c/0x158
             i2c_device_probe+0x25c/0x270
             really_probe+0x174/0x2cc
             __driver_probe_device+0xc0/0xd8
             driver_probe_device+0x50/0xe4
             __device_attach_driver+0xa8/0xc0
             bus_for_each_drv+0x9c/0xc0
             __device_attach_async_helper+0x6c/0xbc
             async_run_entry_fn+0x38/0x100
             process_one_work+0x294/0x438
             worker_thread+0x180/0x258
             kthread+0x120/0x130
             ret_from_fork+0x10/0x20
      
      other info that might help us debug this:
      
       Possible unsafe locking scenario:
      
             CPU0                    CPU1
             ----                    ----
        lock(&(&rdev->notifier)->rwsem);
                                     lock(&ihid_goodix->regulator_mutex);
                                     lock(&(&rdev->notifier)->rwsem);
        lock(&ihid_goodix->regulator_mutex);
      
       *** DEADLOCK ***
      Signed-off-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
      Fixes: 18eeef46 ("HID: i2c-hid: goodix: Tie the reset line to true state of the regulator")
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      2787710f
  9. 24 Jan, 2022 1 commit
  10. 21 Jan, 2022 4 commits
    • Alex Henrie's avatar
      HID: apple: Set the tilde quirk flag on the Wellspring 5 and later · e26a7805
      Alex Henrie authored
      Markus reports that his 2011 MacBook with a German ISO keyboard (USB
      product code 05ac:0246, HID country code 13) has the tilde key quirk.
      Seeing as all of the standalone Apple ISO keyboards since about 2008
      have the quirk, it seems reasonable to assume that once the integrated
      laptop keyboards started having the quirk, they likewise never stopped
      having it.
      Reported-by: default avatarMarkus Wageringel <markus.wageringel@gmail.com>
      Signed-off-by: default avatarAlex Henrie <alexhenrie24@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      e26a7805
    • Jason Gerecke's avatar
      HID: wacom: Avoid using stale array indicies to read contact count · 20f3cf5f
      Jason Gerecke authored
      If we ever see a touch report with contact count data we initialize
      several variables used to read the contact count in the pre-report
      phase. These variables are never reset if we process a report which
      doesn't contain a contact count, however. This can cause the pre-
      report function to trigger a read of arbitrary memory (e.g. NULL
      if we're lucky) and potentially crash the driver.
      
      This commit restores resetting of the variables back to default
      "none" values that were used prior to the commit mentioned
      below.
      
      Link: https://github.com/linuxwacom/input-wacom/issues/276
      Fixes: 003f50ab (HID: wacom: Update last_slot_field during pre_report phase)
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: default avatarPing Cheng <ping.cheng@wacom.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      20f3cf5f
    • Jason Gerecke's avatar
      HID: wacom: Ignore the confidence flag when a touch is removed · df03e9bd
      Jason Gerecke authored
      AES hardware may internally re-classify a contact that it thought was
      intentional as a palm. Intentional contacts are reported as "down" with
      the confidence bit set. When this re-classification occurs, however, the
      state transitions to "up" with the confidence bit cleared. This kind of
      transition appears to be legal according to Microsoft docs, but we do
      not handle it correctly. Because the confidence bit is clear, we don't
      call `wacom_wac_finger_slot` and update userspace. This causes hung
      touches that confuse userspace and interfere with pen arbitration.
      
      This commit adds a special case to ignore the confidence flag if a contact
      is reported as removed. This ensures we do not leave a hung touch if one
      of these re-classification events occured. Ideally we'd have some way to
      also let userspace know that the touch has been re-classified as a palm
      and needs to be canceled, but that's not possible right now :)
      
      Link: https://github.com/linuxwacom/input-wacom/issues/288
      Fixes: 7fb0413b (HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts)
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: default avatarPing Cheng <ping.cheng@wacom.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      df03e9bd
    • Jason Gerecke's avatar
      HID: wacom: Reset expected and received contact counts at the same time · 546e41ac
      Jason Gerecke authored
      These two values go hand-in-hand and must be valid for the driver to
      behave correctly. We are currently lazy about updating the values and
      rely on the "expected" code flow to take care of making sure they're
      valid at the point they're needed. The "expected" flow changed somewhat
      with commit f8b6a747 ("HID: wacom: generic: Support multiple tools
      per report"), however. This led to problems with the DTH-2452 due (in
      part) to *all* contacts being fully processed -- even those past the
      expected contact count. Specifically, the received count gets reset to
      0 once all expected fingers are processed, but not the expected count.
      The rest of the contacts in the report are then *also* processed since
      now the driver thinks we've only processed 0 of N expected contacts.
      
      Later commits such as 7fb0413b (HID: wacom: Use "Confidence" flag to
      prevent reporting invalid contacts) worked around the DTH-2452 issue by
      skipping the invalid contacts at the end of the report, but this is not
      a complete fix. The confidence flag cannot be relied on when a contact
      is removed (see the following patch), and dealing with that condition
      re-introduces the DTH-2452 issue unless we also address this contact
      count laziness. By resetting expected and received counts at the same
      time we ensure the driver understands that there are 0 more contacts
      expected in the report. Similarly, we also make sure to reset the
      received count if for some reason we're out of sync in the pre-report
      phase.
      
      Link: https://github.com/linuxwacom/input-wacom/issues/288
      Fixes: f8b6a747 ("HID: wacom: generic: Support multiple tools per report")
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: default avatarPing Cheng <ping.cheng@wacom.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      546e41ac
  11. 19 Jan, 2022 2 commits
    • Jann Horn's avatar
      HID: uhid: Use READ_ONCE()/WRITE_ONCE() for ->running · c8e7ff41
      Jann Horn authored
      The flag uhid->running can be set to false by uhid_device_add_worker()
      without holding the uhid->devlock. Mark all reads/writes of the flag
      that might race with READ_ONCE()/WRITE_ONCE() for clarity and
      correctness.
      Signed-off-by: default avatarJann Horn <jannh@google.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      c8e7ff41
    • Jann Horn's avatar
      HID: uhid: Fix worker destroying device without any protection · 4ea5763f
      Jann Horn authored
      uhid has to run hid_add_device() from workqueue context while allowing
      parallel use of the userspace API (which is protected with ->devlock).
      But hid_add_device() can fail. Currently, that is handled by immediately
      destroying the associated HID device, without using ->devlock - but if
      there are concurrent requests from userspace, that's wrong and leads to
      NULL dereferences and/or memory corruption (via use-after-free).
      
      Fix it by leaving the HID device as-is in the worker. We can clean it up
      later, either in the UHID_DESTROY command handler or in the ->release()
      handler.
      
      Cc: stable@vger.kernel.org
      Fixes: 67f8ecc5 ("HID: uhid: fix timeout when probe races with IO")
      Signed-off-by: default avatarJann Horn <jannh@google.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4ea5763f
  12. 14 Jan, 2022 2 commits
    • Stephen Boyd's avatar
      HID: vivaldi: Minor cleanups · e24aeff6
      Stephen Boyd authored
      Perform some minor cleanups on this driver. Include header files for
      struct definitions that are used, drop a forward declaration that isn't
      useful, and mark a sysfs attribute static as it isn't used outside this
      file.
      
      Cc: Sean O'Brien <seobrien@chromium.org>
      Cc: Ting Shen <phoenixshen@chromium.org>
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      e24aeff6
    • Dmitry Torokhov's avatar
      HID: vivaldi: fix handling devices not using numbered reports · 3fe6acd4
      Dmitry Torokhov authored
      Unfortunately details of USB HID transport bled into HID core and
      handling of numbered/unnumbered reports is quite a mess, with
      hid_report_len() calculating the length according to USB rules,
      and hid_hw_raw_request() adding report ID to the buffer for both
      numbered and unnumbered reports.
      
      Untangling it all requres a lot of changes in HID, so for now let's
      handle this in the driver.
      
      [jkosina@suse.cz: microoptimize field->report->id to report->id]
      Fixes: 14c9c014 ("HID: add vivaldi HID driver")
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Tested-by: Stephen Boyd <swboyd@chromium.org> # CoachZ
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      3fe6acd4
  13. 12 Jan, 2022 1 commit
    • Karl Kurbjun's avatar
      HID: Ignore battery for Elan touchscreen on HP Envy X360 15t-dr100 · f3193ea1
      Karl Kurbjun authored
      Battery status on Elan tablet driver is reported for the HP ENVY x360
      15t-dr100. There is no separate battery for the Elan controller resulting in a
      battery level report of 0% or 1% depending on whether a stylus has interacted
      with the screen. These low battery level reports causes a variety of bad
      behavior in desktop environments. This patch adds the appropriate quirk to
      indicate that the batery status is unused for this target.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarKarl Kurbjun <kkurbjun@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      f3193ea1
  14. 11 Jan, 2022 14 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · 26b88fba
      Linus Torvalds authored
      Pull HID updates from Jiri Kosina:
       "Highlights:
      
         - support for USI style pens (Tero Kristo, Mika Westerberg)
      
         - quirk for devices that need inverted X/Y axes (Alistair Francis)
      
         - small core code cleanups and deduplication (Benjamin Tissoires)
      
         - Apple Magic Keyboard support improvements (José Expósito, Alex
           Henrie, Benjamin Berg)
      
         - locking performance improvement for hidraw code (André Almeida)
      
         - PM wakeup support for i2c-hid driver (Matthias Kaehlcke
      
         - new driver to support for LetSketch device (Hans de Goede)
      
         - proper batter reporting for hid-magicmouse USB-connected devices
           (José Expósito)"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (32 commits)
        HID: magicmouse: Fix an error handling path in magicmouse_probe()
        HID: address kernel-doc warnings
        HID: intel-ish-hid: ishtp-fw-loader: Fix a kernel-doc formatting issue
        HID: intel-ish-hid: ipc: Specify no cache snooping on TGL and ADL
        HID: hid-uclogic-params: Invalid parameter check in uclogic_params_frame_init_v1_buttonpad
        HID: hid-uclogic-params: Invalid parameter check in uclogic_params_huion_init
        HID: hid-uclogic-params: Invalid parameter check in uclogic_params_get_str_desc
        HID: hid-uclogic-params: Invalid parameter check in uclogic_params_init
        HID: Add new Letsketch tablet driver
        HID: apple: Add Magic Keyboard 2021 with fingerprint reader FN key mapping
        HID: apple: Add 2021 magic keyboard FN key mapping
        HID: magicmouse: set Magic Trackpad 2021 name
        HID: magicmouse: set device name when it has been personalized
        HID: apple: Add 2021 Magic Keyboard with number pad
        HID: apple: Add 2021 Magic Keyboard with fingerprint reader
        HID: i2c-hid-of: Expose the touchscreen-inverted properties
        HID: quirks: Allow inverting the absolute X/Y values
        HID: hidraw: Replace hidraw device table mutex with a rwsem
        HID: thrustmaster use swap() to make code cleaner
        HID: debug: Add USI usages
        ...
      26b88fba
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging · 4a110907
      Linus Torvalds authored
      Pull hwmon updates from Guenter Roeck:
       "New drivers:
      
         - PMBus driver for MPS Multi-phase mp5023
      
         - PMBus driver for Delta AHE-50DC fan control module
      
         - Driver for NZXT RGB&Fan Controller/Smart Device v2
      
         - Driver for Texas Instruments INA238
      
         - Driver to support X370 Asus WMI
      
         - Driver to support B550 Asus WMI
      
        Other notable changes:
      
         - Cleanup of ntc_thermistor driver, and added support for Samsung
           1404-001221 NTC
      
         - Improve detection of LM84, MAX1617, and MAX1617A in adm1021 driver
      
         - Clean up tmp401 driver, and convert to with_info API
      
         - Add support for regulators and IR38060, IR38164 IR38263 to ir38064
           PMBus driver
      
         - Add support for AMD Family 19h Models 10h-1Fh and A0h-AFh to
           k10temp driver
      
         - Add support for F81966 to f71882fg driver
      
         - Add support for ONSEMI N34TS04 to jc42 driver
      
         - Clean up and simplify dell-smm driver
      
         - Add support for ROG STRIX B550-A/X570-I GAMING to nct6775 driver
      
        And various other minor improvements and fixes"
      
      * tag 'hwmon-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (49 commits)
        hwmon: (nzxt-smart2) make array detect_fans_report static const
        hwmon: (xgene-hwmon) Add free before exiting xgene_hwmon_probe
        hwmon: (nzxt-smart2) Fix "unused function" warning
        hwmon: (dell-smm) Pack the whole smm_regs struct
        hwmon: (nct6775) Additional check for ChipID before ASUS WMI usage
        hwmon: (mr75203) fix wrong power-up delay value
        hwmon/pmbus: (ir38064) Fix spelling mistake "comaptible" -> "compatible"
        hwmon/pmbus: (ir38064) Expose a regulator
        hwmon/pmbus: (ir38064) Add of_match_table
        hwmon/pmbus: (ir38064) Add support for IR38060, IR38164 IR38263
        hwmon: add driver for NZXT RGB&Fan Controller/Smart Device v2.
        hwmon: (nct6775) add ROG STRIX B550-A/X570-I GAMING
        hwmon: (pmbus) Add support for MPS Multi-phase mp5023
        dt-bindings: add Delta AHE-50DC fan control module
        hwmon: (pmbus) Add Delta AHE-50DC fan control module driver
        hwmon: prefix kernel-doc comments for structs with struct
        hwmon: (ntc_thermistor) Add Samsung 1404-001221 NTC
        hwmon: (ntc_thermistor) Drop OF dependency
        hwmon: (dell-smm) Unify i8k_ioctl() and i8k_ioctl_unlocked()
        hwmon: (dell-smm) Simplify ioctl handler
        ...
      4a110907
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 5c947d0d
      Linus Torvalds authored
      Pull crypto updates from Herbert Xu:
       "Algorithms:
      
         - Drop alignment requirement for data in aesni
      
         - Use synchronous seeding from the /dev/random in DRBG
      
         - Reseed nopr DRBGs every 5 minutes from /dev/random
      
         - Add KDF algorithms currently used by security/DH
      
         - Fix lack of entropy on some AMD CPUs with jitter RNG
      
        Drivers:
      
         - Add support for the D1 variant in sun8i-ce
      
         - Add SEV_INIT_EX support in ccp
      
         - PFVF support for GEN4 host driver in qat
      
         - Compression support for GEN4 devices in qat
      
         - Add cn10k random number generator support"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (145 commits)
        crypto: af_alg - rewrite NULL pointer check
        lib/mpi: Add the return value check of kcalloc()
        crypto: qat - fix definition of ring reset results
        crypto: hisilicon - cleanup warning in qm_get_qos_value()
        crypto: kdf - select SHA-256 required for self-test
        crypto: x86/aesni - don't require alignment of data
        crypto: ccp - remove unneeded semicolon
        crypto: stm32/crc32 - Fix kernel BUG triggered in probe()
        crypto: s390/sha512 - Use macros instead of direct IV numbers
        crypto: sparc/sha - remove duplicate hash init function
        crypto: powerpc/sha - remove duplicate hash init function
        crypto: mips/sha - remove duplicate hash init function
        crypto: sha256 - remove duplicate generic hash init function
        crypto: jitter - add oversampling of noise source
        MAINTAINERS: update SEC2 driver maintainers list
        crypto: ux500 - Use platform_get_irq() to get the interrupt
        crypto: hisilicon/qm - disable qm clock-gating
        crypto: omap-aes - Fix broken pm_runtime_and_get() usage
        MAINTAINERS: update caam crypto driver maintainers list
        crypto: octeontx2 - prevent underflow in get_cores_bmap()
        ...
      5c947d0d
    • Linus Torvalds's avatar
      Merge tag 'docs-5.17' of git://git.lwn.net/linux · 6f38be8f
      Linus Torvalds authored
      Pull documentation updates from Jonathan Corbet:
       "This isn't a hugely busy cycle for documentation, but a few
        significant things still showed up:
      
         - A documentation section for ARC processors
      
         - Reworked and enhanced KUnit documentation
      
         - The ability to pick your own theme for HTML builds; if the default
           "Read the Docs" theme isn't ugly enough for you, you can now pick
           an uglier one.
      
         - More Chinese translation work
      
        Plus the usual assortment of fixes and cleanups"
      
      * tag 'docs-5.17' of git://git.lwn.net/linux: (53 commits)
        scripts: sphinx-pre-install: Fix ctex support on Debian
        docs: discourage use of list tables
        docs: 5.Posting.rst: describe Fixes: and Link: tags
        Documentation: kgdb: Replace deprecated remotebaud
        docs: automarkup.py: Fix invalid HTML link output and broken URI fragments
        Documentation: refer to config RANDOMIZE_BASE for kernel address-space randomization
        Documentation: kgdb: properly capitalize the MAGIC_SYSRQ config
        docs/zh_CN: Update and fix a couple of typos
        scripts: sphinx-pre-install: add required ctex dependency
        Documentation: KUnit: Restyled Frequently Asked Questions
        Documentation: KUnit: Restyle Test Style and Nomenclature page
        Documentation: KUnit: Rework writing page to focus on writing tests
        Documentation: kunit: Reorganize documentation related to running tests
        Documentation: KUnit: Added KUnit Architecture
        Documentation: KUnit: Rewrite getting started
        Documentation: KUnit: Rewrite main page
        docs/zh_CN: Add zh_CN/accounting/delay-accounting.rst
        Documentation/sphinx: fix typos of "its"
        docs/zh_CN: Add sched-domains translation
        doc: fs: remove bdev_try_to_free_page related doc
        ...
      6f38be8f
    • Linus Torvalds's avatar
      Merge tag 'kcsan.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu · 1be5bdf8
      Linus Torvalds authored
      Pull KCSAN updates from Paul McKenney:
       "This provides KCSAN fixes and also the ability to take memory barriers
        into account for weakly-ordered systems. This last can increase the
        probability of detecting certain types of data races"
      
      * tag 'kcsan.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (29 commits)
        kcsan: Only test clear_bit_unlock_is_negative_byte if arch defines it
        kcsan: Avoid nested contexts reading inconsistent reorder_access
        kcsan: Turn barrier instrumentation into macros
        kcsan: Make barrier tests compatible with lockdep
        kcsan: Support WEAK_MEMORY with Clang where no objtool support exists
        compiler_attributes.h: Add __disable_sanitizer_instrumentation
        objtool, kcsan: Remove memory barrier instrumentation from noinstr
        objtool, kcsan: Add memory barrier instrumentation to whitelist
        sched, kcsan: Enable memory barrier instrumentation
        mm, kcsan: Enable barrier instrumentation
        x86/qspinlock, kcsan: Instrument barrier of pv_queued_spin_unlock()
        x86/barriers, kcsan: Use generic instrumentation for non-smp barriers
        asm-generic/bitops, kcsan: Add instrumentation for barriers
        locking/atomics, kcsan: Add instrumentation for barriers
        locking/barriers, kcsan: Support generic instrumentation
        locking/barriers, kcsan: Add instrumentation for barriers
        kcsan: selftest: Add test case to check memory barrier instrumentation
        kcsan: Ignore GCC 11+ warnings about TSan runtime support
        kcsan: test: Add test cases for memory barrier instrumentation
        kcsan: test: Match reordered or normal accesses
        ...
      1be5bdf8
    • Linus Torvalds's avatar
      Merge tag 'lkmm.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu · 1c824bf7
      Linus Torvalds authored
      Pull memory model documentation updates from Paul McKenney:
       "This series contains documentation and litmus tests for locking,
        courtesy of Boqun Feng"
      
      * tag 'lkmm.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu:
        tools/memory-model: litmus: Add two tests for unlock(A)+lock(B) ordering
        tools/memory-model: doc: Describe the requirement of the litmus-tests directory
        tools/memory-model: Provide extra ordering for unlock+lock pair on the same CPU
      1c824bf7
    • Linus Torvalds's avatar
      Merge tag 'rcu.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu · e7d38f16
      Linus Torvalds authored
      Pull RCU updates from Paul McKenney:
      
       - Documentation updates, perhaps most notably Neil Brown's writeup of
         the reference-counting analogy to RCU.
      
       - Expedited grace-period cleanups.
      
       - Remove CONFIG_RCU_FAST_NO_HZ due to lack of valid users. I have asked
         around, posted a blog entry, and sent this series to LKML without
         result.
      
       - Miscellaneous fixes.
      
       - RCU callback offloading updates, perhaps most notably Frederic
         Weisbecker's updates allowing CPUs booted in the de-offloaded state
         to be offloaded at runtime.
      
       - nolibc fixes from Willy Tarreau and Anmar Faizi, but also including
         Mark Brown's addition of gettid().
      
       - RCU Tasks Trace fixes, including changes that increase the
         scalability of call_rcu_tasks_trace() for the BPF folks (Martin Lau
         and KP Singh).
      
       - Various fixes including those from Wander Lairson Costa and Li
         Zhijian.
      
       - Fixes plus addition of tests for the increased call_rcu_tasks_trace()
         scalability.
      
      * tag 'rcu.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (87 commits)
        rcu/nocb: Merge rcu_spawn_cpu_nocb_kthread() and rcu_spawn_one_nocb_kthread()
        rcu/nocb: Allow empty "rcu_nocbs" kernel parameter
        rcu/nocb: Create kthreads on all CPUs if "rcu_nocbs=" or "nohz_full=" are passed
        rcu/nocb: Optimize kthreads and rdp initialization
        rcu/nocb: Prepare nocb_cb_wait() to start with a non-offloaded rdp
        rcu/nocb: Remove rcu_node structure from nocb list when de-offloaded
        rcu-tasks: Use fewer callbacks queues if callback flood ends
        rcu-tasks: Use separate ->percpu_dequeue_lim for callback dequeueing
        rcu-tasks: Use more callback queues if contention encountered
        rcu-tasks: Avoid raw-spinlocked wakeups from call_rcu_tasks_generic()
        rcu-tasks: Count trylocks to estimate call_rcu_tasks() contention
        rcu-tasks: Add rcupdate.rcu_task_enqueue_lim to set initial queueing
        rcu-tasks: Make rcu_barrier_tasks*() handle multiple callback queues
        rcu-tasks: Use workqueues for multiple rcu_tasks_invoke_cbs() invocations
        rcu-tasks: Abstract invocations of callbacks
        rcu-tasks: Abstract checking of callback lists
        rcu-tasks: Add a ->percpu_enqueue_lim to the rcu_tasks structure
        rcu-tasks: Inspect stalled task's trc state in locked state
        rcu-tasks: Use spin_lock_rcu_node() and friends
        rcutorture: Combine n_max_cbs from all kthreads in a callback flood
        ...
      e7d38f16
    • Linus Torvalds's avatar
      Merge tag 'printk-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux · a2293277
      Linus Torvalds authored
      Pull printk updates from Petr Mladek:
      
       - Remove some twists in the console registration code. It does not
         change the existing behavior except for one corner case. The proper
         default console (with tty binding) will be registered again even when
         it has been removed in the meantime. It is actually a bug fix.
         Anyway, this modified behavior requires some manual interaction.
      
       - Optimize gdb extension for huge ring buffers.
      
       - Do not use atomic operations for a local bitmap variable.
      
       - Update git links in MAINTAINERS.
      
      * tag 'printk-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
        MAINTAIERS/printk: Add link to printk git
        MAINTAINERS/vsprintf: Update link to printk git tree
        scripts/gdb: lx-dmesg: read records individually
        printk/console: Clean up boot console handling in register_console()
        printk/console: Remove need_default_console variable
        printk/console: Remove unnecessary need_default_console manipulation
        printk/console: Rename has_preferred_console to need_default_console
        printk/console: Split out code that enables default console
        vsprintf: Use non-atomic bitmap API when applicable
      a2293277
    • Linus Torvalds's avatar
      Merge branch 'for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq · e9e64f85
      Linus Torvalds authored
      Pull workqueue updates from Tejun Heo:
      
       - The code around workqueue scheduler hooks got reorganized early 2019
         which unfortuately introdued a couple subtle and rare race conditions
         where preemption can mangle internal workqueue state triggering a
         WARN and possibly causing a stall or at least delay in execution.
      
         Frederic fixed both early December and the fixes were sitting in
         for-5.16-fixes which I forgot to push. They are here now. I'll
         forward them to stable after they land.
      
       - The scheduler hook reorganization has more implicatoins for workqueue
         code in that the hooks are now more strictly synchronized and thus
         the interacting operations can become more straight-forward.
      
         Lai is in the process of simplifying workqueue code and this pull
         request contains some of the patches.
      
      * 'for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
        workqueue: Remove the cacheline_aligned for nr_running
        workqueue: Move the code of waking a worker up in unbind_workers()
        workqueue: Remove schedule() in unbind_workers()
        workqueue: Remove outdated comment about exceptional workers in unbind_workers()
        workqueue: Remove the advanced kicking of the idle workers in rebind_workers()
        workqueue: Remove the outdated comment before wq_worker_sleeping()
        workqueue: Fix unbind_workers() VS wq_worker_sleeping() race
        workqueue: Fix unbind_workers() VS wq_worker_running() race
        workqueue: Upgrade queue_work_on() comment
      e9e64f85
    • Linus Torvalds's avatar
      Merge branch 'for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · ea1ca66d
      Linus Torvalds authored
      Pull cgroup updates from Tejun Heo:
       "Nothing too interesting. The only two noticeable changes are a subtle
        cpuset behavior fix and trace event id field being expanded to u64
        from int. Most others are code cleanups"
      
      * 'for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        cpuset: convert 'allowed' in __cpuset_node_allowed() to be boolean
        cgroup/rstat: check updated_next only for root
        cgroup: rstat: explicitly put loop variant in while
        cgroup: return early if it is already on preloaded list
        cgroup/cpuset: Don't let child cpusets restrict parent in default hierarchy
        cgroup: Trace event cgroup id fields should be u64
        cgroup: fix a typo in comment
        cgroup: get the wrong css for css_alloc() during cgroup_init_subsys()
        cgroup: rstat: Mark benign data race to silence KCSAN
      ea1ca66d
    • Jan Kara's avatar
      select: Fix indefinitely sleeping task in poll_schedule_timeout() · 68514dac
      Jan Kara authored
      A task can end up indefinitely sleeping in do_select() ->
      poll_schedule_timeout() when the following race happens:
      
        TASK1 (thread1)             TASK2                   TASK1 (thread2)
        do_select()
          setup poll_wqueues table
          with 'fd'
                                    write data to 'fd'
                                      pollwake()
                                        table->triggered = 1
                                                            closes 'fd' thread1 is
                                                              waiting for
          poll_schedule_timeout()
            - sees table->triggered
            table->triggered = 0
            return -EINTR
          loop back in do_select()
      
      But at this point when TASK1 loops back, the fdget() in the setup of
      poll_wqueues fails.  So now so we never find 'fd' is ready for reading
      and sleep in poll_schedule_timeout() indefinitely.
      
      Treat an fd that got closed as a fd on which some event happened.  This
      makes sure cannot block indefinitely in do_select().
      
      Another option would be to return -EBADF in this case but that has a
      potential of subtly breaking applications that excercise this behavior
      and it happens to work for them.  So returning fd as active seems like a
      safer choice.
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      68514dac
    • Linus Torvalds's avatar
      Merge tag 'devprop-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · fe8152b3
      Linus Torvalds authored
      Pull device properties framework updates from Rafael Wysocki:
       "These update the handling of software nodes and graph properties, and
        the MAINTAINERS entry for the former.
      
        Specifics:
      
         - Remove device_add_properties() which does not work correctly if
           software nodes holding additional device properties are shared or
           reused (Heikki Krogerus).
      
         - Fix nargs_prop property handling for software nodes (Clément
           Léger).
      
         - Update documentation of ACPI device properties (Sakari Ailus).
      
         - Update the handling of graph properties in the generic framework to
           match the DT case (Sakari Ailus).
      
         - Update software nodes entry in MAINTAINERS (Andy Shevchenko)"
      
      * tag 'devprop-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        software node: Update MAINTAINERS data base
        software node: fix wrong node passed to find nargs_prop
        device property: Drop fwnode_graph_get_remote_node()
        device property: Use fwnode_graph_for_each_endpoint() macro
        device property: Implement fwnode_graph_get_endpoint_count()
        Documentation: ACPI: Update references
        Documentation: ACPI: Fix data node reference documentation
        device property: Fix documentation for FWNODE_GRAPH_DEVICE_DISABLED
        device property: Fix fwnode_graph_devcon_match() fwnode leak
        device property: Remove device_add_properties() API
        driver core: Don't call device_remove_properties() from device_del()
        PCI: Convert to device_create_managed_software_node()
      fe8152b3
    • Linus Torvalds's avatar
      Merge tag 'thermal-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · fe2437cc
      Linus Torvalds authored
      Pull thermal control updates from Rafael Wysocki:
       "These add a new driver for Renesas RZ/G2L TSU, update a few existing
        thermal control drivers and clean up the tmon utility.
      
        Specifics:
      
         - Add new TSU driver and DT bindings for the Renesas RZ/G2L platform
           (Biju Das).
      
         - Fix missing check when calling reset_control_deassert() in the
           rz2gl thermal driver (Biju Das).
      
         - In preparation for FORTIFY_SOURCE performing compile-time and
           run-time field bounds checking for memcpy(), avoid intentionally
           writing across neighboring fields in the int340x thermal control
           driver (Kees Cook).
      
         - Fix RFIM mailbox write commands handling in the int340x thermal
           control driver (Sumeet Pawnikar).
      
         - Fix PM issue occurring in the iMX thermal control driver during
           suspend/resume by implementing PM runtime support in it (Oleksij
           Rempel).
      
         - Add 'const' annotation to thermal_cooling_ops in the Intel
           powerclamp driver (Rikard Falkeborn).
      
         - Fix missing ADC bit set in the iMX8MP thermal driver to enable the
           sensor (Paul Gerber).
      
         - Drop unused local variable definition from tmon (ran jianping)"
      
      * tag 'thermal-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        thermal/drivers/int340x: Fix RFIM mailbox write commands
        thermal/drivers/rz2gl: Add error check for reset_control_deassert()
        thermal/drivers/imx8mm: Enable ADC when enabling monitor
        thermal/drivers: Add TSU driver for RZ/G2L
        dt-bindings: thermal: Document Renesas RZ/G2L TSU
        thermal/drivers/intel_powerclamp: Constify static thermal_cooling_device_ops
        thermal/drivers/imx: Implement runtime PM support
        thermal: tools: tmon: remove unneeded local variable
        thermal: int340x: Use struct_group() for memcpy() region
      fe2437cc
    • Linus Torvalds's avatar
      Merge tag 'pm-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · b35b6d4d
      Linus Torvalds authored
      Pull power management updates from Rafael Wysocki:
       "The most signigicant change here is the addition of a new cpufreq
        'P-state' driver for AMD processors as a better replacement for the
        venerable acpi-cpufreq driver.
      
        There are also other cpufreq updates (in the core, intel_pstate, ARM
        drivers), PM core updates (mostly related to adding new macros for
        declaring PM operations which should make the lives of driver
        developers somewhat easier), and a bunch of assorted fixes and
        cleanups.
      
        Summary:
      
         - Add new P-state driver for AMD processors (Huang Rui).
      
         - Fix initialization of min and max frequency QoS requests in the
           cpufreq core (Rafael Wysocki).
      
         - Fix EPP handling on Alder Lake in intel_pstate (Srinivas
           Pandruvada).
      
         - Make intel_pstate update cpuinfo.max_freq when notified of HWP
           capabilities changes and drop a redundant function call from that
           driver (Rafael Wysocki).
      
         - Improve IRQ support in the Qcom cpufreq driver (Ard Biesheuvel,
           Stephen Boyd, Vladimir Zapolskiy).
      
         - Fix double devm_remap() in the Mediatek cpufreq driver (Hector
           Yuan).
      
         - Introduce thermal pressure helpers for cpufreq CPU cooling (Lukasz
           Luba).
      
         - Make cpufreq use default_groups in kobj_type (Greg Kroah-Hartman).
      
         - Make cpuidle use default_groups in kobj_type (Greg Kroah-Hartman).
      
         - Fix two comments in cpuidle code (Jason Wang, Yang Li).
      
         - Allow model-specific normal EPB value to be used in the intel_epb
           sysfs attribute handling code (Srinivas Pandruvada).
      
         - Simplify locking in pm_runtime_put_suppliers() (Rafael Wysocki).
      
         - Add safety net to supplier device release in the runtime PM core
           code (Rafael Wysocki).
      
         - Capture device status before disabling runtime PM for it (Rafael
           Wysocki).
      
         - Add new macros for declaring PM operations to allow drivers to
           avoid guarding them with CONFIG_PM #ifdefs or __maybe_unused and
           update some drivers to use these macros (Paul Cercueil).
      
         - Allow ACPI hardware signature to be honoured during restore from
           hibernation (David Woodhouse).
      
         - Update outdated operating performance points (OPP) documentation
           (Tang Yizhou).
      
         - Reduce log severity for informative message regarding frequency
           transition failures in devfreq (Tzung-Bi Shih).
      
         - Add DRAM frequency controller devfreq driver for Allwinner sunXi
           SoCs (Samuel Holland).
      
         - Add missing COMMON_CLK dependency to sun8i devfreq driver (Arnd
           Bergmann).
      
         - Add support for new layout of Psys PowerLimit Register on SPR to
           the Intel RAPL power capping driver (Zhang Rui).
      
         - Fix typo in a comment in idle_inject.c (Jason Wang).
      
         - Remove unused function definition from the DTPM (Dynamit Thermal
           Power Management) power capping framework (Daniel Lezcano).
      
         - Reduce DTPM trace verbosity (Daniel Lezcano)"
      
      * tag 'pm-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (53 commits)
        x86, sched: Fix undefined reference to init_freq_invariance_cppc() build error
        cpufreq: amd-pstate: Fix Kconfig dependencies for AMD P-State
        cpufreq: amd-pstate: Fix struct amd_cpudata kernel-doc comment
        cpuidle: use default_groups in kobj_type
        x86: intel_epb: Allow model specific normal EPB value
        MAINTAINERS: Add AMD P-State driver maintainer entry
        Documentation: amd-pstate: Add AMD P-State driver introduction
        cpufreq: amd-pstate: Add AMD P-State performance attributes
        cpufreq: amd-pstate: Add AMD P-State frequencies attributes
        cpufreq: amd-pstate: Add boost mode support for AMD P-State
        cpufreq: amd-pstate: Add trace for AMD P-State module
        cpufreq: amd-pstate: Introduce the support for the processors with shared memory solution
        cpufreq: amd-pstate: Add fast switch function for AMD P-State
        cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors
        ACPI: CPPC: Add CPPC enable register function
        ACPI: CPPC: Check present CPUs for determining _CPC is valid
        ACPI: CPPC: Implement support for SystemIO registers
        x86/msr: Add AMD CPPC MSR definitions
        x86/cpufeatures: Add AMD Collaborative Processor Performance Control feature flag
        cpufreq: use default_groups in kobj_type
        ...
      b35b6d4d