From: Will Deacon <will@kernel.org>
To: Besar Wicaksono <bwicaksono@nvidia.com>
Cc: rafael@kernel.org, lenb@kernel.org, catalin.marinas@arm.com,
lorenzo.pieralisi@arm.com, guohanjun@huawei.com,
sudeep.holla@arm.com, linux-tegra@vger.kernel.org,
treding@nvidia.com, jonathanh@nvidia.com, vsethi@nvidia.com,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] ACPI: ARM Performance Monitoring Unit Table (APMT) initial support
Date: Mon, 7 Nov 2022 19:10:35 +0000 [thread overview]
Message-ID: <20221107191034.GB21991@willie-the-truck> (raw)
In-Reply-To: <20220929002834.32664-1-bwicaksono@nvidia.com>
On Wed, Sep 28, 2022 at 07:28:34PM -0500, Besar Wicaksono wrote:
> diff --git a/drivers/acpi/arm64/apmt.c b/drivers/acpi/arm64/apmt.c
> new file mode 100644
> index 000000000000..f55167ca51e7
> --- /dev/null
> +++ b/drivers/acpi/arm64/apmt.c
> @@ -0,0 +1,177 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * ARM APMT table support.
> + * Design document number: ARM DEN0117.
> + *
> + * Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES.
> + *
> + */
> +
> +#define pr_fmt(fmt) "ACPI: APMT: " fmt
> +
> +#include <linux/acpi.h>
> +#include <linux/acpi_apmt.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>
> +
> +#define DEV_NAME "arm-cs-arch-pmu"
> +
> +/* There can be up to 3 resources: page 0 and 1 address, and interrupt. */
> +#define DEV_MAX_RESOURCE_COUNT 3
> +
> +/* Root pointer to the mapped APMT table */
> +static struct acpi_table_header *apmt_table;
> +
> +static int __init apmt_init_resources(struct resource *res,
> + struct acpi_apmt_node *node)
> +{
> + int irq, trigger;
> + int num_res = 0;
> +
> + res[num_res].start = node->base_address0;
> + res[num_res].end = node->base_address0 + SZ_4K - 1;
> + res[num_res].flags = IORESOURCE_MEM;
> +
> + num_res++;
> +
> + res[num_res].start = node->base_address1;
> + res[num_res].end = node->base_address1 + SZ_4K - 1;
> + res[num_res].flags = IORESOURCE_MEM;
> +
> + num_res++;
> +
> + if (node->ovflw_irq != 0) {
> + trigger = (node->ovflw_irq_flags & ACPI_APMT_OVFLW_IRQ_FLAGS_MODE);
> + trigger = (trigger == ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_LEVEL) ?
> + ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE;
> + irq = acpi_register_gsi(NULL, node->ovflw_irq, trigger,
> + ACPI_ACTIVE_HIGH);
> +
> + if (irq <= 0) {
> + pr_warn("APMT could not register gsi hwirq %d\n", irq);
> + return num_res;
> + }
> +
> + res[num_res].start = irq;
> + res[num_res].end = irq;
> + res[num_res].flags = IORESOURCE_IRQ;
> +
> + num_res++;
> + }
> +
> + return num_res;
> +}
> +
> +/**
> + * apmt_add_platform_device() - Allocate a platform device for APMT node
> + * @node: Pointer to device ACPI APMT node
> + *
> + * Returns: 0 on success, <0 failure
> + */
> +static int __init apmt_add_platform_device(struct acpi_apmt_node *node,
> + struct fwnode_handle *fwnode)
I queued this already, but my testing kicked up a nit that 'fwnode' is not
described in the kerneldoc. Please can you send a follow-up fix for that,
based on for-next/acpi? The indentation is also pretty weird with extra
parameter.
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-11-07 19:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 0:28 [PATCH v2] ACPI: ARM Performance Monitoring Unit Table (APMT) initial support Besar Wicaksono
2022-09-30 17:46 ` Rafael J. Wysocki
2022-10-07 16:49 ` Besar Wicaksono
2022-10-14 10:55 ` Sudeep Holla
2022-10-14 10:59 ` Sudeep Holla
2022-10-14 14:15 ` Lorenzo Pieralisi
2022-10-14 14:17 ` Lorenzo Pieralisi
2022-11-02 9:31 ` Lorenzo Pieralisi
2022-11-07 19:08 ` Will Deacon
2022-11-07 19:10 ` Will Deacon [this message]
2022-11-11 23:54 ` Besar Wicaksono
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=20221107191034.GB21991@willie-the-truck \
--to=will@kernel.org \
--cc=bwicaksono@nvidia.com \
--cc=catalin.marinas@arm.com \
--cc=guohanjun@huawei.com \
--cc=jonathanh@nvidia.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=rafael@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=treding@nvidia.com \
--cc=vsethi@nvidia.com \
/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).