1. 31 Oct, 2023 7 commits
  2. 27 Oct, 2023 1 commit
  3. 26 Oct, 2023 1 commit
  4. 25 Oct, 2023 18 commits
    • Hans de Goede's avatar
      HID: logitech-hidpp: Drop HIDPP_QUIRK_UNIFYING · 9ce363aa
      Hans de Goede authored
      HIDPP unifying is only checked once in probe() and it is also
      set by probe() itself.
      
      Drop the quirk and replace its one check by the condition which is
      used to set the quirk in the first place.
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-13-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      9ce363aa
    • Hans de Goede's avatar
      HID: logitech-hidpp: Drop delayed_work_cb() · f3c4ee71
      Hans de Goede authored
      Drop delayed_work_cb() instead make hidpp_connect_event() the workqueue
      function itself.
      
      Besides resulting in a small cleanup this will hopefully also make
      it clearer that going forward hidpp_connect_event() should only
      be run from a workqueue and not be directly invoked.
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-12-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      f3c4ee71
    • Hans de Goede's avatar
      HID: logitech-hidpp: Fix connect event race · 680ee411
      Hans de Goede authored
      There is a connect event race in hidpp_probe() in these 2 lines:
      
      	connected = hidpp_root_get_protocol_version(hidpp) == 0;
      	atomic_set(&hidpp->connected, connected);
      
      Specifically the following can happen:
      
      1. This line from hidpp_probe() is executed:
      	connected = hidpp_root_get_protocol_version(hidpp) == 0;
         and sets connected to false;
      
      2. A connect-event packet is received and does:
      	atomic_set(&hidpp->connected, true);
      
      3. The next line from hidpp_probe() is executed:
      	atomic_set(&hidpp->connected, connected);
         and sets the atomic_t back to 0 again.
      
      4. hidpp_connect_event() runs and sees the connected device
         as disconnected because of this.
      
      To fix this make hidpp_connect_event() query the connection status
      of the device itself instead of having it rely on possibly stale
      data cached in struct hidpp_device.
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-11-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      680ee411
    • Hans de Goede's avatar
      HID: logitech-hidpp: Remove unused connected param from *_connect() · bb17b2c6
      Hans de Goede authored
      Remove the unused connected function parameter from wtp_connect(),
      m560_send_config_command() and k400_connect().
      
      This is a preparation patch for moving all connected state handling
      to hidpp_connect_event().
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-10-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      bb17b2c6
    • Hans de Goede's avatar
      HID: logitech-hidpp: Remove connected check for non-unifying devices · 6f335b47
      Hans de Goede authored
      Non-unifying devices (USB, Bluetooth) are always connected during
      probe(), remove the unnecessary connected check.
      
      This is a preparation patch for moving all connected state handling
      to hidpp_connect_event().
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-9-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      6f335b47
    • Hans de Goede's avatar
      HID: logitech-hidpp: Add hidpp_non_unifying_init() helper · c14f1485
      Hans de Goede authored
      Turn hidpp_overwrite_name() into a hidpp_non_unifying_init() helper
      which takes care of setting both the name and the serial for non
      unifying devices.
      
      This mirrors the hidpp_unifying_init() helper for unifying devices.
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-8-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      c14f1485
    • Hans de Goede's avatar
      HID: logitech-hidpp: Move hidpp_overwrite_name() to before connect check · 8954dac1
      Hans de Goede authored
      Move the hidpp_overwrite_name() call to before the connect check, this
      puts it at the same place in the probe() order as hidpp_serial_init()
      which seems more logical. This should not make a difference since this
      is in the non-unifying path and only unifying devices can be probed
      in non-connected state.
      
      This is a preparation patch for moving all connected state handling
      to hidpp_connect_event().
      
      Doing this before the connect check requires dropping the protocol
      version check since protocol_major is not set yet now. Instead
      this relies on hidpp_root_get_feature(HIDPP_PAGE_GET_DEVICE_NAME_TYPE)
      failing on older devices, just like how hidpp_get_serial() relies on
      hidpp_root_get_feature(HIDPP_PAGE_DEVICE_INFORMATION) failing on older
      devices. So this again makes the code more consistent.
      
      Also stop printing an error on failure now, since with the proto
      version check gone failures are expected to happen on older devices.
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-7-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      8954dac1
    • Hans de Goede's avatar
      HID: logitech-hidpp: Move g920_get_config() to just before hidpp_ff_init() · 219ccfb6
      Hans de Goede authored
      The data retrieved by g920_get_config() is only used by hidpp_ff_init().
      
      Now that the hw is kept open till the end of probe() the g920_get_config()
      call can be moved to just before hidpp_ff_init() to have all
      the HIDPP_QUIRK_CLASS_G920 together in a single place.
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-6-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      219ccfb6
    • Hans de Goede's avatar
      HID: logitech-hidpp: Remove wtp_get_config() call from probe() · a3643036
      Hans de Goede authored
      For WTP devices which start disconnected (paired with the unifying
      receiver, but not connected atm) hidpp_connect_event() takes care
      of calling wtp_get_config() when the device later connects.
      
      There is no need to have a separate code path for WTP devices which
      are connected at probe() time, these can use the same code-path since
      probe() will queue hidpp_connect_event() for those at probe time.
      
      Drop the unnecessary wtp_get_config() call from probe().
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-5-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      a3643036
    • Hans de Goede's avatar
      HID: logitech-hidpp: Move get_wireless_feature_index() check to hidpp_connect_event() · ba9de350
      Hans de Goede authored
      Calling get_wireless_feature_index() from probe() causes
      the wireless_feature_index to only get set for unifying devices which
      are already connected at probe() time. It does not get set for devices
      which connect later.
      
      Fix this by moving get_wireless_feature_index() to hidpp_connect_event(),
      this does not make a difference for devices connected at probe() since
      probe() will queue the hidpp_connect_event() for those at probe time.
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      
      Fixes: 0da0a63b ("HID: logitech-hidpp: Support WirelessDeviceStatus connect events")
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-4-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      ba9de350
    • Hans de Goede's avatar
      HID: logitech-hidpp: Revert "Don't restart communication if not necessary" · 55bf7036
      Hans de Goede authored
      Commit 91cf9a98 ("HID: logitech-hidpp: make .probe usbhid capable")
      makes hidpp_probe() first call hid_hw_start(hdev, 0) to allow IO
      without connecting any hid subdrivers (hid-input, hidraw).
      
      This is done to allow to retrieve the device's name and serial number
      and store these in hdev->name and hdev->uniq.
      
      Then later on IO was stopped and started again with hid_hw_start(hdev,
      HID_CONNECT_DEFAULT) connecting hid-input and hidraw after the name
      and serial number have been setup.
      
      Commit 498ba206 ("HID: logitech-hidpp: Don't restart communication
      if not necessary") changed the probe() code to only do the start with
      a 0 connect-mask + restart later for unifying devices.
      
      But for non unifying devices hdev->name and hdev->uniq are updated too.
      So this change re-introduces the problem for which the start with
      a 0 connect-mask + restart later behavior was introduced.
      
      The previous patch in this series changes the unifying path to instead of
      restarting IO only call hid_connect() later. This avoids possible issues
      with restarting IO seen on non unifying devices.
      
      Revert the change to limit the restart behavior to unifying devices to
      fix hdev->name changing after userspace facing devices have already been
      registered.
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      
      Fixes: 498ba206 ("HID: logitech-hidpp: Don't restart communication if not necessary")
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-3-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      55bf7036
    • Hans de Goede's avatar
      HID: logitech-hidpp: Don't restart IO, instead defer hid_connect() only · 11ca0322
      Hans de Goede authored
      Restarting IO causes 2 problems:
      
      1. Some devices do not like IO being restarted this was addressed in
         commit 498ba206 ("HID: logitech-hidpp: Don't restart communication
         if not necessary"), but that change has issues of its own and needs to
         be reverted.
      
      2. Restarting IO and specifically calling hid_device_io_stop() causes
         received packets to be missed, which may cause connect-events to
         get missed.
      
      Restarting IO was introduced in commit 91cf9a98 ("HID: logitech-hidpp:
      make .probe usbhid capable") to allow to retrieve the device's name and
      serial number and store these in hdev->name and hdev->uniq before
      connecting any hid subdrivers (hid-input, hidraw) exporting this info
      to userspace.
      
      But this does not require restarting IO, this merely requires deferring
      calling hid_connect(). Calling hid_hw_start() with a connect-mask of
      0 makes it skip calling hid_connect(), so hidpp_probe() can simply call
      hid_connect() later without needing to restart IO.
      
      Remove the stop + restart of IO and instead just call hid_connect() later
      to avoid the issues caused by restarting IO.
      
      Now that IO is no longer stopped, hid_hw_close() must be called at the end
      of probe() to balance the hid_hw_open() done at the beginning probe().
      
      This series has been tested on the following devices:
      Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
      Logitech M720 Triathlon (bluetooth, HID++ 4.5)
      Logitech M720 Triathlon (unifying, HID++ 4.5)
      Logitech K400 Pro (unifying, HID++ 4.1)
      Logitech K270 (eQUAD nano Lite, HID++ 2.0)
      Logitech M185 (eQUAD nano Lite, HID++ 4.5)
      Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
      Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
      
      And by bentiss:
      Logitech Touchpad T650 (unifying)
      Logitech Touchpad T651 (bluetooth)
      Logitech MX Master 3B (BLE)
      Logitech G403 (plain USB / Gaming receiver)
      
      Fixes: 498ba206 ("HID: logitech-hidpp: Don't restart communication if not necessary")
      Suggested-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231010102029.111003-2-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      11ca0322
    • Thomas Weißschuh's avatar
      HID: rmi: remove #ifdef CONFIG_PM · eeebfe62
      Thomas Weißschuh authored
      Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be
      compiled, protecting against bitrot.
      The linker will then garbage-collect the unused function avoiding any overhead.
      Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
      Link: https://lore.kernel.org/r/20231012-hid-pm_ptr-v1-4-0a71531ca93b@weissschuh.netSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      eeebfe62
    • Thomas Weißschuh's avatar
      HID: multitouch: remove #ifdef CONFIG_PM · fc254341
      Thomas Weißschuh authored
      Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be
      compiled, protecting against bitrot.
      The linker will then garbage-collect the unused function avoiding any overhead.
      Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
      Link: https://lore.kernel.org/r/20231012-hid-pm_ptr-v1-3-0a71531ca93b@weissschuh.netSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      fc254341
    • Thomas Weißschuh's avatar
      HID: usbhid: remove #ifdef CONFIG_PM · f3548721
      Thomas Weißschuh authored
      Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be
      compiled, protecting against bitrot.
      The linker will then garbage-collect the unused function avoiding any overhead.
      Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
      Link: https://lore.kernel.org/r/20231012-hid-pm_ptr-v1-2-0a71531ca93b@weissschuh.netSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      f3548721
    • Thomas Weißschuh's avatar
      HID: core: remove #ifdef CONFIG_PM from hid_driver · df8b030d
      Thomas Weißschuh authored
      Allow HID drivers to pass ->suspend, ->resume and ->reset_resume via
      pm_ptr().
      Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be
      compiled, protecting against bitrot.
      The linker will then garbage-collect the unused function avoiding any overhead.
      
      The only overhead in the final kernel image and at runtime are a few
      extra bytes in 'struct hid_driver'.
      
      The same approach is chosen by 'struct usb_driver' and other subsystems.
      Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
      Link: https://lore.kernel.org/r/20231012-hid-pm_ptr-v1-1-0a71531ca93b@weissschuh.netSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      df8b030d
    • Jamie Lentin's avatar
      hid: lenovo: Resend all settings on reset_resume for compact keyboards · 2f2bd7cb
      Jamie Lentin authored
      The USB Compact Keyboard variant requires a reset_resume function to
      restore keyboard configuration after a suspend in some situations. Move
      configuration normally done on probe to lenovo_features_set_cptkbd(), then
      recycle this for use on reset_resume.
      
      Without, the keyboard and driver would end up in an inconsistent state,
      breaking middle-button scrolling amongst other problems, and twiddling
      sysfs values wouldn't help as the middle-button mode won't be set until
      the driver is reloaded.
      
      Tested on a USB and Bluetooth Thinkpad Compact Keyboard.
      
      CC: stable@vger.kernel.org
      Fixes: 94eefa27 ("HID: lenovo: Use native middle-button mode for compact keyboards")
      Signed-off-by: default avatarJamie Lentin <jm@lentin.co.uk>
      Signed-off-by: default avatarMartin Kepplinger <martink@posteo.de>
      Link: https://lore.kernel.org/r/20231002150914.22101-1-martink@posteo.deSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      2f2bd7cb
    • Danny Kaehn's avatar
      hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip · dc3115e6
      Danny Kaehn authored
      Previously cp2112_gpio_irq_shutdown() always cancelled the
      gpio_poll_worker, even if other IRQs were still active, and did not set
      the gpio_poll flag to false. This resulted in any call to _shutdown()
      resulting in interrupts no longer functioning on the chip until a
      _remove() occurred (a.e. the cp2112 is unplugged or system rebooted).
      
      Only cancel polling if all IRQs are disabled/masked, and correctly set
      the gpio_poll flag, allowing polling to restart when an interrupt is
      next enabled.
      Signed-off-by: default avatarDanny Kaehn <danny.kaehn@plexus.com>
      Fixes: 13de9cca ("HID: cp2112: add IRQ chip handling")
      Link: https://lore.kernel.org/r/20231011182317.1053344-1-danny.kaehn@plexus.comSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      dc3115e6
  5. 11 Oct, 2023 6 commits
  6. 10 Oct, 2023 7 commits
    • Linus Torvalds's avatar
      Merge tag 'xsa441-6.6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 1c8b86a3
      Linus Torvalds authored
      Pull xen fix from Juergen Gross:
       "A fix for the xen events driver:
      
        Closing of an event channel in the Linux kernel can result in a
        deadlock. This happens when the close is being performed in parallel
        to an unrelated Xen console action and the handling of a Xen console
        interrupt in an unprivileged guest.
      
        The closing of an event channel is e.g. triggered by removal of a
        paravirtual device on the other side. As this action will cause
        console messages to be issued on the other side quite often, the
        chance of triggering the deadlock is not negligible"
      
      * tag 'xsa441-6.6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/events: replace evtchn_rwlock with RCU
      1c8b86a3
    • Sumit Garg's avatar
      KEYS: trusted: Remove redundant static calls usage · 01bbafc6
      Sumit Garg authored
      Static calls invocations aren't well supported from module __init and
      __exit functions. Especially the static call from cleanup_trusted() led
      to a crash on x86 kernel with CONFIG_DEBUG_VIRTUAL=y.
      
      However, the usage of static call invocations for trusted_key_init()
      and trusted_key_exit() don't add any value from either a performance or
      security perspective. Hence switch to use indirect function calls instead.
      
      Note here that although it will fix the current crash report, ultimately
      the static call infrastructure should be fixed to either support its
      future usage from module __init and __exit functions or not.
      Reported-and-tested-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
      Link: https://lore.kernel.org/lkml/ZRhKq6e5nF%2F4ZIV1@fedora/#t
      Fixes: 5d0682be ("KEYS: trusted: Add generic trusted keys framework")
      Signed-off-by: default avatarSumit Garg <sumit.garg@linaro.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      01bbafc6
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2023-10-10-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 87813e13
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A set of updates for interrupt chip drivers:
      
         - Fix the fail of the Qualcomm PDC driver on v3.2 hardware which is
           caused by a control bit being moved to a different location
      
         - Update the SM8150 device tree PDC resource so the version register
           can be read
      
         - Make the Renesas RZG2L driver correct for interrupts which are
           outside of the LSB in the TSSR register by using the proper macro
           for calculating the mask
      
         - Document the Renesas RZ2GL device tree binding correctly and update
           them for a few devices which faul to boot otherwise
      
         - Use the proper accessor in the RZ2GL driver instead of blindly
           dereferencing an unchecked pointer
      
         - Make GICv3 handle the dma-non-coherent attribute correctly
      
         - Ensure that all interrupt controller nodes on RISCV are marked as
           initialized correctly
      
        Maintainer changes:
      
         - Add a new entry for GIC interrupt controllers and assign Marc
           Zyngier as the maintainer
      
         - Remove Marc Zyngier from the core and driver maintainer entries as
           he is burried in work and short of time to handle that.
      
        Thanks to Marc for all the great work he has done in the past couple
        of years!
      
        Also note that commit 5873d380 ("irqchip/qcom-pdc: Add support for
        v3.2 HW") has a incorrect SOB chain.
      
        The real author is Neil. His patch was posted by Dmitry once and Neil
        picked it up from the list and reposted it with the bogus SOB chain.
      
        Not a big deal, but worth to mention. I wanted to fix that up, but
        then got distracted and Marc piled more changes on top. So I decided
        to leave it as is instead of rebasing world"
      
      * tag 'irq-urgent-2023-10-10-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        MAINTAINERS: Remove myself from the general IRQ subsystem maintenance
        MAINTAINERS: Add myself as the ARM GIC maintainer
        irqchip/renesas-rzg2l: Convert to irq_data_get_irq_chip_data()
        irqchip/stm32-exti: add missing DT IRQ flag translation
        irqchip/riscv-intc: Mark all INTC nodes as initialized
        irqchip/gic-v3: Enable non-coherent redistributors/ITSes DT probing
        irqchip/gic-v3-its: Split allocation from initialisation of its_node
        dt-bindings: interrupt-controller: arm,gic-v3: Add dma-noncoherent property
        dt-bindings: interrupt-controller: renesas,irqc: Add r8a779f0 support
        dt-bindings: interrupt-controller: renesas,rzg2l-irqc: Document RZ/G2UL SoC
        irqchip: renesas-rzg2l: Fix logic to clear TINT interrupt source
        dt-bindings: interrupt-controller: renesas,rzg2l-irqc: Update description for '#interrupt-cells' property
        arm64: dts: qcom: sm8150: extend the size of the PDC resource
        irqchip/qcom-pdc: Add support for v3.2 HW
      87813e13
    • Linus Torvalds's avatar
      Merge tag 'hyperv-fixes-signed-20231009' of... · b711538a
      Linus Torvalds authored
      Merge tag 'hyperv-fixes-signed-20231009' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
      
      Pull hyperv fixes from Wei Liu:
      
       - fixes for Hyper-V VTL code (Saurabh Sengar and Olaf Hering)
      
       - fix hv_kvp_daemon to support keyfile based connection profile
         (Shradha Gupta)
      
      * tag 'hyperv-fixes-signed-20231009' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
        hv/hv_kvp_daemon:Support for keyfile based connection profile
        hyperv: reduce size of ms_hyperv_info
        x86/hyperv: Add common print prefix "Hyper-V" in hv_init
        x86/hyperv: Remove hv_vtl_early_init initcall
        x86/hyperv: Restrict get_vtl to only VTL platforms
      b711538a
    • Linus Torvalds's avatar
      Merge tag 'v6.6-p4' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 832b5d0b
      Linus Torvalds authored
      Pull crypto fix from Herbert Xu:
       "Fix a regression in dm-crypt"
      
      * tag 'v6.6-p4' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        dm crypt: Fix reqsize in crypt_iv_eboiv_gen
      832b5d0b
    • Linus Torvalds's avatar
      Merge tag 'sound-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 68d187ec
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of pending fixes since a couple of weeks ago, which
        became slightly bigger than usual due to my vacation.
      
        Most of changes are about ASoC device-specific fixes while USB- and
        HD-audio received quirks as usual. All fixes, including two ASoC core
        changes, are reasonably small and safe to apply"
      
      * tag 'sound-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits)
        ALSA: usb-audio: Fix microphone sound on Nexigo webcam.
        ALSA: hda/realtek: Change model for Intel RVP board
        ALSA: usb-audio: Fix microphone sound on Opencomm2 Headset
        ALSA: hda: cs35l41: Cleanup and fix double free in firmware request
        ASoC: dt-bindings: fsl,micfil: Document #sound-dai-cells
        ASoC: amd: yc: Fix non-functional mic on Lenovo 82YM
        ASoC: tlv320adc3xxx: BUG: Correct micbias setting
        ASoC: rt5682: Fix regulator enable/disable sequence
        ASoC: hdmi-codec: Fix broken channel map reporting
        ASoC: core: Do not call link_exit() on uninitialized rtd objects
        ASoC: core: Print component name when printing log
        ASoC: SOF: amd: fix for firmware reload failure after playback
        ASoC: fsl-asoc-card: use integer type for fll_id and pll_id
        ASoC: fsl_sai: Don't disable bitclock for i.MX8MP
        dt-bindings: ASoC: rockchip: Add compatible for RK3128 spdif
        ASoC: soc-generic-dmaengine-pcm: Fix function name in comment
        ALSA: hda/realtek - ALC287 merge RTK codec with CS CS35L41 AMP
        ASoC: simple-card: fixup asoc_simple_probe() error handling
        ASoC: simple-card-utils: fixup simple_util_startup() error handling
        ASoC: Intel: sof_sdw: add support for SKU 0B14
        ...
      68d187ec
    • Shradha Gupta's avatar
      hv/hv_kvp_daemon:Support for keyfile based connection profile · 42999c90
      Shradha Gupta authored
      Ifcfg config file support in NetworkManger is deprecated. This patch
      provides support for the new keyfile config format for connection
      profiles in NetworkManager. The patch modifies the hv_kvp_daemon code
      to generate the new network configuration in keyfile
      format(.ini-style format) along with a ifcfg format configuration.
      The ifcfg format configuration is also retained to support easy
      backward compatibility for distro vendors. These configurations are
      stored in temp files which are further translated using the
      hv_set_ifconfig.sh script. This script is implemented by individual
      distros based on the network management commands supported.
      For example, RHEL's implementation could be found here:
      https://gitlab.com/redhat/centos-stream/src/hyperv-daemons/-/blob/c9s/hv_set_ifconfig.sh
      Debian's implementation could be found here:
      https://github.com/endlessm/linux/blob/master/debian/cloud-tools/hv_set_ifconfig
      
      The next part of this support is to let the Distro vendors consume
      these modified implementations to the new configuration format.
      
      Tested-on: Rhel9(Hyper-V, Azure)(nm and ifcfg files verified)
      Signed-off-by: default avatarShradha Gupta <shradhagupta@linux.microsoft.com>
      Reviewed-by: default avatarSaurabh Sengar <ssengar@linux.microsoft.com>
      Reviewed-by: default avatarAni Sinha <anisinha@redhat.com>
      Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
      Link: https://lore.kernel.org/r/1696847920-31125-1-git-send-email-shradhagupta@linux.microsoft.com
      42999c90