From patchwork Thu Jan 4 13:01:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13511077 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D85D8C47074 for ; Thu, 4 Jan 2024 13:02:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=d0tOdB3UsMKhqyJ9M3a7NUlJEX8DumDWXJeFtdAv2k0=; b=Jg4VUJv8a0lE7I gYFAi/D64IQCZFJnMSpa0jrjLF0KHteB9hUDk1FLIeU6y/oIjLkZzejWliFtiZnC/c8g/QO7Mh6a0 U0W/Y242vQRq8jheHeSMGb9YjuY9ou11nto2bDM5YO3LOQTN1XCT/7nOM+U3Sb1sMk8UIaBPAPK/y mNFZSw+pe7Y9qEE+boEwlPpnlLmpVm7WvbGDr8sFi0Wkc8glCFbU1gKEC09pkPEVI2bMTZcFPBYiD VfnzRX7sOaamOmRcU0g1YlzW8EJLk4B2tWk8IUrYwXh+eYAa7Jd68NFVSzSClUxX/K+f+WfUIZSRn GNPaZBYXYjd4GOHEwRTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rLNMV-00E2w5-37; Thu, 04 Jan 2024 13:02:15 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rLNMS-00E2pa-19 for linux-arm-kernel@lists.infradead.org; Thu, 04 Jan 2024 13:02:13 +0000 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3373bc6d625so365428f8f.3 for ; Thu, 04 Jan 2024 05:02:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1704373328; x=1704978128; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ko9AldsNAGIySQ6r8IsXSCtLQ9r/1ys0AWCrWCqKA/w=; b=hJqkS2kzYGSJPlPnIQRCspel0TrbmObSlo2EhzXHx3kUZifaT+A8Ukpk0zHkIYqBCK Y1myb+hfEZWfCOOIkH8igMgADfUuct3VZgdWWeFWC53srikIDDcHVmLFXj7t8eUV+aP+ pzJH9s9s6v+bxjfVyBxmhU+foANZzsakpuwlrd/katiyK3xFMd0xK0TZXvEzuOeQMeHe xd6pg1g0yDkUepQzPuAwcs/TWHNadbC1lD1eQVxE8+ZjxEMXCTeE8BAoqr1xK6EnDbQX 6us1wA+h1U3mJSAVuPAY2K05g4mUGgPypMfjedSTetNXvxuGm2Qos2zYwPxP75+MA9I9 awtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704373328; x=1704978128; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ko9AldsNAGIySQ6r8IsXSCtLQ9r/1ys0AWCrWCqKA/w=; b=ia3ji5qHX0lM4RtZIc7Q3gCA0DoDtOcQr9bPGUBK57DNV28m+kVVKMIzrCNjR0DzzW DcC98q2b62qa+Vnhb3yw2jJ/ER2fJSp9amovBQc+n7/peCRkFijLIt33yhjsGwh7l6qz S/mLIL+pPU2cZAzB3iQH1ioVKjFuOJSwiM5GNjbHJHX231LTjbg78KKtLgxCz7LnEaf0 bs2fdqaNdAE+EUJ9OVc5/PEvZK4hVTcjcYCJqxpR/0HonsjqjhSQtPu9L2JGpEBSZxln w27XRLXyEatzRVh2pplZ59zKiGUxfb8Mv4VY3XTGjZYUsZCVp/3FZeWp2kHip8MEnjV0 j2dg== X-Gm-Message-State: AOJu0Yy8JD83dJvezvcdLOlSwbf0slzuBa9kbHqk2NYJv2i24soEO3f5 KYvVt0u6OHB3fVq7LT0m6ZEB4mmgFrSz6A== X-Google-Smtp-Source: AGHT+IFUjxl+akq5qBUWz1Hq2UkXunszpKE6K042Vn3Nvy8yjJ9A6yhdSklCJkd/SLfWbEWSuN0qWg== X-Received: by 2002:adf:f1c7:0:b0:336:7f93:3dcc with SMTP id z7-20020adff1c7000000b003367f933dccmr292279wro.81.1704373328663; Thu, 04 Jan 2024 05:02:08 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:5b69:3768:8459:8fee]) by smtp.gmail.com with ESMTPSA id w5-20020a5d5445000000b0033660f75d08sm32887387wrv.116.2024.01.04.05.02.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 05:02:08 -0800 (PST) From: Bartosz Golaszewski To: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Kuppuswamy Sathyanarayanan , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: [RFC 4/9] PCI: hold the rescan mutex when scanning for the first time Date: Thu, 4 Jan 2024 14:01:18 +0100 Message-Id: <20240104130123.37115-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240104130123.37115-1-brgl@bgdev.pl> References: <20240104130123.37115-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240104_050212_395919_2295553D X-CRM114-Status: GOOD ( 12.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Bartosz Golaszewski With the introduction of the power sequencing drivers that will be able to trigger the port rescan, we need to hold the rescan mutex during the initial pci_host_probe() too or the two could get in each other's way. Signed-off-by: Bartosz Golaszewski --- drivers/pci/probe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index b7335be56008..957f7afee7ba 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -3122,7 +3122,9 @@ int pci_host_probe(struct pci_host_bridge *bridge) struct pci_bus *bus, *child; int ret; + pci_lock_rescan_remove(); ret = pci_scan_root_bus_bridge(bridge); + pci_unlock_rescan_remove(); if (ret < 0) { dev_err(bridge->dev.parent, "Scanning root bridge failed"); return ret;