Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1285837ybg; Fri, 18 Oct 2019 15:14:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7LVaOysZ5goeA6Zzd/qpL/Ww+qqS6ayIaQa+TD07DxxNE7QcwJe/AIhq3IwsLpVI2++Jg X-Received: by 2002:a05:6402:698:: with SMTP id f24mr12289467edy.172.1571436853877; Fri, 18 Oct 2019 15:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571436853; cv=none; d=google.com; s=arc-20160816; b=rXuiK5AAAlyih/5dqvlxapK480iu3gdxTJE6tmvkLBhHl+gAXUaegs6tnsiWqDo2Fb I5/4jbNoMEth9wRCwyiL3pi+nJV/VzdUa8JXymIecFQHK9Q7H8XWXT2Ikt3CXiunhHaE C2e+ttn0e64UZwOV3gY9X4iU7uKcdNfnzATdi5RzjSg778kfdpIV1aUppzuX7im0wPLz BNDwqc/1iNkUoBw5aejZFAy4ZlBWVHH7w2+mL2zVSnGVXzSM7BHJPYU4I3a6x0GfdteU deQ0V2gQI2HXSXzpLLo1y8qldIlrbTjHsKobMoGf4oLUZRoljyVk8T1ZZW452vZ8QAzV ubrw== 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; bh=e0Fv/9q1RP7k5MMlTnFQ+NkUCo2Z4WjoAL5z869bMFg=; b=VIQvSh0uJZv6TV/0cmfuOt4NPOii65pGi1LNQgXJc5Io45xGAL+JyoOuamkluft2H+ Y5+xmurwO536D7rD0bJ7aFzd6SdoqoZ3xt9vFnucXVlQcottRsnHIdcxiJuDGKCp+NUK CaJNRmY9KlmJLgBbN1ARJ83QgM0zZQJi/jpVOBCtMqXMY8ZPhgXadO4oyYbWm6mjnduo reNlC9spLHUToE1FhI4ZzZY/LFjdx2f7gB9vTkLh9LBEtrzh1ujFuzdMLeKd6EA7Jv3U n7Lb+cTDvavdHleX8ZS15eMMEvCY9PBgz/bRimZaly69trujbqSzC5Z3ESBrto3yJKbK XzzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KnGzyi7l; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19si4255278ejj.120.2019.10.18.15.13.51; Fri, 18 Oct 2019 15:14:13 -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=@gmail.com header.s=20161025 header.b=KnGzyi7l; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438845AbfJQSfo (ORCPT + 99 others); Thu, 17 Oct 2019 14:35:44 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:34151 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731227AbfJQSfn (ORCPT ); Thu, 17 Oct 2019 14:35:43 -0400 Received: by mail-yb1-f193.google.com with SMTP id m1so1025857ybm.1; Thu, 17 Oct 2019 11:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=e0Fv/9q1RP7k5MMlTnFQ+NkUCo2Z4WjoAL5z869bMFg=; b=KnGzyi7lgBbkt+FTXOcx6dPG+6CX/Of9IIuIBRATesx6l61nclhOCeG7fkafpro1uH VUZFjLjqwLYrjMjyi2WADJo20nDFeVcQ352IcYy6R8SYfL6kGoUYB603OspEFVIrn/9U zXy9MLgsti8FCqCnB5VdqFdSlBeNnn7fpOGnKZ+CUVuQ2zFcCOnBiQCynrsqH98zlrIl HzNLP+v5RbGpCN9EY7TobAiViDL1jkI4nMpVnB1S/Ka/+IXCd6xmLtjiLFXbfnjR/Nj/ uVJCl6j6L3j2fxRFstsaG20jftmhaxLGbifgtWxNrP9XTnmZfU/9llOo30LTtO7GUbjn 30nQ== 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=e0Fv/9q1RP7k5MMlTnFQ+NkUCo2Z4WjoAL5z869bMFg=; b=EnOZTs1XaAhMydx918NK/Xbn+Xyxf3BkA60NkubVn/NLoG9gFPYhxogaeBNp+lAirs vT/N64YCXpYhfaIi3pmwADu/j9eoCinNnm6kMepqW1o16sSkgdL87v2IiYDigQ2T7DL1 JjH64w1xS1/xGzYh7LblSgCYTLArwB4AwfHVD2u+8DTlUiKqsnl0On3ZF5xmkdJumbh3 LXHAYjAmuJE58Ou7Hc5diaYTSFYQyqiAVZ4gzLNQnihWnKzCGJA/uGHHrHWOcmmFX5/s U88Exd7xqMduax6HAFJQsTEW7ilCNYta8lASe9YKjevCJt8j9cmV/0lk5GissUz7fsXZ dhgA== X-Gm-Message-State: APjAAAUmiCBIm8x9jinm9mSIuk8mU4ZPZjsivXPw1OtkcgAilSbKxho6 iVHzelBfqLZUIMKbq4SFb84= X-Received: by 2002:a25:2189:: with SMTP id h131mr3041545ybh.231.1571337342928; Thu, 17 Oct 2019 11:35:42 -0700 (PDT) Received: from [192.168.1.62] (c-73-88-245-53.hsd1.tn.comcast.net. [73.88.245.53]) by smtp.gmail.com with ESMTPSA id z66sm75337ywz.78.2019.10.17.11.35.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Oct 2019 11:35:42 -0700 (PDT) Subject: Re: [PATCH] of: Add of_get_memory_prop() To: Rob Herring , rananta@codeaurora.org Cc: Trilok Soni , Android Kernel Team , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190918184656.7633-1-rananta@codeaurora.org> <19d727bbfce08e59294920ba8097be7a@codeaurora.org> <5d93ce80.1c69fb81.4acf3.4716@mx.google.com> From: Frank Rowand Message-ID: <6a5a6cdc-e5e0-0f94-4eba-cfaaf0a16b19@gmail.com> Date: Thu, 17 Oct 2019 13:35:35 -0500 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: <5d93ce80.1c69fb81.4acf3.4716@mx.google.com> 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 Hi Raghavendra, I have not received your emails in this conversation, and I do not see them in my spam folder. I see some replies from Rob, so I am guessing he added me to the CC: list. Please add me to future Devicetree emails. Digging a little deeper, in the devicetree mail list archive, I see myself on the CC: list of your "Date: Wed, 18 Sep 2019 15:32:14 -0700" reply to Rob. I'm not sure why that email did not get through to me. So just a heads up that something may be interfering with delivery of email from you to me. I've seen disappearing email problem from other senders, even when most of their emails get through. Thanks, Frank On 10/01/2019 17:09, Rob Herring wrote: > On Wed, Sep 18, 2019 at 03:32:14PM -0700, rananta@codeaurora.org wrote: >> On 2019-09-18 13:13, Rob Herring wrote: >>> On Wed, Sep 18, 2019 at 1:47 PM Raghavendra Rao Ananta >>> wrote: >>>> >>>> On some embedded systems, the '/memory' dt-property gets updated >>>> by the bootloader (for example, the DDR configuration) and then >>>> gets passed onto the kernel. The device drivers may have to read >>>> the properties at runtime to make decisions. Hence, add >>>> of_get_memory_prop() for the device drivers to query the requested >>> >>> Function name doesn't match. Device drivers don't need to access the >>> FDT. >>> >>>> properties. >>>> >>>> Signed-off-by: Raghavendra Rao Ananta >>>> --- >>>> drivers/of/fdt.c | 27 +++++++++++++++++++++++++++ >>>> include/linux/of_fdt.h | 1 + >>>> 2 files changed, 28 insertions(+) >>> >>> We don't add kernel api's without users. >>> >>>> >>>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c >>>> index 223d617ecfe1..925cf2852433 100644 >>>> --- a/drivers/of/fdt.c >>>> +++ b/drivers/of/fdt.c >>>> @@ -79,6 +79,33 @@ void __init of_fdt_limit_memory(int limit) >>>> } >>>> } >>>> >>>> +/** >>>> + * of_fdt_get_memory_prop - Return the requested property from the >>>> /memory node >>>> + * >>>> + * On match, returns a non-zero positive value which represents the >>>> property >>>> + * value. Otherwise returns -ENOENT. >>>> + */ >>>> +int of_fdt_get_memory_prop(const char *pname) >>>> +{ >>>> + int memory; >>>> + int len; >>>> + fdt32_t *prop = NULL; >>>> + >>>> + if (!pname) >>>> + return -EINVAL; >>>> + >>>> + memory = fdt_path_offset(initial_boot_params, "/memory"); >>> >>> Memory nodes should have a unit-address, so this won't work frequently. >> Sorry, can you please elaborate more on this? What do you mean by >> unit-address and working frequently? > > A memory node is typically going to be something like: /memory@80000000. > So your function will not work for any of those cases. And just > '/memory' generates a dtc warning. > > Rob > >