From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE901606A334 for ; Fri, 4 Dec 2026 17:55:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0A85A6B00EF; Fri, 4 Dec 2026 12:55:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0592C6B05B2; Fri, 4 Dec 2026 12:55:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB1396B05B3; Fri, 4 Dec 2026 12:55:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CC3576B00EF for ; Fri, 4 Dec 2026 12:55:12 -0500 (EST) Received: from smtpin27.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B5B6AA0578 for ; Fri, 4 Dec 2026 17:55:11 +0000 (UTC) X-FDA: 85507052022.27.E308DB6 Received: from mailout1.hostsharing.net (mailout1.hostsharing.net [83.223.95.204]) by imf21.hostedemail.com (Postfix) with ESMTP id 85F681C0012 for ; Fri, 4 Dec 2026 17:55:09 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of lukas@wunner.de designates 83.223.95.204 as permitted sender) smtp.mailfrom=lukas@wunner.de; dmarc=none ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796406910; b=0BjslSAYuKoicfqAqi35/ArjWN868ji6143NjrChDLjo3gCKN4rWC6IOFBfqFSZt0njCg5 OQRr1BOpf5kzayXirtGqU8BIzwm+kF8lreXW7u8CmPiG+cKUp8APQkh/4LmKx/P5sVPgLC Z98+qihijYxpgFBkBXJsA859/DfkbL8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796406910; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WPIAYRjODngETi9UrJJ6Yzm4HP4CnBT2Fpn0K3XJScc=; b=ngp9DUsdfDGwP6xJYwBSSmEkuMjoC11dh3TgCekeg1sv3ulEVb2CuBwfSLneIwK9XTpDwf 1hwyx2ZlBsAJgEZJFpkSAR1h3g6O67hfJ63F4yf5G/gHMVdPYHBGtVC8Z9O3i9uj/LLgkA 3zmkDlHfYJN6ks2SHgOByjPOn2yTEE0= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of lukas@wunner.de designates 83.223.95.204 as permitted sender) smtp.mailfrom=lukas@wunner.de; dmarc=none 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-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261106004218.604799-3-dmatlack@google.com> X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 85F681C0012 X-Rspam-User: X-Stat-Signature: g9g6kzsbgs9hwnbh9o9a77fytuaeekey X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-HE-Tag: 1796406909-310649 X-HE-Meta: U2FsdGVkX1/NdHNtousSWjtrNhVI/qjmvjlxR6wwu1NW60sie4z2Yv5K8c4RVwvH5BSnxGLgZgLV7dEn5BMSZ6HUdl6/C3CR+tFE9u0ro7ObIUhzsazljVKjyc/JZB4a/D66ME4wSEazWDJc+HxHCadxwe75VPDWGzFgenHxOGm50IAonE5yOdjBecBuqwLnzT1DUUXj7GGzQk7ekxuXCVzEUdHHMu7RNtyr5ACZLb80a9m0XTQx3hWzhrE5YQWfAdfPfKSzaFF8dVe46fIIfzdxkVSzuE+dWMlHCJSbfXks1R/fVz7KkE0ZVrChBjAg1g89E5R9LFDDU7SkXNPWdJz7ixMTpV+DdVi8Nq0JMHX1CfXCv0bJolBH8UQ7fPzTH78qD0ILNtihtng//NCPPtJFT11FwzgfE4RbFfs+/AVL2TvGy9yooq9by8Uq3SvNT1g5UMKq+oBAIXiNDdt/LW4IScXiHC1qRn9wvF2ZvObqXnqmzpgO75Eyx65CkHBB7MzuJ4thXLZYMbfL4pOpMq3toh00I48KtZiK4aUGL5vz24WXIaf+6Cygy/jgoQdRNN8NLjpb6Ige/XsY6zDfXTnEduFuTzGLR8syqTAfEgK3ZAWXGEM5sSImwWuVsTJBz+IZDoXwa+fiQOWxWdf0QAFtCCBo1YdDVPs1Vh8ll4MGg+obb6sVlSDujvAxLxdkcV/x+Ym+/QJkTHS88FSB8WEolsYH5SO2lxZBbbUiRgV9m47J1XnY9EwIg7XJ8f4N87HNuVQ5FWrMOkWoHlJh1XlAK/gdMqE0xILDQm5FdIwcJoBeCDAeaaroxkDdjMKgyCw2e7uGIuE5KpuAldzP10oODv9wnFjqDEkBeuuY4j2GmBH5a5ZDcVOT8xW3E1JDCT0LHm+DQ37t7jNRBrw0N5z47nQCLvNIjx61bx9r554OeLOlilLESbPYu2V/Xven8G/s+PvbuXSWheJxQde MCr7Qf5f DOXukMFtUfeQApfV4Cx3vBR96q6yqIj0j2RZTQxnqtxvZYObteAxF1ghhz4zHicbRROyVQpGRr4KfVECh58MPZqz/oWQe5Nn5zFjqlDrxZX1enFb1unx1JzoyKvtmWjKX6Cfag4exe3VOo/TW71gIrXiykFaTb8RmwmZL Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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