Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2183233rdb; Fri, 8 Dec 2023 00:02:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGirzjcoK2kIIRpzcd4/c3TEag71OAy9ZbNNGhkUv4p+zPoQwpwFRg2fQhDCXQuKQgnYakf X-Received: by 2002:a17:902:ef85:b0:1d0:7f06:1751 with SMTP id iz5-20020a170902ef8500b001d07f061751mr3722879plb.79.1702022541218; Fri, 08 Dec 2023 00:02:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702022541; cv=none; d=google.com; s=arc-20160816; b=kpgChxK0LsQknRITLZPxPF4L+6HbRj4KkkUld/jhoXe5gLXxSwSwhHOG3EvlvX8eNG f3xS9aEYePIJSx6xqA6bV6fxhOjHvuExmT0lz6UodIjK/K8dyGg0KBU+7E6veiLf+zMs 4MOK2CEQLuFy4jDdd5jEnhD9XXnaI+zCd5cE8m1IxeFIFxePkN6oNys4FgwaMRn66yZT D4iAm2ig3jz9Ul+vxHLwEk/VhsE4dJ0LA8IGJzJ057jgmFfNZiJUpzf0ONRw5C37kkW/ J6M94SI+Vxz8m08jI7T4/r3khAUBMknjqgwKoNwelZuDTbGZ4kqCPE/hLiEtLAtFsAMF G39A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FBzmzAr/+fEZeszeqaDSNEhuFGJpmA5Mfl9b2QraJhw=; fh=Grm3zw8KfHAhHBte3bulUX8vpkjm0QIk7h5hAfgLlXI=; b=q0wfvFEA4fa3jnLtg3azT42bfttGTIIomA+qgVkNPNZCu9A3zYG270wX+wPCyn5h3n Q3ICoNuDmyYUmHCwBXZgjYmtwSi7o8VsvILcnEqzM0EXb2a76a4W9g7YOEjSuhHrtUxh xBum0m1E+FMBn8f73MGDvdvXQOi9bR6HftfLcqUIpYHGo5REJKofFU2bNigGCMOcPA8M QPdtapzxI24DaJxZG+XubPyWFy+O8qdkCUX/FKHEW/ouoxmjWYrWliSqGvqfCjpFVUgf a1ylKW+h7nBkSQwNpYBoicS0BvI46JIxO2zTRQ+WTL0Abv7GpEHAjoqnB6SFY0A06SVC RRlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AZ6Ap3sl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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. [23.128.96.32]) by mx.google.com with ESMTPS id b2-20020a170903228200b001cfc170c11asi1153561plh.475.2023.12.08.00.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 00:02:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AZ6Ap3sl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 AE02680EF246; Fri, 8 Dec 2023 00:02:18 -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 S1573344AbjLHICC (ORCPT + 99 others); Fri, 8 Dec 2023 03:02:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235823AbjLHIBk (ORCPT ); Fri, 8 Dec 2023 03:01:40 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D2141996 for ; Fri, 8 Dec 2023 00:00:08 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED718C433C8; Fri, 8 Dec 2023 08:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702022408; bh=KHV0ZGPq3MX7s2HDIPDrsThZSX5szDZVhE9ErAHo8tU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AZ6Ap3slRyF3YOWOEdPCjpEcYV/WFG+MzvEYoskaV3JjcRPj/DXi4sJwrnDEfiROs /B8tYAoITAczfm+WZgkiHC3TQv1T9L/5HMBNuqayfsAA65hq5A1Dn0kko1JFRM4BOE arOc5GuDHJhI92B9guVaicWT2ktdtjJc+pRoPl1R65B60jIRjh69cN+g0NXzzCKtNP 14DNELaKEs7cPaz2sOKer4ZCljM2Y6YAx7OLE7oZ1W++x9HEWedtLL9XtOlAFK/35X 3J7QLVD28YI/w8ekJTrka6m1DE5vAYoQjE9QDLyR1S3uxsIIpbB4jioEdDzMgJ5jdN JKT96xnf21b9g== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1rBVn6-0001Vo-1K; Fri, 08 Dec 2023 09:00:57 +0100 Date: Fri, 8 Dec 2023 09:00:56 +0100 From: Johan Hovold To: Bjorn Helgaas Cc: Johan Hovold , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , 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, stable@vger.kernel.org, Michael Bottini , "David E . Box" , Manivannan Sadhasivam , Kai-Heng Feng Subject: Re: [PATCH v2 1/6] PCI/ASPM: Add locked helper for enabling link state Message-ID: References: <20231128081512.19387-2-johan+linaro@kernel.org> <20231207204716.GA764883@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231207204716.GA764883@bhelgaas> 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]); Fri, 08 Dec 2023 00:02:18 -0800 (PST) On Thu, Dec 07, 2023 at 02:47:16PM -0600, Bjorn Helgaas wrote: > [+cc Kai-Heng] > > On Tue, Nov 28, 2023 at 09:15:07AM +0100, Johan Hovold wrote: > > Add a helper for enabling link states that can be used in contexts where > > a pci_bus_sem read lock is already held (e.g. from pci_walk_bus()). > > > > This helper will be used to fix a couple of potential deadlocks where > > the current helper is called with the lock already held, hence the CC > > stable tag. > As far as I can see, we end up with pci_enable_link_state() defined > but never called and pci_enable_link_state_locked() being called only > by pcie-qcom.c and vmd.c. Correct, I mentioned this in the cover letter. > Can we just rename pci_enable_link_state() to > pci_enable_link_state_locked() and assert that pci_bus_sem is held, so > we don't end up with a function that's never used? That would work too. I went with adding a new helper to facilitate stable backports and to mirror pci_disable_link_state(). The variants are simple wrappers around the implementation so there's no real cost to having the unused one. But it seems like you think there will never be a need to call this helper outside of pci_walk_bus() and if so we can drop the unlocked variant right away. Would you prefer basically squashing the first three patches and mark the result for stable even though that patch will fail to apply to older kernels as the Qualcomm bits went into -rc1? Or should I send a follow-on patch removing the unused helper after merging this series? The end-result will be identical. Johan