From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 67C24606A32F for ; Fri, 4 Dec 2026 17:55:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=08vhbMfy DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=WPIAYRjODngETi9UrJJ6Yzm4HP4CnBT2Fpn0K3XJScc=; b=08vhbMfyydOLNWf3xHcdPscf/m kDZyL7ltFVEPe5qvjdH8UGZvdeEinJ4KeE4hlAP7PDQrcWVdOCsg5EkCCCKRBAVJ04pqriNsP04Wh fHYeByRstBxTwTW+Wq7PLL1bivb8InHQq/6UNBiXQ88a/DiwveJqMUb2N56Ng8Xc9pyqQo+2tu1BY /BepZ9eArWdjO9jxAUdN+1ZIvB7wb2x1Arb7l+nZn7ORHRw3ToExQTkNJhbjVpaG65QAA02zvVqqs +/v1R9YnKz9WKvndoCUmAX+YyS8c81oy64drvg3mMaWSq/s68gBm9aQo95h2R69+bGZ9K+KCd5Ocy LdY/O2Nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZXVk-000000017EI-0icp; Fri, 04 Dec 2026 17:55:56 +0000 Received: from mailout1.hostsharing.net ([2a01:37:1000::53df:5fcc:0]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZXV2-0000000177D-0QPW for kexec@lists.infradead.org; Fri, 04 Dec 2026 17:55:54 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_095551_388097_20AAA230 X-CRM114-Status: GOOD ( 17.03 ) X-Spam-Score: -2.6 (--) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 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