From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 855C5C4332F for ; Mon, 7 Nov 2022 19:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=H7LVL0coL17ZfWwBH7BqRo26VIb2sFRjBLn2EOzsgWU=; b=YqeKSFoQd8Rqt8 zifIMNVIhTQx+GyRwkaiicH4Y1868FNshdU8L9PoTyUK758qnjOeZfBdcjZIYxVwLtC2s/3pvzeo9 6f3byddKCOSJggmG+IY8pBMs+sC3bojGF5+v/u1MUZzRwK5RlZjlh/KNxywMfnmFv0l4s/Shyg+6O vRSFi56bk9I3ZDlJo/+TtziOVq2mgG7gQZyZyc8JuG3GiEsiq0r1wP7Kf2oz0+wfaVCFUhreqTuyw cwxhOSx6btcWYAe9pYAkzfhdHf4gKEZk3NXpMWuRCYrQtxws1TpVM69XsARxLst6NGPi34GH8zo9+ thywkC819zQ/xQq546LQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1os7Xj-00HUUU-4m; Mon, 07 Nov 2022 19:12:23 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1os7W7-00HTEb-3W for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 19:10:44 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6DC576120A; Mon, 7 Nov 2022 19:10:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52CA7C433D7; Mon, 7 Nov 2022 19:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667848241; bh=sx18lClMexihvXvYPtPJeHIqpLhp8A2J1jWg0z5jVbg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gOyZI/DzlYTrvJq8IyKW9aN21QPXmyCHVsV2ItjZ8Y5xhYoHVWt3TMlgK/vHAK37e jrd8qrAhs6/GrH8dw1DX7ur8DuM5BFmgUFeedrmtnZBG+5FPTWQ7kDWKgdsQ8RyRMy rA/T5EwTx+FdSQ0QGkfqKLEUKIza3WMWgtQpn9mlGgLRV2yuySROYr3ves3RGkxcDO b9cWfG4MakMGjLDqxE6fZpFWSe6uR/Aa/L5mT97Y5Pw40wxyI9rZQ/9cig+Cp/yDnk T9lBTESD+FDxVvTfvapnBLFQftoiMU88yaTAxATJVMQ0h6T+UEcbwfQ820V8+VWcKW t8G8hrz97jTfA== Date: Mon, 7 Nov 2022 19:10:35 +0000 From: Will Deacon To: Besar Wicaksono 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 Message-ID: <20221107191034.GB21991@willie-the-truck> References: <20220929002834.32664-1-bwicaksono@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220929002834.32664-1-bwicaksono@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221107_111043_254901_F33AC8F2 X-CRM114-Status: GOOD ( 21.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > +#include > +#include > +#include > +#include > + > +#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