Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2762059iob; Mon, 16 May 2022 05:50:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd+cx/sug+CxYELqktFTbk9bLxBtcFDxBydcuXKa+/8gUUWWorRTG+XKkbHcgvzvThfjRX X-Received: by 2002:a17:907:6d06:b0:6fa:8499:66ce with SMTP id sa6-20020a1709076d0600b006fa849966cemr15429525ejc.718.1652705430471; Mon, 16 May 2022 05:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652705430; cv=none; d=google.com; s=arc-20160816; b=EGbzNhceLjhddY0xAZlHI1u6c10WMP/nnHaioM+owEks+aM4dOJM+zwaV8AU1/7bdf B4RRXvv1e2dxv3KVPE4iTxu+s8wL+6YHMXxztNcCwkMgJbjDnPr4wJSXk5A7xZYmlFKt 1aCfFO5z9zR/bANJJOtRtW7+M1bW4fBGoofDmfrlTrEGLjyFRsjg8Yp3WgfLQNAEs4bj no7BCFWsrozz8yVq8v1xv/xcAkkBmuGOcQTVyAg+iXTb/4uqHxOq+kTGnNP7F6ZlqEZF 6g1dwRjNGqnaEO1fTmSbhQTizQi613PToeQb+66bfJgI3rY74gB6lNuYJl6vzbg2/Ac1 MguQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Wi7FZ4sQpiYFKSAT45PbkZoAgmyf6uUSxphI+SAE7xg=; b=fpa/68fODrSdxmCvakBeUDSZmOk8M6yvDnQfrAtea1onfjEq9VAukt8udmLDoSC5JE tE6r5FLLzxl+Y2C9zF8XYmhN68A2BjWzYhXYeEMGJAabrX2f08Mme6SEXu3sYSvLXxib 3SKQLfiikMhb+Vsg1+GOTTQSHlHImxGhaEbryQXG/7CocrC47Ccnrl8KQTjpjf9QdAAd b9b9DNVWn3UAuU5POvPi6MBV4K/AQvH3mCcshQ6VN1SnrsSSAG3eyxJh3vFyd+DGokX9 oxt7QfJN5fsiQhDQ+ztHzFtWzmllMyHpMspr5usbnitRloCSNkCBEm9T8/Nn5CP/O8C9 Jz5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gExCtsIs; 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 w5-20020a056402268500b00425f86e7823si11623699edd.31.2022.05.16.05.50.03; Mon, 16 May 2022 05:50:30 -0700 (PDT) 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=gExCtsIs; 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 S234616AbiEPKZn (ORCPT + 99 others); Mon, 16 May 2022 06:25:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242624AbiEPKZi (ORCPT ); Mon, 16 May 2022 06:25:38 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F26C711A1A for ; Mon, 16 May 2022 03:25:27 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id r27so15386129iot.1 for ; Mon, 16 May 2022 03:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Wi7FZ4sQpiYFKSAT45PbkZoAgmyf6uUSxphI+SAE7xg=; b=gExCtsIsHo4jDqSh1oIaaQMB/SVgN1TgdoLWTbuBqlwADdC4X8/BXUu0W5pAsIbnuB Gd/lIj0KUexSKmCA6VgMA5qw0Kp80B8oD++5zkRiD1X5kn70tlwr8pOM8HKCaPgJpZod hVCcl6MZZajGoz5v/sH7W7trFYcCi0WK4tPqbHNTRsxxQyivr4dYEzu+tgvXPYXOzrk8 hZcIPvbUEEEl7+dIEQMujSm2xzHvye0fTzRpcGSJBYt4JbZVMeEOT5yMn6Rm3sr9rwVD GSPgTZ9358/8ti/Vq3+MyAbtWI6VESWFHyxGEE3yK5dHhlPRlQ9D6yGDrvYSAVI7XABI R7KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Wi7FZ4sQpiYFKSAT45PbkZoAgmyf6uUSxphI+SAE7xg=; b=2jJp/sMKBzAR9Hj2ArI94kjwecUVtklSGc1BvlZ3WcLKhmSR3M4Sii8hGGKc7dmHPa n/iZbNtCCRCTZTr/ZXcGz2geCy6jYRrzDzp9rBMogpeUXFj9PPd0BrqvYFUr7ujYDpZQ WXSbcUnCJI9O7vOqxx0Dh0pcSrYxPYIPMdSebkRouLGP2AhvdDsdtpLUYZP/ZU9xXZ2j yDbHbYhw/zG9EO7YrT4lOnOqNAPDUgHDmd71oXjLA+Q+NpSXHtWLjMH0NhfYo1ukA2Nr m0vVb4uY6i7E86meyyfkhPjZ/R5whSem63cixfL6DFNyKzK2RwSSFbzKYu/rOiztp8qy vmTg== X-Gm-Message-State: AOAM5314PlZVv0Os489JtHFmmIk6XNwsjtwzrTypD7Es8NA2x5vl1FG+ DSHN7wT4s74ILomfMPTRb4cPgLK2LHYIE17L7AKFkA== X-Received: by 2002:a05:6638:450a:b0:32e:1bd1:735f with SMTP id bs10-20020a056638450a00b0032e1bd1735fmr4119326jab.145.1652696726666; Mon, 16 May 2022 03:25:26 -0700 (PDT) MIME-Version: 1.0 References: <20220516030251.42323-1-schspa@gmail.com> <20220516030251.42323-2-schspa@gmail.com> In-Reply-To: <20220516030251.42323-2-schspa@gmail.com> From: Viresh Kumar Date: Mon, 16 May 2022 11:25:15 +0100 Message-ID: Subject: Re: [PATCH v6 2/2] cpufreq: make interface functions and lock holding state clear To: Schspa Shi Cc: rafael@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Mon, 16 May 2022 at 04:12, 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 | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Acked-by: Viresh Kumar