Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3289692pxk; Mon, 21 Sep 2020 09:48:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHmVNeXQ68gx4K/hRTQgTUYX6B2rk9EF26jNjWm1F4kryHX0z6zCYkyGZqtkXXQGIcUISV X-Received: by 2002:a50:9355:: with SMTP id n21mr526642eda.237.1600706900026; Mon, 21 Sep 2020 09:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600706900; cv=none; d=google.com; s=arc-20160816; b=sZmmqd9nPBlqYGW+dmTRqdE+59hG1d+GAABkL7e5CxYQA2WT1rIpdAmBwFuBrISYly F2ZTsjglBc8dPYaRwCEZjc60gN8FFRtUcDIANKB+k6+zMUxTcNgCy/+ROqQb9D/etRV0 IADaqdPLsP6TAb5RpasfglrYJez9Y4f3bB7EdBjJ3L0y7phAkSRloniBAMQ9WiUJAuuR DRtBvjnHjbbNgy4V+j7DSn8AFH2yuGG0Twq+eo7vkdwMAOvpBqg3RGNy0fzWnEhe3rns r4RLNON1rZ9m2bco3CPvTY12B5E/Uz/W/3C8j1iSlE6Be5e6rueK0ytz6supnwgF7r7q Hrpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=khzwWxmctBWJdV/d0vWKIwQSEX5x8MN4s93zUNVqiTM=; b=wezA4FTtG77BVqYRGHewFHFo8efOurVYRXDqqM8CoscVUWOVjvvgc6/+0Vh98jn1E7 jwKst29k854i1VWMzTwCc4YlDqHDlXacUZladSYrzq9zmW+s4HuLPAxl6dDPo/Zifrs2 +sIGN1HlfPC46L7b6FhaSCZ6XQ6V7lgSM9re5uVnzELLHExJ933WLbCAy0eV1KqtvqAi 5ytoZ7aQDbD6JKPanx2nhATqyGTDcj1hFIFS/4xIuK5CRWw6RWL/H4p6MfIUQCig0YHY YznnOLs+4tGz5DkQkOWjp2x5TtmMBmkNWxFad9Fdga2Jl1i0a3vpt7vr1Z/coFy1L3yU YRew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="I5dVXI/B"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b19si8376329edy.519.2020.09.21.09.47.54; Mon, 21 Sep 2020 09:48:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="I5dVXI/B"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728659AbgIUQrD (ORCPT + 99 others); Mon, 21 Sep 2020 12:47:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:53586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728636AbgIUQq7 (ORCPT ); Mon, 21 Sep 2020 12:46:59 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6B8082388B; Mon, 21 Sep 2020 16:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706818; bh=Ene7O8YK1qgIDkHOO2I0Sb/9C+Q1OqyCAPRST8nYiRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I5dVXI/BX9FWZtbScPZ7AikaubENPYiGAhaS9Z+hnHukiozlCQPu26Umuf8+RwQoU rXRi8ZjdJ2onG7KZXRwUxaKv+Gv6EZRJZUgGeGY+UxaSSbMLw5SXbMOe+Xnglaa8vl RM3+wc3axaXua/Sq35zxMc1t6LjJRmXUvVWTtnDk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heikki Krogerus Subject: [PATCH 5.8 089/118] usb: typec: ucsi: acpi: Increase command completion timeout value Date: Mon, 21 Sep 2020 18:28:21 +0200 Message-Id: <20200921162040.486534913@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Heikki Krogerus commit 130a96d698d7bee9f339832d1e47ab26aad8dbf1 upstream. UCSI specification quite clearly states that if a command can't be completed in 10ms, the firmware must notify about BUSY condition. Unfortunately almost none of the platforms (the firmware on them) generate the BUSY notification even if a command can't be completed in time. The driver already considered that, and used a timeout value of 5 seconds, but processing especially the alternate mode discovery commands takes often considerable amount of time from the firmware, much more than the 5 seconds. That happens especially after bootup when devices are already connected to the USB Type-C connector. For now on those platforms the alternate mode discovery has simply failed because of the timeout. To improve the situation, increasing the timeout value for the command completion to 1 minute. That should give enough time for even the slowest firmware to process the commands. Fixes: f56de278e8ec ("usb: typec: ucsi: acpi: Move to the new API") Cc: stable@vger.kernel.org Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200916090034.25119-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/ucsi/ucsi_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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 u if (ret) goto out_clear_bit; - if (!wait_for_completion_timeout(&ua->complete, msecs_to_jiffies(5000))) + if (!wait_for_completion_timeout(&ua->complete, 60 * HZ)) ret = -ETIMEDOUT; out_clear_bit: