From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v3 4/4] arm64:numa: adding numa support for arm64 platforms.
Date: Tue, 06 Jan 2015 20:59:04 +0100 [thread overview]
Message-ID: <2425557.4DHPZVafv4@wuerfel> (raw)
In-Reply-To: <CAFpQJXVQnRY9wZRk-83bQLw0m=41ZxH2v-YZCHdF0fvC8LS_Tw@mail.gmail.com>
On Tuesday 06 January 2015 14:55:53 Ganapatrao Kulkarni wrote:
> On Sat, Jan 3, 2015 at 2:40 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> >> +int dt_get_cpu_node_id(int cpu)
> >> +{
> >> + struct device_node *dn = NULL;
> >> +
> >> + while ((dn = of_find_node_by_type(dn, "cpu"))) {
> >> + const u32 *cell;
> >> + u64 hwid;
> >> +
> >> + /*
> >> + * A cpu node with missing "reg" property is
> >> + * considered invalid to build a cpu_logical_map
> >> + * entry.
> >> + */
> >> + cell = of_get_property(dn, "reg", NULL);
> >> + if (!cell) {
> >> + pr_err("%s: missing reg property\n", dn->full_name);
> >> + return default_nid;
> >> + }
> >> + hwid = of_read_number(cell, of_n_addr_cells(dn));
> >> +
> >> + if (cpu_logical_map(cpu) == hwid)
> >> + return of_node_to_nid_single(dn);
> >> + }
> >> + return NUMA_NO_NODE;
> >> +}
> >> +EXPORT_SYMBOL(dt_get_cpu_node_id);
> >
> > Maybe just expose a function to the device node for a CPU ID here, and
> > expect callers to use of_node_to_nid?
> shall i make this wrapper function in dt_numa.c, which will use
> functions _of_node_to_nid and _of_cpu_to_node(cpu)
Yes, I guess that would work.
> And, this function can be a weak function in numa.c which returns 0.
No, please don't use weak functions. You can either use IS_ENABLED()
tricks to remove function calls at compile-time, or in the header
file provide an inline function as an alternative to the extern
declaration, based on a configuration symbol.
Arnd
next prev parent reply other threads:[~2015-01-06 19:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1420011208-7051-1-git-send-email-ganapatrao.kulkarni@caviumnetworks.com>
[not found] ` <1420011208-7051-5-git-send-email-ganapatrao.kulkarni@caviumnetworks.com>
2015-01-02 21:10 ` [RFC PATCH v3 4/4] arm64:numa: adding numa support for arm64 platforms Arnd Bergmann
2015-01-06 9:25 ` Ganapatrao Kulkarni
2015-01-06 19:59 ` Arnd Bergmann [this message]
2015-01-07 7:09 ` Ganapatrao Kulkarni
[not found] ` <1420011208-7051-3-git-send-email-ganapatrao.kulkarni@caviumnetworks.com>
2015-01-02 21:17 ` [RFC PATCH v3 2/4] Documentation: arm64/arm: dt bindings for numa Arnd Bergmann
2015-01-06 5:28 ` Ganapatrao Kulkarni
[not found] ` <1420011208-7051-2-git-send-email-ganapatrao.kulkarni@caviumnetworks.com>
2015-01-02 21:17 ` [RFC PATCH v3 1/4] arm64: defconfig: increase NR_CPUS range to 2-4096 Arnd Bergmann
[not found] ` <1420011208-7051-4-git-send-email-ganapatrao.kulkarni@caviumnetworks.com>
2015-01-02 21:17 ` [RFC PATCH v3 3/4] arm64:thunder: Add initial dts for Cavium's Thunder SoC in 2 Node topology Arnd Bergmann
2015-01-06 9:34 ` Ganapatrao Kulkarni
2015-01-06 20:02 ` Arnd Bergmann
2015-01-07 7:07 ` Ganapatrao Kulkarni
2015-01-07 8:18 ` Arnd Bergmann
2015-01-14 17:36 ` Lorenzo Pieralisi
2015-01-14 18:48 ` Ganapatrao Kulkarni
2015-01-14 23:49 ` Lorenzo Pieralisi
2015-01-15 17:32 ` Arnd Bergmann
2014-12-31 7:36 [RFC PATCH v3 0/4] arm64:numa: Add numa support for arm64 platforms Ganapatrao Kulkarni
2014-12-31 7:36 ` [RFC PATCH v3 4/4] arm64:numa: adding " Ganapatrao Kulkarni
2015-01-06 7:22 ` Shannon Zhao
2015-01-06 8:40 ` Ganapatrao Kulkarni
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=2425557.4DHPZVafv4@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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).