Received: by 10.223.148.5 with SMTP id 5csp6116948wrq; Wed, 17 Jan 2018 09:34:57 -0800 (PST) X-Google-Smtp-Source: ACJfBoveixqa3ExcqzDy2WNptJRI/7sSbewxm9pu/BKbqPWCgBa9F0wjd+SYLOmeEMCoGAXU6hG2 X-Received: by 10.159.197.74 with SMTP id d10mr23144753plo.314.1516210497131; Wed, 17 Jan 2018 09:34:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516210497; cv=none; d=google.com; s=arc-20160816; b=xF8SOIO6geklxIP9PHsyIlKYT3Z5kKLWgqcSEBKQJVFh38M7ciSfXh4wPnYPna8Vjs TQmPsj0OyFH39HOXBviOL3FEjeF18yIztjBdBqIdEZ4BvV+nawjppiDmGwECk0QF4Iua bhiWmGDQF1hwQtJX5alOmvjUq/8psc3nthhURkTUPsDTtR1raGRGjXo2TJK3WfHdXD9m g5OmHzJnepyNnqVknrvW5ExxXRAmqE+eY+co30eL55HBEhZgpya2RtxuCD+vz5zCmDHN bdPE2inem6yEFyvnzv3uZKsDXAh6Z7PubHPd0dnKE0QrleuYauocNVTkhA1EB5Xc42mt ie7Q== 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:dkim-signature :arc-authentication-results; bh=tSl6jLslBUj6Bsh+tvgovkrqKtVHIE8nmmH6/XktDhU=; b=0e5CMjCYKeo5tSpBLvzas76uiGpz6oq0b7p/VujVHJv9ukUAKVKgQZlKZVMCmVdL61 Vz7ZShdmMnPc0bIieyKb8OKsOIRzC6nHf9Z7U8v/vfDTCVVJRb5TdvvoGr+o7kE/wdq3 vqV7mO6goAIdWnrwNYYGKrNV6LTbrcc3crHwRm01cJKzPdCzwLNJGCBi/Zcf5aN/MnXS pBxuK3nGO6YeER2pXLo498CWu/yHUmgtk23KZnP1UcEKM75DRbGNfL581WsSju0iZ+s1 wjKXsrtvpRcWgm1slEGDQ0VM2wj09iiXwjsUjpPS4BiSo8CgtoNbJaw/+UpFliTG+LHW TcPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=UfsKNUvl; 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 o7si4305719pgr.390.2018.01.17.09.34.42; Wed, 17 Jan 2018 09:34:57 -0800 (PST) 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=fail header.i=@lechnology.com header.s=default header.b=UfsKNUvl; 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 S932089AbeAQRdP (ORCPT + 99 others); Wed, 17 Jan 2018 12:33:15 -0500 Received: from vern.gendns.com ([206.190.152.46]:52172 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753860AbeAQRdL (ORCPT ); Wed, 17 Jan 2018 12:33:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tSl6jLslBUj6Bsh+tvgovkrqKtVHIE8nmmH6/XktDhU=; b=UfsKNUvlA1JvL0oEvbX+a9zKKE uiMP8J+3hB7QxV1ulhnrPK7lkZUn7zi1S+Ec9Z0WR6bghXK4PgtSPbKWcuo2BYbt2keC3bTcwJtZW wxCEDM6RlUPuD1PAgDNDeJQhb2nHQqX+R9E8AfAszbHWeHVwdJRV3sLV3qsg4jfkHXPI7w72bKqhp 7lWT82lQcdoJpMNm90To1bHO0pttQdK6cUCWwjyGH6gDxxseNoCLbYGpI7W8rB1K52iuIURoYEa+s i+gj4ZjFBByO05RjTNjxxyFDL8WeY/ZDo3E5z8Cx9teKYV68zrIkMC/0A6ELsf9vQ+QvWoAV+yD82 NFykllNA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:52848 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1ebrZu-000ufu-7d; Wed, 17 Jan 2018 12:32:46 -0500 Subject: Re: [PATCH v5 12/44] clk: davinci: Add platform information for TI DA850 PSC To: Sekhar Nori , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Kevin Hilman , Adam Ford , linux-kernel@vger.kernel.org References: <1515377863-20358-1-git-send-email-david@lechnology.com> <1515377863-20358-13-git-send-email-david@lechnology.com> <8d09dba6-9b1d-e06e-8730-256b8a4320db@ti.com> From: David Lechner Message-ID: Date: Wed, 17 Jan 2018 11:33:09 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/17/2018 05:57 AM, Sekhar Nori wrote: > On Tuesday 16 January 2018 10:51 PM, David Lechner wrote: >> On 01/16/2018 08:00 AM, Sekhar Nori wrote: >>> On Monday 08 January 2018 07:47 AM, David Lechner wrote: >>>> +void __init da850_psc_clk_init(void __iomem *psc0, void __iomem *psc1) >>>> +{ >>>> +    struct clk_onecell_data *clk_data; >>>> + >>>> +    clk_data = davinci_psc_register_clocks(psc0, da850_psc0_info, 16); >>>> +    if (!clk_data) >>>> +        return; >>>> + >>>> +    clk_register_clkdev(clk_data->clks[3], NULL, "ti-aemif"); >>>> +    clk_register_clkdev(clk_data->clks[3], "aemif", "davinci-nand.0"); >>>> +    clk_register_clkdev(clk_data->clks[4], NULL, "spi_davinci.0"); >>>> +    clk_register_clkdev(clk_data->clks[5], NULL, "da830-mmc.0"); >>>> +    clk_register_clkdev(clk_data->clks[9], NULL, "serial8250.0"); >>>> +    clk_register_clkdev(clk_data->clks[14], "arm", NULL); >>>> +    clk_register_clkdev(clk_data->clks[15], NULL, "davinci-rproc.0"); >>>> + >>>> +    clk_free_onecell_data(clk_data); >>>> + >>>> +    clk_data = davinci_psc_register_clocks(psc1, da850_psc1_info, 32); >>>> +    if (!clk_data) >>>> +        return; >>>> + >>>> +    clk_register_clkdev(clk_data->clks[1], "usb20_psc_clk", NULL); >>> >>> Is this con_id really needed now? Searching for "usb20_psc_clk" in your >>> tree results in only this one hit. >> >> Yes, this is left over from previous attempts. >> >>> >>>> +    clk_register_clkdev(clk_data->clks[1], NULL, "musb-da8xx"); >>>> +    clk_register_clkdev(clk_data->clks[1], NULL, "cppi41-dmaengine"); >>> >>> I guess multiple dev_id matches like these are another hurdle in moving >>> them to davinci_psc_clk_info[] table? If its too cumbersome to keep >>> multiple entries in the table, they can be handled as an exception at >>> the end of processing the table? Still they are not the norm so I hope >>> the normal case will still benefit. >> >> Right, as I mentioned in the reply to the previous patch, instead of >> assigning a con_id and dev_id to each clock, we would need to assign >> an array with a list of clocks. I think that would work better than >> trying to handle the extras as an exception since there, on average, >> about 5 per SoC. > > Okay, are you going to try this to see how it looks? It looks like > samsung (clk-s3c2410.c) and tegra (clk-tegra20.c) use such tables > (although both use separate tables mapping just the gate number to > con_id/dev_id). > > Others like u8540_clk.c and clk-mmp2.c have multiple calls in code to > clk_register_clkdev() like you have, but they keep them right after the > gate clock registration which makes it easy to see the mapping. > > clk-imx35.c has multiple clk_register_clkdev() calls, but uses an enum > for the gates so its easy to see the mapping. This approach looks fine > to me as well. > > So looks like there is a whole gamut of ways people have approached > this. But I do think we need to change the scheme you have currently > since it is difficult to review and audit (believe me on this one :)) > OK, I'll figure out something here.