Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp698215lqs; Tue, 5 Mar 2024 13:47:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVFcZ6OV2cJIzH3nkr89N2K0pNm5BwyXLn/w/8zPQfKAkge+frDEFUuKLpqVHsdx5IP9SqR9rNyyOSrnyyiaRV9aSauv6XicL2InGD/Fg== X-Google-Smtp-Source: AGHT+IHTBUJZY/J/Tc1QAV6eTC0/lSz/JLQLi3IW68zwFohuWFOERtacV+5z7WQtISLlfxsu0Chx X-Received: by 2002:ac8:5dc7:0:b0:42e:def6:3d31 with SMTP id e7-20020ac85dc7000000b0042edef63d31mr3058178qtx.49.1709675227825; Tue, 05 Mar 2024 13:47:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709675227; cv=pass; d=google.com; s=arc-20160816; b=ljKfnAh1iD6XSzjK7eatcUgRiboAxrtUdI/iNNTa2v0x8pGSVgtGXuGBbnY5KRAHd/ G6o+QJyLnn66LpfKnaNwSzVNgshp3UK2QlUqQaIW/dsTHJRol8+hqbANP5iKGyp8ls8Q 7VTcIN8NXqVAMXxJzhZT4ECXRNDKh7SFgu+USyH6ABjdvO9nUH364nrYmv3uQe2iyx9h wQIdIcA8lLASYJ4vzUC5Y0/aV4RRk7kREiD4s1FykGx9H5qOSPUQLPJ+MOBfETszAwPM cOA46YaDQLgF4Z4aHrioMxR3KiP3x2aaLgM8ofiKY2wYRCrG/wtgbm8YApx1miLoQFDg P6hQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=gPwyKyRg/6C04lC5LEKd4r4UzxQTbAq6BpuA1AcGopM=; fh=ySMM0A4lYyfy7/m0A01yP3XMEqnQdJ0BBU3PYXgatbs=; b=V+8zChVfPzylTZtCPXIVfuSv/8UcbsrEOW+M68pn5FRotrYAWLthFeoeMpTvePJKdA yGec+EgIstBL7CJKhMJAKrXBhi1QNG8jFqr7NxTojZTMdbRcKtFvPvkxLebGoFI/azSM ss8RNdXs9XM7ig/E4YEsJvrgfc5cwDNNlOW4FemFd0iOqLOYTK+521XEawC3yVf6niHw zoduq30hAS9xuIMwV1IZPAw5X0dsGu0wTY2F8CnNSgPalepYUWrfI+dVJXf0tQgUboak KTWXQF4WBzBIz5+6+Kq/TEHbTAmUjPO5NanH4HKgy3Mdeoe4qbisNUmH18SXzSO24584 5FxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eHiuENwA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-93024-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93024-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id cx9-20020a05620a51c900b007882d713b5dsi4404588qkb.11.2024.03.05.13.47.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 13:47:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93024-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eHiuENwA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-93024-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93024-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8BB431C21A80 for ; Tue, 5 Mar 2024 21:47:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9670612CDA8; Tue, 5 Mar 2024 21:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eHiuENwA" 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 BB31926AD0; Tue, 5 Mar 2024 21:46:58 +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=1709675218; cv=none; b=D3795pQhh1OpPwS9G+fHfwXeywcPNfyKHPZxbe9Nh31oo4E3o3PUq8O4OcE0gUaNkSpkiW//V4FNixOIjXGw1QZsgyu9711QSCMQ7ePWMl8CcZq98lkLxWBAuK8p8N0qVgbuANLylP2g8TiHNbxMpka/Z/wRQk5eLh9gokfs+N0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709675218; c=relaxed/simple; bh=OD6AI2U1UEuP5wU1R3uEeYZuHVK+Wompw+JThsAf25I=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=iy2rHFbVVVQrMi1QNvjwWAr8F5Id2t+GGRWdQOog6TcX0FbucqGeybWuk9qfG9YnQt4Y6o6p39mycr4d3p+DrxSi0X9B3e3Xvbp8UMEJf33eGW+1rgemAt4N6pa3iYsxLlxVJ5ctOVaD7WbZEG4dNJAeqWHT48J2uD7REQqHWls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eHiuENwA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF473C433C7; Tue, 5 Mar 2024 21:46:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709675218; bh=OD6AI2U1UEuP5wU1R3uEeYZuHVK+Wompw+JThsAf25I=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=eHiuENwAYxHUsepW+xTvgywZLlprjoNJMN0yJ3UUR0k+RwcLSA3OMNud8SVKsZMg2 fE0cePXaknQfgYbddSWDI/dEWFhdn3PeYnt3baR3ewYOCHFmUchCC1dDMZG2TIQ6R6 A3dJ7UyHnCKlPWjglDFP2kl5pA3YdZuUHShwNHl7nhcL3D6OKXDWPxyz6M7ASE6xwN 6JqOrHqyF4jaMMw1SOWM0irCg7K372zEZdMQd294aZyxr6+60n4oCu1wKmJvMotCl0 mqGb4AdZBjFiAJM3Clx399ATS7lJdrlyal2PzRx9VbcnuIQ/1RwlpvDenzW40ZUaZf 5vf3aAMwPbEcg== Date: Tue, 5 Mar 2024 15:46:56 -0600 From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Mika Westerberg , "David E . Box" , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , "Rafael J . Wysocki" , Tasev Nikola , Mark Enriquez , Thomas Witt , Werner Sembach , Vidya Sagar , Kai-Heng Feng , Kuppuswamy Sathyanarayanan , Ricky Wu , Mario Limonciello , Bjorn Helgaas Subject: Re: [PATCH v7 0/5] PCI/ASPM: Save/restore L1 PM Substates for suspend/resume Message-ID: <20240305214656.GA550701@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240223205851.114931-1-helgaas@kernel.org> On Fri, Feb 23, 2024 at 02:58:46PM -0600, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > This is some rework of David's series to preserve ASPM L1 substate > configuration across suspend/resume. > > We've had several attempts to make this work: > > (unlabeled): https://lore.kernel.org/r/20240128233212.1139663-1-david.e.box@linux.intel.com > v5: https://lore.kernel.org/r/20231221011250.191599-1-david.e.box@linux.intel.com > v4: https://lore.kernel.org/all/20231002070044.2299644-1-mika.westerberg@linux.intel.com/ > v3: https://lore.kernel.org/linux-pci/20230925074636.2893747-1-mika.westerberg@linux.intel.com/ > v2: https://lore.kernel.org/linux-pci/20230911073352.3472918-1-mika.westerberg@linux.intel.com/ > v1: https://lore.kernel.org/linux-pci/20230627062442.54008-1-mika.westerberg@linux.intel.com/ > > The most recent posting is the unlabeled one mentioned above, and I'm > calling it v6 and this rework v7. > > Changes since the unlabeled v6: > > - Rename pci_save_aspm_state() to pci_save_aspm_l1ss_state() (this > is the reason for opening this again, because Vidya's patch [1] > had to do some incidental renaming). > > - Rename pcie_restore_aspm_l1ss() to pci_restore_aspm_l1ss_state() > to match. > > - Move the PCI_EXP_LNKCTL_ASPMC from pci_restore_aspm_state() to > pci_restore_pcie_state() so both writes are in the same place. > > - Rename pci_aspm_get_l1ss() to pci_configure_aspm_l1ss() and add > the save_buffer there as well. > > - Split [1/5] into two patches: move pci_configure_ltr() and > pci_bridge_reconfigure_ltr() to aspm.c, and build aspm.c > unconditionally. > > - Squash [2/5] and [3/5] since [2/5] didn't add any functionality > itself so they seem like a single logical change. > > [1] https://lore.kernel.org/r/20230125133830.20620-1-vidyas@nvidia.com > > David E. Box (5): > PCI/ASPM: Move pci_configure_ltr() to aspm.c > PCI/ASPM: Always build aspm.c > PCI/ASPM: Move pci_save_ltr_state() to aspm.c > PCI/ASPM: Save L1 PM Substates Capability for suspend/resume > PCI/ASPM: Call pci_save_ltr_state() from pci_save_pcie_state() > > drivers/pci/pci.c | 89 ++++------------ > drivers/pci/pci.h | 13 ++- > drivers/pci/pcie/Makefile | 2 +- > drivers/pci/pcie/aspm.c | 215 ++++++++++++++++++++++++++++++++++++++ > drivers/pci/probe.c | 62 +---------- > include/linux/pci.h | 2 +- > 6 files changed, 252 insertions(+), 131 deletions(-) I applied these as pci/aspm for v6.9, replacing the original unlabeled v6 that has been in -next. I also added the patch I suggested at https://lore.kernel.org/r/20240223213733.GA115410@bhelgaas to disable L1 inside pci_restore_aspm_l1ss_state() where we actually depend on it being disabled. Bjorn