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 51E53606A33D for ; Sat, 5 Dec 2026 08:46:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1CA406B00EF; Sat, 5 Dec 2026 03:46:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 17BE56B05B3; Sat, 5 Dec 2026 03:46:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 092216B05B4; Sat, 5 Dec 2026 03:46:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DBF716B00EF for ; Sat, 5 Dec 2026 03:46:24 -0500 (EST) Received: from smtpin26.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 6D3691A0554 for ; Sat, 5 Dec 2026 08:46:24 +0000 (UTC) X-FDA: 85509297888.26.40C0181 Received: from mailout2.hostsharing.net (mailout2.hostsharing.net [83.223.78.233]) by imf04.hostedemail.com (Postfix) with ESMTP id 2D5B240006 for ; Sat, 5 Dec 2026 08:46:22 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of lukas@wunner.de designates 83.223.78.233 as permitted sender) smtp.mailfrom=lukas@wunner.de ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796460383; b=YKDsQAgPRX30oUO9jL6fqDJ+ikRKnOy56TIzapNGqv+JV3hUg9gP+Q9F4KXUA/CSvqygNX 7wh9UgnvSusJJECp4sEjpNK1RF68+nomMm/u4xR9CpdDDCxntu7cdQcVsDJ06LSA6OP2MN ZNlLwEdOZJCiUIHCcsGQb8rwa+IO+ic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796460383; 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=E+/iwkFEFcAnD3ceGuz3yy41Z8UefgoL5pmYtry0+0M=; b=StQrIOoQkxN37usEfJ3jxKLi4QToRY28u8BVm38YdB6ubixc/nY1ZrDcjalTQG4rgqvI2o hlfcokSpdtAacaZ1qncyK22XBoUKji6lhdYGv2uk3fH8Bqptt2/4rRHaPeL9jPPFTcN7pV ke/S1mzrj/CiTpeAhfKRYzMebyutCEQ= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of lukas@wunner.de designates 83.223.78.233 as permitted sender) smtp.mailfrom=lukas@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 mailout2.hostsharing.net (Postfix) with ESMTPS id B0C0510610; Sat, 05 Dec 2026 09:46:19 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 87BB8603191F; Sat, 5 Dec 2026 09:46:19 +0100 (CET) Date: Sat, 5 Dec 2026 09:46:19 +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 01/17] PCI/DPC: Allocate the DPC save buffer during device setup Message-ID: References: <20261106004218.604799-1-dmatlack@google.com> <20261106004218.604799-2-dmatlack@google.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam11 X-Rspam-User: X-Stat-Signature: cpqrz613ift5ckt16p5r45p1zzarutc5 X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Rspamd-Queue-Id: 2D5B240006 X-HE-Tag: 1796460382-517598 X-HE-Meta: U2FsdGVkX18nQFMXMA9bCDDnxc2CvOZxz2Aw5JiKveRBDTQTMXHUWnOILNwBos5Hl2aL9HCkh+EPNnW2+LQUtbYnnx/IsbomgodG1l7/9VxiWQWLJhF4Yt4p59FxfuR7mOBKpn5AefkERVLk738DVcWNHm81toECiAYnrTRRlZbE5JCZLuwmJkiVY3VAJEL1S5EA3xoH9WfQNNMmRnFCXx7Nn4IFjJtOoXWrcdNmGgwdLJk1/nb/9hms4v/46hzVPFi+hfiTm/B4kT6g2J6Nbr1Q3FLqmSi2kANby3slEZQGR4DnQTMn6tCJvPhk5dP9f+VAXWbgmDDVz63nZDJ1VF/wx5z9GfnZvSgvbZKd67Kpvlc+DTMq4fM8+h5pg4nTH0rvl+ZufiIDQzgevKnihdNSUhDZPENziinC9pdhzBkkKMtB7ahh6sl96rZIJPM65BXMC3Mccl4g3NYOwQSvL8AIdxA1VoGK3I77Xgb/6/UWmySIrvKY7xwf4IZyaGFQmKOSVq/FiBL9njVYqL32koPEpGQvpYDrMNFQpY3TCxS2LSBaqen00Np3lDcXQr2/7Xr5Tw0JaCvh8QyUgQO+hYaaXVUaM2NKOeV1h11cFywovXztvcPex2iIXJZi30wHRQ41WHFLXhCNQmPkKdnwry3LmNR/XY42t67SfxpBXrRQkF4W9MhzS6QSUYW++CKuvp5N9vq+sebD5fBqWkghKR0yL3/oUmcAgStlbfW/teFUNjgKfa6KqskggEHHebmfOpbHo46S+pxojojB497nSMU4kS2Y/z1utMLhheezaHLB3R+rJFK2qvcmvE96X/HWqQeM62pEM61MDyRSIUHhL1hkgzVmzwaTWyCqfCg7sxPlIWQtkhR0aMMb6grWbLqrjljJ6CYUjNzDlcv9XXvPF40yG9F/o714ls7+Y7Q5TKn5XSrwmSwDwgIrp+4FE4WbLLJWlpS8NFFaGRYd+Fe TU/gtvew eymS9mr4VqCzC2sAc6zGc4xfa/GDxPAV/OzaVRp3F1cgiqdMkw1OY4iunOaPTmwMwxtRwIXPs3adIhOUk9On/FbM7aS7WtxxZrnViuo97qu5oQV4w6rR1PwWeKotxluL+AkLYUR1qFhq3WZagc5ShbMiP1KYH5xBXh5oYVT9GgFCSxpsfzerTHuZr4M8ZX2BoW+W1 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, Dec 04, 2026 at 02:53:07PM -0800, David Matlack wrote: > My plan is to keep reserving DPC Control in pci_dpc_init() I'd be fine with that. An alternative approach would be to allow multiple calls to pci_saved_caps_finalize() and have it reallocate the buffer if necessary. > and have > pci_restore_dpc_state() skip the write unless the kernel owns DPC, via a > flag set in dpc_probe() and cleared in dpc_remove(). That keeps today's > behavior of restoring DPC Control only after the DPC service has bound > to the port. We've changed this cycle how the kernel decides whether to instantiate a DPC port service: The check at the top of dpc_probe() is gone. There's now only a check in get_port_device_capability() and it's very small: if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) && host->native_dpc) services |= PCIE_PORT_SERVICE_DPC; So you don't need a new flag. You can just check for "pdev->dpc_cap && pci_find_host_bridge(pdev->bus)->native_dpc". Those changes are queued on the pci/aer branch: https://web.git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=aer > The one difference is that pci_save_state() would read DPC Control on > every port with a DPC capability, since saving reads every reserved > register. My understanding is that a read doesn't count as modifying the > capability, but I could gate the save on the same flag if you'd prefer. Either way is fine, but perhaps checking the flag is more consistent since you have to check it in pci_restore_state() as well. Thanks, Lukas