From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E790EC49361 for ; Fri, 18 Jun 2021 21:53:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8AA8613E8 for ; Fri, 18 Jun 2021 21:53:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234694AbhFRVz1 (ORCPT ); Fri, 18 Jun 2021 17:55:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234687AbhFRVzY (ORCPT ); Fri, 18 Jun 2021 17:55:24 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6B7AC061767 for ; Fri, 18 Jun 2021 14:53:14 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id o20so8665198qtr.8 for ; Fri, 18 Jun 2021 14:53:14 -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=tlfC7guzHnGUhI3CYP6SsQ3L2F2bpnWxpAP26B/r4lE=; b=c1PJM9IMsmEV7WTgP5glA28gcryVt11Yy9rOy4sMWcHpuAuYctnhMoRA/TnndaEXu9 Rbcd4FhRPcC5JhriCLMuoqQm3ez0POjKf7G/OaRDnad4p2XwpEGRFybzjb5qAh+5I9wx V9zRDm2/O+uNQtirG2wWc6MwxGhSbuqdaBDhxZUayBY84NvbB1/47euOL7Jy8HDPhdrU joJ/K5EijUK5LXR60pm/3S8eJNDlO93A/vTG9eNu2UIt/j+Wbt51cqiXirPWCDO08Wts pJzlIn37eTLTSKfOrUKBIPiWrVe0DbvU3D0cueSAOYhR4zhKuHuIC1ulTai/nATOxii4 iAsQ== 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=tlfC7guzHnGUhI3CYP6SsQ3L2F2bpnWxpAP26B/r4lE=; b=V2CGON9xrvXHRPNhLEW2he63j+uHyswhWQ2J4cYoiJxgGzebUO3INHXLfquUlfBO1F ImpfxES9+dzms/bxtjxl8ue8EcsTONnFCbhpae7M7kvnK+rz7bs3GkDAzMWZCXG0kR8H 4EkBlyuSEDsrR40mqiw07LRYXWngQEpfaEUsy4NgDjdBcC95qJt5DOkUJr19MgoHGRhl YB0BknDlRDmvRS4fUXUuNC7r5opD+HkkVyfBGVKvNVfG4QEf+ilZd277hkh6/6KYDmnm RhcwM0tm/Y5UTrV+RNZ+0Yh+kcsbpAp6e2wJZF69G1YVuiMz+JLDO9dK4R3OgjoL4Tar /4EA== X-Gm-Message-State: AOAM5309X0C5WTUfeOuXSkm1neuOG8ufqxoeBgX/faEch3hjiYG2o6v2 nzSRUJzRwR8CQZiiah2wdaEiJKfDOsQMpg== X-Google-Smtp-Source: ABdhPJwE91wGSAlfUJ9FU4CUkiG2NiKNvaCkaB0RyBPbh6dTpxuRmWrOGkt55gHzGx6RZk5nygbmMQ== X-Received: by 2002:a05:622a:40b:: with SMTP id n11mr12438838qtx.60.1624053193550; Fri, 18 Jun 2021 14:53:13 -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 w8sm4761888qkp.136.2021.06.18.14.53.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Jun 2021 14:53:12 -0700 (PDT) Subject: Re: [PATCH 2/5] thermal: qcom: Add support for LMh driver To: Bjorn Andersson Cc: agross@kernel.org, rui.zhang@intel.com, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, rjw@rjwysocki.net, robh+dt@kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20210608222926.2707768-1-thara.gopinath@linaro.org> <20210608222926.2707768-3-thara.gopinath@linaro.org> <4996de55-daa9-18a4-3c03-cf194d85500e@linaro.org> From: Thara Gopinath Message-ID: Date: Fri, 18 Jun 2021 17:53:11 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 6/18/21 1:54 PM, Bjorn Andersson wrote: > On Mon 14 Jun 20:38 CDT 2021, Thara Gopinath wrote: >> On 6/14/21 4:53 PM, Bjorn Andersson wrote: >>> On Tue 08 Jun 17:29 CDT 2021, Thara Gopinath wrote: >>>> diff --git a/drivers/thermal/qcom/Makefile b/drivers/thermal/qcom/Makefile > [..] >>>> +static irqreturn_t lmh_handle_irq(int hw_irq, void *data) >>>> +{ >>>> + struct lmh_hw_data *lmh_data = data; >>>> + int irq = irq_find_mapping(lmh_data->domain, 0); >>>> + >>>> + /* >>>> + * Disable interrupt and call the cpufreq driver to handle the interrupt >>>> + * cpufreq will enable the interrupt once finished processing. >>>> + */ >>>> + disable_irq_nosync(lmh_data->irq); >>> >>> The contract between this driver's disabling of the IRQ and the >>> cpufreq-hw driver's enabling it when we're done polling does worry me. >>> >>> In the case of EPSS, don't we disable the interrupt during the polling >>> there as well? If that's the case wouldn't it be better to implement >>> irq_chip->irq_disable and have the cpufreq-hw driver do the disable in >>> both cases? >> >> Yes. You are right. In case of EPSS, the cpufreq-hw will have to disable the >> interrupt. I did think of the approach you suggested here. My only issue is >> that we will dispatch the interrupt to cpufreq-hw without it disabling it >> and hence the interrupt could fire again, right ? >> > > Does it fire again before you INTR_CLK it? You mean clear it ? I couldn't reproduce it either way. I did not try the irq_chip->irq_disable either. So I will give it a try and if my tests pass , I will post it. > > Regards, > Bjorn > -- Warm Regards Thara (She/Her/Hers)