Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1050648iob; Fri, 13 May 2022 21:08:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEoNogYbgpoN+ngFYUJBB9B0/OCvabQyoG6U2C+FUNClqk628x7l2FmLq2OlST3ajQOX5a X-Received: by 2002:a5d:414a:0:b0:20a:d5f9:8b62 with SMTP id c10-20020a5d414a000000b0020ad5f98b62mr6405622wrq.492.1652501296743; Fri, 13 May 2022 21:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652501296; cv=none; d=google.com; s=arc-20160816; b=AW5NZ7f2fk2xcbF7MSSTBTA+s414TU13imJ8AFOQeu31KpnbZRkhm9LUogVY7YF6Ch 1askmVhu9l7QkwXihq1NkcV7vuFxDWNXZDCetYJFGsMq3mCn8u5TlndYSw9Ry+koBeby VQbrJaGtIlmJpx4cYERSwcNB98if8u9eQ61lg0UGci0M5fqyz7wwKRAdgotsdmKyV5gF BDg7lW2kB94bOpe4nF9OHa9g/KVInr3IljsqmAZA3mVWafPyQu0XSUbrw7Cx5DpaDyXN qfmx0h8mDTS7mylZ1x0f6gNkHfxphcXvd4GG7S5IP1GjnlHofJTPLp2dziPZ0STnst2W Nweg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kOkWkR9Ocy2CU7QPzBKs2WmW8Yr7OVdgCwKhMEH1vEU=; b=czO+kzSLX2XbtaebgesgUQ81NqFfPsj1mNbcnMYYsVN2AqorLwqePQt3nrhunM4A7+ VrTxGwEKmeo3dpoR/Z52uEM2hoa0sIHAP4tf8SZw3LWg/jkVxdvUBoQx9f3sriphJpKg oUyGH1mDhzczmHWsmuXJ5qht+IOHQYrkG8OPf08s73OANM0FRCPaVtEwpFmbw3L4DfG+ ub4czyE1+yM5RW/ncHtbjH/aWTP5u8MLX0F2W+vO45qORqDlB7M+kHPGH+hCpWgMVsZM Fgy3qvnCxG9PbsZQPGaICC3LqDqcujGtP9sIheaC/muQI282EdJ+dw756aXS+A0o1WTf us4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pr9XuWJg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h13-20020a05600c414d00b0038f3ff82f26si6755887wmm.29.2022.05.13.21.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 21:08:16 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pr9XuWJg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E720F4C71A4; Fri, 13 May 2022 17:39:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356927AbiEME3a (ORCPT + 99 others); Fri, 13 May 2022 00:29:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348393AbiEME33 (ORCPT ); Fri, 13 May 2022 00:29:29 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B2E9292797 for ; Thu, 12 May 2022 21:29:28 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id t11-20020a17090ad50b00b001d95bf21996so9745342pju.2 for ; Thu, 12 May 2022 21:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kOkWkR9Ocy2CU7QPzBKs2WmW8Yr7OVdgCwKhMEH1vEU=; b=pr9XuWJgiU/uRmmT5fZbBoUYR2ZQfOvIP/fG8IH7DKeqmuojFuDZ5c8c4YUHPmqBmh zXNWMD3IgW8+O/7EHImSmJOMWPbw4I/GwppQwL8wZOPiK6LvvlpuBjNBTHMbMwZqiD8y hXkWpEI31SeVpwZGidBW3OrJdvIc1VSzXbPDMG45/V9kihbRiwTFLZdv3bmc2a9zzgEj yzGnffWVkfmvcPTQeqLwmZIq34n4O5wVfPfXE/Ebg4edrwrZE9reXxaAFO42AqvAMI6V KA6K1ScFTbKuf+vbjXXUv0zz2w8of7sO+JSJwKPDa4ZO9gJlXH+fbjEA1MHINOZ3fxbd EIcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kOkWkR9Ocy2CU7QPzBKs2WmW8Yr7OVdgCwKhMEH1vEU=; b=dlgTdX/5Kuu4hzPaz3ZqoYMi5+qNAo77De9giGVwU3bWbLyZ01Lr9cF/uCa5gf9CGE Q0/y5MawD0/lI2YEfQJLCLX/11zARryS6OOUiKDCRZg2HWDesl/4z77fxHoWMGJ/nxoC vSZIBQsMXDayFeIDgx78fNohF219ZxTllCIs/M4RNk+tkkKQkedpkMoYxncud9zQBimg 6xR6ruM7qiDMMaEJA4Iv8siifF+71j9Cb/B3EulfSgjL1l+EHTepMWS9dNj2Wa6Q4sf/ kA1vFod4hrloR6xT3bUW/117HOw63bOTRy1DOCHa+wiKxsfu8tpN2yQqbapJu3m1Xxax HZLA== X-Gm-Message-State: AOAM531KbrjsXLP/TELkPwe0j4uh9CuqKC8s4qh0fjyliCKrKuSJhl8F 9OOh4g4wcPnRrCjSgW2Qkn2m0A== X-Received: by 2002:a17:90b:4c85:b0:1dc:5778:5344 with SMTP id my5-20020a17090b4c8500b001dc57785344mr14165956pjb.8.1652416167522; Thu, 12 May 2022 21:29:27 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id m21-20020a17090aab1500b001cd4989fed4sm2555583pjq.32.2022.05.12.21.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 21:29:26 -0700 (PDT) Date: Fri, 13 May 2022 09:59:25 +0530 From: Viresh Kumar To: Schspa Shi Cc: rafael@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/2] cpufreq: make interface functions and lock holding state clear Message-ID: <20220513042925.42hvv26ejup6js3h@vireshk-i7> References: <20220512135231.10076-1-schspa@gmail.com> <20220512135231.10076-2-schspa@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220512135231.10076-2-schspa@gmail.com> User-Agent: NeoMutt/20180716-391-311a52 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 12-05-22, 21:52, Schspa Shi wrote: > cpufreq_offline() calls offline() and exit() under the policy rwsem > But they are called outside the rwsem in cpufreq_online(). > > This patch move the offline(), exit(), online(), init() to be inside > of policy rwsem to achieve a clear lock relationship. > > All the init() online() implement only initialize policy object without > holding this lock and won't call cpufreq APIs need to hold this lock. > > Signed-off-by: Schspa Shi > --- > drivers/cpufreq/cpufreq.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) Acked-by: Viresh Kumar -- viresh