linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2 3/3] usb: ucsi_acpi: Increase the command completion timeout
Date: Tue, 7 Mar 2023 09:47:19 +0200	[thread overview]
Message-ID: <ZAbsBzOWilYzF61D@kuha.fi.intel.com> (raw)
In-Reply-To: <20230306103359.6591-4-hdegoede@redhat.com>

On Mon, Mar 06, 2023 at 11:33:59AM +0100, Hans de Goede wrote:
> Commit 130a96d698d7 ("usb: typec: ucsi: acpi: Increase command
> completion timeout value") increased the timeout from 5 seconds
> to 60 seconds due to issues related to alternate mode discovery.
> 
> After the alternate mode discovery switch to polled mode
> the timeout was reduced, but instead of being set back to
> 5 seconds it was reduced to 1 second.
> 
> This is causing problems when using a Lenovo ThinkPad X1 yoga gen7
> connected over Type-C to a LG 27UL850-W (charging DP over Type-C).
> 
> When the monitor is already connected at boot the following error
> is logged: "PPM init failed (-110)", /sys/class/typec is empty and
> on unplugging the NULL pointer deref fixed earlier in this series
> happens.
> 
> When the monitor is connected after boot the following error
> is logged instead: "GET_CONNECTOR_STATUS failed (-110)".
> 
> Setting the timeout back to 5 seconds fixes both cases.
> 
> Fixes: e08065069fc7 ("usb: typec: ucsi: acpi: Reduce the command completion timeout")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/ucsi/ucsi_acpi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c
> index ce0c8ef80c04..62206a6b8ea7 100644
> --- a/drivers/usb/typec/ucsi/ucsi_acpi.c
> +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c
> @@ -78,7 +78,7 @@ static int ucsi_acpi_sync_write(struct ucsi *ucsi, unsigned int offset,
>  	if (ret)
>  		goto out_clear_bit;
>  
> -	if (!wait_for_completion_timeout(&ua->complete, HZ))
> +	if (!wait_for_completion_timeout(&ua->complete, 5 * HZ))
>  		ret = -ETIMEDOUT;
>  
>  out_clear_bit:
> -- 
> 2.39.1

-- 
heikki

      reply	other threads:[~2023-03-07  7:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 10:33 [PATCH v2 0/3] usb: ucsi: 3 bug fixes Hans de Goede
2023-03-06 10:33 ` [PATCH v2 1/3] usb: ucsi: Fix NULL pointer deref in ucsi_connector_change() Hans de Goede
2023-03-07  7:32   ` Heikki Krogerus
2023-03-07  9:17   ` Heikki Krogerus
2023-03-07  9:28     ` Greg Kroah-Hartman
2023-03-06 10:33 ` [PATCH v2 2/3] usb: ucsi: Fix ucsi->connector race Hans de Goede
2023-03-07  7:46   ` Heikki Krogerus
2023-03-06 10:33 ` [PATCH v2 3/3] usb: ucsi_acpi: Increase the command completion timeout Hans de Goede
2023-03-07  7:47   ` Heikki Krogerus [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=ZAbsBzOWilYzF61D@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-usb@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).