From: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
To: Pantelis Antoniou
<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
Cc: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Frank Rowand
<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Matt Porter <mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>,
Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
Koen Kooi
<koen-QLwJDigV5abLmq1fohREcCpxlwaOVQ5f@public.gmane.org>,
Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>,
Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Pantelis Antoniou
<panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
Subject: Re: [PATCH 2/3] of: Support hashtable lookups for phandles
Date: Mon, 9 May 2016 22:38:20 +0200 [thread overview]
Message-ID: <CAMuHMdXBnxTaKB4io4j4jbbUh+QU0b_Fj8zYi_K_7NZSE33YpQ@mail.gmail.com> (raw)
In-Reply-To: <1462817488-8370-3-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
Hi Pantelis,
On Mon, May 9, 2016 at 8:11 PM, Pantelis Antoniou
<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> 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-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-05-09 20:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-09 18:11 [PATCH 0/3] of: generic infrastructure fixes Pantelis Antoniou
2016-05-09 18:11 ` [PATCH 1/3] of: rename *_node_sysfs to _node_post Pantelis Antoniou
[not found] ` <1462817488-8370-2-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-05-09 21:49 ` Rob Herring
2016-05-10 13:57 ` Pantelis Antoniou
2016-05-09 18:11 ` [PATCH 2/3] of: Support hashtable lookups for phandles Pantelis Antoniou
[not found] ` <1462817488-8370-3-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-05-09 20:38 ` Geert Uytterhoeven [this message]
[not found] ` <CAMuHMdXBnxTaKB4io4j4jbbUh+QU0b_Fj8zYi_K_7NZSE33YpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-09 21:11 ` Rob Herring
2016-05-10 13:45 ` Pantelis Antoniou
2016-05-10 14:26 ` Rob Herring
2016-05-09 21:21 ` Rob Herring
2016-05-10 13:52 ` Pantelis Antoniou
[not found] ` <1462817488-8370-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-05-09 18:11 ` [PATCH 3/3] of: overlay: Pick up label symbols from overlays Pantelis Antoniou
2016-05-09 20:32 ` Marek Vasut
[not found] ` <1462817488-8370-4-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-05-09 21:47 ` Rob Herring
[not found] ` <CAL_JsqLVnQ12AS-2CNfsf5PsyGvELrMjDDGfRcv7opijgJkGdw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-10 13:56 ` Pantelis Antoniou
[not found] ` <2B34FBA8-A9DB-4DB5-BF95-4FE752EAF128-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
2016-05-10 14:23 ` Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMuHMdXBnxTaKB4io4j4jbbUh+QU0b_Fj8zYi_K_7NZSE33YpQ@mail.gmail.com \
--to=geert-td1emuhucqxl1znqvxdv9g@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=koen-QLwJDigV5abLmq1fohREcCpxlwaOVQ5f@public.gmane.org \
--cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marex-ynQEQJNshbs@public.gmane.org \
--cc=mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
--cc=pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
--cc=panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org \
--cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).