Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp518633iob; Fri, 13 May 2022 06:51:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc5nSLmqdEGo9BJ99BUG0xsY6p0FkO+n6sTVvSIDvl7lfoE18Sp3/lntbY/Lly6VIA7NSs X-Received: by 2002:a17:906:6bd7:b0:6f4:e6e4:1d41 with SMTP id t23-20020a1709066bd700b006f4e6e41d41mr4432127ejs.770.1652449884862; Fri, 13 May 2022 06:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652449884; cv=none; d=google.com; s=arc-20160816; b=Qut++/x8s30dzbzEt6L/8EVCms+yS20XirSiq6SdADhlerRKRTzrbufm7EMwC/1WP/ P4q7E3/nq61bwQJIFOY0qrluUsfIjzz2Vq9ulT5ud3CTXAbk5at98Q34pu/ecdibU1gZ KJW3cfvOe4p6Ux2/JREUOW4BJfDXGxVy4iPehMq4rpYXvn/0F5Q5MECMbZZBy40NKeu5 x37lw1d0oyRV/eiM+yMMxyoSBcM9gUgiiiAcJ1syS8XZlp2Sn8GFOCXG7ySTGeZXGauc WS+X93AcMwTCkumrTRrmdScNVDNbi9FUNyrC/WVaEmwjhfxmVopyu3sKVusI37FIAAkj dlLg== 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=WgTgy6Q+d8TrDK1hHPXj5oNnS+nB3lnyhddRNxBZhpk=; b=Z9PbguL/HmeJv6imocHZjuSOCpg3N9XY7c3iDuYQV4yIClWElcR2GU0bqN5c8fXGuV Eb+u06ZnSoDmkfju0JaDnvQxJq2WCR2OqQhZVm+qXlSd4/0SV3HuBf8QroVFNnZO2Sxo OgLggKjJMHm8fi/hHBi416E9hjN1zorFm0woP2z3WN52p3qIbO6AjLt+NWpl3SAjqc2s GfZ5AQvDIGsB8E3layrmeR+1dat7LAt5cJCKzH4Af+YHKyjBtEBY5mBMMK4j4uCgIin9 QaiXWrdS/Mfbc1xzgpw8u/58MuScPjyYgyd+xP4mLRq2TdKG9qIb6WIg8z5Z/92AhVgy qTMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OhYgBUt2; 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 jg12-20020a170907970c00b006e7f5b1fb91si2315164ejc.370.2022.05.13.06.50.51; Fri, 13 May 2022 06:51:24 -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=OhYgBUt2; 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 S1351114AbiELHmp (ORCPT + 99 others); Thu, 12 May 2022 03:42:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351112AbiELHmm (ORCPT ); Thu, 12 May 2022 03:42:42 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 883131A15D7 for ; Thu, 12 May 2022 00:42:39 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id p12so4113357pfn.0 for ; Thu, 12 May 2022 00:42:39 -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=WgTgy6Q+d8TrDK1hHPXj5oNnS+nB3lnyhddRNxBZhpk=; b=OhYgBUt2hUmUJ+ybZL/wdXJLTU0v+/9O+N5ePdErfkb4ZTtdJ5P0t67WYjcdjFXEne 2vPwS8X0CJy1h25YJo8wqCso1FL5di2KkfkbiMtLzZl8FVax2zIVTSD1r5cB1voGiKF4 +XDyVWJvry04by0kx6zsSlLL1DW8PSOiTvF794KJCtUKVwVQ76fOdt3hWhfa9nRuw5fS mxrV809q5uSxkGUqEd/LYNrNru8VAtzAnM5erRvTwbYsMDExyUyXh7VQBMUk2ATHyh3L RkZoEpu2+XFPdhKXFJH+7Na36uTHaXDQmE13zYefldQeQ0E3s6T4QSYIy3RRjgCrN2bV 3V0Q== 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=WgTgy6Q+d8TrDK1hHPXj5oNnS+nB3lnyhddRNxBZhpk=; b=wmjo2Mi2qIssd+jBhSoIpPcXkWHwIPMhppLbAOr6CSUePplkEf4TZC92cRyNIvlTmK vxnS/vnz0ZkJAWcwLVgxUdBDmQOOBo5Rf+JtYK5w0PPcqB5McfekhKf5T9N+qqa1cCwJ Ra8AhNhV7abbNGSc0Mu2JcKO+/knkfQnalfkQEult8qZZTFdBN06nLa4aFahy0TuObpF AmqGMJCbmDmUtQemmHo8SOQc2qknVdSttxXkCJRL6Wqo3pRqowrqByQAevCVWPsa8HIF N4ovzNcTJBbQVGLvrZOk+dYnX4S3HLaHshm1CcC780pFvQav/6uTziw9sQ8msL6JddRL wh5Q== X-Gm-Message-State: AOAM532er1vJi6+JoB59JEf9oTgj2/e2exj89YtO2VvaKHixuAl2eKvq 83qeJf7Hqa1OI7kpXrhNPBtN7w== X-Received: by 2002:a63:1d26:0:b0:3c1:eb3f:9daf with SMTP id d38-20020a631d26000000b003c1eb3f9dafmr23797634pgd.284.1652341358988; Thu, 12 May 2022 00:42:38 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id m3-20020a17090aef8300b001cd4989ff42sm1204989pjy.9.2022.05.12.00.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 00:42:38 -0700 (PDT) Date: Thu, 12 May 2022 13:12:36 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM , LKML Subject: Re: [PATCH v1 3/3] cpufreq: Rearrange locking in cpufreq_remove_dev() Message-ID: <20220512074236.bkamv2o5hgson243@vireshk-i7> References: <5585781.DvuYhMxLoT@kreacher> <1836239.tdWV9SEqCh@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1836239.tdWV9SEqCh@kreacher> User-Agent: NeoMutt/20180716-391-311a52 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=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 11-05-22, 17:51, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Currently, cpufreq_remove_dev() invokes the ->exit() driver callback > without holding the policy rwsem which is inconsistent with what > happens if ->exit() is invoked directly from cpufreq_offline(). > > It also manipulates the real_cpus mask and removes the CPU device > symlink without holding the policy rwsem, but cpufreq_offline() holds > the rwsem around the modifications thereof. > > For consistency, modify cpufreq_remove_dev() to hold the policy rwsem > until the ->exit() callback has been called (or it has been determined > that it is not necessary to call it). > > Signed-off-by: Rafael J. Wysocki > --- > drivers/cpufreq/cpufreq.c | 21 ++++++++++++++------- > 1 file changed, 14 insertions(+), 7 deletions(-) Acked-by: Viresh Kumar -- viresh