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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 4729CCCF9E0 for ; Tue, 28 Oct 2025 17:37:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D632910E632; Tue, 28 Oct 2025 17:37:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="JVS3hHbY"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id C3F3C10E630; Tue, 28 Oct 2025 17:37:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1761673021; x=1793209021; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EiT5hL30QLFm3yb5FssrJ17hLpcSHd+wx/30o6JfyWo=; b=JVS3hHbY7AWIi+k4U8O3JNXTxeBdpry4+eBb9/gR9Ql2MXL+chmzjGxh 6rLdjcNJRliTHJdihW8eT8rMSswUT7Yt1gEnfSVuyYq4l5yUSbTsjMtFf 5+Qm+2z1+Bq46HNQ4DPAXi4MidrI5yLCKQ0DzfJYREW8CsMXpRLWSo0nD bdPf1YWCEDMSCekD9m+dapwj1Xhwlfzp1PNtwhjRxEEmz098mcvoMqsUj KTv6u/X+wwbjwSSa03tEUuURzn8O3QPpMBcC9wtxpfxZGcYZjTsdrj6j2 MTzI7JZfz1a9ZNiZN3hbEkCvuRXb6H+PqcvBb3VPFU32GLJ1+UhoYZaG1 A==; X-CSE-ConnectionGUID: EwSj/QvRQfOePIbTuMbq0g== X-CSE-MsgGUID: 40CmljWqQAigXqkwhVFcyQ== X-IronPort-AV: E=McAfee;i="6800,10657,11586"; a="63877934" X-IronPort-AV: E=Sophos;i="6.19,261,1754982000"; d="scan'208";a="63877934" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2025 10:37:00 -0700 X-CSE-ConnectionGUID: TC3quM/ERgeiXFGUpMlo2A== X-CSE-MsgGUID: vdt7woL2RBiSVzd55S1BGA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,261,1754982000"; d="scan'208";a="216072445" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.244.182]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2025 10:36:52 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Simon Richter , Lucas De Marchi , Alex Deucher , amd-gfx@lists.freedesktop.org, Bjorn Helgaas , David Airlie , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, Jani Nikula , Joonas Lahtinen , linux-pci@vger.kernel.org, Rodrigo Vivi , Simona Vetter , Tvrtko Ursulin , =?UTF-8?q?Christian=20K=C3=B6nig?= , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , =?UTF-8?q?Micha=C5=82=20Winiarski?= , linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 4/9] PCI: Try BAR resize even when no window was released Date: Tue, 28 Oct 2025 19:35:46 +0200 Message-Id: <20251028173551.22578-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251028173551.22578-1-ilpo.jarvinen@linux.intel.com> References: <20251028173551.22578-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Usually, resizing BARs requires releasing bridge windows in order to resize it to fit a larged BAR into the window. This is not always the case, however, FW could have made the window large enough to accomodate larger BAR as is, or the user might prefer to shrink a BAR to make more space for another Resizable BAR. Thus, replace the check that requires that at least one bridge window was released with a check that simply ensures bridge is not NULL. Signed-off-by: Ilpo Järvinen --- drivers/pci/setup-bus.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index d58f025aeaff..76a4259ab076 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -2459,10 +2459,8 @@ int pbus_reassign_bridge_resources(struct pci_bus *bus, struct resource *res) bus = bus->parent; } - if (list_empty(&saved)) { - up_read(&pci_bus_sem); + if (!bridge) return -ENOENT; - } __pci_bus_size_bridges(bridge->subordinate, &added); __pci_bridge_assign_resources(bridge, &added, &failed); -- 2.39.5