Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98F554EE86B for ; Mon, 28 Sep 2026 17:19:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790615951; cv=none; b=V7e2V3cXl5Ih0S21gnjSUQw0k1jiXEtFjOoIjiQGd+oIK4u4TVrZHc3vBrU+gLyYhwOTgEP6mTYpFrMnyq87ARtZWiFHp6tOhI4UEvW12T9woG6dKcgSSyu7nYfPKSroNt6MUDZUbAtJm+NJ+oK69HoChHYieNmGgf4/9Eo/n4I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790615951; c=relaxed/simple; bh=WnPzOTBnOLBjWHSRy274vlZE7IROYEPKRRksgkVb/iw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TkboGw08aqL2DbOidmOVIPCQ4VZwkY+K02AWq+6+ypY5Epc0ngg7erTY/HGuuTySvJWHIbQquAh9o1xgBVivVteYDrR2yw2ZS0mSuL00XpH7DbUheF9T2x6b3h+eleaTXBy9m5iRCcFwRlxe128ulOeL9dQoTFTLdMBGW+G1gw0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=VB3TXCXe; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="VB3TXCXe" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2d8fd7a3f38so3175ad.1 for ; Mon, 28 Sep 2026 10:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1790615949; x=1791220749; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=qGfj2Y/eKe1ZG7o5pFOTvuJbhKG8WlfCFzo9fqTzU3o=; b=VB3TXCXe+HN4r+UQAWPMjyHh4A31RCm1xTAKQsC0FoCk6lCiZ2+E9GXfnxE/s0yWN4 JzawP+KLcRIX+3fnvJpegNySVke/0qQVAwvTXRZirdm4YOzMVphXaCiH+Ax0a2qu8yjR 8f6WMexWjWjS+DB/9DRrZmF5+BAROEoQB8fBxpPfhTs4YRFVeXCv1WdQOGg3eMwiD0oV UfzPgfNMChm4mwyBT9jDjfvYVmbJXJLKB9ipARpQRj0NVTnCOE9r0XLBa9uonxFFGniR 6JcT9ToseIDd1BBb8kQ8dD0QV3CH7dOjg837ntYDReMZSsvDPQKyh5zszFdu3PYxXyso QgAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790615949; x=1791220749; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=qGfj2Y/eKe1ZG7o5pFOTvuJbhKG8WlfCFzo9fqTzU3o=; b=WS6gderdbvcsXan8owBhQrCoADYDNAAoJ4SEFOTX1mLzPUs39n7SqdpdwdqaQ1iHge zZdDJqRCNSG3MNdY+Nlt6ORqFSvR6XumMT0QLS61mNLKPEI7tWdkm/dLVIpkR1ha82hM UxcXfRORKzvPs9jtjE9tsAsxYOVtQJfmXWDgUkesAFCVS+DWHYKFgAym3QT8Qc2dpLQn qIVayFB0/WQOc/A8rCer4s5W58MZb1dF62pz/5DO7FY5GGEV6jIKclc60U9sxoPImSGR 8uR60T0yGsZXgsRXwLvf6FOzlgL3gcIuvEL8mx2B9+iIJanYuUDWuln2sn6PbvbHG20y mm3g== X-Forwarded-Encrypted: i=1; AKwUvBz0wxnIV02ioHqfUcmoUGmj4ujkUx8m6zxmnuzb69V3vMsAkQ8bgyuf1YLh2Gt+KbtIKnJu43oxICs=@vger.kernel.org X-Gm-Message-State: AFq9FYLAjlW5IWWU7AANtDOEmtdnUatoVVG4O7Z4HZ7UgBBBOKBpgOye 4YP0gVZlZHfbk2cEn6HWiQiwUcGhMlX2Crfhauo9d5HvcIw5HzetnXSdmpqlZXXzJA== X-Gm-Gg: AYBFou2r/XE60d/DVRRzRQ8P0COPODOFCegPxSWURoYbk9b6BlMOxh/vMLUwicVgErK UkTVvWpdhVzWnmJpFRx7QAyBQlek6XAREmWuPxMwhyXH07Ed//dhhY3AkMGjtbpU2UHMsjU/Y7/ NtVzRVu+Q6frpRtddzLCzKcVbiyNEJC8vofEQahBcr/J7m30vx+nKFIkhqm/n8lj9cS4mrcEb5K VID6HQwk/EUguj2+6Xa1klxCaDPnD5M9TxDgdG+nXGTBN/wijK0l4ZyjhQnP/MWPtQrOuQH7aBj pKcyQERaA6MeTHfaLw4y5dvvJ5DmPIn+y5je79g4FpxoB/eDlIAljh/myRj8Gxqh2BivQr6Uvqq iGhX7wv+S3/MyjhvUqTpkt87XUDtVNKR4MmGb2RyzhpcIK1yg+JQvtbj9QwmvIa0/fA+n1LV5YP Hm0TGIjyf+Wr03QYWjKSoGUAiIEKMjdx6FlPiNCziAqAVH4bEEzuvWwLcUTc/dvGPdm/lJlOQVU PP8xe9ekiEEWdXFxDFP2znSqSzr8PYe4/4Z X-Received: by 2002:a17:902:f70b:b0:2df:8e89:3bff with SMTP id d9443c01a7336-2dfa9795c44mr8307715ad.17.1790615948122; Mon, 28 Sep 2026 10:19:08 -0700 (PDT) Received: from google.com (105.211.142.34.bc.googleusercontent.com. [34.142.211.105]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cc7a4b03082sm2784007a12.11.2026.09.28.10.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2026 10:19:07 -0700 (PDT) Date: Mon, 28 Sep 2026 17:18:58 +0000 From: Pranjal Shrivastava To: David Matlack Cc: kexec@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-pci@vger.kernel.org, Adithya Jayachandran , Alexander Graf , Alex Williamson , Bjorn Helgaas , Chris Li , David Rientjes , Jacob Pan , Jason Gunthorpe , Jonathan Corbet , Josh Hilke , Leon Romanovsky , Lukas Wunner , Mike Rapoport , Parav Pandit , Pasha Tatashin , Pratyush Yadav , Randy Dunlap , Saeed Mahameed , Samiullah Khawaja , Shuah Khan , Vipin Sharma , William Tu , Yi Liu Subject: Re: [PATCH v9 08/13] PCI: Save and restore the ACS Control register Message-ID: References: <20260918200640.887030-1-dmatlack@google.com> <20260918200640.887030-9-dmatlack@google.com> Precedence: bulk X-Mailing-List: linux-doc@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: <20260918200640.887030-9-dmatlack@google.com> On Fri, Sep 18, 2026 at 08:06:34PM +0000, David Matlack wrote: > Save the ACS Control register in pci_save_state() and write it back > in pci_restore_state(), instead of recomputing the ACS controls from > scratch with pci_enable_acs(). > > This makes ACS symmetric with the rest of a device's saved state. Today > pci_save_state() ignores ACS entirely and pci_restore_state() re-enables > the ACS controls from the kernel's current ACS policy. As a result, a > device can come out of a reset with different ACS controls than it went > in with, e.g. any controls programmed outside of pci_enable_acs() are > silently dropped. > > pci_enable_acs() runs when a driver binds to a device > (pci_dma_configure()), i.e. after pci_bus_add_device() has already saved > the device's state. Refresh the saved ACS Control register there as > well, otherwise a subsequent reset would revert ACS back to the > configuration left behind by firmware. > > Devices that rely on device-specific quirks to enable an ACS equivalent > keep that configuration outside of the ACS Control register, so keep > configuring ACS from scratch for them. Do the same for devices that have > no saved ACS state at all. > > Reviewed-by: Bjorn Helgaas > Assisted-by: Claude:claude-opus-5 > Signed-off-by: David Matlack Reviewed-by: Pranjal Shrivastava Thanks, Praan