Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp649565pxb; Wed, 13 Apr 2022 09:25:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpYx//PC718jnDiOCgwM/6/aGy7oyiSUGneXZaKkJKeA0EdVQm8CcyqCJL4s7dx8dYPdxK X-Received: by 2002:a17:907:97cf:b0:6df:846f:ad0a with SMTP id js15-20020a17090797cf00b006df846fad0amr40404461ejc.286.1649867100882; Wed, 13 Apr 2022 09:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649867100; cv=none; d=google.com; s=arc-20160816; b=hbWOxEXAvgNMhEoWR/hd6ID6+aHrDFpim/PSQUZLHB94CoQ0PJF/04yO1x3/nrAizV IDVsTvMzyYgqsIkCX6ARf0ACdcDS9+MzVv+CkyB29xXuIFuYQMs43UIwzcXgO9du9jdQ btZzJnrxMNbABwDEjh2JUP/qaZQBkVlbbGJ4L+x3bsGogQjQeB17kpWIHC5T5egHvmoA BUlGgE4hu+VEA95l43sLG03yb2r5lWtX1SQPY1xxUJDg08bi5PuSiQJaqSTU/ug7bESN nZhMSY6Xn6GeLHNtY3200kD+hEotrfNVQdI/Vy2NGMf7pmVU8s8gkoX3lB2WzpcMxKmA O6DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=BLI+Nyg/Ni75UOqspoWC+HU8EZeUpAgD7Xpu4sFJJTs=; b=KJL2AQDnG91/wk014TWlS8xcriZB+WYZMyMRNvucyHWwt++wvQNyXJc8Tr5vNfFAob 4zlr6hilVWh4u5gVU9CJUQmi6bYXoFZrt6/QVlE/n/7qa7vgi9L6WeIkbG9HlAlt9jyR Z1vvZoVBPqfZF97uiqbMGp2otyLowUuWEw6EEuDkc7edpvR5vhuG/hpG/2qeBeYFhOFk DHZckhWMH2WHJ+3ioG3AmgxkZzRD1fnkW0Cb5eo59QchsW1PvalhNfn3iYp5EBTS38kk IRQxHt+8o94sHvSRFjRr0D7a8f1y1rneCMHVx4eeGHkSlFN/jwixwEpOlGL9ukWpI9ZJ bZVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eUO8ZZFD; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id us3-20020a170906bfc300b006e8ab67737esi203923ejb.670.2022.04.13.09.24.30; Wed, 13 Apr 2022 09:25:00 -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=@kernel.org header.s=k20201202 header.b=eUO8ZZFD; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235754AbiDMN3N (ORCPT + 99 others); Wed, 13 Apr 2022 09:29:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232618AbiDMN3M (ORCPT ); Wed, 13 Apr 2022 09:29:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 628105D649; Wed, 13 Apr 2022 06:26:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5AADF6196E; Wed, 13 Apr 2022 13:26:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84157C385A6; Wed, 13 Apr 2022 13:26:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649856406; bh=huzeaPBM4joEiWG34xFTjGMlaFsI6Qi5QXhXd+tYt4E=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=eUO8ZZFD4VMw0xm2d7KhfkyWSTpIogel1xK2LFNPpTcqQWUBWSZkU7E0qTMEeRa6+ FDDeQtz5+8zg/a/uw37loUdLe8t2IP2upCrtDlGWC4DTwju3Gb0iifml08wHvPAslW 1mIPepdi+GgU+I1VfbkIkAZmLbqDhyoBgziZuySU/Cjm3vcFylh/0MOOVgqzT1jB/3 ae+jdYAOk4f/UqwmrapIM9rPHk/ibtO+ExhhJl9aSIwvqLbpLxSBB74y4KZH/fyw/0 lxhDlyiaXZV55Ya2xuF2X0fyimMZB2OurpDqbqgoLJOkk4Wnn7YAsgz6l9XFTEFDxW 2XIT8wqG2Q8pw== Date: Wed, 13 Apr 2022 08:26:44 -0500 From: Bjorn Helgaas To: Vidya Sagar Cc: "Kenneth R. Crudup" , bhelgaas@google.com, lorenzo.pieralisi@arm.com, hkallweit1@gmail.com, wangxiongfeng2@huawei.com, mika.westerberg@linux.intel.com, kai.heng.feng@canonical.com, chris.packham@alliedtelesis.co.nz, yangyicong@hisilicon.com, treding@nvidia.com, jonathanh@nvidia.com, abhsahu@nvidia.com, sagupta@nvidia.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kthota@nvidia.com, mmaddireddy@nvidia.com, sagar.tv@gmail.com, Ricky Wu , Rajat Jain , Prasad Malisetty , Victor Ding Subject: Re: [PATCH V1] PCI/ASPM: Save/restore L1SS Capability for suspend/resume Message-ID: <20220413132644.GA673431@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220412225047.GA627910@bhelgaas> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Tue, Apr 12, 2022 at 05:50:47PM -0500, Bjorn Helgaas wrote: > ... > I think we should try this patch again with some changes and maybe > some debug logging: > > - I wonder if we should integrate the LTR, L1 SS, and Link Control > ASPM restore instead of having them spread around through > pci_restore_ltr_state(), pci_restore_aspm_l1ss_state(), and > pci_restore_pcie_state(). Maybe a new pci_restore_aspm() that > would be called from pci_restore_pcie_state()? Sorry, this was a dumb idea, please ignore it. Maybe it would be useful in the future sometime, but right now when we're trying to understand the issue, the code churn would just confuse things. I think we need minimal changes right now (like 4257f7e008ea). > - For L1 PM Substates configuration, sec 5.5.4 says that both ports > must be configured while ASPM L1 is disabled, but I don't think we > currently guarantee this: we restore all the upstream component > state first, and we don't know the ASPM state of the downstream > one. Maybe we need to: > > * When restoring upstream component, > + disable its ASPM > > * When restoring downstream component, > + disable its ASPM > + restore upstream component's LTR, L1SS > + restore downstream component's LTR, L1SS > + restore upstream component's ASPM > + restore downstream component's ASPM > > This seems pretty messy, but seems like what the spec requires. Actually, I think it's unlikely that a downstream device would have ASPM enabled while we're restoring state of the upstream device, since we're probably restoring state after a reset or coming back from D3cold. But we may still need to wait to enable the upstream device ASPM until after configuring it in the downstream device. Logging of the previous & new state of these registers might help untangle things. > - Add some pci_dbg() logging of all these save/restore values to > help debug any issues.