Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp352941pxv; Wed, 14 Jul 2021 05:39:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrh+uf3eir3o6mgsfDXWmAF061aAAPaWsH/k4nIKFe6kpbdyxTfJxEinUKRpucsemqAbZZ X-Received: by 2002:a17:906:c108:: with SMTP id do8mr12457486ejc.74.1626266344305; Wed, 14 Jul 2021 05:39:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626266344; cv=none; d=google.com; s=arc-20160816; b=nMNdRn7tSFxk0aiHw9MH2JPvCHMY18ORPM5a7tfUfYOYmwUBC37StnOClaVtodqRNd aqcXgbxhIyufnY0wnbKXkyfY9FSlgIoV3RuvksddaYvn+YmH8nr3YjEz3ND2pUw7R5A0 8m/wTDXM7Mh2wDyrVwgGCaclJP4PMX/ZcTHX8XEGWG6G4Aq+eyc98nWrgNA0KFhAurIX 6OTxSfUrZX2X6cegqi/R8FE/PKzHQEG/2QCeK6aTtMWcHYUtSh9txK2Xz0WwIOj8m0wx q2dSFHPHpzSXJtUAkT+qQpGcM1G14pm5xbKzQhGD4BQCsbN3Xqoghwi8qfJvb4tXz548 iRBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=zqg/oXXnwPi1uirxFlAxSo1xe+utXrq9i3VULjmSOuQ=; b=ny9ihocsoQgcrsuOnXk3yTURP8MVKNSE4j8qPGzKPPSwL3nZhgFYkWzhr6PBYK77sT DUaJXWxR3yTuWuIlPj1h/nsaq8s2Wm70AH/hdF497DxkFa3t7m++Iq6sZ90yuruPF0+y rjOS07ALYDOu9b0+EToUnwhwf06lJfxtoqFiMjWkXGTbonosEHXcwYFtlNAFJBRYxT+z BrheIhFmrSaKmCXiBYqIG8xWBY9iI6zDqxBk5bI0mUWkFcUnWdFlPqtwkBRvPUj/ECQy Yd53PFl3s0EQHmb63NcHQqypULLQkGIp16Oj86+RpFqilnNPQX01l+gR13Nk04s1lkx+ +4jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J3Kfa4Rr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zg9si2554302ejb.672.2021.07.14.05.38.38; Wed, 14 Jul 2021 05:39:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J3Kfa4Rr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S239271AbhGNMkN (ORCPT + 99 others); Wed, 14 Jul 2021 08:40:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231356AbhGNMkN (ORCPT ); Wed, 14 Jul 2021 08:40:13 -0400 Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2B3DC061762 for ; Wed, 14 Jul 2021 05:37:21 -0700 (PDT) Received: by mail-qk1-x732.google.com with SMTP id 201so1334163qkj.13 for ; Wed, 14 Jul 2021 05:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zqg/oXXnwPi1uirxFlAxSo1xe+utXrq9i3VULjmSOuQ=; b=J3Kfa4RrBgV0eTAzR82Lviy/WfIGFLcshXMyEUFbjaa5EhzrrX4uANQk/YTbCOQYTc VpAWY55etdOw4IZGnUDrg4uUZOiU28Jc04Yk7q171breIPRm856q8iUuen7DfZobQvqv mw9TTXdIyGQn0vuHuj4n60ptEu7LIZSbwMDY8+vwg85H2o1QhooORCU94q6nwNUw1AzJ j86jEObFpAnbainPyN+NTLl9Oux2LcpnD8lOcDBZP1WlZuiXj8mQyh4ErbBj7B0krrDw adKjuFhsa65ccroVHnVikPl+Mx0EqJ59Vxj0Y8/G5G9rSDK3qW+4ksN0hBlEb2fNiDIb Yrxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zqg/oXXnwPi1uirxFlAxSo1xe+utXrq9i3VULjmSOuQ=; b=etrxhbe706kQZ8t4pcjtG0zFVcAkwoi602yt17DALTSgOGEzhmMxZP4baPSeDhh+Aj ELGG7Stasx+zL67UOYReY5XdDm94pDO77Xyn3VDDkN31mApv7J5k7HaTtyOlFhpDBo0/ IAM+h5qP9O5zGXpyZeK1/yg+REjr68jyjxdRRmPzlKFg87qiq4sHBy4y51VYzyx9cSR0 GyrwmhRWz/CNR8pR3LU69TGhIEDM/MkxG1E9hGqsezAc1DzuiVJ+YHg6pwZvlwzLDojP nTZN2kZ+RiidmWwXXsP8lTgofjbW4Badih2YAeTgLvPKkAy+L2uzyzOGhWhDtZJjCsVI KRqA== X-Gm-Message-State: AOAM533bpGTD6jGruepnVpfgSNIzLFIn0u6XOwJA41jHOCZIXGQM6Y53 AFq9kjXnxWGHntuG2HYTijKvTA== X-Received: by 2002:a37:5b47:: with SMTP id p68mr9666364qkb.73.1626266240969; Wed, 14 Jul 2021 05:37:20 -0700 (PDT) Received: from [192.168.1.93] (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.gmail.com with ESMTPSA id h68sm955221qkf.126.2021.07.14.05.37.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jul 2021 05:37:20 -0700 (PDT) Subject: Re: [Patch v3 3/6] cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support To: Viresh Kumar Cc: agross@kernel.org, bjorn.andersson@linaro.org, rui.zhang@intel.com, daniel.lezcano@linaro.org, rjw@rjwysocki.net, robh+dt@kernel.org, tdas@codeaurora.org, mka@chromium.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20210708120656.663851-1-thara.gopinath@linaro.org> <20210708120656.663851-4-thara.gopinath@linaro.org> <20210709064646.7vjgiba2o7beudly@vireshk-i7> <5a98ef2a-d170-f52d-cc48-b838cddaa5c2@linaro.org> <20210712044112.svhlagrktcfvyj35@vireshk-i7> <20210713031848.sp5fpjg36uthnmuq@vireshk-i7> From: Thara Gopinath Message-ID: <6de43ee8-e3f4-f09e-1076-7746e44dd19a@linaro.org> Date: Wed, 14 Jul 2021 08:37:19 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210713031848.sp5fpjg36uthnmuq@vireshk-i7> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/12/21 11:18 PM, Viresh Kumar wrote: > On 12-07-21, 21:18, Thara Gopinath wrote: >> So I really need the interrupt to fire and then the timer to kick in and >> take up the monitoring. I can think of introducing a variable is_disabled >> which is updated and read under a spinlock. qcom_cpufreq_hw_cpu_exit can >> hold the spinlock and set is_disabled to true prior to cancelling the work >> queue or disabling the interrupt. Before re-enabling the interrupt or >> re-queuing the work in qcom_lmh_dcvs_notify, is_disabled can be read and >> checked. > > Or you can make the lmh_dcvs_poll_work item a pointer and mark it NULL in exit, > with proper locking etc. Yes it could work. I will spin the next version with either this or introducing a new variable with locking. > >> But does this problem not exist in target_index , fast_switch etc also ? One >> cpu can be disabling and the other one can be updating the target right? > > The race doesn't happen there as cpufreq_unregister_driver() takes care of > stopping everything before removing the policy. To be more precise, governor's > ->stop() function is responsible for making sure that frequency won't be updated > any further. > -- Warm Regards Thara (She/Her/Hers)