Re: [PATCH] of: use hash based search in of_find_node_by_phandle

2018-01-26 Thread Frank Rowand
On 01/26/18 13:29, Frank Rowand wrote: > 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 nod

Re: [PATCH] of: use hash based search in of_find_node_by_phandle

2018-01-26 Thread Frank Rowand
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 >>

Re: [PATCH] of: use hash based search in of_find_node_by_phandle

2018-01-26 Thread Frank Rowand
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 devic

Re: [PATCH] of: use hash based search in of_find_node_by_phandle

2018-01-26 Thread Rob Herring
On Fri, Jan 26, 2018 at 1:22 AM, Chintan Pandya wrote: > On 1/25/2018 8:20 PM, Rob Herring wrote: >> >> On Thu, Jan 25, 2018 at 4:14 AM, Chintan Pandya >> wrote: >>> [...] >> I'd guess that there's really only a few phandle lookups that occur >> over and over. > > On my system, there are ~6.7k

Re: [PATCH] of: use hash based search in of_find_node_by_phandle

2018-01-26 Thread Chintan Pandya
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-m

Re: [PATCH] of: use hash based search in of_find_node_by_phandle

2018-01-25 Thread Chintan Pandya
On 1/25/2018 8:20 PM, Rob Herring wrote: On Thu, Jan 25, 2018 at 4:14 AM, Chintan Pandya wrote: of_find_node_by_phandle() takes a lot of time finding Got some numbers for what is "a lot of time"? On my SDM device, I see total saving of 400ms during boot time. For some clients whose node is q

Re: [PATCH] of: use hash based search in of_find_node_by_phandle

2018-01-25 Thread Frank Rowand
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 c

Re: [PATCH] of: use hash based search in of_find_node_by_phandle

2018-01-25 Thread Rob Herring
On Thu, Jan 25, 2018 at 4:14 AM, Chintan Pandya wrote: > of_find_node_by_phandle() takes a lot of time finding Got some numbers for what is "a lot of time"? > right node when your intended device is too right-side > in the fdt. Reason is, we search each device serially > from the fdt, starting f

[PATCH] of: use hash based search in of_find_node_by_phandle

2018-01-25 Thread Chintan Pandya
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. Implement, device-phandle relation in hash-table so that look up can be faster. C