Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3680429rdh; Tue, 28 Nov 2023 00:15:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYF6zieJ26aPYmy28/+crDc5Yv4gTLBqNsTbGKvnuM6+YSPEO0vKINqIC6yqUjlIZPwkUr X-Received: by 2002:a05:6e02:2191:b0:35c:b333:a860 with SMTP id j17-20020a056e02219100b0035cb333a860mr8123747ila.18.1701159359450; Tue, 28 Nov 2023 00:15:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701159359; cv=none; d=google.com; s=arc-20160816; b=z+60Z8Wrbjqjb1t/MUPPHSGd4GkHw5PKkKjVWix1cG+i1b9kZ5hT4mnVIEJ9F5Gu/G rXzBB2htdtTAyjVZbN9gp/N6NGoqg0GdLwA67BihThm9lRMJbzAd2ZZGGtmBWHWAtH9h PASn5ZGGuIBfKu1+SfV+UKB8ZqdnwebUHXUSUA0mU6qPVO9uPH/TRPpdI0T2LSi9eTj9 O5S66CrasbtWgVnlEC83w4cuRuENxYmnNWGU5Uh4kU2QxkNDZcp4Ybw/PIMjGk/MrspQ tkcd80QVHs9BxMEBA8lVFXexXJgp9BjEYT4RmPUl7AI25L2mZh1GU2MSSU2qoDygr09D o7oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OdCvS0dcB0hwTpgK11XyCAoDh23HmeqICedf/ZRA4JA=; fh=n9j1ofctKSeYxvmwnbKmIbkuN2/6NCaqclsXgGVH+6A=; b=zHOL0hHSJLbqYCr2Lz1q8/RT4qZjSBp1d3+q7pqEaxtYnwV+O4HVllaFQ0G+kHN6cx GaZrwBKHuPmUKPhDjOgmqsBJ7bqAzjLJCLmzbf7+5DYLjiAt8bOCzVsEBlGfOJSVEHfl 3dzxRubb13QFFnSmBh0O2Gwz05OgucuZZ/WAXyzu0Lobc/L/LH0wn73zn60cLTYT+ZFk u8onUJEPiUhQYO87Xtb7KBSicVbQ+in1AzEBGbqkTJwPFsjklmhBVJalVn289yImoe81 Ln6vbhy9OSkTDbshnTcywbnGg9QtQ8zn+L/NicOUW1vfRxAc/kQwC4UoB5SAGWZBWnJE Bx4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gc8TG5Uy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id fb23-20020a056a002d9700b006935df3019esi11813245pfb.235.2023.11.28.00.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:15:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gc8TG5Uy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B00908092153; Tue, 28 Nov 2023 00:15:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344073AbjK1IP2 (ORCPT + 99 others); Tue, 28 Nov 2023 03:15:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233910AbjK1IPT (ORCPT ); Tue, 28 Nov 2023 03:15:19 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED299E1 for ; Tue, 28 Nov 2023 00:15:24 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58596C433C9; Tue, 28 Nov 2023 08:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701159324; bh=i/EHkRtVuPQPs5OIMVcI6ZSMpjBbo9UrT0fH07edjzo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gc8TG5UyJ9xcrTjk67G3eNwL38tdLdf5NMSifIzV8q+o4CpN5IWL2j9WEJcMiqMIs pcqQ6UBN8X9Ft6teNQegKrQL5sKl1e0bKPOvO77pHIMTL/F9O8lSVFeSYS6JlCmzqQ 4bLqpW5F30uN8aiYqvyBBV6x2ESrOt/mR4KRWJVUCWdzFdhtSlqvPcnAObwVJPzwHO iSctaJFdrns5imocLhcx3C/3aGH14F8A1OTx5kYkJmVEfuJUcmG2P8aWx5DbcTWGJm OgFx07/0N80angxPUpx2esF8c33jk14HftNEJUzZvfScYx0d87nyNyoOC7z2LxEE+q RlKwAeE3Vo5qQ== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1r7tG4-00053z-2x; Tue, 28 Nov 2023 09:15:52 +0100 From: Johan Hovold To: "Lorenzo Pieralisi" , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , "Bjorn Helgaas" Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , Rob Herring , Nirmal Patel , Jonathan Derrick , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Manivannan Sadhasivam Subject: [PATCH v2 6/6] PCI/ASPM: Add lockdep assert to link state helper Date: Tue, 28 Nov 2023 09:15:12 +0100 Message-ID: <20231128081512.19387-7-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231128081512.19387-1-johan+linaro@kernel.org> References: <20231128081512.19387-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 00:15:56 -0800 (PST) Add a lockdep assert to the locked disable link state helper which should only be called with a pci_bus_sem read lock held. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Johan Hovold --- drivers/pci/pcie/aspm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index d7a3ca555cc1..5dab531c8654 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -1090,6 +1090,8 @@ static int __pci_disable_link_state(struct pci_dev *pdev, int state, bool locked int pci_disable_link_state_locked(struct pci_dev *pdev, int state) { + lockdep_assert_held_read(&pci_bus_sem); + return __pci_disable_link_state(pdev, state, true); } EXPORT_SYMBOL(pci_disable_link_state_locked); -- 2.41.0