From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=83.223.78.233 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796557233; b=5UFx+gqWoOx4Ck+6x3HBv92YX81R8nB4bs2L00JOWYOFENg9jld0WKalNICss6AmfSjC x4LhYizWKNVqWK/Konmo8h7r3XSW/CUikyPemgThqwESJsZqp8VkGqX/eKuZa07VZ80sY 4/g3IJ2KKqqhjP633c0bzDpbtpJf4xEacm1sKAr4H01oF9DvrJxoMn1IX5eoo5pF9Hcuj JJIfv8DlUWH5CEHAeu2eCv2vuT52xgGb9WMOYlj/H82zAlOxZ52KjCEikNbdLx7mfq9pW qWvj+A4mR6ohfN587r2Nnmz4qXjiLe4IHrxppTZJgEjDZfeAj3HC5KqY0qjmdrJcCtg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796557233; h=DMARC-Filter:Received:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=XiWuagX0WuZLpnk92PhYRrN38pcaY0leP4evGn53wFg=; b=ifTJOeO2HJV2ks3inulk96Z9DvaH7okzcY8m9Lw7vnC6BIJpVZRQRcGfOTT2jt0BPR/a 5NaIBBRfgNHqOLc28Y5VrvsvgHaDTD5mAHiKxmqgWMYd3G+x6uBAY5/bab/BZ8PhdEMoO jT+fKBGgpOiLCwc2dzpjNyC58asy9u4mWk5lMHNgoWwM5NtQ8O1CsSm8sGFJol9CNf+Ar R7xRNZH2alEbgzoOC5fx2sw66jY19dbpE92xq0NhRL6uidSTxAV9EhsSF3Xh+K21F3gMd KCcNrB6WtEKjf44QRBkBoyJVZXLXMh3rKkQsiOG3SuXgVsb6LldDrcU296vHKmQgcuA== 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.78.233 Received: from mailout2.hostsharing.net (mailout2.hostsharing.net [83.223.78.233]) (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 043B9606A31F; Sun, 6 Dec 2026 11:40:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 043B9606A31F 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 [83.223.95.28]) (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 mailout2.hostsharing.net (Postfix) with ESMTPS id 6E0E578C9; Sun, 06 Dec 2026 12:40:23 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 5573260208B4; Sun, 6 Dec 2026 12:40:23 +0100 (CET) Date: Sun, 6 Dec 2026 12:40:23 +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 08/17] PCI/AER: Save AER state in the saved capability store Message-ID: References: <20261106004218.604799-1-dmatlack@google.com> <20261106004218.604799-9-dmatlack@google.com> X-Mailing-List: linux-kernel@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-9-dmatlack@google.com> On Fri, Nov 06, 2026 at 12:42:09AM +0000, David Matlack wrote: > void pci_restore_aer_state(struct pci_dev *dev) > { > - int aer = dev->aer_cap; > - struct pci_cap_saved_state *save_state; > - u32 *cap; > + unsigned int i; > > - if (!aer) > + if (!dev->aer_cap) > return; > > - save_state = pci_find_saved_ext_cap(dev, PCI_EXT_CAP_ID_ERR); > - if (!save_state) > - return; > + for (i = 0; i < aer_nr_saved_regs(dev); i++) > + pci_restore_cap_dword(dev, dev->aer_cap + aer_saved_regs[i]); > +} I'd keep the local "aer" variable, both here and in pci_save_aer_state(), it makes the diff smaller and easier to review and avoids multiple dereferences of dev->aer_cap (unless the compiler avoids that automatically). > +static void pci_reserve_aer_state(struct pci_dev *dev) > +{ > + unsigned int i; > + int rc; > + > + for (i = 0; i < aer_nr_saved_regs(dev); i++) { > + unsigned int off = dev->aer_cap + aer_saved_regs[i]; > + > + rc = pci_reserve_saved_cap(dev, off, sizeof(u32)); > + if (rc) { > + pci_err(dev, "unable to reserve AER save state (%pe)\n", > + ERR_PTR(rc)); > + return; > + } > + } > } Same comment as before, the error message seems gratuitous because either a WARN splat is emitted by pci_reserve_saved_cap() or it's supposed to fail quietly per the code comment in pci_reserve_saved_cap(). Thanks, Lukas