Received: by 10.223.176.46 with SMTP id f43csp1190607wra; Fri, 26 Jan 2018 13:30:53 -0800 (PST) X-Google-Smtp-Source: AH8x2278OVTj98l/DwuWdeRPr86Wb8xSDWns1fM54nwPW9hlHWnvRXx44h8jJkaP++D4DPViIs9c X-Received: by 10.98.238.2 with SMTP id e2mr20290877pfi.206.1517002252912; Fri, 26 Jan 2018 13:30:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517002252; cv=none; d=google.com; s=arc-20160816; b=pQ5cM2lQBMgq+6ZoMZx2HGlttVmpn5UnH7zXkhb01f/V84gL6kltQxtNzpOGWowSCt A1UgXNuLVFiWOPGqvZyNuAGvAerwjFfZEmIU8EHdWNxqwH+MlZP0TRuUl+t6NuNxzDUR 8U2MPqH6erutJRp9py/MUZx+mHev+6gg87Hwy6s9Bmws55yekSYdc8F3Dl8YQNuNfk7T ql0proiIqoKeW9frMwhV4DaAlqc+BQreXz2OazBFNyVtC4RQL4/QqVwnRsXC3/nI1DiN Yi0zofPsEtEq43KCFJp9VMyVgcxhLEAJPfAAssAyPalhnBLPxOIlvezjG2LGtScFIZLr vlrg== 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:references:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=mOgaS032L30ptlRzTxiy/3JHmEsb8pLJomr+7xsKTEw=; b=jhCw5Aehqd1n55lQnmMj36GFl+b3MFEVn0DpWtJQn3YmW8EQQRlE+N1GFqWxxwf3MQ 5EwRy7jfbJg/ntb/r9KyZ9AtIgfUwUWRGpqFj76HNAHHLVVAvLdwAkQa7FEDG7OfSdJn AHynvUVJzGsE4guE7u6xICGF5fKhxpc1zxpcbDy4i7JFxOkdpY2uJo3c1t33lYJ4JCmC FvChh+Xp/Qi+Rn1Q/O+DRx0Mix4dCYff1cp0euAaOygxslGPPjNSV74a9pabQCyZpjdI 8mXytRv5rC7o8qocD3Gr/kiwoAR1vU2siKs9hpXmlM4wURNMAzYbR4gryF4i4PXK95BM v8qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F/cyXquZ; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9-v6si3367446pli.404.2018.01.26.13.30.38; Fri, 26 Jan 2018 13:30:52 -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=pass header.i=@gmail.com header.s=20161025 header.b=F/cyXquZ; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751938AbeAZVaE (ORCPT + 99 others); Fri, 26 Jan 2018 16:30:04 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:45278 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751237AbeAZVaB (ORCPT ); Fri, 26 Jan 2018 16:30:01 -0500 Received: by mail-pf0-f196.google.com with SMTP id a88so1081714pfe.12; Fri, 26 Jan 2018 13:30:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=mOgaS032L30ptlRzTxiy/3JHmEsb8pLJomr+7xsKTEw=; b=F/cyXquZYtTOLA/mEnzqlYkD4HJCgyQOULN2IueqP5EWlfRrJ6+S8DNAQ5vMZp/FaL 0h99885AG+Vps1Ca0S546/NnbfmqYl+xo/R1K6f3lWcp7jXTRCXxfebj5cCq0F8hpqjE uiS8vkFg/DBZXFG/OCC6R5NOlVE7bJcI67LfW3mPsjyOjyyJLmHYogsclUse11LMxapQ hcKgvbp+KfpvWIAwlQuVTSZGeddvnP7Ia55AhEWVMoxV4sI2VRAlTDp+hU/TxXiodfsR 9o5lqlkfA7BwRAG3wnkM8bVtKvU0R2pHQn/vNf22gG3oSya5J1iUtnp4XzkFQbLaSWpX E4+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mOgaS032L30ptlRzTxiy/3JHmEsb8pLJomr+7xsKTEw=; b=jdym59hnFk7BJ89aokTgPdt93dE5VHY0dNHUEefLR8EvKQ1tDAqaRevIXl1QtOqMfP 9QE94NsKj6GyB6fRjgjzq67yTuaLv3xL6w1mNgtfELxSz/e91X2AniW/lAzjPwUkW7Jl UKweH3g/EjkLzYu+imiJ9oXFVS5aLluq64IOvfbnqiSxLadYEu+LeMv76jVu5WOq4MTN rxRoGv0ImbvuCpS0Vrx7UtYfGJQykXrTw5H5tTwdjsnDFZBO5jdHpIVmPiDghKJRzGFs QOhpu0Ipe22b+4pnoWRJrtQXLuYPhk7BWELm9ASCdAANcHflPd1X46EYgH86wJIntVgJ s7wQ== X-Gm-Message-State: AKwxytcLTt+tRNrQ8eG7cvBTY1Yrd5WADkJSlo8ptE19ri5PFCGpdN2/ 2G0LQpveFmtcOU9G3nM/RcM= X-Received: by 2002:a17:902:424:: with SMTP id 33-v6mr15051931ple.57.1517002201292; Fri, 26 Jan 2018 13:30:01 -0800 (PST) Received: from [192.168.1.70] (c-73-93-215-6.hsd1.ca.comcast.net. [73.93.215.6]) by smtp.gmail.com with ESMTPSA id p1sm9514748pgr.44.2018.01.26.13.30.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 13:30:00 -0800 (PST) Subject: Re: [PATCH] of: use hash based search in of_find_node_by_phandle From: Frank Rowand To: Chintan Pandya , robh+dt@kernel.org, devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <1516875247-19599-1-git-send-email-cpandya@codeaurora.org> <5a7793df-725e-608d-778b-cb81fde0cc64@gmail.com> <13846fcb-3aa2-a4fb-1bd8-e624855f105d@codeaurora.org> <2ac0d70d-074d-5eff-77e9-29d1a246a3ef@gmail.com> Message-ID: Date: Fri, 26 Jan 2018 13:29:59 -0800 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: <2ac0d70d-074d-5eff-77e9-29d1a246a3ef@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/26/18 13:27, Frank Rowand wrote: > On 01/26/18 00:22, Chintan Pandya wrote: >> >> >> On 1/26/2018 1:24 AM, Frank Rowand wrote: >>> On 01/25/18 02:14, Chintan Pandya wrote: >>>> of_find_node_by_phandle() takes a lot of time finding >>>> right node when your intended device is too right-side >>>> in the fdt. Reason is, we search each device serially >>>> from the fdt, starting from left-most to right-most. >>> Please give me a pointer to the code that is doing >>> this search. >>> >>> -Frank >> You can refer include/linux/of.h >> >> #define for_each_of_allnodes_from(from, dn) \ >>         for (dn = __of_find_all_nodes(from); dn; dn = __of_find_all_nodes(dn)) >> #define for_each_of_allnodes(dn) for_each_of_allnodes_from(NULL, dn) >> >> where __of_find_all_nodes() does >> >> struct device_node *__of_find_all_nodes(struct device_node *prev) >> { >>         struct device_node *np; >>         if (!prev) { >>                 np = of_root; >>         } else if (prev->child) { >>                 np = prev->child; >>         } else { >>                 /* Walk back up looking for a sibling, or the end of the structure */ >>                 np = prev; >>                 while (np->parent && !np->sibling) >>                         np = np->parent; >>                 np = np->sibling; /* Might be null at the end of the tree */ >>         } >>         return np; >> } >> > > Let me restate my question. > > Can you point me to the driver code that is invoking > the search? > > -Frank > And also the .dts devicetree source file that you are seeing large overhead with.