From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.173 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796426568; b=NeljyYSq114abHP6LPWH7DPB2TWaxwWpIS7AHzYyzzrsAMBiBUho+odd58kOECpBAlNO m/WfAnIuA9KOaUd+HJt9XW83hrC/nMST98fhuXtppdL5hhLwj3Yn2n9vVFj59zwpKMRG2 RKaqyHrB+tLUSUa8hejLcKXOxMKmOsIg9II6cPIux5R8vMaENnB8lVbrwXHShJ1/FsS/+ 7xS914VyUPgCRgCYlAmrtT+DxbNJwmxgqITjes4q4K9eL6YFwcLlVJVcmY2TVdLFtuAjm 99Xr/wlQubqxkwgPViG+VHBr3ThZTZwl2G0ky9+OauaRfdtvmLfQOzW6eEVNP8S6BFw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796426568; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Mime-Version:Content-Transfer-Encoding:Content-Type:Date:Message-Id: To:Cc:Subject:From:X-Mailer:References:In-Reply-To; bh=egEB4tqKAmYu1OVv3TLkXydv5XcabfSGoUbOmkXHZ48=; b=QGOaLSpIdNBZZn9IDnwkNE8SHdMK2wS8TetiAg+uQGgVYajzMaLtOg74IOWn1PD/es2D yCpyEVbxgtzCNdF4G514zZv6mYm29QqnmTDgTWUvgP13/gaArnKiM5VtmwKLKHRw6+464 ar9e8QElvGt0IawvyCIVImW+mrekFCDpzaSGIuS1Uvk6aY+H+6w5AQRx7T2UqG0irxL14 EfsFWEi9h6X65zCsDiiNfmf0SVG6otfzdAlcsBeOYhvRQHofgt5N5z6v4WIBNC3DBXrM1 0OHwPz4vcdYDpoCGo7WpAWfw0vTRJ5WTECjd0X84LJt35xECsLkD8nCV5WhjKtNY+6A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=mKUcmb98; arc=none smtp.remote-ip=209.85.210.173 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55AE2606A32D for ; Fri, 4 Dec 2026 23:22:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 55AE2606A32D 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.a=rsa-sha256 header.s=20260707 header.b=mKUcmb98 Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-8b67f25e6e1so805435b3a.0 for ; Fri, 04 Dec 2026 15:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796426567; x=1797031367; darn=vger.kernel.org; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=egEB4tqKAmYu1OVv3TLkXydv5XcabfSGoUbOmkXHZ48=; b=mKUcmb98a8j0WA2Q5tcJMvfY5GvvwqbV0RJNJETwj6rRJsa0pLQKQoJhXq8BUbGKoJ 9T26FsKREDXJ9XOmDd7V4C1K1V/y69899t0z7osJqXkJaEVzvhMtbHcOaYQr9dq9+XpH BZeE/bUhiPFm1Fqvi3n0F7qMXqTIkL6sJgqLEe95EVtF2HOjsX7UwIPHYwN6kxT+PGQM 5OgGIzuqZDUbd5b832feGr2mwAc4fZ8hS7lgAxL5E0l6uIdpnZYmxHogNC3MfluNquPh mSvWaAD1M2GT6dOyDDO/1yjaXQ5UhTpE1rndnNYEUqxNT05p77Fxyhrr93sYRNyZkcFK eOhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796426567; x=1797031367; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=egEB4tqKAmYu1OVv3TLkXydv5XcabfSGoUbOmkXHZ48=; b=D/rkkFnIsYQJulKXDLr0g2Rhkt4g6Y0H7fOoyg7zboLAUdoXXqp4nTa4NooKY5p+n6 HCzgR7SN9gZOitQV49PNWxqvc04n0ldYworlKX9bMAw+8mON4qVLjlRsjSDERxlMZEMr EeWbzlRJTOTQ2BAa0wCWb9Aq8zUOgugMHA7DvPBmAqyOwME9x7QSlE9UPAoNLewskWrT ePkf5cStuuhV2t2YbsPo9RGwvXJ4kmZ115tIrpyZmgC0hxUDs8zZ2x+uJN6yTt/Oa74u tc9rc7wTCVYe+guVI/s0OVcX73vHjJ5qMFblfuT+s/8iBLMoKUYXJMdIVjJrs/8k/Snc Gmqg== X-Forwarded-Encrypted: i=1; AL+hErHAJFBPs51P/4rTML5I+jHbImcGP6O9YDVAEmgbhMVmNk0iePw6TCM5NkcgV+EyJAIUs2hq1RyvzLM=@vger.kernel.org X-Gm-Message-State: AB4q+uHh1FX/nq8PPdHGKxk2+c2CY5xsaQlK/ng7/M4UncDLREy5ictW miVFzbf+niCtQj88gbKIcUmaHgJwaIHGEM46fgjBJv6vpGSBebDBE3U+BXVXSMGW1K2cWa0/8Z0 Wmg2xOA== X-Gm-Gg: AZFdTZcGwpGZnqB/AHLYjn1CGm3CKPBZpXL7uk11PIcvA4+2uTBgPBuqwX/wab9rpef HhtXucL7lqIXiGxWGBEEB+1zxXgce/oFnyRYDkWi3DACu3FAWq7/FBrJ9becpxlFWP9YdYKeml3 meaTQrua0qj4rmDt0dJg+600QPZOdS+xx/GK3UMEo0sxcrkFBZgOMUpCrdMFKGSZTzOun3VaeR4 FUDBpAR4Fj4Gz5dZBb3sqcQVlJt6wxGvFfld07ZePhJYysDKU31iM8h24FJh5Shinvy25lvrXl7 xAx9wgdS/uDumX00un588PouZObz5cJcOUJ6TtevN/m3cHgoMFXwnGTRpx7gumXfaQEjehJqvKY fWD/R2pH/R1R+wZj+LC1XzTdFw8fLt5XBdaa4/xfnWvuLm3OyZogyTWVqfO/U797q+YOZP3ogPM Zal/QvyllPtnvaP8c1+m4T1Lhy2A7SoTMBj9l4JsKWJGVe/03xHORp1x68L2UchMX7iHuqqjAte 3iKwEsMBj3A+O+GZvl865ngzljssPWCteiN8VFJvZwcuxDOpfkgyOIdvw/Cqv/4+Pdwdm6p0p/Y jKksDMXA7GRTvfvdi/xmRUoFfORPTHe1HZGiH9Zw+lQw15Ud5ayyO5OUB0QMLdCqIC5G5v/VZ9Q a+KYqIgUClw== X-Received: by 2002:a17:90b:2d81:b0:3b5:35eb:5ea4 with SMTP id 98e67ed59e1d1-3b5e06a6759mr2859429a91.55.1796426567083; Fri, 04 Dec 2026 15:22:47 -0800 (PST) Received: from localhost (33.79.127.34.bc.googleusercontent.com. [34.127.79.33]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b6166af840sm651056a91.2.2026.12.04.15.22.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 15:22:45 -0800 (PST) X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 04 Dec 2026 15:22:45 -0800 Message-Id: To: "Lukas Wunner" , "David Matlack" Cc: , , , , , , "Alexander Graf" , "Alex Williamson" , "Bjorn Helgaas" , "Jason Gunthorpe" , "Jonathan Corbet" , "Josh Hilke" , "Mahesh J Salgaonkar" , "Mike Rapoport" , "Oliver O'Halloran" , "Pasha Tatashin" , "Pratyush Yadav" , "Randy Dunlap" , "Samiullah Khawaja" , "Shuah Khan" , "Vipin Sharma" Subject: Re: [PATCH v2 02/17] PCI: Add an offset-indexed store for saved capability registers From: "David Matlack" X-Mailer: aerc 0.21.0 References: <20261106004218.604799-1-dmatlack@google.com> <20261106004218.604799-3-dmatlack@google.com> In-Reply-To: On Fri Dec 4, 2026 at 9:55 AM PST, Lukas Wunner wrote: > On Fri, Nov 06, 2026 at 12:42:03AM +0000, David Matlack wrote: >> The store holds capability registers only. The configuration space heade= r >> continues to be saved in pci_dev.saved_config_space, which is embedded i= n >> struct pci_dev so that saving it cannot fail. > > I'd prefer moving saved_config_space to the new store as well > for consistency and simplicity. As an optional optimization, > the saved-caps library could skip the hweight and test_bit > operations for the lowest 16 dwords. Agreed, I'll do both in v3 (more details in my reply to your other email on this patch). > >> +/* >> + * Return the slot holding the value saved for the DWORD containing @of= f, or >> + * NULL if there is nowhere to save it. Reservations that do not fit in= the >> + * device's configuration space and a failure to allocate the values we= re >> + * reported during setup, so return NULL quietly for those. Reaching an= y other >> + * register that was not reserved is a kernel bug. >> + */ >> +static u32 *pci_saved_cap_slot(struct pci_dev *dev, unsigned int off) > > Documentation should be kerneldoc-formatted so that it's recognized > by cross referencers such as elixir. Will do. > The "slot" terminology is a little unfortunate as it sounds as if > there's a connection with struct pci_slot.=20 Yes, good point. I'll swap "slot" with "ptr" in the next version. >> +/** >> + * pci_write_saved_cap_word - change the saved value of a 16-bit regist= er >> + * @dev: the PCI device >> + * @off: offset of the register in configuration space >> + * @val: value to save >> + */ >> +void pci_write_saved_cap_word(struct pci_dev *dev, unsigned int off, u1= 6 val) > > Another naming issue: "write" sounds like something is written to > config space. You're actually updating the saved config store. > > Same for pci_read_saved_cap_word(). Maybe "store" / "retrieve"? How about get/set? I'd like to avoid "retrieve" since patch 17 already uses it for Live Update, where it means something else (pci_liveupdate_retrieve_saved_state()). > Aside from the issues mentioned, this looks pretty good! Thanks for the review!