From patchwork Wed Apr 10 12:46:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13624321 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 244F3CD128A for ; Wed, 10 Apr 2024 12:47:59 +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=CTs/ynF28tWsC4bHIlkWxxPfcLHFUjuGD10CHlWAkbs=; b=DHDZuZcrNEdLc8 zF/gbV0y9BAJ3jGcCNhxvxgSVA6SuueK1zw39InZNSKKx/qr8TldNrrxrSDaToBWFU7FcmW6VHqIs +VSVLTke0gkzTvgruET0Od//lpp8vL4hMLGwFIA2+9GkcFL/o57lAaMsw1J9K8h9hDGnU76CaNbVX TqF6SLX/wEWmc4edoCyjcvGt2oSst5z8GfTXO1EyRulBTMyJpFDi6LQ9xi4yu6xUcN+wqqNyyPQuu tRNIZWWjwMmq9q3rQjV1AGyGqrKZWggQCX9dbN6zu871Q9U6hOIkZahrB2MapiocPsPJz4tTmNQc2 qOJaUW0UhWoTmHfcEtaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruXMd-00000006xGq-2pX0; Wed, 10 Apr 2024 12:47:43 +0000 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruXM7-00000006wsX-32ya for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2024 12:47:16 +0000 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2d700beb6beso72624151fa.2 for ; Wed, 10 Apr 2024 05:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1712753224; x=1713358024; 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=Y3Qk/DJ4ryR6XkF1VG+aVefQinCL6xUnkD758p4/AkE=; b=iqOz6X9wqQZW/bo8Bey1Q833yt8g2RYBd4eyoqqY+O8m0TjJ8tqvBDjT++kazadnOU i54/Q9wGIS6ZZ2659p8oikOZLfZvVSoWmPBJcPZi3junsBadEwt3OVBU11wsPdzvg7Kp 3rR309LZOoo98tE8ETyvTEmRuxmUNA/bJ91DB9tEdnA988ycgR1KUSKmDnEHZ9qD+7z3 PXzTpOHVduPqxFGGoKamjuXcQEB8tAOsGkO8elmcnMAngpHv6y+aLWjiA7EtFO8AFwEq nzJIlnmyKvZoR691t7NPu+ChbN10zdJw6SNXKgSiS7Ndj18NvFcgcfWvsZGdk2H0o3iT 6j6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712753224; x=1713358024; 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=Y3Qk/DJ4ryR6XkF1VG+aVefQinCL6xUnkD758p4/AkE=; b=C6PbjcY3jDNn9NnQv5qQ+VLCAsCSuz7NUwaoHWGGKccMuZOUIMp8QJdkZot546gXJH 3Y98Qj0An5f9AjJ9ILKOt1x1wjAonJi7oOcO6utZbaMU8HOyAiW8Vc4qvTImmS5rNFkB uHMI9pvn70fTeAZWTKEgq8kLK08ZNGVY6fokR8x9hQRUFX6Tx0buycqrL+IjGxU10OlA rV/P8mlQmFBwis+Bmncv8wsgIsEXwA1g7eU2hWVTRcOw8sPV7+XImoEpLdknBovGLk2n ukQ7YFo1TkG7xN5rQgRvrm1DGQ/Wp98QuUL4DzK41ENnW+MGGQClTN6c7llysQCuCtuo kIAg== X-Forwarded-Encrypted: i=1; AJvYcCWHE6WKSsIxAutidfrgAZ1ycNx5c+3elmc967sEeadRHkTMjf2IuGG7bSy0MVPqEODIcuX0HvZz1Lp/CJoH5RYXTlEODkTr8ZSTcJXpYMr9TCGbnbM= X-Gm-Message-State: AOJu0YwtN0a6DQs6MSj3TcJVMmbHXZ4p8LEB5KIOpcVnIIFCw7C0F5gT vFfLNXyqPfGRV0NtYwC5YTlT3isVq3c7kS+gT3MTT7bI7eXeBlp8v674jxKuVR0= X-Google-Smtp-Source: AGHT+IHz4nxeX4Kf6VHEirR5NLp0YeiXxNxBQwG9L0Vdn0xDzZmeanJ4D1dLir6knQRmR1TckfDACg== X-Received: by 2002:a2e:9dd7:0:b0:2d4:a22e:d3b3 with SMTP id x23-20020a2e9dd7000000b002d4a22ed3b3mr1712240ljj.11.1712753223862; Wed, 10 Apr 2024 05:47:03 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:75a:e000:6908:7e99:35c9:d585]) by smtp.gmail.com with ESMTPSA id v13-20020a05600c444d00b0041663450a4asm2150929wmn.45.2024.04.10.05.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 05:47:03 -0700 (PDT) From: Bartosz Golaszewski To: Marcel Holtmann , Luiz Augusto von Dentz , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kalle Valo , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Catalin Marinas , Will Deacon , Bjorn Helgaas , Bartosz Golaszewski , Saravana Kannan , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , Marek Szyprowski , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa , Manivannan Sadhasivam , Lukas Wunner , Dmitry Baryshkov , Amit Pundir , Xilin Wu Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v7 09/16] PCI: hold the rescan mutex when scanning for the first time Date: Wed, 10 Apr 2024 14:46:21 +0200 Message-Id: <20240410124628.171783-10-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240410124628.171783-1-brgl@bgdev.pl> References: <20240410124628.171783-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_054711_960500_D767114B 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 PCI device power control drivers that will be able to trigger the port rescan when probing, 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 1325fbae2f28..1802900328a0 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -3066,7 +3066,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;