Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp289811lqp; Wed, 12 Jun 2024 01:21:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVueiXucebCRY1jQyAZHRPyB1q2Yh8BTrs6zxce1XhUEFpkhgrh+ecklJO/hd1Co0Xl/s117rjCIjv+KNNZ82+0JuT1duex5tGe0PazQw== X-Google-Smtp-Source: AGHT+IHuRwIz1Uuv7QVJQa2K5FN1qGglwjZnV6oOqSeOFu5tVP653rXr/x4DFoU08KVO4IEymBPR X-Received: by 2002:a9d:73d4:0:b0:6fa:c96:ce42 with SMTP id 46e09a7af769-6fa1c43601emr1049279a34.33.1718180480919; Wed, 12 Jun 2024 01:21:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718180480; cv=pass; d=google.com; s=arc-20160816; b=nI1hj/1y/Ke96qGeCEc1bqOM3fwGjk5QE1g8UjCbDmnW2fKTg3QTq0UZPq7TWoR0Mu aLovszLk84qoxrc/oVwvqkMjT7N8g3ZPKqXm5TuJc/7HhzJA0usx3BYqkPcM/NmRHKJM PsgNj5vFQcfxsbzfuV3fMgqL4/rlKNvJ1v8kl9YFFlau1buZuSWjsNIqVvz+H0mdY6va 2Jo2mTZNOgtePxETYNN1CbASfU3JgALtcwT9LZHOOzZtX8tufDSq+vvSKtwe25nW54hd deWfRpP99LcGhRA//922SZ5aRNHx108u+LOYR4d4Akb00jOmf6scUGoKV82MB+jBU+Vj Rr6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=R+tryJWSLGei4yj4mnd/Wwwy83ERVx62Yqnj8MX2+CY=; fh=yZps1dv0x8HTcVwHqv61CIg3atuzNLvnIddHsSL3P0c=; b=tiQzNc4mttISm9uVnEJ2iZyMQNT+5bAHBgt6fxPe/bZQF0ghDCpAWT56agE0AtA+RY VInUxWAL1Hq8M1iens68+QzG8c/jvBa2DWg8cHghl5YaEFbbujFI+N/+i8wihJpTfMLt 1+aBlrvLSz8jGF45iC1sFKfor+m4uOV/s2ni20wYCz71rqdBJsUDm9jtURNQxK9R4mIH lyVjz/FWFw2RrCj9rltrgpfIWltBCITJGXk53aRmB7Z7s8hicKfG0BUae/AlE9B6WU4F Wxcrhbb0Q2+9RUoXILyCHUi39VjIo85gu4rC3dQSREnSckysI1TkeiYp7IbT9hl2SzRd NUOA==; 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=TQxk5MYK; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-211167-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211167-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de261caa0csi11143897a12.258.2024.06.12.01.21.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 01:21:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211167-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=TQxk5MYK; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-211167-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211167-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6A7AE287508 for ; Wed, 12 Jun 2024 08:21:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AB1916D9A3; Wed, 12 Jun 2024 08:20:39 +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="TQxk5MYK" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 1216416C865 for ; Wed, 12 Jun 2024 08:20:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718180438; cv=none; b=QiczvrLxwXZ3aVkYqK9MVVDsu5Ee7BOLR1iwfXDKfsMLXRRslfUcmdYZFE/rat5LM7pBoMRyRzx4KjpjG27SzYLKv86wL05GECUmNnc3wfjwZgKECz4UMHMYpAC8o/eEPIaCG9pIlqJLJircHvcp5ynB85E8/puncQ1bUa5tBiU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718180438; c=relaxed/simple; bh=7ODnCMLyMATh86YrN1ZPmjwWRMHpwQW+fCV8rLwj58E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZfQRYBx4GO3lFTAMJgib4+5df8aC40tg004hqcRpSg3P6nxQBN0APF+G+0by8uFoCm4vEUd52DfLHS4QyrMaKe6IyFKJ4dFOVY9RZ8oCL04Ksx2uvA1LKo1TBod1LCTm+VFRAZgx2xDxXuVvQjDyYcET1Bi1qTVCmrl/UM/+w84= 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=TQxk5MYK; arc=none smtp.client-ip=209.85.128.48 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-f48.google.com with SMTP id 5b1f17b1804b1-4218180a122so13980075e9.1 for ; Wed, 12 Jun 2024 01:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1718180434; x=1718785234; darn=vger.kernel.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=R+tryJWSLGei4yj4mnd/Wwwy83ERVx62Yqnj8MX2+CY=; b=TQxk5MYKztGI6IXzOvLNSX1Njy4G7Hep1ykBwj6IhXYoOEw9pKxLtEzPd2wxtFb+cc YAUAbUsz81k3PQwwtmjrzngEVjQP4rLRn5UMo326cRTX8vPoPRci43fPmLaByxOTfn0s n/+BQV91CFCQfd7B9ahbGfKBH2G/7GNjglh78dz6WDDucsESrZa2P7YjtAmSGe2Otl4p mHrThXSC9sEbti4UNFlq3kAWDNBu0OM8OnN7vKzYrh2PdIGXrNLYaA54VLL23wbtVBDi 6AVHg/yCYS9XrSRZcSTyhPVEWqy7IoZ7N3QAegDDfM4e1rLHyOEZU1pu20naTZo6ShTL pYAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718180434; x=1718785234; 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=R+tryJWSLGei4yj4mnd/Wwwy83ERVx62Yqnj8MX2+CY=; b=DFf0uSK8ckkfomoxH1zChOXaiCnZCTRhQfJgGQ/EdJodZvMBtVRGEk3qVyEOvQqq6N G7ASNz8fODrjsw7czeUf7EHTC3dxfje+d2eHgvI7zTOxurkBNgnPEIbw3cmTmuBQ4Zta Wsd+notYaOZK+Zgww4znI1WuYO2UDWnZrCacWddPULO2xtokrLa/tttakyUYrzP97ehh HYFpn2LsEWXdZQpsWJhIdsmnfHyIF1MweAnFYr6neFwcW4fW0XWrqa+kIcVJ1zEVwcyz hsEkDcA/+n8qO/mxDofGbp0XEGQsKBGkgaR0mSbiggrVpU/IbCEfecbX/FQcvf6L0kBC kPmw== X-Gm-Message-State: AOJu0YwRUjnXo3tSuTaH75RmP2HHHnXd+NLKnQao6Vvs5CRb55rmGxaf RR8jVcGWgcWeB3zaO+2N64Ryl8+l6R13H5sjITLEmqwnpvMlcRsLMxgHvmAbHZc= X-Received: by 2002:a05:600c:1913:b0:422:727c:70b1 with SMTP id 5b1f17b1804b1-422861aed43mr12346085e9.8.1718180434362; Wed, 12 Jun 2024 01:20:34 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:8d3:3800:a172:4e8b:453e:2f03]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4229207d1a7sm6011775e9.1.2024.06.12.01.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 01:20:33 -0700 (PDT) From: Bartosz Golaszewski To: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Bartosz Golaszewski , Amit Pundir , Neil Armstrong , Caleb Connolly Subject: [PATCH v9 1/5] PCI: Hold the rescan mutex when scanning for the first time Date: Wed, 12 Jun 2024 10:20:14 +0200 Message-ID: <20240612082019.19161-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240612082019.19161-1-brgl@bgdev.pl> References: <20240612082019.19161-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Tested-by: Neil Armstrong # on SM8550-QRD, SM8650-QRD & SM8650-HDK Tested-by: Caleb Connolly # OnePlus 8T Acked-by: Bjorn Helgaas 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 bfeeaf2d1fa9..b14b9876c030 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -3083,7 +3083,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.40.1