From patchwork Fri Aug 23 04:25:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 1975838 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qsePWQqA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=linux-pci+bounces-12057-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wqn7V4WLGz1ydn for ; Fri, 23 Aug 2024 14:25:58 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F3A28284ED2 for ; Fri, 23 Aug 2024 04:25:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3919383BF; Fri, 23 Aug 2024 04:25:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qsePWQqA" X-Original-To: linux-pci@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6CFA2E644; Fri, 23 Aug 2024 04:25:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724387154; cv=none; b=Nov7mhs9N3IUJ4oHQQ0yrcjILPPE3UsI1Ig49ZqF+CHcz1lZEGFUE5aM8UFJhaoMC1Ux156qQWRNeq/Kf+bxO8L9LzVZZ+V1ZX0EVKnVAyfNBcyKI50y5EhN2WdJt/txtcGC6w3y94KWjRhcA7MKJEYe9LsXKq5oTWgAdwGiQ00= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724387154; c=relaxed/simple; bh=a9AaoV/PlDTg4wiYf+B6pjA+/siBtOFdk8XhX8IhY7Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=W6j9DglRFLrs1b0xdxpivfwK90dDfU3DNnYI0RZK5ygwU/Eh264Y4BfWNgjQqf92si8Sl30lCG2rHYQmjPdbq7JuXvXa/IejeG5Gb7PPtVHjs54XE0bQRtC/F+xZu/hneoPHmK6TIU/QuwYwfD4230aHw6+SHJh8hXHLLcP1K9A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qsePWQqA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26CBAC32786; Fri, 23 Aug 2024 04:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724387154; bh=a9AaoV/PlDTg4wiYf+B6pjA+/siBtOFdk8XhX8IhY7Q=; h=From:To:Cc:Subject:Date:From; b=qsePWQqAqOoFpHKLEKvjWKJjr/6hf3tloxe2aqKutS2czCff++xtOp5S6o/LQtcRc XiLnhxHKzMSbBC/Q3F89ZELhnBgaVUCtRq5DXVvAlQIGQUlWa0uG7xT5jrkcKac6zO Fddwsmfv+O1XLKoOkla/E7/kDqilnX+PKPevGPtWW4qsk8b1Cw9hjYcu3VitDrl75v iZw2RS+IdAnJtaRIgAaVMyAj4UblzbfoWp7CwIvMrNqyVPc+CsYiExRYKyKEiHR9XT 8Mmq5B6EzYgTFTSQwt+eNHrBIMtrUXscNyViolQFpGmF2VQp+WI+bYqnYvfb1Ch6FR Hl5ZCnA1/KmdA== From: Mario Limonciello To: Bjorn Helgaas , Mathias Nyman , Mika Westerberg Cc: "open list : PCI SUBSYSTEM" , open list , "open list : USB XHCI DRIVER" , Daniel Drake , Gary Li , Greg Kroah-Hartman , =?utf-8?q?Ilpo_J=C3=A4rvin?= =?utf-8?q?en?= , Mario Limonciello Subject: [PATCH v4 0/5] Verify devices transition from D3cold to D0 Date: Thu, 22 Aug 2024 23:25:02 -0500 Message-ID: <20240823042508.1057791-1-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Mario Limonciello Gary has reported that when a dock is plugged into a system at the same time the autosuspend delay has tripped that the USB4 stack malfunctions. Messages show up like this: ``` thunderbolt 0000:e5:00.6: ring_interrupt_active: interrupt for TX ring 0 is already enabled ``` Furthermore the USB4 router is non-functional at this point. Those messages happen because the device is still in D3cold at the time that the PCI core handed control back to the USB4 connection manager (thunderbolt). The issue is that it takes time for a device to enter D3cold and do a conventional reset, and then more time for it to exit D3cold. This appears not to be a new problem; previously there were very similar reports from Ryzen XHCI controllers. Quirks were added for those. Furthermore; adding extra logging it's apparent that other PCI devices in the system can take more than 10ms to recover from D3cold as well. This series add a wait into pci_power_up() specifically for D3cold exit and then drops the quirks that were previously used for the Ryzen XHCI controllers. v3->v4: * Rebase on 6.11-rc4 * Sparse fix * Index based array init Mario Limonciello (5): PCI: Use an enum for reset type in pci_dev_wait() PCI: Check PCI_PM_CTRL instead of PCI_COMMAND in pci_dev_wait() PCI: Verify functions currently in D3cold have entered D0 PCI: Allow Ryzen XHCI controllers into D3cold and drop delays PCI: Drop Radeon quirk for Macbook Pro 8.2 drivers/pci/pci-driver.c | 2 +- drivers/pci/pci.c | 68 +++++++++++++++++++++++++++---------- drivers/pci/pci.h | 12 ++++++- drivers/pci/pcie/dpc.c | 2 +- drivers/pci/quirks.c | 25 -------------- drivers/usb/host/xhci-pci.c | 11 ------ 6 files changed, 63 insertions(+), 57 deletions(-)