Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp112092lqb; Tue, 4 Jun 2024 06:41:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUM0N4oOTqpoGhiyZE3fj4cuOjbX6BJGoiqK3robZS9Y5EmduWYGuKHC88f+JjjBhp2oUucLmfintAEFPJTDDOV5DcO5M3a/r6K/jkycA== X-Google-Smtp-Source: AGHT+IHhZuwJaVE7mb8sSy+anHm1LyWSVGROaPmXCQHXzd73w/NtP7AMNDZX4r9yRolWQURPzET6 X-Received: by 2002:a05:6a20:7f98:b0:1af:d19b:a76 with SMTP id adf61e73a8af0-1b26f17d3c4mr12807651637.12.1717508490930; Tue, 04 Jun 2024 06:41:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717508490; cv=pass; d=google.com; s=arc-20160816; b=0pLJFSAjxRPgs3EAEdc1EbgotIfNlDyu4J+LBqb06SsgU8jqzKGWkcXzQaC6zHJhfO 2VYsXmMidxTA8ZOm4eBLW+DUVwzod+z6ez89ShNOKLoJ3R5asz5Eyq9YMbynmltEoFsn gjXvVjMWxhlsB6rfqwuDa6mDZ3TttuA1Or9dGdd3mmm2PEd8RdouXfNQqD1THSVmEIOX EVWvJk1XGaqQgkffia82w2G+TRUqqWiQXuNCrJOm+AbOPraY1KYVDaLUfnW9YqSiLR3X vVqztrcXFPpg5PqKPYZHShxHq8fSEjri2AgenB+9j/dBZ7nBBd4lDvACz1kQi4yGHd6d pR0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=QPSi69NKkDl86Z+DG7MVLpzqXo+cHpFb4T+eUjHO5Lw=; fh=fgFYqd4aajc9nXTk2DxQjGsV9Pgk8ndIZeBhp9grVJQ=; b=GG5RD9EyhOpMtth692lgJ5o+8e6geGtSVhMZf3G64kYR5oLMj3xQSeGwKq9cC0h+2k dRki4riGNW3taDCGRuBNrKY3ua6Nsv/997sbUnIapLs9dt3ss/JTAROoqcLHXkjSnMFe +uWzho7tkTNHSZuNOasPgurSWK4SxrKbmsQsO9SItONeLbsHx2HsobOKiVJUl3Ey9KAR RZecPHXJrQZhmeSiGuDiqEgRtlbSiWSRzNXCse+lri1d1PogW+Z1hOw4FpEmm0qeYq51 mZzMZHDXAJRftT91XfBaAhPsQTJTFAvxJ15JKLVzzcdwfPThLH6oy5Nbs7CkfRAXnGbS Zs+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=fs2vc81L; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-200727-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200727-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-70241cb2814si8151803b3a.0.2024.06.04.06.41.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 06:41:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200727-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=@ibm.com header.s=pp1 header.b=fs2vc81L; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-200727-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200727-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com 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 43FD3281748 for ; Tue, 4 Jun 2024 13:41:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 365B7148FF5; Tue, 4 Jun 2024 13:39:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="fs2vc81L" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AFF8146D6E; Tue, 4 Jun 2024 13:39:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717508343; cv=none; b=gEB+riawlYxeYDjq44v5fvHciYkUFuRykDnTc4bmP9IM+J1ujlTX2CtkJFODS+DM/zsbZt65khTU+iN9r7TxLOPv3PSmgp7eSCCGvYMXpPK+7PtKpMjuxcj3YG8QugBoNj8gEhKkOejp+d1gtfkH2prPpPtKgwc4g9h4SwZ23rQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717508343; c=relaxed/simple; bh=O+deWQNt5OanYzNos3NVHzpWd15SU72v0FwzQLeeXhQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=lC7rBcd9Rfs3PFeovWhXQKb2nDF7ULH3qxvjkqFFg4Vgv2AyTiShvI66bx9vjGXhcRloRzTCcnqZq3g16xXjQMMWbFs6Vu/tV1KX6zvxSfA9juOUvUfKov+T251NicMpZwBQuMT1NzYpjCOe90ZRomnwfBEG0Xypc+aKs1iE8BQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=fs2vc81L; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 454Cutm2013955; Tue, 4 Jun 2024 13:38:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc : content-transfer-encoding : content-type : date : from : message-id : mime-version : subject : to; s=pp1; bh=QPSi69NKkDl86Z+DG7MVLpzqXo+cHpFb4T+eUjHO5Lw=; b=fs2vc81LNN1x5QMsRWFDQr6LPDLUIa8fomWBAwTpow+hZzRWzxMMtT9K8uyfHN1PT0LD e/9Oj/klzlph6LP2WpG5bAms7037wKSk+mvH0RGCoIi2yTHh1MConH2MOJa8vxLHhBf5 0KC1ONiiM4aG+vCkItHrAUz/7YLO5USpZ31RRiSx5igZofb7lN9fqarC0h+UWZ3CI0h0 ovDXz9KpFgGNcC5wPCaq9Tsgr/zq1VhKWJt+4GC6Rp3RaWQXpVNRD7AajaVz+E7Eo6wM d0Bnx70o4t2ZC7YQlHVZajL/WSKIvCWKo2CKI3d6ZoWl6OCY9LEOQeviRXOiJr8i1MKs Rw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yj2x9g81j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Jun 2024 13:38:57 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 454DcvZg013875; Tue, 4 Jun 2024 13:38:57 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yj2x9g81g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Jun 2024 13:38:57 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 454Cg95i008517; Tue, 4 Jun 2024 13:38:56 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([172.16.1.70]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ygec0pf6n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Jun 2024 13:38:56 +0000 Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 454DcreF27788000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 4 Jun 2024 13:38:55 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C3D5958054; Tue, 4 Jun 2024 13:38:53 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E46358050; Tue, 4 Jun 2024 13:38:52 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 4 Jun 2024 13:38:52 +0000 (GMT) From: Niklas Schnelle Date: Tue, 04 Jun 2024 15:38:39 +0200 Subject: [PATCH] PCI: Add missing lockdep assertion in pci_cfg_access_trylock() Precedence: bulk X-Mailing-List: linux-kernel@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: <20240604-pci_cfg_lockdep-v1-1-00da1706c9fd@linux.ibm.com> X-B4-Tracking: v=1; b=H4sIAN4YX2YC/x3MQQqAIBBA0avErBNsEKOuEiGlUw1FikIE4t2Tl m/xf4ZEkSnB2GSI9HBif1d0bQP2WO6dBLtqQIlKaqlEsGzstpvL29NREKseOkUaXY8aahUibfz +x2ku5QOsVV36YQAAAA== To: Bjorn Helgaas , Dan Williams , Dave Jiang Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Matthew Rosato , Niklas Schnelle X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1128; i=schnelle@linux.ibm.com; h=from:subject:message-id; bh=O+deWQNt5OanYzNos3NVHzpWd15SU72v0FwzQLeeXhQ=; b=owGbwMvMwCH2Wz534YHOJ2GMp9WSGNLiJZ6lPt98Y4W/68uv8/vXbdyyujR2FZOM8L09Z3O+P Jwio7tIvaOUhUGMg0FWTJFlUZez37qCKaZ7gvo7YOawMoEMYeDiFICJ/GVm+GfCuKWy7HnktKuf s+YsLXRcviXy1ZcFZhP/+S+UW6o57dMWRoY/x728lyVJrku70ptxusIzfNHhpH/GXXY1h2MYGla 938sAAA== X-Developer-Key: i=schnelle@linux.ibm.com; a=openpgp; fpr=9DB000B2D2752030A5F72DDCAFE43F15E8C26090 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: EuWyve0ZBFGSziGMKYKH3OoHm_EqeriT X-Proofpoint-ORIG-GUID: TkuItEXU7KJSJI0OxFDg8G5dTJXOPHt_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_05,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 priorityscore=1501 spamscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 clxscore=1011 mlxscore=0 suspectscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406040109 In commit 7e89efc6e9e4 ("PCI: Lock upstream bridge for pci_reset_function()") it was missed that pci_cfg_access_trylock() needs the same lockdep assertion as pci_cfg_access_lock(). This leads to false positive lockdep splats for users of pci_cfg_access_trylock(). Add the missing assertion when the lock was successfully acquired. Fixes: 7e89efc6e9e4 ("PCI: Lock upstream bridge for pci_reset_function()") Signed-off-by: Niklas Schnelle --- drivers/pci/access.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/access.c b/drivers/pci/access.c index 30f031de9cfe..5b6620da30d7 100644 --- a/drivers/pci/access.c +++ b/drivers/pci/access.c @@ -319,6 +319,8 @@ bool pci_cfg_access_trylock(struct pci_dev *dev) dev->block_cfg_access = 1; raw_spin_unlock_irqrestore(&pci_lock, flags); + if (locked) + lock_map_acquire(&dev->cfg_access_lock); return locked; } EXPORT_SYMBOL_GPL(pci_cfg_access_trylock); --- base-commit: c3f38fa61af77b49866b006939479069cd451173 change-id: 20240604-pci_cfg_lockdep-b6914e62d726 Best regards, -- Niklas Schnelle