From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E3CC43B3DA; Tue, 21 Jul 2026 21:49:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784670552; cv=none; b=pGuvzx22BkujpQ73CBd/NYDYbHpEtHd4HJMFHuIkWbalE+l5kbl2IFb0Plvh1XhJ+TJ5cX+tXC1igyTe/BVRhPEiT7aCTVRdC9ex2Sqb8Y05XLbEfYgplsJQvCqDuR2UpyZ/2d4aDnuSyYyZADIWwdpW5PvMW2nDSoT0J0DVmho= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784670552; c=relaxed/simple; bh=b02SNmQukRRf/wHIWb3texJeIH0OsS208pLO2Z5wXTw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=riIVr5ytPQ3LPcxREpuOQLWKYc5tKxQUQqmc/uEkHaZQhYBc0edt2pmpw7whLc+7eMUVscmvaxCReipG9D3l8czNXAQloZE3uox2XhyOVPIm6BIKVHuP1rGmY5Od0lOQAk7mcmPPp8HHc6FUqdVMIktQh9kCRBflnSlFIjI7d/E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jlbZQx2p; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jlbZQx2p" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C79A61F000E9; Tue, 21 Jul 2026 21:49:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784670550; bh=IXRQldqiVD0gebZvV3GuEA6iPpxCt8dh4WwAyRINhI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jlbZQx2p6dpR8PZD2w6VGh8s8s+7wCWT52BpDoX1Ilnh8ml0EYogLJa/iAOe3IXIi ZpGG8FTsmkrS/aZxc+4FA+7QSt6+LR3ax+0KkIrXBwppUbIVjovWs4G9trII2s2t3Q jKZWdcFnCFKgY3E0d2tbP0g8q8t3gAisGeHhDVn8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Bjorn Helgaas , Sasha Levin , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 6.1 0973/1067] PCI: Add kerneldoc for pci_resize_resource() Date: Tue, 21 Jul 2026 17:26:14 +0200 Message-ID: <20260721152446.309730695@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152424.521567757@linuxfoundation.org> References: <20260721152424.521567757@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ilpo Järvinen [ Upstream commit d787018e2dfdc4c1331538e7a8717690d1b7c9b3 ] As pci_resize_resource() is meant to be used also outside of PCI core, document the interface with kerneldoc. Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas Tested-by: Alex Bennée # AVA, AMD GPU Link: https://patch.msgid.link/20251113162628.5946-8-ilpo.jarvinen@linux.intel.com Stable-dep-of: ee7471fe968d ("PCI: Skip Resizable BAR restore on read error") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/pci/setup-res.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -427,6 +427,26 @@ void pci_release_resource(struct pci_dev } EXPORT_SYMBOL(pci_release_resource); +/** + * pci_resize_resource - reconfigure a Resizable BAR and resources + * @dev: the PCI device + * @resno: index of the BAR to be resized + * @size: new size as defined in the spec (0=1MB, 31=128TB) + * @exclude_bars: a mask of BARs that should not be released + * + * Reconfigure @resno to @size and re-run resource assignment algorithm + * with the new size. + * + * Prior to resize, release @dev resources that share a bridge window with + * @resno. This unpins the bridge window resource to allow changing it. + * + * The caller may prevent releasing a particular BAR by providing + * @exclude_bars mask, but this may result in the resize operation failing + * due to insufficient space. + * + * Return: 0 on success, or negative on error. In case of an error, the + * resources are restored to their original places. + */ int pci_resize_resource(struct pci_dev *dev, int resno, int size, int exclude_bars) {