Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3415331pxb; Tue, 19 Apr 2022 01:50:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAUjeIaR04UH+B3KNmloeyHcb5UjsGPQkfcsk83Et2Z0meZVTAyUWQY01Q7LN6yPDHhVOu X-Received: by 2002:a17:902:7684:b0:156:25b3:ef6b with SMTP id m4-20020a170902768400b0015625b3ef6bmr14620986pll.39.1650358203950; Tue, 19 Apr 2022 01:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650358203; cv=none; d=google.com; s=arc-20160816; b=h7wnSpcIqM9SjqA2ydFD+dM4kyWainFjQ2vlyzoSerd2WvDOVJ/CJveI4ueaX6OWoS /3Q2Tpb7sU4JUiesMZtG75kRGhPKRQW/xTlhoI9QvdGkVyrQgWfl+hlLSHKtWc/ZXmgS xXZ8jnqnhCekk1mJ9oOleBsN1XA/AM7bf++Ajj4CeTvOrE3GER9/jm7AqjZ/t8dV9SmD 5TQqpUC4ZKBApLNi0tqqLddptdhEcO+k0jmw1h2QtM/xx4SAcwUbYeEPOfcWz7q6rm3n F0LerGR9q9SpJn0naYpg/QcUn68bVI+bjFYcgQC6x7dpnevOomuA4KdJvMATc373+Z3J C8ng== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=k9zAsbJbbMkbkhGPC3AiZK56sfvnFwgtRHAzZ3j6nuo=; b=J8VuqxKzjghYfguZUpOafioaN/xHNBsaVg2SieBiRbxnczoB9XJuIW0wpyk1f83K2B Kb4tkR2sL0dXJvPm7iKjz4p5roK1erp0j6ttc0KCS758akWHReSxheXgEwYAngKSvbey TrD1hbRGsSpdNXpgP3jIKsX+VbdsLxLiYYlZbif3GeQhiFJpBE5HzcVkF3hNKRhGr84L CW8UuSEOZ5osCWGkhrxIIjNNFMvnKRCEFJ5e90K3d4mFumseyE+5SDGKv+C1q5OucFdf bbqPtElWvKNKb5KsPzFKmo6XFaCDzzo9diEWnV1d2RD0sz96M1UaoOAhCtUK/M7fi4om LmgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LXaDrlWX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q3-20020a63ae03000000b0039ce0b6491asi11688371pgf.702.2022.04.19.01.49.50; Tue, 19 Apr 2022 01:50:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LXaDrlWX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347866AbiDRVE1 (ORCPT + 99 others); Mon, 18 Apr 2022 17:04:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347893AbiDRVER (ORCPT ); Mon, 18 Apr 2022 17:04:17 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDA822A248 for ; Mon, 18 Apr 2022 14:01:36 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id s14so13316694plk.8 for ; Mon, 18 Apr 2022 14:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k9zAsbJbbMkbkhGPC3AiZK56sfvnFwgtRHAzZ3j6nuo=; b=LXaDrlWX1IzYqRN2I3vgl3tGCggTtV1OtXzNrURe7q91ArQBRtZK39bEfj1eR2FSJN U5QWDaSAL43GTHUwnJPVIXuSz4jZGctINjNXSlnl+HXZci4ELdfcUBNccDAhW0SFPVb7 XnaFLHO3P7c55YnsXK9dBmYtmM5mCnDTn5IuQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k9zAsbJbbMkbkhGPC3AiZK56sfvnFwgtRHAzZ3j6nuo=; b=4mx4NZnp2TP4hcENC2hNgpYSjWNpMz11yrPWa+kUjxMdfwXMn9qD3e5Me3b5NiZcaI 4JcaRB/UGC3kI8lQiWlfTwby9B41fdnXJU5cTvH9nh5kgNGh9sFSlRBw6AAxVKqUjQkv qJI3x7jct6PeL42xAYwSy6sl8Ya7pEtJCINp5IDDCyWxRsvB5x4+FMfcYb9syzys0KKd 304WI8NHtP+nrBcRSt1bBDBCta3JcqkHzOmxqb44gt65WW/wRW9ASb0cWR15HA+v7MMI bhJzhNL3nAPd/+Kp/wfcIJR7n13qeN7qwkZSVPiuYbzzmv34Jih+J/EVyu+0zKCuQ3Pm wm3Q== X-Gm-Message-State: AOAM530mjIXOkzJMy0T5U6IYlDXch4auE2wBrkyfJfztFjIfrvZlBALa /wdTs1sYmKxoJRZmxn4D5gwz1A== X-Received: by 2002:a17:902:e3c1:b0:158:faf5:a0be with SMTP id r1-20020a170902e3c100b00158faf5a0bemr6899956ple.102.1650315696029; Mon, 18 Apr 2022 14:01:36 -0700 (PDT) Received: from evgreen-glaptop.lan ([98.47.98.87]) by smtp.gmail.com with ESMTPSA id y15-20020a17090a1f4f00b001c7ecaf9e13sm14047973pjy.35.2022.04.18.14.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 14:01:35 -0700 (PDT) From: Evan Green To: Greg Kroah-Hartman Cc: Thomas Gleixner , Mathias Nyman , Alan Stern , Rajat Jain , Evan Green , Bjorn Helgaas , "Rafael J. Wysocki" , Youngjin Jang , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH v2 2/2] USB: hcd-pci: Fully suspend across freeze/thaw cycle Date: Mon, 18 Apr 2022 14:00:46 -0700 Message-Id: <20220418135819.v2.2.I8226c7fdae88329ef70957b96a39b346c69a914e@changeid> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220418210046.2060937-1-evgreen@chromium.org> References: <20220418210046.2060937-1-evgreen@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The documentation for the freeze() method says that it "should quiesce the device so that it doesn't generate IRQs or DMA". The unspoken consequence of not doing this is that MSIs aimed at non-boot CPUs may get fully lost if they're sent during the period where the target CPU is offline. The current callbacks for USB HCD do not fully quiesce interrupts, specifically on XHCI. Change to use the full suspend/resume flow for freeze/thaw to ensure interrupts are fully quiesced. This fixes issues where USB devices fail to thaw during hibernation because XHCI misses its interrupt and cannot recover. Signed-off-by: Evan Green --- Changes in v2: - Added the patch modifying the remote wakeup state - Removed the change to freeze_noirq/thaw_noirq drivers/usb/core/hcd-pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 8176bc81a635d6..ae5e6d572376be 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c @@ -616,10 +616,10 @@ const struct dev_pm_ops usb_hcd_pci_pm_ops = { .suspend_noirq = hcd_pci_suspend_noirq, .resume_noirq = hcd_pci_resume_noirq, .resume = hcd_pci_resume, - .freeze = check_root_hub_suspended, + .freeze = hcd_pci_suspend, .freeze_noirq = check_root_hub_suspended, .thaw_noirq = NULL, - .thaw = NULL, + .thaw = hcd_pci_resume, .poweroff = hcd_pci_suspend, .poweroff_noirq = hcd_pci_suspend_noirq, .restore_noirq = hcd_pci_resume_noirq, -- 2.31.0