Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp191559imm; Wed, 30 May 2018 21:22:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKFSyxbNHEobUzhROLU0DpXhmyrILjmLPD/znnIKS9hBJJagMIK4G8oODn3oNeVcn2H9N1U X-Received: by 2002:a17:902:bd8f:: with SMTP id q15-v6mr5285518pls.161.1527740569840; Wed, 30 May 2018 21:22:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527740569; cv=none; d=google.com; s=arc-20160816; b=Yce9u8DdVRRZXMPwtN1lGD9DE3p4w5pO8vOtGhwvyqYEt0KCon0Pnl+kSxpCluw69r EOmrPKtECISZqMuEgCVpgi6Jg5/rLuKoKjNn3czp9ZSpnjUsKJDTTeBwR5nuQfG4BPnw pvIfJ8hSIFThnfbd6PJf6Kji1Uz69QQlfyzpL+wa442EUSWye4wzmjl/AwLeBlvP7Jp0 ycfMXh0BhHRS16cMoCQoJZDfitTmOqeahhHQL/cLN9kkVNrQPnpV415Lw0HvTSgF8dKw Qs0ViHIYyNxIXXXTJpD8QtUZJ/qgUO0hhBjeSS+moBHgJ6JMNIzRLmVY67orU2uAJO0w 1mug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=6LQvLCBauNimmE+1HNSromH1RL5rngEilEjJ6jl6WGg=; b=Xv4JK6uMvP0RcSOMdyueZIEg9j7J0RwwEQo5Sb8PpuYiS4nc3cV4ICXDOsQa68ZBml 71ewgXt89yAA2baYj7bRCcQmgToKDYW8tWBgb9oTK8Q9JBbXLYdckQRN7M9TVWVQPpFX Nbd72uS0eOwEknm+lJr1Vw8Gdem+np/UuZPIMBVblTDnOBuJZOh8EeU6w5JrKKdRXJJD sRJdxR88yhnEsW5Dpx7cxAnq4VRujwWum2geUXgix9DAqX5NeneF1m6Amlk6dAy35NhP LVPzHsD6F1AwhyyLn8+XMbSPZ4YBWpKor55blkaDp/9Iq3vkb9WT56a/zd0kpzoehkSg Gsng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=AweL4MNA; dkim=pass header.i=@codeaurora.org header.s=default header.b=AweL4MNA; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6-v6si36702291plq.382.2018.05.30.21.22.35; Wed, 30 May 2018 21:22:49 -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=@codeaurora.org header.s=default header.b=AweL4MNA; dkim=pass header.i=@codeaurora.org header.s=default header.b=AweL4MNA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753852AbeEaEVR (ORCPT + 99 others); Thu, 31 May 2018 00:21:17 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53768 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750868AbeEaEVQ (ORCPT ); Thu, 31 May 2018 00:21:16 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 91E3360452; Thu, 31 May 2018 04:21:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527740475; bh=CcBSxuGWFbHbnTOKFS7pGdxUJijdvzz0YSEFVZbGrzs=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=AweL4MNA43QUXN8LTJKyWmfNdxn7xgtm7pjhrn6mDP4VExESlhbeRZfNCaGoKx0Vv ZWR/g6ktttle1pHuewkDucKYPyRZXK2NO7pVaq9YA2Hvp6y4IglOBIGxHvq/Z8/jsJ 4rEHdKR4gPsPCrmkiQcJvt0zQwuKvphGRBjlpOdQ= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.79.40.88] (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 54768602A7; Thu, 31 May 2018 04:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527740475; bh=CcBSxuGWFbHbnTOKFS7pGdxUJijdvzz0YSEFVZbGrzs=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=AweL4MNA43QUXN8LTJKyWmfNdxn7xgtm7pjhrn6mDP4VExESlhbeRZfNCaGoKx0Vv ZWR/g6ktttle1pHuewkDucKYPyRZXK2NO7pVaq9YA2Hvp6y4IglOBIGxHvq/Z8/jsJ 4rEHdKR4gPsPCrmkiQcJvt0zQwuKvphGRBjlpOdQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 54768602A7 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rnayak@codeaurora.org Subject: Re: [PATCH v2 1/6] soc: qcom: rpmpd: Add a powerdomain driver to model corners To: Ulf Hansson Cc: Viresh Kumar , Stephen Boyd , Andy Gross , devicetree@vger.kernel.org, linux-arm-msm , Linux Kernel Mailing List , collinsd@codeaurora.org References: <20180525100121.28214-1-rnayak@codeaurora.org> <20180525100121.28214-2-rnayak@codeaurora.org> <0e07d577-9728-e97a-2da0-dd7dd324f058@codeaurora.org> From: Rajendra Nayak Message-ID: Date: Thu, 31 May 2018 09:50:55 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Most other powerdomain/clock/regulator drivers I see do it statically, and thats what I followed. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation