From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F93DF8D761 for ; Thu, 16 Apr 2026 18:02:18 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fxQnL6KvWz2yvr; Fri, 17 Apr 2026 04:01:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1776362502; cv=none; b=gxR+BZ1kNvcdH1OEWAi9I4LwC2zL0stf5TsRcCu1Ze8FlI3sU3+1rO/ha1mONDlgVqNbSIQ2qCqsqvmg5wpM4PfhJz6Iju2fOXUCS9IBAHRvEuIvJBgucksCjKVvygSA91jIrE93jv5xFw6pIHTakmiLd2/4ZuVcCMnFm8Gf85IeeHlpmiw4s7SasI029ehsKE6HHAeZtKKbftqISW4WQh9xbtNYuxE/R3MgHqZfOOPShpj0vLbKAx9Sq0fYvEBBVr3/+PB6flKFJ1MoYwwmMBdHimxY1nxX6Jxh8MHEQAYA6ydQnBeh0JIKT+dG1r3cUgwr3+a/a89i3vX100K0AQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1776362502; c=relaxed/relaxed; bh=3QCwo1gfYjgd4IF1l4QyDSg4TPdyym4cMGRCRHrztZU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Dw7AaEIfboM4S2vJ+ytgJOGfU/aznWamp428/nwJ2eGEiXNYhpFBHSS+dzJsbmEMHGuL7uhOpp7vE7vRkxbwu6PwXguuWHoTF7flYIm89hvWLjCN4FsSQFB2IK88Djyi7MYr1h0qeUCcKCeqW48kWZn7vuM//ndJUT2dlGfYHFt2AyuddrWqBB1CBJ2eXaAT1oRvaFdnAT4Ux/Jto/S5vqxLUxuLawaMupJDHbCThfCXX+84xvutt6dtcGSV5xmaTzfCGc2vSlQLeGcNHFlJXzr/RR0aqfl1ICPPv+vWtycYi/nDTVl6xq4sO8r0orxjbE7YCHWHn8z8f6njtyLT8Q== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=b042CshG; dkim-atps=neutral; spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=kwilczynski@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=b042CshG; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=kwilczynski@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4fxQnL18Mfz2xmX for ; Fri, 17 Apr 2026 04:01:42 +1000 (AEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 5EB9040144; Thu, 16 Apr 2026 18:01:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15D63C2BCAF; Thu, 16 Apr 2026 18:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776362500; bh=ETL+W+tW2dvlxsZyN2YnEvNwnvTJRalLy+LfLN3MvZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b042CshGS+igON2yWBtn6udjzMZFtQhv7UWmyvNYZaBt43mqSpPQ8xm4hGIS5RaUB 8aQ5bIz4Ot/Kq5PDQ66D8Oc7nEdUb+nPAKQ6JLS2WX0gUBEyz+mFZX05pxmmDiGXMM HZpK7Cm4oVD4fj5FuOV8Ph2JSBbw4j+/ehFkJwqUoK4Eq7oqT3hvgl11OmcwnsVWFO SsPMl1G/jdAMnXz2v/EyslDXsRqy5fuq+Mdk9etXSSWRVVEN3pqwp5LTo7PN62XDGE 01XrANtGSZvZIJWw5G+S1xFUhCcTpBL6s3xrrn3dKw2zNHSsVWd8u9tNJlmAoN0FJR svcuY5lMOrdMA== From: =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= To: Bjorn Helgaas Cc: Bjorn Helgaas , Manivannan Sadhasivam , Lorenzo Pieralisi , Magnus Lindholm , Matt Turner , Richard Henderson , Christophe Leroy , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Dexuan Cui , =?UTF-8?q?Krzysztof=20Ha=C5=82asa?= , Lukas Wunner , "Oliver O'Halloran" , Saurabh Singh Sengar , Shuan He , Srivatsa Bhat , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , linux-pci@vger.kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v5 08/23] PCI/sysfs: Warn about BAR resize failure in __resource_resize_store() Date: Thu, 16 Apr 2026 18:00:52 +0000 Message-ID: <20260416180107.777065-9-kwilczynski@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260416180107.777065-1-kwilczynski@kernel.org> References: <20260416180107.777065-1-kwilczynski@kernel.org> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a pci_warn() to __resource_resize_store(), so that BAR resize failures are visible to the user, which can help troubleshoot any potential resource resize issues. While at it, rename the resource_resize_is_visible() to resource_resize_attr_is_visible() along with the corresponding group variable to align with the naming convention used by the resource attribute groups. Also, change the order of pci_dev_groups[] such that the resize group is now located alongside the other resource groups. Signed-off-by: Krzysztof WilczyƄski --- drivers/pci/pci-sysfs.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 3508e29f6ad1..c0925bdc9ecd 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -1703,6 +1703,9 @@ static ssize_t __resource_resize_store(struct device *dev, int n, sysfs_remove_groups(&pdev->dev.kobj, pci_dev_resource_attr_groups); ret = pci_resize_resource(pdev, n, size, 0); + if (ret) + pci_warn(pdev, "Failed to resize BAR %d: %pe\n", + n, ERR_PTR(ret)); pci_assign_unassigned_bus_resources(bus); @@ -1750,7 +1753,7 @@ static struct attribute *resource_resize_attrs[] = { NULL, }; -static umode_t resource_resize_is_visible(struct kobject *kobj, +static umode_t resource_resize_attr_is_visible(struct kobject *kobj, struct attribute *a, int n) { struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj)); @@ -1758,9 +1761,9 @@ static umode_t resource_resize_is_visible(struct kobject *kobj, return pci_rebar_get_current_size(pdev, n) < 0 ? 0 : a->mode; } -static const struct attribute_group pci_dev_resource_resize_group = { +static const struct attribute_group pci_dev_resource_resize_attr_group = { .attrs = resource_resize_attrs, - .is_visible = resource_resize_is_visible, + .is_visible = resource_resize_attr_is_visible, }; int __must_check pci_create_sysfs_dev_files(struct pci_dev *pdev) @@ -1881,6 +1884,7 @@ const struct attribute_group *pci_dev_groups[] = { &pci_dev_resource_uc_attr_group, &pci_dev_resource_wc_attr_group, #endif + &pci_dev_resource_resize_attr_group, &pci_dev_config_attr_group, &pci_dev_rom_attr_group, &pci_dev_reset_attr_group, @@ -1892,7 +1896,6 @@ const struct attribute_group *pci_dev_groups[] = { #ifdef CONFIG_ACPI &pci_dev_acpi_attr_group, #endif - &pci_dev_resource_resize_group, ARCH_PCI_DEV_GROUPS NULL, }; -- 2.53.0