From patchwork Wed Jan 17 16:07:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13521977 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 37C1FC47DA2 for ; Wed, 17 Jan 2024 16:09:21 +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=MqUaP5OFncpn9T ngsRYU/F2AQymzWO4T2HUq5/Ul5sNRpLWBVmhN1G0cNxLDR3lsYwrapvkB9JXm3Z8rDG2b7DYrUv3 IXs+TNv5iTcY6x56nm3RPgOpwW+i+yFmPaLrHqUqBAcClxBYWTENl9x9GtV+FDhOjVBBJ60eLt2VO TAgJeM+rAHSFCwFwbS95IBEwQZNTD3u8LqGGAegEGyyzYEDMSLB0vksv8hsgT0a614F8mdXuL5Arz p0TpPWn7GJCSHQ+dED5tc4qDhpEL7OKiFAKcB2hkvgBq8cxppiaRfC4g5dBmqC2IldhhaPw7SZHVH 5jMv5n7t31YADW/xaZJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQ8TF-00HZyW-2C; Wed, 17 Jan 2024 16:08:53 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQ8T1-00HZnr-1J for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 16:08:40 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2cd0db24e03so129449441fa.3 for ; Wed, 17 Jan 2024 08:08:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705507714; x=1706112514; 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=fp/kg5ZsgsU1fC95kzpRmhejnLQcs/ir3Wcmgmh3/BThHOeA798AyeR8TTfQ+6NX9o dLnbSiYWDS/yuNHR+1eix7ZvcuE8q6P7VP/TFkOyMVyEJrzojAJ1KfuqfvnkLd9ed2uA t6E1vR2jGtXrH/VFK5g8X+/2d0GGwku8kWmys8xhodhdGTyk4TQILt8V1beU8nvNiRLQ zIjvob//v1MN6aDr5BeeUScjF3y/WDQJ3CiFfygmeHPJ9i/5Wy1BkRbl5ep1myNHUso+ uYnPTlK2l9XYi3moNwMaPssEKPItE0q6FaVmLoFiq5cA1hnGZZNkz6NbcANyRE9RtVc/ ZD3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705507714; x=1706112514; 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=uRU/P0W2MhM7YISo7/7OOUqTYm6au58SUFOm6ctM7hFB0YJKxd0FNjzN2GjWQJ9pXF UQe4/PQU+TfMw9BuLjePZVzbB6gSyXrd1Vp938PqpMGgU3JrQSK4gbZZkXNrk37fCUi+ NDUL4GMrcf84Ut+gOtvb0vKr/cU0EShGqP+swR2TD7lqDRl/qWXXMmFumH12tj4M7iSl atpXny1ujmh176rfcAktgZkd/7+3H8UHRjkPUCX+URwDVA8xERbstFPyecPOihB5fdr8 df33uAhHwbg9LL02uauyRuTJsQNjEgE9Oi93/gr4dOAeTHGfyztX8fbiT6I6hh5Ptd29 /cJg== X-Gm-Message-State: AOJu0YyNdyELFuFTzUd973/MDa8uLU0l2tw/PMydGsRSD4s00e2/9DCt yFw/EbdV7lRNW/BeoH3K3k8+4YvJyDXE6g== X-Google-Smtp-Source: AGHT+IH00GMnU28EnlPeGajWNZo/yfmgLAtVEq5+nkiN5uNxUQ5AichUQRHPt2D0pz/XGhDNycFPnw== X-Received: by 2002:a2e:a40d:0:b0:2cc:8a2b:4594 with SMTP id p13-20020a2ea40d000000b002cc8a2b4594mr2168546ljn.23.1705507714754; Wed, 17 Jan 2024 08:08:34 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:d0b5:43ec:48:baad]) by smtp.gmail.com with ESMTPSA id t10-20020a5d6a4a000000b00337b0374a3dsm1972092wrw.57.2024.01.17.08.08.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 08:08:34 -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 , Lukas Wunner , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa 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: [PATCH 5/9] PCI: hold the rescan mutex when scanning for the first time Date: Wed, 17 Jan 2024 17:07:44 +0100 Message-Id: <20240117160748.37682-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240117160748.37682-1-brgl@bgdev.pl> References: <20240117160748.37682-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_080839_469481_1BE8062F X-CRM114-Status: GOOD ( 12.88 ) 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;