Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1397375
| From | Geert Uytterhoeven <geert@linux-m68k.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/3] of: Support hashtable lookups for phandles |
| Date | 2016-05-09 22:40 +0200 |
| Message-ID | <rx08b-4n8-11@gated-at.bofh.it> (permalink) |
| References | <rwXWG-2q8-13@gated-at.bofh.it> <rwXWG-2q8-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Pantelis,
On Mon, May 9, 2016 at 8:11 PM, Pantelis Antoniou
<pantelis.antoniou@konsulko.com> wrote:
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1073,9 +1097,14 @@ struct device_node *of_find_node_by_phandle(phandle handle)
> return NULL;
>
> raw_spin_lock_irqsave(&devtree_lock, flags);
> - for_each_of_allnodes(np)
> - if (np->phandle == handle)
> - break;
> + /* when we're ready use the hash table */
> + if (of_phandle_ht_available() && !in_interrupt())
I guess the !in_interrupt() test is because of the locking inside
rhashtable_lookup_fast()?
> + np = of_phandle_ht_lookup(handle);
> + else { /* fallback */
> + for_each_of_allnodes(np)
> + if (np->phandle == handle)
> + break;
> + }
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] of: generic infrastructure fixes Pantelis Antoniou <pantelis.antoniou@konsulko.com> - 2016-05-09 20:20 +0200
[PATCH 2/3] of: Support hashtable lookups for phandles Pantelis Antoniou <pantelis.antoniou@konsulko.com> - 2016-05-09 20:20 +0200
Re: [PATCH 2/3] of: Support hashtable lookups for phandles Geert Uytterhoeven <geert@linux-m68k.org> - 2016-05-09 22:40 +0200
Re: [PATCH 2/3] of: Support hashtable lookups for phandles Rob Herring <robherring2@gmail.com> - 2016-05-09 23:20 +0200
Re: [PATCH 2/3] of: Support hashtable lookups for phandles Pantelis Antoniou <pantelis.antoniou@konsulko.com> - 2016-05-10 15:50 +0200
Re: [PATCH 2/3] of: Support hashtable lookups for phandles Rob Herring <robherring2@gmail.com> - 2016-05-10 16:30 +0200
Re: [PATCH 2/3] of: Support hashtable lookups for phandles Rob Herring <robherring2@gmail.com> - 2016-05-09 23:30 +0200
Re: [PATCH 2/3] of: Support hashtable lookups for phandles Pantelis Antoniou <panto@antoniou-consulting.com> - 2016-05-10 16:10 +0200
[PATCH 3/3] of: overlay: Pick up label symbols from overlays. Pantelis Antoniou <pantelis.antoniou@konsulko.com> - 2016-05-09 20:20 +0200
Re: [PATCH 3/3] of: overlay: Pick up label symbols from overlays. Marek Vasut <marex@denx.de> - 2016-05-09 22:40 +0200
Re: [PATCH 3/3] of: overlay: Pick up label symbols from overlays. Rob Herring <robherring2@gmail.com> - 2016-05-09 23:50 +0200
Re: [PATCH 3/3] of: overlay: Pick up label symbols from overlays. Pantelis Antoniou <panto@antoniou-consulting.com> - 2016-05-10 16:10 +0200
Re: [PATCH 3/3] of: overlay: Pick up label symbols from overlays. Rob Herring <robherring2@gmail.com> - 2016-05-10 16:30 +0200
[PATCH 1/3] of: rename *_node_sysfs to _node_post Pantelis Antoniou <pantelis.antoniou@konsulko.com> - 2016-05-09 20:20 +0200
Re: [PATCH 1/3] of: rename *_node_sysfs to _node_post Rob Herring <robherring2@gmail.com> - 2016-05-09 23:50 +0200
Re: [PATCH 1/3] of: rename *_node_sysfs to _node_post Pantelis Antoniou <pantelis.antoniou@konsulko.com> - 2016-05-10 16:00 +0200
csiph-web