public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Fedor Pchelkin <boddah8794@gmail.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	"Christian A. Ehrhardt" <lk@c--e.de>
Cc: Fedor Pchelkin <boddah8794@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Benson Leung <bleung@chromium.org>,
	Jameson Thies <jthies@google.com>,
	Saranya Gopal <saranya.gopal@intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mark Pearson <mpearson@squebb.ca>,
	stable@vger.kernel.org
Subject: [PATCH RFC 2/2] usb: typec: ucsi: increase timeout for PPM reset operations
Date: Thu,  6 Feb 2025 21:43:15 +0300	[thread overview]
Message-ID: <20250206184327.16308-3-boddah8794@gmail.com> (raw)
In-Reply-To: <20250206184327.16308-1-boddah8794@gmail.com>

It is observed that on some systems an initial PPM reset during the boot
phase can trigger a timeout:

[    6.482546] ucsi_acpi USBC000:00: failed to reset PPM!
[    6.482551] ucsi_acpi USBC000:00: error -ETIMEDOUT: PPM init failed

Still, increasing the timeout value, albeit being the most straightforward
solution, eliminates the problem: the initial PPM reset may take up to
~8000-10000ms on some Lenovo laptops. When it is reset after the above
period of time (or even if ucsi_reset_ppm() is not called overall), UCSI
works as expected.

Moreover, if the ucsi_acpi module is loaded/unloaded manually after the
system has booted, reading the CCI values and resetting the PPM works
perfectly, without any timeout. Thus it's only a boot-time issue.

The reason for this behavior is not clear but it may be the consequence
of some tricks that the firmware performs or be an actual firmware bug.
As a workaround, increase the timeout to avoid failing the UCSI
initialization prematurely.

Fixes: b1b59e16075f ("usb: typec: ucsi: Increase command completion timeout value")
Cc: stable@vger.kernel.org
Signed-off-by: Fedor Pchelkin <boddah8794@gmail.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 0fe1476f4c29..7a56d3f840d7 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -25,7 +25,7 @@
  * difficult to estimate the time it takes for the system to process the command
  * before it is actually passed to the PPM.
  */
-#define UCSI_TIMEOUT_MS		5000
+#define UCSI_TIMEOUT_MS		10000
 
 /*
  * UCSI_SWAP_TIMEOUT_MS - Timeout for role swap requests
-- 
2.48.1


  parent reply	other threads:[~2025-02-06 18:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06 18:43 [PATCH RFC 0/2] usb: typec: ucsi: avoid problems during initial PPM reset Fedor Pchelkin
2025-02-06 18:43 ` [PATCH RFC 1/2] acpi: typec: ucsi: Introduce a ->poll_cci method Fedor Pchelkin
2025-02-07  0:38   ` Dmitry Baryshkov
2025-02-07  6:51     ` Christian A. Ehrhardt
2025-02-13 13:56   ` Heikki Krogerus
2025-02-06 18:43 ` Fedor Pchelkin [this message]
2025-02-13 13:58   ` [PATCH RFC 2/2] usb: typec: ucsi: increase timeout for PPM reset operations Heikki Krogerus
2025-02-17 10:18     ` Fedor Pchelkin
2025-02-17 10:32       ` Greg Kroah-Hartman
2025-02-18 16:57   ` Mark Pearson
2025-02-18 19:53     ` Fedor Pchelkin

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=20250206184327.16308-3-boddah8794@gmail.com \
    --to=boddah8794@gmail.com \
    --cc=bleung@chromium.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jthies@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lk@c--e.de \
    --cc=mpearson@squebb.ca \
    --cc=saranya.gopal@intel.com \
    --cc=stable@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox