Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2873409pxu; Sat, 19 Dec 2020 04:59:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+sTzfbiMdR5mJ7Ye9Pg7hf3Gmse179bH+EEPh/gTcFm1Tdo+lTCenAai9ETKYcqOCOda1 X-Received: by 2002:a17:906:6693:: with SMTP id z19mr8166022ejo.376.1608382784245; Sat, 19 Dec 2020 04:59:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608382784; cv=none; d=google.com; s=arc-20160816; b=M5dm41UG5nZJtuv0+ye0qj/RJY8Xfwix2CJFRvzKBcI4yBHkfN22Qlk+GbpCk/tGBz skFqirlGt9/0vcIYoi3HeYSe7x1n2LsBqiBcYu+Ypo93/r/GPFVJ8BeFeBtLyzga4DqK W2JIQphBFJPgUqocGPd+qoChCO6q/zLWdoYoA28TuxGVbTUwIX/zUCNuWTd5N1JNxM/X jI1ifMtp18L6BbpZbU9wRYsZDdM/WcjcXMkSbNY3KdHPvmOxNFMWQYX5G6vO8i5hh0mH zwezY0EtQyeS2GTWlAHGlxBCRxieveCTB9sxjXcFV9ziFnQjTJtskSKXbUdvWc9THrvH 91KQ== 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; bh=+TZhDK+sLKhKvOWpTnolxOSbaygOO0vnoRXMcStnl/U=; b=i7MbcVnV+VW8mvmgEyk0gUA8Ax3XsGZmYdcWTad/qumVbgEkf/yIzTw2+s7DSZVmb5 4Uy24V/eIcqzPchOhfuUmA4hlTDOM+AiI/EswLeSaGrMTTGvVKGFyseTlBofp9AORPbL XzM1PckXxBMNSauWNVuXvD6mkGWXzpTQ9O3u+ivTxWxzY54cPlavwT2V0nJn6a2PGHt+ pb2UttA4zvEX+SbYfWD6cYiCmniG/K3Kq/RlKiggF3Vm1FU1t2CXDeibE5A5rPiIv1mz mg1+rQWFa1wvqiPjBYdq8IsABdUSb/mKvmZyzTDEKF/iEJcfFev9WxYIfDuC3KXAf2it e8vQ== ARC-Authentication-Results: i=1; mx.google.com; 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 c4si4352066ejk.182.2020.12.19.04.59.20; Sat, 19 Dec 2020 04:59:44 -0800 (PST) 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; 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 S1727090AbgLSM52 (ORCPT + 99 others); Sat, 19 Dec 2020 07:57:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:44116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727018AbgLSM51 (ORCPT ); Sat, 19 Dec 2020 07:57:27 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Jun , Mathias Nyman Subject: [PATCH 5.10 09/16] xhci: Give USB2 ports time to enter U3 in bus suspend Date: Sat, 19 Dec 2020 13:57:16 +0100 Message-Id: <20201219125339.532622249@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125339.066340030@linuxfoundation.org> References: <20201219125339.066340030@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: Li Jun commit c1373f10479b624fb6dba0805d673e860f1b421d upstream. If a USB2 device wakeup is not enabled/supported the link state may still be in U0 in xhci_bus_suspend(), where it's then manually put to suspended U3 state. Just as with selective suspend the device needs time to enter U3 suspend before continuing with further suspend operations (e.g. system suspend), otherwise we may enter system suspend with link state in U0. [commit message rewording -Mathias] Cc: Signed-off-by: Li Jun Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20201208092912.1773650-6-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-hub.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -1712,6 +1712,10 @@ retry: hcd->state = HC_STATE_SUSPENDED; bus_state->next_statechange = jiffies + msecs_to_jiffies(10); spin_unlock_irqrestore(&xhci->lock, flags); + + if (bus_state->bus_suspended) + usleep_range(5000, 10000); + return 0; }