From patchwork Sun Aug 25 14:34:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13776798 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09684C5320E for ; Sun, 25 Aug 2024 14:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=b/+WxYlkSCaxJVD+lANibTyIufP0s0obescAo/C5LRY=; b=cVnfgyRVUIjGNPvjG2NCwInGdv bT7bqjdb9HUybfSNO1SxY+3167JWRa04fO2PtahTGQSKAbSOpXkvIRJnS1CmxPyAGOdsGweqqPw7D v89c7+omFTshbIYhE4/UfoitZF/x//tSfUnvAICGyzyMGxzNbuVH4dT2Mn1hzmE1etPWtg7Qyz4Y5 RnMQ57LS6bibmqP0GP99qRN+D2AcWzbN1RNC7odC0JK7jrhO/rCk9wPkdGCjIS/oZLwyvE/NZxR+T FxcUe1y+olsBmtXMycALZnsRoWWWJJ9EWc7f2bxfhb9bKz796U5nnLiVP3/dfcZCb5HxGCcZC/P42 dyg7PKAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siEKy-00000004VU6-426x; Sun, 25 Aug 2024 14:35:24 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siEKE-00000004VHh-442p for linux-arm-kernel@bombadil.infradead.org; Sun, 25 Aug 2024 14:34:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=b/+WxYlkSCaxJVD+lANibTyIufP0s0obescAo/C5LRY=; b=cWk+gA9THylwMrOTMf1IyRSymb BHh/05oC1f/t1NoaEWIBLoJGD3LJcpVz9Y7UUKRug8IGMYy3NwH3t3KWR4ML9v7p39SJkdp54SjE1 ZYWxaoyZictg+UOSJMIeMBJc2k0vq/Vpl/khAy/U7E2BLeHvcmX9I8HoNN/NztBarALrD3H7FS+Cx /zAz/6NQQ5KooSdrQtzmBT6oOwEG+HGUqMPsYP7zbPrAxZr1e8HMGUDBtXsWqOImNIuIsb3lHdTsX k5zTHMw2XLEFV0ijpxeDctLB/c8XV1lsTBXyUKX5Zcvd6n408q0ulT7dIm6deYCX/HzmD58Eo4JfD KewKZQug==; Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siEKB-0000000ASHf-2bJq for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 14:34:37 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a8677ae5a35so354390566b.0 for ; Sun, 25 Aug 2024 07:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724596473; x=1725201273; darn=lists.infradead.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=b/+WxYlkSCaxJVD+lANibTyIufP0s0obescAo/C5LRY=; b=qRGFWVASTM/+IKJrbNKwCecwCi4vB12ToZRpdBjyjGERWm68XiysGjRGsvGaw15zuc vf0TzIMlgPDGZs2q0EQsVSFBg5ZIJhbF+F2Q02GQipUG3GOMtozMbxFbpCn/ks8ascxu 6xzG1njOMkg3FkBH0ItloUdJ7kFTM9kjsJSsw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724596473; x=1725201273; 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=b/+WxYlkSCaxJVD+lANibTyIufP0s0obescAo/C5LRY=; b=TH3yw1nfTG4TPB9M+e7gNvjqUI5TkFAtu0qZ8U6HBQA3qDRICy+aEPN9VW2bGyy0Qz yOto5KayFxR3obYhLUbEu0Hnh0E/E5Swy1DouB5MFnzaeocCupQdZ0dFN633m9wxtzQQ SwX3yr/s9u9yrjS14kgEYr3VbqOhfqcp/m/tBrEnkGwlgCj4WaLFmGDniRLgJlNAG/5H khpgTeJ7XjmQAMbP8OREAdaupw/fo/GXPdVZeZrUfctNShIsT8REjfmwqKYTdBCyJ00A p1IQcRedRZa7TebJpo1j4+T4F/8fi+SEF098aXG7h3zoRFskFHhg5WICn6I8gRb9rxHd kHlg== X-Forwarded-Encrypted: i=1; AJvYcCUoI17gDC+AHGD5rSmcxyApP8xDsFVqn77Czdh8s5Hb38sIAbPfACK6QIEfbOasH3m0RTUKtmHV1FfWY7JZkP8a@lists.infradead.org X-Gm-Message-State: AOJu0Ywyp6dKbvBJpUud/mlnnG7Sd1M6DY3lG42R+VUg56fg9D124lG2 uwc7GNID0M3/9lPJfCRlVOFfOSz0x8HSP8gSzjOfoYZG++BLiVqFq9FIi/8y9RQ= X-Google-Smtp-Source: AGHT+IFIxJEDmnRdmJ2yfEJLKXiwKOFoIxfU32uGKJOfRx3/E1xOLH6e41n99MLu4zc4j3as810TWA== X-Received: by 2002:a17:907:9626:b0:a86:899d:6459 with SMTP id a640c23a62f3a-a86a53017a9mr610711266b.38.1724596472420; Sun, 25 Aug 2024 07:34:32 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-25-99-149.retail.telecomitalia.it. [79.25.99.149]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f4862b6sm550625566b.170.2024.08.25.07.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 07:34:32 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Fabio Estevam , Heiko Stuebner , Peng Fan , Pengutronix Kernel Team , "Rafael J. Wysocki" , Sascha Hauer , Shawn Guo , Ulf Hansson , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH v2 2/3] pmdomain: imx93-pd: don't unprepare clocks on driver remove Date: Sun, 25 Aug 2024 16:34:01 +0200 Message-ID: <20240825143428.556439-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240825143428.556439-1-dario.binacchi@amarulasolutions.com> References: <20240825143428.556439-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_153435_925112_496944DE X-CRM114-Status: GOOD ( 13.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The removed code was added to handle the case where the power domain is already on during the driver's probing. In this use case, the "is_off" parameter is passed as false to pm_genpd_init() to inform it not to call the power_on() callback, as it's unnecessary to perform the hardware power-on procedure since the power domain is already on. Therefore, with the call to clk_bulk_prepare_enable() by probe(), the system is in the same operational state as when "is_off" is passed as true after the power_on() callback execution: probe() -> is_off == true -> clk_bulk_prepare_enable() called by power_on() probe() -> is_off == false -> clk_bulk_prepare_enable() called by probe() Reaching the same logical and operational state, it follows that upon driver removal, there is no need to perform different actions depending on the power domain's on/off state during probing. Signed-off-by: Dario Binacchi --- (no changes since v1) drivers/pmdomain/imx/imx93-pd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c index 44daecbe5cc3..fb53a8e359bc 100644 --- a/drivers/pmdomain/imx/imx93-pd.c +++ b/drivers/pmdomain/imx/imx93-pd.c @@ -90,9 +90,6 @@ static void imx93_pd_remove(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; - if (!domain->init_off) - clk_bulk_disable_unprepare(domain->num_clks, domain->clks); - of_genpd_del_provider(np); pm_genpd_remove(&domain->genpd); }