Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp179143lqb; Tue, 28 May 2024 12:10:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXn9LRTlyZHsJXKiUEgX9SfXMuztQy9x06g82EZ+TZ0sf2jHYLmYaFhV77xv8NeTSdf4f6WbsuMJpaP7/9v4I8P79uS+nvpKasutY683A== X-Google-Smtp-Source: AGHT+IH4rqaTrWOz3TTrqbFQPlzwzHBnR35EAlNRlBFHapKGeS4/NC7ehVY1n3ksJZPVdjMb2xS1 X-Received: by 2002:a17:906:744:b0:a58:e2b1:92c2 with SMTP id a640c23a62f3a-a6265148c24mr860785766b.57.1716923427285; Tue, 28 May 2024 12:10:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716923427; cv=pass; d=google.com; s=arc-20160816; b=rkOdoHcxhvCB5XXvDE0qeMzuTx7gabN0+gof/PBcPWC/IgWnKtNQUFyVYmYWHCz113 sTRnRqYZyR1OFDzXQMMY6ElkNygP3Xuqn4XsYD9iqSMCLVaDFqA/J/m0gvJOwGoGGQx+ S0BJB08uoVub8vyxk1MakBUJU25FeWjbphN6oJ6CjcA2shMe6DU3LdcopdrY5PGz6H4L MWJLW+8+K7/qPiM2e6ShlFU55DJIsOAc7oD8ODfvbUiaO/Ma4ln1ShRykvl1kDh7yTiT 2+UqYQDu23s8KESXO6tvVQnKdV7Ol6q6mgFffNOlV8l4dVTtnfFt/pNC38JMuYPdpcb8 DPKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=gFU0fFDLXBVTpEVhQ1putOMYxJzP0S29Lv1LacuJjZ8=; fh=1Tlfi6bLPR4c5yLJxjE0V7ma0Kpt7tbSwYpIQ6AcxZM=; b=CF53PUTwkJihuxwhRk/zvBlbRaqWQs9/c6YKKApVsx54GIpiAxKvXJVqwF0i3tFf/+ ml1wklf/F3dkTQWjuLEV+iRT+z9+RFRr2Xbp22HU1UQlbTNUcIsuQNo0fnRTNkvWvka5 fpz0tTKbDL4fVDBEFraO2puYg9SrD8NyApj4TUxt6sib3e+8kapbvkJgVZUxHgxXD+oh zH1NZb6VdLlgKY0/uMZfYQb+RFQEf+OE+77ljCjw5NLKR6FUtouu8ll4D14jqitc/YQX 5CSfTVY4T5opxVkj0twx/ySpsruNmsHw7RbzKkk+jGn++I1Z0sP8V2a+zs34L8NpR+c5 vb5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=R38BqZDh; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-wireless+bounces-8229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8229-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6331930c01si139029066b.1018.2024.05.28.12.10.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 12:10:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=R38BqZDh; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-wireless+bounces-8229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8229-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D8B631F27674 for ; Tue, 28 May 2024 19:10:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2B58181BB5; Tue, 28 May 2024 19:04:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="R38BqZDh" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E452C180A84 for ; Tue, 28 May 2024 19:04:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716923051; cv=none; b=XqUttFZs+rBUL/YyoMN/PocQG05d24axFnqu9B0rDVqqy++QH5NxCrJ5p8rb/nhqMnaeUsJ3yJ/ptKE9aIRWRZqIo5zTVYgjyPak6YSgLv9pw+Iyp/iifV2qSpY94mBcov3qKVt6hT9VbmU07vQa/2Di5lqhf8dk7LL36mTLAIc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716923051; c=relaxed/simple; bh=oGqCjZoMtSrCwf8xbipdg0QeegidLEYbNGeloSkNMkY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G24gO6HISLJi5LI4p9VuV7o1wVpLEjqiaBjfW+mZNsHe29YYSssO78ZHLiPxGgyDZBZ6AEFtNmyCJun/rg4CGici1GnIRNdgctvHIMEsKHWfheSS7PBTHX8Py2nvyo+SK3G0T3LARtCClA3DUXvX8z0kqENiqdLmyxgmB7LOJIM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=R38BqZDh; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-420180b59b7so10227365e9.0 for ; Tue, 28 May 2024 12:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1716923044; x=1717527844; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gFU0fFDLXBVTpEVhQ1putOMYxJzP0S29Lv1LacuJjZ8=; b=R38BqZDhYNvR2rKNSmV0hLmvuMnuSYa1+tsiCVZyA63IxmjdJzuvLuqQuFtzLNn+XE wEcngCulIRJz1lVeu0uMvJFkv0qngFax3d9huS2AsegvZ9yuPjYKvhUzNtK2jNWv1aCh Tm35LZsDIce8vGMRm6JyYZjD0YQRk48MeqgQuX+eEe02UlrEwt+oMMfuTNc5VL9KlfX0 xoIFM/zUreqABkUuMexDadEtMHymoD8YleZ7VmyOo0CDl5GXG8c3UDouIBbqAylMdrwd 8Iv47hoF7h+whHEwp+CqNie1vidWQoWhgG0vSYEPiiuD6NWtDGchZMkaQ7PCpar4HP2o FkPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716923044; x=1717527844; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gFU0fFDLXBVTpEVhQ1putOMYxJzP0S29Lv1LacuJjZ8=; b=qcN2Sxp6zXl9FFaPB3VX8+h7Dad3irY/DMXaUVskS5P6kQsnowuj5lhTDniBGtnC73 RHgi1BqA10PNN5VwMDY4UqrDb+nbmUtV0jI2u69Sy3sAEGF9Tn3SzosnyLULLaKGLBPD Gg95ryox5x8CePCI6EJh+yzAZQ8cPN+IdEFxKwwqJPKEq3/LX+FcbQ3ELJHfXjdJ7QnX CXEuG5SbAnhTqjlK+6VQklTcb8nfRcbEhBudLuCx47sWzD4Wmpqwmz3akVXCI9Qz69h8 z3Wm7Lx+tFOsGgeYShSgRCyh6eYdmQCEnEHUUeSc4jC9qYHEoeH1f/RDeB47zdDj6G4X 4RtA== X-Forwarded-Encrypted: i=1; AJvYcCXvHWjleEoi5jJNfjbGerJwhLf3sZcVSmve5m2+aPevp0PIlcIr1hppFr9/r0YSNqS2uje/g9OHqnocxlqG0mg7FSusT2o/E6x40Qg23eQ= X-Gm-Message-State: AOJu0YwM7Zp3dG+E8Y9a5XcpiSOyIvGFW9+JltF0m+j1sDe08XSs6/1f rWPkQn8etNkeu6Nog05hdIDjfQ89nLQuM6u0OjpNUH7b19en2HxfxuBhPo6lzj8= X-Received: by 2002:a05:600c:5719:b0:420:173f:e1e9 with SMTP id 5b1f17b1804b1-421089e97bcmr91269195e9.21.1716923044209; Tue, 28 May 2024 12:04:04 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:75a:e000:93eb:927a:e851:8a2f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42100ee954bsm183895415e9.4.2024.05.28.12.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 12:04:03 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 28 May 2024 21:03:20 +0200 Subject: [PATCH v8 12/17] PCI: hold the rescan mutex when scanning for the first time Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240528-pwrseq-v8-12-d354d52b763c@linaro.org> References: <20240528-pwrseq-v8-0-d354d52b763c@linaro.org> In-Reply-To: <20240528-pwrseq-v8-0-d354d52b763c@linaro.org> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Balakrishna Godavarthi , Rocky Liao , Kalle Valo , Jeff Johnson , Bjorn Andersson , Konrad Dybcio , Bartosz Golaszewski , Bjorn Helgaas , Srini Kandagatla , Elliot Berman , Caleb Connolly , Neil Armstrong , Dmitry Baryshkov , Alex Elder Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, Jeff Johnson , ath12k@lists.infradead.org, linux-pm@vger.kernel.org, linux-pci@vger.kernel.org, Bartosz Golaszewski , kernel@quicinc.com, Amit Pundir X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=914; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=kuyJTCA9fdYhUGDXvoePXqDSaNb9NruStgSbf5wa/1E=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmViqP/eY7rIuS/eQw4O3UlON8rwdGRoMGUP7rz yzNVdBe65WJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZlYqjwAKCRARpy6gFHHX cvKjD/9WKJ6xrPFHjBRP7ktzwHOQmaTfICHaHJtV3PV0foF3NVt3xBjv/3MfTIoDHxKL/27sUbX AX0c1HDDrhyg+xUEwP3Ldeoi+bmJKHTPpBgTuLU0F9ax8+nQsFBoHyOQwaIFebtMFB0f8GE+xA0 jsxo/VePbSMksuxs1v066MNDPpVjKPx/BS6ZmdWbZU/Fhw/PA83vcPyKHyS+gSwR+/a6naEoIDG /r4rQ1fIQMD+/LMFzTJYgTkk5dh96SRuGfQ0HgYSfbWr42EdZUbFyMDhgUiqQceMOBwexPlqd0J BOASeFIGFOYM7lyG+0RBjDGGbtg9P3D8EF5EbrI5IMHMJGEPlOdEEHydvZ3irbtN/FdyTQcps60 W3h5F7J/GEci3w5eTef3u2+nLFBD7+v/IzE/U+e/ISniyUz+HOqEMZ2cfKGAqvzBXOFxzAONnzI GUn45522td18GWGJ2IQq6PWkohJhco7ANiMaK/pwgGkemTt34e2f56iqSkaw2hhTnzrI1oaIP7K SsLgff5wn0FMZqpU/xOqN1gUJ6dCL9fQiFa32Acmjqlhp9qs/MVZY6ri19ncKXCEPITAp6Qv/Rm AK96m/GOCFcx5h2BnodJx318PL5gOmyFiDLn7oaEdmqmPq2rpC9akype843qdeE5gZ0F8jt0z/I Tu7x3hngIac7MMA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 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. Tested-by: Amit Pundir 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 8e696e547565..604fc96b1098 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -3072,7 +3072,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; -- 2.43.0