linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jnair@caviumnetworks.com (Jayachandran C)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/2] acpi, gicv3-its, numa: Adding numa node mapping for gic-its units
Date: Wed, 21 Jun 2017 15:25:10 +0000	[thread overview]
Message-ID: <20170621152509.GA4485@localhost> (raw)
In-Reply-To: <a3550a73-9345-b360-44e6-949f0b6c42da@arm.com>

On Wed, Jun 21, 2017 at 09:44:58AM +0100, Marc Zyngier wrote:
> On 21/06/17 08:09, Jayachandran C wrote:
> > On Wed, Jun 21, 2017 at 11:45:43AM +0530, Ganapatrao Kulkarni wrote:
> >> Add code to parse SRAT ITS Affinity sub table as defined in ACPI 6.2
> >> Later in per device probe, ITS devices are mapped to
> >> numa node using ITS id to proximity domain mapping.
> >>
> >> Signed-off-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
> >> ---
> >>  drivers/irqchip/irq-gic-v3-its.c | 80 +++++++++++++++++++++++++++++++++++++++-
> >>  1 file changed, 79 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> >> index 45ea1933..88cfb32 100644
> >> --- a/drivers/irqchip/irq-gic-v3-its.c
> >> +++ b/drivers/irqchip/irq-gic-v3-its.c
> >> @@ -1833,6 +1833,82 @@ static int __init its_of_probe(struct device_node *node)
> >>  
> >>  #define ACPI_GICV3_ITS_MEM_SIZE (SZ_128K)
> >>  
> >> +#ifdef CONFIG_ACPI_NUMA
> >> +struct its_srat_map {
> >> +	u32	numa_node;  /* numa node id */
> >> +	u32	its_id;  /* GIC ITS ID */
> >> +};
> >> +
> >> +static struct its_srat_map its_srat_maps[MAX_NUMNODES] __initdata = {
> >> +	[0 ... MAX_NUMNODES - 1] = {NUMA_NO_NODE, UINT_MAX} };
> >> +
> >> +static int its_in_srat __initdata;
> >> +
> >> +static int __init
> >> +acpi_get_its_numa_node(u32 its_id)
> >> +{
> >> +	int i;
> >> +
> >> +	for (i = 0; i < its_in_srat; i++) {
> >> +		if (its_id == its_srat_maps[i].its_id)
> >> +			return its_srat_maps[i].numa_node;
> >> +	}
> >> +	return NUMA_NO_NODE;
> >> +}
> >> +
> >> +static int __init
> >> +gic_acpi_parse_srat_its(struct acpi_subtable_header *header,
> >> +			 const unsigned long end)
> >> +{
> >> +	int pxm, node;
> >> +	struct acpi_srat_its_affinity *its_affinity;
> >> +
> >> +	its_affinity = (struct acpi_srat_its_affinity *)header;
> >> +	if (!its_affinity)
> >> +		return -EINVAL;
> >> +
> >> +	if (its_affinity->header.length <
> >> +			sizeof(struct acpi_srat_its_affinity)) {
> >> +		pr_err("SRAT:ITS: Invalid SRAT header length: %d\n",
> >> +			its_affinity->header.length);
> > 
> > The original driver does not use pr_fmt properly, it may be worth
> > fixing that up rather than having prefixes, here...
> 
> Irrespective of what the "proper" usage is

The prefixes of the prints in this driver are a bit inconsistent. And
there are a few error messages like the "Failed to allocate PROPBASE"
and "Bad LPI chunk %d\n" without any prefix at all. pr_fmt would be
helpful to clean it up.

> this kind of cleanup doesn't belong in this series.

Right. I think the printed messages in this patch can be improved quite
a bit. currently the tags and spacing are inconsistent, something like:
|  pr_err("SRAT: Invalid header length %d in ITS affinity\n", ...
|  pr_err("SRAT: Invalid NUMA node %d in ITS affinity\n", node);
|  pr_info("SRAT: PXM %d -> ITS %d -> Node %d\n",
would be better in my opinion.

> Feel free to submit a separate patch.

The driver also prints 2 lines per CPU on boot which can get to a few
hundred lines on our test machines. So there are a few things worth
fixing up here... maybe in another kernel dev cycle.

JC.

  reply	other threads:[~2017-06-21 15:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21  6:15 [PATCH v3 0/2] acpi, gicv3-its, numa: Adding numa node mapping for ITS Ganapatrao Kulkarni
2017-06-21  6:15 ` [PATCH v3 1/2] ACPICA: ACPI 6.2: Add support for new SRAT subtable Ganapatrao Kulkarni
2017-06-21  6:15 ` [PATCH v3 2/2] acpi, gicv3-its, numa: Adding numa node mapping for gic-its units Ganapatrao Kulkarni
2017-06-21  7:09   ` Jayachandran C
2017-06-21  8:44     ` Marc Zyngier
2017-06-21 15:25       ` Jayachandran C [this message]
2017-06-21  8:58   ` Marc Zyngier
2017-06-21  9:56     ` Ganapatrao Kulkarni
2017-06-21  9:28   ` Lorenzo Pieralisi
2017-06-21 10:06     ` 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=20170621152509.GA4485@localhost \
    --to=jnair@caviumnetworks.com \
    --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).