Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp890944rwl; Thu, 5 Jan 2023 06:06:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXtvEOL8pCv7evdIww1LPBPx4F00QukN0UAhhEdEzF0WapErOnqPNzfWkAzlJa2CRMNlvd4Y X-Received: by 2002:a62:148f:0:b0:582:46a4:87f6 with SMTP id 137-20020a62148f000000b0058246a487f6mr16460960pfu.22.1672927571408; Thu, 05 Jan 2023 06:06:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672927571; cv=none; d=google.com; s=arc-20160816; b=p3aY8tGp/PJsyBrQABtRLh6eTjCDwO3XAUleuCpRB7NNtVdGBeuO0rxSfo6u6Y8uJg BHF7havd1zuhjfoxpnIp6E+uxWENTMkeKcSrOqkl9NCbZoBUlI+7cQAyygp2yPEZnGE3 LCmM7v/5VmYbQULcZdRxxajApCskFkLsMhyrq9GY+vcJnyOe4ML/ko7ZW3s0tNmRIqAN eYEuCRzEa0rK+UcFqErsxJ+GP/iOHFDzJqjDFLKhXh+fR4Pv5ulCZqm7jJOA0H0VDftf GdhVt5mec4W+JvNiyr4b3xTt22qfL6Zz+uDlDDo824td/YRWN95heNPwZyXtwVwppQMe TUkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=e5zML+NPV/fPr0ZWlrrZXjBxIr8nZb+LuCRyRRcoWI8=; b=vhmG3UOvysJYsR85l03Omdn/Ql/SyXzZDpNOK9TBET3Nok3wfWLCMe/Yl/CX75/4uB Z/TuY/vIluDLyxPjOuQNLrAI2hL2ifFTM9zuH7crJB2zkV4lMdiDVaJiR6HIun+0w302 5l++YGMsN6/zZEXE0X+1wP9MmWDhg6BjOcgBCsFQm4fMv2JXUsbbY+Ekq62oXFFyBAnD SLn7B+xvInDjZjS3cmVv4e8qNOUTxddVMa8B499k/9Ei2MpN1IjK/QW0XN3c/4A+sech nyrZaimIHpaj1Po3EHzAtGQP04Ey7OiPblhVs0L6VI3xHiKueM9SSnc63JpfJBz8mHs3 Ko7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GOKUDttj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020aa78893000000b0058320580dfbsi2106416pfe.38.2023.01.05.06.05.52; Thu, 05 Jan 2023 06:06:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GOKUDttj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234655AbjAEOET (ORCPT + 56 others); Thu, 5 Jan 2023 09:04:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234412AbjAEODj (ORCPT ); Thu, 5 Jan 2023 09:03:39 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2BC112D02 for ; Thu, 5 Jan 2023 06:03:38 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id bf43so55141485lfb.6 for ; Thu, 05 Jan 2023 06:03:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=e5zML+NPV/fPr0ZWlrrZXjBxIr8nZb+LuCRyRRcoWI8=; b=GOKUDttjA11IzZPrNzfinH3jYjtRfTLJpPSHvtDaquUjbpOJqzX6kHzIuzMNhk5Ayk evrSapDJP/n7OLxXflnC6UuYx2KZ/+ltwqhuvneDswtXyKAajgbqGR/gF8xB1hRtpJjg cOqtMhDw0G4EAgVrnxMp84JA9dChr5a2dl5NYOh+V1dE+luS2HULSwbwj7FhC531ymRJ GRcVO+q7SSbq7Sg6jX5fZMStF98hf02sUl4s6qtsZg5YnJxTrPFXAsptzkxmAyr7wQaC X1zBXCJn4WzW2GqCPXLKpzKcspZ+GlSyvhDXCt7aSvhMrQV5rLqXsY/0h1A4RduC9TJL jdUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=e5zML+NPV/fPr0ZWlrrZXjBxIr8nZb+LuCRyRRcoWI8=; b=sF2MML4Z0oxgbPIbSZ8YxzDbBCBBfw+zXJ7CU2UiwGHvQ6ZHETbO5FoWiQLR9twdY6 7aKUtxlUY5nnuZTB73cS93sFZXAfWXveLBL5HVdjRTCEeLIV7n2txPYlNKmK2M/d2vjU xylELxHxMdyvQB1xkEnZfuAdJ1E/UpepZdI2uYscUfQiHsY3XcVA5jjD9BYqsNl3ua6N KBfqYjDzH4UjYDr7W5gnUnrXWZBhcnz4HxTZDbnQh8VRi37aSG9n58iR6P/6uQr6NINj XEKq4yAfXL3eTu6e1RsJMZAra6ZaWNBZyKGljVC/HQqEqYQmV5g21xSmRJtUGS7YGibc FOEg== X-Gm-Message-State: AFqh2kr/b62O7tDNq5bEfxAWEQ4crwQqAIkttxY7waOk+xy9w/bCOtTa ZT1yMsMf6nrmzVrNvv0zTeZ5Wg== X-Received: by 2002:a05:6512:ba5:b0:4c0:91d0:e7b7 with SMTP id b37-20020a0565120ba500b004c091d0e7b7mr24071207lfv.27.1672927417012; Thu, 05 Jan 2023 06:03:37 -0800 (PST) Received: from ?IPV6:2001:14ba:a085:4d00::8a5? (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id bt17-20020a056512261100b00494942bec60sm5462737lfb.17.2023.01.05.06.03.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Jan 2023 06:03:36 -0800 (PST) Message-ID: <517e749d-12c7-2ba1-f6e3-b96f682b432a@linaro.org> Date: Thu, 5 Jan 2023 16:03:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v3 1/2] clk: Add generic sync_state callback for disabling unused clocks Content-Language: en-GB To: Abel Vesa , Mike Turquette , Stephen Boyd , Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-clk@vger.kernel.org, Linux Kernel Mailing List , linux-arm-msm@vger.kernel.org References: <20221227204528.1899863-1-abel.vesa@linaro.org> From: Dmitry Baryshkov In-Reply-To: <20221227204528.1899863-1-abel.vesa@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/12/2022 22:45, Abel Vesa wrote: > There are unused clocks that need to remain untouched by clk_disable_unused, > and most likely could be disabled later on sync_state. So provide a generic > sync_state callback for the clock providers that register such clocks. > Then, use the same mechanism as clk_disable_unused from that generic > callback, but pass the device to make sure only the clocks belonging to > the current clock provider get disabled, if unused. Also, during the > default clk_disable_unused, if the driver that registered the clock has > the generic clk_sync_state_disable_unused callback set for sync_state, > skip disabling its clocks. > > Signed-off-by: Abel Vesa > --- > > Changes since v2: > * dropped the check for sync_state callback (clk_sync_state_disable_unused), > like Dmitry suggested > > drivers/clk/clk.c | 57 +++++++++++++++++++++++++++++------- > include/linux/clk-provider.h | 1 + > 2 files changed, 47 insertions(+), 11 deletions(-) Reviewed-by: Dmitry Baryshkov -- With best wishes Dmitry