Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9456016pxu; Mon, 28 Dec 2020 17:12:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvya0SlofEeJv6YZYLqfstkRlx7Nj8ckf55FARq7P5A7QOFYivudIO7EjrBiYPBDeAx5CR X-Received: by 2002:a05:6402:c0b:: with SMTP id co11mr43505051edb.180.1609204347874; Mon, 28 Dec 2020 17:12:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609204347; cv=none; d=google.com; s=arc-20160816; b=mbvkE2Si1Zwv6D1mUoBbveok/m6tWBSZ7o5J8h8TXhmOx3tP3wFaqAGtzrvfqY3LZ/ FtxWInS52SV+qBJ78DYN50Xx0zq0kC7AMbwys+/1dap5VsNqf7VSqtvk9vVfDe2oh/Yl 38GM+uzVOLm4hoYdAmfRlXLy7yAYJ+BRDj+ARjRqnuN0FvBbD1fy6XAumbRf3lxSn+10 Qgq5Mw8hLvBnXNINisCF+o0pnY1AUFkqlSeuus+4EpJe+KV4ZVxAEIkp0SeZvCFBV5YW 2kduk+Axn8qZRGXXsv7RqJTAA4CTQrVpJhCFa1bUDjf5Iyu/yQhMMBXfshvTImnxLMO9 hnyQ== 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=Mb3ipWpI7FXGyf3KTe15AU9SsboFrkyB1RxCvk1/1xY=; b=s93HhDrQQLwZuwtCJHcQLm4am50KYib/NJVYuN5k9C59kIOgBt0Y6rMAG43+zYKVCU MzJ7c/93wbDGbfxztCw98WbLQbLXvuT1z1cuj6OY8lw+/JDYNHbWoDWwbrU9GoDaycMG TWAnwztnFXaF7mpEutt62CoC1/Tcr50Q0O41LL28Um5RCPGV4NhV/2SzvGIfQOzhsAbb z/+xgh4GpYrhQnaHT7KtAMwVWiirj1eiXE/GOBDAXRkdsFxmMpEN58fRnel9qm0VPjaY 7KTUV9Dp+8Zu8DzQiVdAY664B6dpxjTfHzQoTCFl/0CS1kxQ9vlAIdqLm3PZFXAmtLEh Pd5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GMqB+dTy; 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=pass (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 j9si21226043edv.261.2020.12.28.17.12.05; Mon, 28 Dec 2020 17:12:27 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GMqB+dTy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633785AbgL1QjR (ORCPT + 99 others); Mon, 28 Dec 2020 11:39:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:56358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729444AbgL1NAS (ORCPT ); Mon, 28 Dec 2020 08:00:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 936F722582; Mon, 28 Dec 2020 13:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160403; bh=2iY3FMv8rvS+96QWtPYxQScWAMxwvZduwNl1DhsT8U8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GMqB+dTywZazmBMMMKYDa/SaND6ajEnXTWEKGXj8qk9koU1UywbaciDviK6CH46z/ THR2nzJEqeJUZigXHO3vqIGXD5NUEJs8i4it3vtpULS9zIOrnjpSwUp4QU4PNU4c0V PyqV90aDg+Rqzq6KuR+7s4Kxf4x0DmkZHciW/qJM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Jun , Mathias Nyman Subject: [PATCH 4.9 022/175] xhci: Give USB2 ports time to enter U3 in bus suspend Date: Mon, 28 Dec 2020 13:47:55 +0100 Message-Id: <20201228124854.332998053@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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 @@ -1424,6 +1424,10 @@ int xhci_bus_suspend(struct usb_hcd *hcd 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; }