Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6F84C74A44 for ; Tue, 7 Mar 2023 09:43:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230218AbjCGJnZ (ORCPT ); Tue, 7 Mar 2023 04:43:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbjCGJnS (ORCPT ); Tue, 7 Mar 2023 04:43:18 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98AFD30B13; Tue, 7 Mar 2023 01:43:15 -0800 (PST) Received: from booty (unknown [77.244.183.192]) (Authenticated sender: luca.ceresoli@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id AEE37E0005; Tue, 7 Mar 2023 09:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1678182194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fBXMFy24pB1L3M53iT14RCAKjfqpFvZO6FaFdhmAFPk=; b=gVTSj14MgoBG4gs3EBb/yS4z1UVGC9WxSCIkJr4xV9QLRIAWT4/qYoadkpXoySXjOiMDO5 TFbuaNtobklneO5eVFomlh1zHpmNtpmaLafLZtFd+YONwhGkaZn2qfgNguB95FiyLrBF8e Y3729IfU6UNr94JzAgJWMqAOy1chLkJPj7nG6zA4Ll6Q/aBgHJiTiAl4WqFcxjtCD8Y26J A50G6X6U+5TMn8PQvoJ7FkW8mvvxC4l3jN7v5FtXKxpsOGIXEhDTXlHffEXM7fHSdohoUz VY2DDDCwyOy73TFdosMsPQXQ66tkdiS2Pfsmd60O20MbL0Hxf1IyoJClfNyTAA== Date: Tue, 7 Mar 2023 10:43:08 +0100 From: Luca Ceresoli To: Johan Hovold Cc: Georgi Djakov , "Shawn Guo" , "Sascha Hauer" , "Pengutronix Kernel Team" , "Fabio Estevam" , "NXP Linux Team" , "Andy Gross" , "Bjorn Andersson" , "Konrad Dybcio" , "Sylwester Nawrocki" , Artur =?UTF-8?Q?=C5=9Awigo=C5=84?= , "Krzysztof Kozlowski" , "Alim Akhtar" , "Thierry Reding" , "Jonathan Hunter" , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 02/23] interconnect: fix icc_provider_del() error handling Message-ID: <20230307104308.3bd7b595@booty> In-Reply-To: <20230306075651.2449-3-johan+linaro@kernel.org> References: <20230306075651.2449-1-johan+linaro@kernel.org> <20230306075651.2449-3-johan+linaro@kernel.org> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 6 Mar 2023 08:56:30 +0100 Johan Hovold wrote: > The interconnect framework currently expects that providers are only > removed when there are no users and after all nodes have been removed. > > There is currently nothing that guarantees this to be the case and the > framework does not do any reference counting, but refusing to remove the > provider is never correct as that would leave a dangling pointer to a > resource that is about to be released in the global provider list (e.g. > accessible through debugfs). > > Replace the current sanity checks with WARN_ON() so that the provider is > always removed. > > Fixes: 11f1ceca7031 ("interconnect: Add generic on-chip interconnect API") > Cc: stable@vger.kernel.org # 5.1: 680f8666baf6: interconnect: Make icc_provider_del() return void > Reviewed-by: Konrad Dybcio > Signed-off-by: Johan Hovold [Tested on i.MX8MP using an MSC SM2-MB-EP1 Board] Tested-by: Luca Ceresoli -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com