From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=83.223.95.204 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796406911; b=DLUGQvIn5Wq56Pum+/zb/Ce2U7THz3UgooKsKeY/2XeOr78dIZb6pGYEv8BARqCcKWAW mVFaJR7CYYO+MAnzMMDh+17lfNAGMDe/S8rRuwbaKbFVMZRIKYFtVUboxEKbUOVV9TK4L W0xcnv7ufWP5BBoKkR8onz/mBjTGuZfKHkxlpVFPxxUVSQjFqlfYiqWl9ZmQ2SJ9gr+6k M/giqbO+RWecglxzJAVIIDK374kq+XJhHuBLvLRlckjQlM0GA+5/sFbRwpNo7/e84rRQV B7E2OkVLz9xDFh4D2OZCrsGhsLQE9laA/LiRp8IOhY2wSmvJI4rcFZsg29w0ytzK2iw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796406911; h=DMARC-Filter:Received:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=WPIAYRjODngETi9UrJJ6Yzm4HP4CnBT2Fpn0K3XJScc=; b=Yn6TpK6/SfInmilyQQLM1pmxhubFj+0wZktfDVP6HAAamOmNgyytObMC8bSUyKZOTB4Y 8gmiHNYWrqcIPyXmHBQVpnVvuYWhKNuhaWC+ecZpB5eeeEUTNxtvF/AyjGhymwP+RAvwo 3TKu8JhFC6PqtjqibTxIwWW4HTOK5qQYercFQz4Y3K2tCfqyFAr+VF42y4hdeSo5trwcX mDGltxfyqPQyHlAt5vi2Lf+lHh10q2vDcVBgpMQgQ5t9dwJKlkSzvWyT/Z7G76yvXmH0r 0xujFIiumBzNzKGKOcLJc+nFLb9P/pSDWharBKcu+gzMCSQN02NOyIWxWIMzmc9b7XA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=wunner.de; spf=pass smtp.mailfrom=wunner.de; arc=none smtp.remote-ip=83.223.95.204 Received: from mailout1.hostsharing.net (mailout1.hostsharing.net [83.223.95.204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA016606A322; Fri, 4 Dec 2026 17:55:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DA016606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wunner.de Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "*.hostsharing.net", Issuer "GlobalSign GCC R6 AlphaSSL CA 2025" (verified OK)) by mailout1.hostsharing.net (Postfix) with ESMTPS id 43BDD361; Fri, 04 Dec 2026 18:55:07 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 26A6960CF5F4; Fri, 4 Dec 2026 18:55:07 +0100 (CET) Date: Fri, 4 Dec 2026 18:55:07 +0100 From: Lukas Wunner 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, linuxppc-dev@lists.ozlabs.org, 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 Message-ID: References: <20261106004218.604799-1-dmatlack@google.com> <20261106004218.604799-3-dmatlack@google.com> X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261106004218.604799-3-dmatlack@google.com> On Fri, Nov 06, 2026 at 12:42:03AM +0000, David Matlack wrote: > The store holds capability registers only. The configuration space header > continues to be saved in pci_dev.saved_config_space, which is embedded in > 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. > +/* > + * Return the slot holding the value saved for the DWORD containing @off, 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 were > + * reported during setup, so return NULL quietly for those. Reaching any 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. The "slot" terminology is a little unfortunate as it sounds as if there's a connection with struct pci_slot. > +/** > + * pci_write_saved_cap_word - change the saved value of a 16-bit register > + * @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, u16 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"? Aside from the issues mentioned, this looks pretty good! Thanks, Lukas