From patchwork Sun Aug 25 12:36:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3340 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6CB8E3F1CD for ; Sun, 25 Aug 2024 14:36:35 +0200 (CEST) Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5becd2ca7e7sf5407978a12.1 for ; Sun, 25 Aug 2024 05:36:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1724589395; cv=pass; d=google.com; s=arc-20240605; b=WKBybUwwQztipYC8zonXdg5Xv1S7c1Y0aHWZ/lQBlLJi2U5ZdmOTj9tKC7hPV0sfMb cV/UwrgxYUVOkb0N/jlsKmvyoC5tTFH0tfJTU30RSq+uY0opoL3taOGqBjxz74VX3+zc YQaN5rhpu1dG+aj/klTQ68B6zvO2tqV5eGEVDmHlIB8PcXbrkNkimJtVvSDiJnLBbnWS cLXI51aFztnJWdZ9gEemxo6vIcBgYXEPQXBlVL1r7ws65jaZ4bY3MhtzmbwSdTx4fPO1 /cktKzqfIQzhShVUakYOHNxt8bSi9j3T0yuzDY4SkAzDavmpqsEKeIaJG0BWXFUYxcfa Me5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=oxgX9PezmkrMOi9ECTRCmgRDF6CZXDkS0UqVQhc6WxI=; fh=kBwJ9j91DKaIAWgAIg7KxduTzpslY4X/CTfpnDwg2uM=; b=kkoIh4dgpE2P4Ft+97IO6n/mK7cw7Yye/H4jl/uZ1hxPhIMUMLvpOYjTlXMhU7XWMs o5lqEyJO6PxNBhNPpArW+am7QAl9s+9AFteM37QTJPi8X2of54Y0RxtwAvpvWypc8rbj jOW8DYReuOVyGVOATjgVRuhW+/NeVTnGMxSLKQm07gsPmfnQOTudJg7mKEMUtxV46lYC jrGD9l68dLxcqjJPVH8lDqhDma9L/ilVDT2BpSPTZhxmnEOlz2OKOva4PP+/DdhePz5r Ov8mLULxs4LuS4qV2Hr6+iygvi5LEv28DdK3bkeSsj3iKGdiKbp5FsuYJvP7BwuUdA5S t6Aw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="cC3M/AeG"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724589395; x=1725194195; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=oxgX9PezmkrMOi9ECTRCmgRDF6CZXDkS0UqVQhc6WxI=; b=WG3W9EGcp2kNKotUZPDXBGH16IzT8/DXcUpZpcACgdrmQ7ovar2y09dXouUaP+hH7C H+G9P5zpa9qwxuIle2TemwQ/uwC6Q1tO8XbZqYvEHdCWc1NcJsieTFF7FjoxsPZUBaOG 42PET74qk1n+qCUfeKO0tJ5Q4Qw63PBIiLE24= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724589395; x=1725194195; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oxgX9PezmkrMOi9ECTRCmgRDF6CZXDkS0UqVQhc6WxI=; b=qQxjClGNjoq99PlgV+IG1OhlVEJHUV2LjgXUDKiMuy2ojQ1Je1r+Pkx8kXL+dr9G5c 6AIbhylyj1jlTwhy/16gLRQL6gELXpTcWfge6bHXnRERHD07CJDVfjnR9wiPeQYAGWH2 ArCKJvoXS3ktAVno3m2/D+LJZh3TjdC+N9gORqMi6CpyxC1pTRv0nqPGHgO/1cbTSRFu ncdTWpjDMtfnYRFjGBa26h+vidW922GdySsf1vkTelOj2Q3q12jT7C1feSYYZ8wQEl1f 4uOGOWX30eaG55SBNuo3xM6BYKyO0NWkWIGXN95ojczIrWNunoaQ+QUz0lgFxMxJjWYG IvCw== X-Forwarded-Encrypted: i=2; AJvYcCVhmV1gKwMDDxgX/Ff9+SdhgjC0Lyc4G074uOE8rrAZnI8V22AO6pobGpNjOqu9exygd4uWkrEco8xQZp7D@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyoJzaTRx7hwzEUlM5VKNEyyncpn6T3Z8oTXuMPvdyHSyc8bj3P CR0uUq7bpkx9heayT44KQgW0pqNOMMF/JMPNs5bpLGpuKQrVv8ko/LedN+xr0G9TJA== X-Google-Smtp-Source: AGHT+IGGtprrQ7qy7N+eap32LHcCMy2Uy95a1MU8eg6HV09WmCTi8+kRsn1YlxuvC0QvE2yzrUstOQ== X-Received: by 2002:a05:6402:2713:b0:5c0:aad3:9006 with SMTP id 4fb4d7f45d1cf-5c0aad392e1mr695155a12.5.1724589394805; Sun, 25 Aug 2024 05:36:34 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:40c1:b0:5be:ef89:e79f with SMTP id 4fb4d7f45d1cf-5bf63c7b07bls438876a12.2.-pod-prod-00-eu; Sun, 25 Aug 2024 05:36:33 -0700 (PDT) X-Received: by 2002:a17:907:3d94:b0:a86:abbd:6834 with SMTP id a640c23a62f3a-a86abbd6a82mr681866466b.30.1724589393298; Sun, 25 Aug 2024 05:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724589393; cv=none; d=google.com; s=arc-20160816; b=JtF04ABHF+QIrpNPX8zI/Wh796T4Wn781wpbcMrRHy/c4tz5oDavsLJpFgG2Pw7KVB EfmH66WzQ+u2lmTWb2PggOZTJHSg2fl3iVlm5j7fWkTnUYr0+QSU0vW30so0GZXv4BzR QgVkGMTEqVFflEQ2QF06JsBSEE7K68uBSbqCWTUXAvhkAmxtOH4dmrB9vJm6dwbMQ0Uy kI0SqF3QweBF0+MHn3QRw73D8PQ+uNEU2G2FXVS+R3EBPon6ypt6sU6Sqis8zNdEf56E UzzC0dEYqAC8HK1akNRU7eQ0N7X2AfM9o9gu4DeQDgLTKhDZK/jortvjbpcUMGyLwnVP SE4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=zf5APENb9JvqJNcRLDTY5Ylob0hcYN8J/GA4M8ib6BM=; fh=TAxMnOnpv/zZtbTkNCX/0OJvHLUcL4lkl5Ac4HPLJ70=; b=s4uBK/Z7ggKaFvg+Be8QOy/ZP9sNK8g54XpCJaHjW3PwW4rsiKhcwfaxMYNZTlP1H2 2WWLEKPwcbbB1Pdhtz83vXfTBsiva4I0W698kiGqjZ+M9iusx8uoi5d87GOfCCG1UFVm YVdwOb6cQzRM/Kr6YPivpwmlshlTC101kysjaDpApCLUX2EISsXVr3UZuQVruTckQT4q oyZgEC6zW/UXwXVnWk7qLZvK0rahlU8WSaiv0n4URDYAkuQBa4+KdLDT33NJ69c4/SRM dOlHEB0OGRwqc7m58zhF87a+P0BGXGsENL4Ab8ROgaDDEsWd2aI/cp3SNmiZHjSaSJRh dmJA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="cC3M/AeG"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a8671e0c5f7sor327466766b.3.2024.08.25.05.36.33 for (Google Transport Security); Sun, 25 Aug 2024 05:36:33 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:907:2d11:b0:a86:a30f:4b00 with SMTP id a640c23a62f3a-a86a30f4d3fmr825679566b.27.1724589392821; Sun, 25 Aug 2024 05:36: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 4fb4d7f45d1cf-5c04a3e89ebsm4350404a12.43.2024.08.25.05.36.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 05:36:32 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Fabio Estevam , Heiko Stuebner , Jacky Bai , Linus Walleij , Peng Fan , Pengutronix Kernel Team , 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 2/3] pmdomain: imx93-pd: don't unprepare clocks on driver remove Date: Sun, 25 Aug 2024 14:36:15 +0200 Message-ID: <20240825123626.3877812-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240825123626.3877812-1-dario.binacchi@amarulasolutions.com> References: <20240825123626.3877812-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="cC3M/AeG"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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 afc482ec563f..24e5bfb336ca 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); }