Skip to content
  1. Jul 26, 2023
    • Jeffery Miller's avatar
      Input: psmouse - add delay when deactivating for SMBus mode · 92e24e0e
      Jeffery Miller authored
      There is a period of time between the psmouse deactivate and the
      ability to communicate with the SMBus companion. Insert a
      sleep after the deactivate to account for the delay and ensure
      the SMBus companion is responsive.
      
      Attempting to read from the SMBus companion too quickly was causing
      the touchpad on machines with an i801_smbus companion to stop working
      after a sleep/resume cycle.
      
      On resume the rmi4_smbus would fail with errors reading the SMBus version
      number:
      ```
      [5454] i2c_i801:i801_check_post:414: i801_smbus 0000:00:1f.3: No response
      smbus_result: i2c-0 a=02c f=0000 c=fd BYTE_DATA rd res=-6
      rmi4_smbus 0-002c: failed to get SMBus version number!
      ...
      rmi4_f01 rmi4-00.fn01: Failed to restore normal operation: -6.
      rmi4_f01 rmi4-00.fn01: Resume failed with code -6.
      rmi4_physical rmi4-00: Failed to suspend functions: -6
      rmi4_smbus 0-002c: Failed to resume device: -6
      ```
      In this case the rmi_smb_get_version fails with -ENXIO if it happens too
      soon after the preceding serio_resume -> psmouse_deactivate call.
      
      On boot this issue could cause the touchpad to stay in the limited PS/2
      mode. This only reproduced in 1 in 10 boots on the Lenovo T440p.
      Failures in the log on boot would show up as:
      ```
      psmouse serio1: synaptics: Trying to set up SMBus access
      [122] i2c_i801:i801_check_post:437: i801_smbus 0000:00:1f.3: No response
      psmouse serio1: synaptics: SMbus companion is not ready yet
      ```
      
      Experimentation on the Lenovo T440p showed that a delay of 7-12ms on
      resume allowed the companion to respond.
      
      The 30ms delay in this patch was chosen based on the linux-input message:
      Link: https://lore.kernel.org/all/BYAPR03MB47572F2C65E52ED673238D41B2439@BYAPR03MB4757.namprd03.prod.outlook.com/
      
      
      
      Signed-off-by: default avatarJeffery Miller <jefferymiller@google.com>
      Link: https://lore.kernel.org/r/20230726025256.81174-1-jefferymiller@google.com
      
      
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      92e24e0e
    • Nathan Chancellor's avatar
      Input: mcs-touchkey - fix uninitialized use of error in mcs_touchkey_probe() · 8362bf82
      Nathan Chancellor authored
      Clang warns (or errors with CONFIG_WERROR=y):
      
        drivers/input/keyboard/mcs_touchkey.c:149:49: error: variable 'error' is uninitialized when used here [-Werror,-Wuninitialized]
          149 |                 dev_err(&client->dev, "i2c read error[%d]\n", error);
              |                                                               ^~~~~
        include/linux/dev_printk.h:144:65: note: expanded from macro 'dev_err'
          144 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
              |                                                                        ^~~~~~~~~~~
        include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
          110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
              |                                     ^~~~~~~~~~~
        drivers/input/keyboard/mcs_touchkey.c:110:11: note: initialize the variable 'error' to silence this warning
          110 |         int error;
              |                  ^
              |                   = 0
        1 error generated.
      
      A refactoring updated the error handling in this block but did not
      update the dev_err() call to use fw_ver instead of error. Do so now to
      fix the warning and avoid printing uninitialized memory.
      
      Closes: https://github.com/ClangBuiltLinux/linux/issues/1893
      
      
      Fixes: e175eae1 ("Input: mcs-touchkey - convert to use devm_* api")
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Link: https://lore.kernel.org/r/20230725-mcs_touchkey-fix-wuninitialized-v1-1-615db39af51c@kernel.org
      
      
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      8362bf82
  2. Jul 21, 2023
  3. Jul 19, 2023
  4. Jul 18, 2023
  5. Jul 14, 2023
  6. Jul 13, 2023
  7. Jul 11, 2023
  8. Jul 08, 2023