Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp479793imm; Thu, 31 May 2018 04:11:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLQvJGQQqcBcfVfrdL6G1r/UnWxbXoSfMP3b2/jvFmZRTgKKu1KSw5kMQIp0kHyLGjYkkub X-Received: by 2002:a62:4916:: with SMTP id w22-v6mr6362114pfa.63.1527765066794; Thu, 31 May 2018 04:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527765066; cv=none; d=google.com; s=arc-20160816; b=LCiJJOWhtJqmYeSUepZkgg5hd/LVoyiNZi3BKkiSHakGRGU9CJxuK/UsjY4kfuOlMv 8j2RT2zRD+AEYDx+7Nbx+pnTayqH6+i73YTKtk0FZ6uHlkAVLljyrzDXgen8IJRT70eZ 4YF/w+qFimzyqFjHAmSgQkEZFmBbrPnXao2Hb2FiDNJawmKhAAk5nAh8YZ3+sLOBcPaP /nP899eNJ+2b4jM1Wqh9f9iH8qqzxC8fQEnlNoNvGIAUUNBwpeKznTM9SCwm6JJlVwNg tWhvqTXJR2ysujGUJ7LQOGEv7UrJY+x/4XFxURMZZFh5ZyoL4Oimps1+EyiEVFbfhjmr tS1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=T34IhnyxXIdflk6jL2TEY6MzCc0i96bje4n9KylYzxA=; b=t5xEt+FP7Hc3aSCETd4bsAyf7rzSlRkvAM6SifB9j+wcXYSKJnE8WuHNFQV38bL9Mk ECFL2k7Fm0ugeDyfjb6mFT9xxnBowlaJfvIf3zohMkgz5qLz9NOLUCJ6nxJl99NFOxO9 JDaa1Ng3vppYZdJXiga218PH3TEtUuLqFHKNYsl/cnkyvP/BTA+rj903ARjv7nGRWqU3 Ft4sUSwkP+Lsg2lSPDMkACdefAU3rvzZXGzhuq/Dk3UCuDI0FT+HWUxocqWaQ9nmNA/3 wv+mJf0y1HPDCd6kMFFSbKYpiUR4Q3ldJIylHQeRd+QBdftxnluCsx68WH8AgXkymcSs QAXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eNWGonrl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id h3-v6si17862735pld.114.2018.05.31.04.10.52; Thu, 31 May 2018 04:11:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eNWGonrl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1754845AbeEaLJb (ORCPT + 99 others); Thu, 31 May 2018 07:09:31 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:38914 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754464AbeEaLJZ (ORCPT ); Thu, 31 May 2018 07:09:25 -0400 Received: by mail-io0-f194.google.com with SMTP id 200-v6so24290259ioz.6 for ; Thu, 31 May 2018 04:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=T34IhnyxXIdflk6jL2TEY6MzCc0i96bje4n9KylYzxA=; b=eNWGonrl9PVX/30Le5P+CXozyw87L/GoETxPZuBHjuGTywvD1N81Ch20Rb/k7o4ZCR Da8jxSJ26NOC+pn70C8bJWQCx9XvJDl4u1oRTkVIcu+uz/GWqeRhKljMNkLoG+P9tWgm w7a0nU4hdM+LgmdE+TEQHxc5PFJNNej6KhG/8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=T34IhnyxXIdflk6jL2TEY6MzCc0i96bje4n9KylYzxA=; b=hLni/vEc3FygkRuBZHEx9oImgigYE8cl7IkeLzPlEwwwZR7/ERoutiv3mHZZhaL7G9 HFDHJFQQsqEwbupHanME1zikaXMXRDnKnWtBcVdEx7mhI7ZSOZ14D1dULYTtPcH7NLmE bN0R67NJGF/ZktkKWyaGtL8DgXAYmdl7SkcihWKaFnVzDZWC8Fna8hFKBnVUm2kVv4Dy TjHLKphyXgCgeGoYMzThdiRbijStObZ4bTymDB86fbgQv73FOw950sgFs8y7sL23Lp2k fJbqLnNd2Vv1e+bG/B3kNsaZvG69v9PPbh7WW/d6fUNH+MkJc7CFxVpELcIhrrKUKb+O 5qyQ== X-Gm-Message-State: ALKqPwcMj0WTPqtowGBOBYRX75PJwHdvtl8j4ynO5tP5zIXg8LrM32QY rEUcVDzi/r2OtmVNDYSCSOmd4tniRUiG5uTW8SHTcQ== X-Received: by 2002:a6b:1e8f:: with SMTP id e137-v6mr5773195ioe.192.1527764964382; Thu, 31 May 2018 04:09:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:c054:0:0:0:0:0 with HTTP; Thu, 31 May 2018 04:09:23 -0700 (PDT) In-Reply-To: References: <20180525100121.28214-1-rnayak@codeaurora.org> <20180525100121.28214-2-rnayak@codeaurora.org> <0e07d577-9728-e97a-2da0-dd7dd324f058@codeaurora.org> From: Ulf Hansson Date: Thu, 31 May 2018 13:09:23 +0200 Message-ID: Subject: Re: [PATCH v2 1/6] soc: qcom: rpmpd: Add a powerdomain driver to model corners To: Rajendra Nayak Cc: Viresh Kumar , Stephen Boyd , Andy Gross , devicetree@vger.kernel.org, linux-arm-msm , Linux Kernel Mailing List , collinsd@codeaurora.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31 May 2018 at 06:20, Rajendra Nayak wrote: > > > On 05/30/2018 06:14 PM, Ulf Hansson wrote: >> [...] >> >>>>> + >>>>> +static DEFINE_MUTEX(rpmpd_lock); >>>>> + >>>>> +/* msm8996 RPM powerdomains */ >>>>> +DEFINE_RPMPD_CORN_SMPA(msm8996, vddcx, vddcx_ao, 1); >>>>> +DEFINE_RPMPD_CORN_SMPA(msm8996, vddmx, vddmx_ao, 2); >>>>> +DEFINE_RPMPD_CORN_LDOA(msm8996, vddsscx, 26); >>>>> + >>>>> +DEFINE_RPMPD_VFC_SMPA(msm8996, vddcx_vfc, 1); >>>>> +DEFINE_RPMPD_VFC_LDOA(msm8996, vddsscx_vfc, 26); >>>>> + >>>>> +static struct rpmpd *msm8996_rpmpds[] = { >>>>> + [0] = &msm8996_vddcx, >>>>> + [1] = &msm8996_vddcx_ao, >>>>> + [2] = &msm8996_vddcx_vfc, >>>>> + [3] = &msm8996_vddmx, >>>>> + [4] = &msm8996_vddmx_ao, >>>>> + [5] = &msm8996_vddsscx, >>>>> + [6] = &msm8996_vddsscx_vfc, >>>>> +}; >>>> >>>> It's not my call, but honestly the above all macros makes the code >>>> less readable. >>> >>> This is all static data per SoC. The macros will keep the new additions >>> needed for every new SoC to a minimal. Currently this supports only >>> msm8996. >> >> Right, that's fine then. >> >>> >>>> >>>> Anyway, I think you should convert to allocate these structs >>>> dynamically from the heap (kzalloc/kcalloc), instead of statically as >>>> above. >> >> However, I assume this is still doable!? > > Perhaps it is, but is there any specific advantage of constructing these structures > dynamically vs statically, given they are static data? Well, I was just thinking that the genpd struct has grown quite big. > Most other powerdomain/clock/regulator drivers I see do it statically, and thats > what I followed. Right, so forget it and keep it as is. Kind regards Uffe