Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp169833pxa; Wed, 26 Aug 2020 21:30:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjIzZa2/9N/FKJt0yypOyezHPpXjpQy2eN23SA0pWTqdjr2uS2jdxYip3o2JYvJaqO7c0t X-Received: by 2002:a17:906:c1d8:: with SMTP id bw24mr18704400ejb.91.1598502614288; Wed, 26 Aug 2020 21:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598502614; cv=none; d=google.com; s=arc-20160816; b=SIeFEX63iQ95hf46VccOTB7pt+cVoaTWkY1WhZpMoQ83piVohC/sW8jQFUlwrfNZNa BiSp/8LRlv3AhUX2gI78IuW58ou2tqlg0GggfwN62CSd3xhdv7Of6qUJo9mjjHeoe1/P qZaT9PdxcP1EC+f1YIUnUN1yAmKYjzwuXDqXKWHQ2Z2eQIjG76/HNs/HLs/ZGdK9Ux9N XYZyv1DXAYJywPK3NXG95LRRWJz/zvMvk1ZZIcq5nUvNeRsUVmqmRto4HxUa/R1CauJU RFVNKIAK4QqvtCJsWTsYe/C0vtZJzC2YTu+qbcDNDrDRvF3vO34eVrO4Y4lpbM2QOXf8 j9EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bn7ZvG4ybcooDrNm25U4C10jlmrGjFdQ/FaC/rxAetw=; b=EZuWSUwtBYX17ebMeTR0prxlMdbLDZTjesM9FSB/JWE0M0nBk4INKolelydXUzBLDz b7ZQH4/vhDyjZBa60P6a3REClGDFCX3OLe+6Z2o0yqdLw0DeWEi0gfUqNfjRvfKsIvo3 /LCoZjpY5iHsJqKIJxJIJc1RGUEwl0uy65f9FGsDuyklzZxuwcQzqqNCQ3v1wCXfNTnx PqWIat0JcfJYblTF7dMAxqkUofKchNPJpD6tOTgxK8G6CRIu6D3m49vEnjUxZ8XaI06N /gLwYtrULKC8o3CrhBFdjvsmJ0d5xFzViAx78dNfVj6Hs/FyKrJPAd1S/1qTi+XorMOz 2TKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JWGdadun; 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 d4si727496edz.16.2020.08.26.21.29.51; Wed, 26 Aug 2020 21:30:14 -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=JWGdadun; 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 S1726093AbgH0E06 (ORCPT + 99 others); Thu, 27 Aug 2020 00:26:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbgH0E05 (ORCPT ); Thu, 27 Aug 2020 00:26:57 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEB27C0612AC for ; Wed, 26 Aug 2020 21:26:56 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id q93so2024273pjq.0 for ; Wed, 26 Aug 2020 21:26:56 -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=bn7ZvG4ybcooDrNm25U4C10jlmrGjFdQ/FaC/rxAetw=; b=JWGdadunye66WMfXu1P4p7JU12j51p8o/dw5xBp05k4WBlQSeSFjHzokSYn55bVV3o J4tcFBW+K0k9bbB0ds4GyUbQ9KAjULJVcytETxzcrQeP3yifDm/M/suCNnYmsgY5Qzlv bYLOwZvhvgDdXRldn4DmRvNGzykpHvQF1muP3pcCByHjEYtEHbeJDDqUjNpus61Fowov JyoN9QhOtYitibsWLrqe+FQ9q4BVoMTkmiVKZ/RQ8BzwYqbwxbkzyx1YBIYj6oYH/uoi E6OZ9hPBdCD4DEyRV0Y3/EiRxpSeNBUdMXvmYIiHxOPHTWp3rcwr9/3wHDVTWkLGz5kb 6DjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=bn7ZvG4ybcooDrNm25U4C10jlmrGjFdQ/FaC/rxAetw=; b=tW1D7lvj3DEOpbYk7KQQrdNrBUfqV/qKHEJ7F4jvHu8S5Cr8iLR3L/ViTAwm4pL9gR 58t+WqhZQrPPL/agu64Sx2WTXIqpXPpbwD2MCk3i21tqLsi7ix6qF6vJjxxo9u/9XAtx sjssMCpb5mA33Mx6A0XyLrkuEYq6K8TWhW9hAxYZzqxrH1mHaQwdsKNA65s9u9vfaYV0 uzyNnJDTJfBP1G3IEGZXY7Jl8CW0Se0h5T6C34DpZQGkI+xe0D9SLqb2Cp5RsUHzg6HO ii0fX6M8Lqik6+rN6S48Hppk2Lk54ZiOCM1GmEYgN58hIlv75ISv9zZ1q93Uf1pPxYLt dCqg== X-Gm-Message-State: AOAM5319eajroRPleghQZiCszy0GGNBh0pGok5yc1THHCaEoes8XGLh8 pnwkC0VYbwOhzgKSCP/BRwQwhw== X-Received: by 2002:a17:90a:f593:: with SMTP id ct19mr9163811pjb.36.1598502416374; Wed, 26 Aug 2020 21:26:56 -0700 (PDT) Received: from localhost ([122.167.135.199]) by smtp.gmail.com with ESMTPSA id nu14sm631975pjb.19.2020.08.26.21.26.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2020 21:26:55 -0700 (PDT) Date: Thu, 27 Aug 2020 09:56:53 +0530 From: Viresh Kumar To: Hector Yuan Cc: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, "Rafael J. Wysocki" , Rob Herring , Catalin Marinas , Will Deacon , Matthias Brugger , Bjorn Andersson , Shawn Guo , Li Yang , Vinod Koul , Arnd Bergmann , Anson Huang , Geert Uytterhoeven , Olof Johansson , linux-kernel@vger.kernel.org, wsd_upstream@mediatek.com Subject: Re: [PATCH v2 1/2] cpufreq: mediatek-hw: Add support for Mediatek cpufreq HW driver Message-ID: <20200827042653.5ttsxnjjhpslmrcv@vireshk-i7> References: <1597302475-15484-1-git-send-email-hector.yuan@mediatek.com> <1597302475-15484-2-git-send-email-hector.yuan@mediatek.com> <20200824100619.o6uwnlsaxdgc3l7r@vireshk-i7> <1598446624.24220.10.camel@mtkswgap22> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1598446624.24220.10.camel@mtkswgap22> User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26-08-20, 20:57, Hector Yuan wrote: > On Mon, 2020-08-24 at 15:36 +0530, Viresh Kumar wrote: > > On 13-08-20, 15:07, Hector Yuan wrote: > > > CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=m > > > CONFIG_ARM_ARMADA_37XX_CPUFREQ=y > > > +CONFIG_ARM_MEDIATEK_CPUFREQ_HW=m > > > > What about a 'default m' in Kconfig itself ? > > OK, will update in V3. Hector, you need to remove (or not add) the right bracket (>) before the beginning of your lines. This makes it incredibly difficult to read. > > > + for (i = 0; i < LUT_MAX_ENTRIES; i++) { > > > + data = readl_relaxed(base + (i * LUT_ROW_SIZE)); > > > + freq = FIELD_GET(LUT_FREQ, data) * 1000; > > > + volt = FIELD_GET(LUT_VOLT, data); > > > + if (freq != prev_freq) { > > > + table[i].frequency = freq; > > > + dev_pm_opp_add(cpu_dev, freq * 1000, volt); > > > > Why are you adding OPPs here and rather why using OPP specific stuff > > at all in the driver ? > > yes, the opp information is read from CPU HW engine.Then add it to the CPU dev OPP one by one. I asked a different question, why are you adding OPPs ? You don't need the OPPs at all in my opinion. You can just create the frequency table and that's it. > > > + for_each_possible_cpu(cpu) { > > > + cpu_np = of_cpu_device_node_get(cpu); > > > + if (!cpu_np) > > > + continue; > > > + > > > + ret = of_parse_phandle_with_args(cpu_np, "mtk,freq-domain", > > > > Where are bindings of this node and how does this look ? > > Can refer to the same patch series, I split it to another patch.Each cpu will be group into one frequency domain for the CPU DVFS. That binding only defines "mediatek,cpufreq-hw" and not "mtk,freq-domain". -- viresh