All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jeffery Miller <jefferymiller@google.com>
Cc: Lyude Paul <lyude@redhat.com>,
	Jonathan Denose <jdenose@chromium.org>,
	jdenose@google.com, Andrew Duggan <aduggan@synaptics.com>,
	Andrew Duggan <andrew@duggan.us>,
	loic.poulain@linaro.org, benjamin.tissoires@redhat.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] Input: psmouse - add delay when deactivating for SMBus mode
Date: Tue, 25 Jul 2023 22:13:15 -0700	[thread overview]
Message-ID: <ZMCra8UjEhJsEc9S@google.com> (raw)
In-Reply-To: <20230726025256.81174-1-jefferymiller@google.com>

On Wed, Jul 26, 2023 at 02:52:48AM +0000, Jeffery Miller wrote:
> 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: Jeffery Miller <jefferymiller@google.com>

Applied, thank you.

-- 
Dmitry

      reply	other threads:[~2023-07-26  5:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26  2:52 [PATCH v4] Input: psmouse - add delay when deactivating for SMBus mode Jeffery Miller
2023-07-26  5:13 ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZMCra8UjEhJsEc9S@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=aduggan@synaptics.com \
    --cc=andrew@duggan.us \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jdenose@chromium.org \
    --cc=jdenose@google.com \
    --cc=jefferymiller@google.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=lyude@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.