Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1141490rwe; Thu, 25 Aug 2022 16:45:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR5hFZdJkA42gdrf7ZvGfzC7gHShDv1wwx7XlPuY1bWu1WHmPzhOS8DjQwOlRt2rjBBNz/hV X-Received: by 2002:a17:907:a422:b0:73f:18a8:4137 with SMTP id sg34-20020a170907a42200b0073f18a84137mr336781ejc.10.1661471132716; Thu, 25 Aug 2022 16:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661471132; cv=none; d=google.com; s=arc-20160816; b=Twuq8aIS+CiAxyu0rrfrB3CMUGY6f3Rt9gxBbFwV0sKn8UawpT8HYk+ZlqWsqRZ3AM NbTsAaKZgLyNM5oH1/lMiWXKbckTMRo4pNVP+zVTHl+pTJ9CcPRsRTwYjVBsGKtuv1Oa 0z0HC41kx4NqNzRVxXRy058zdqOaSqygJ/xuceth0pgxamB84TlIvbRFClcCYIbQrJ6k n7R+kO5dfy9cUvkQ2f22OsCJU9eQGMBViIZgJOhH+C1ys++61yz5uM5YgNB51Cur9TzS BqY969PvZNaqnECvteSrU11tAgZlJ7N6DByxmCLom49l36AYJd+niL8Kbf3w3q2M+35h Fo9Q== 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=/Gxc2iqHT0LYS9JGgRCbkHJUZucURe1iY6Lp42uMrxc=; b=ncdGtFolgPUMfQgLNnh4vodnr71wyDTz+ZJ1TXcDrbkWPE1847Tqm1pzbnTd8wboIZ plTciUCJkxv0kMcoSfBZb6VeCGmly8FZz5Jk0AMNV3VtM6dfAV9RbWUy652zAPp4Hyil jOTOwak/yUlvGvf1VbLdVaa8xKbrNL1AHlwHkgqYsTLaGpmV5UB5ZmVwa8CbB1dMG3/O o+SJMRPMItam/UwcHaab0sO+sIEH8Ua0WAhP282p6s4V0FQtlOuaJuavlNt+jS9UOPse PLwics9rAQzJc4b1h7IjhtzsyAsSxl9EDPjk9bSrLEUkRFlwD+dMFQ7La6vMY+gzpxXt pG0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ah2YD2Hh; 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 t4-20020a508d44000000b0043e6a16bca1si453258edt.475.2022.08.25.16.44.51; Thu, 25 Aug 2022 16:45:32 -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=Ah2YD2Hh; 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 S243837AbiHYXBb (ORCPT + 99 others); Thu, 25 Aug 2022 19:01:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237680AbiHYXB0 (ORCPT ); Thu, 25 Aug 2022 19:01:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C34D02F38D; Thu, 25 Aug 2022 16:01:25 -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 ams.source.kernel.org (Postfix) with ESMTPS id 75222B82ED6; Thu, 25 Aug 2022 23:01:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07CF3C433D7; Thu, 25 Aug 2022 23:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661468483; bh=N9/OkBdSri03Qzc+4rkRzs+yO6Yj2dmrnrsBxRJtJkA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Ah2YD2HhZ1OrzztkUliUk/p7ynvLyqyqpmGJkdpkIZ6PmjppuJJLmDEqVokgvdrQn PKBGzBB/H7cLvFxLwO194fgJzJnOo7/6+Tt1Bh0KlTOw/426psUnV7QEa+0EKOlx9g dQT4q8GFyssoZGz2rcgSN0oiMADrQw97RNllV02FEq4EcLseQbpBeUL6D7O2i/FClZ E0ULcJoHPd1p9XDzrDSD+vgKpNphoOvHgpOUUSdiN6OBKGtxSmcGutjjFR17iJ+MKR q7EerHOBxF2IqY1ArbP2R1/2oscYC1kB7H9llbo/c5wnlCOGuY5blKUqQ/+nPD1LQB 9CEhCMT80SinA== Date: Thu, 25 Aug 2022 18:01:21 -0500 From: Bjorn Helgaas To: Kai-Heng Feng Cc: Vidya Sagar , Lukasz Majczak , Rajat Jain , Ben Chuang , bhelgaas@google.com, lorenzo.pieralisi@arm.com, refactormyself@gmail.com, kw@linux.com, kenny@panix.com, treding@nvidia.com, jonathanh@nvidia.com, abhsahu@nvidia.com, sagupta@nvidia.com, linux-pci@vger.kernel.org, Linux Kernel Mailing List , kthota@nvidia.com, mmaddireddy@nvidia.com, sagar.tv@gmail.com Subject: Re: [PATCH V2] PCI/ASPM: Save/restore L1SS Capability for suspend/resume Message-ID: <20220825230121.GA2879965@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Aug 23, 2022 at 10:55:01PM +0800, Kai-Heng Feng wrote: > On Tue, Aug 9, 2022 at 12:17 AM Vidya Sagar wrote: > > > > Thanks Lukasz for the update. > > I think confirms that there is no issue with the patch as such. > > Bjorn, could you please define the next step for this patch? > > I think the L1SS cap went away _after_ L1SS registers are restored, > since your patch already check the cap before doing any write: > + aspm_l1ss = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_L1SS); > + if (!aspm_l1ss) > + return; > > That means it's more likely to be caused by the following change: > + pci_write_config_dword(dev, aspm_l1ss + PCI_L1SS_CTL2, *cap++); > + pci_write_config_dword(dev, aspm_l1ss + PCI_L1SS_CTL1, *cap++); > > So is it possible to clear PCI_L1SS_CTL1 before setting PCI_L1SS_CTL2, > like what aspm_calc_l1ss_info() does? Sorry, I've totally lost track of where we are with this. I guess the object is to save/restore L1SS state. And there are two problems that aren't understood yet? 1) Lukasz's 01:00.0 wifi device didn't work immediately after resume, but seemed to be hot-added later? [1] 2) The 00:14.0 Root Port L1SS capability was present before suspend/resume but not after? [2,3] I thought Lukasz's latest emails [4,5] indicated that problem 1) still happened and presumably only happens with Vidya's patch, and 2) also still happens, but happens even *without* Vidya's patch. Do I have that right? If adding the patch causes 1), obviously we would need to fix that. It would certainly be good to understand 2) as well, but I guess if that's a pre-existing problem, ... Bjorn [1] https://gist.github.com/semihalf-majczak-lukasz/fb36dfa2eff22911109dfb91ab0fc0e3#file-dmesg-L1762 [2] https://gist.github.com/semihalf-majczak-lukasz/fb36dfa2eff22911109dfb91ab0fc0e3#file-lspci-before-suspend-log-L136 [3] https://gist.github.com/semihalf-majczak-lukasz/fb36dfa2eff22911109dfb91ab0fc0e3#file-lspci-after-suspend-log-L136 [4] https://lore.kernel.org/r/CAFJ_xbr5NjoV1jC3P93N4UgooUuNdCRnrX7HuK=xLtPM5y7EjA@mail.gmail.com [5] https://lore.kernel.org/r/CAFJ_xboyQyEaDeQ+pZH_YqN52-ALGNqzmmzeyNt6X_Cz-c1w9Q@mail.gmail.com