Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2334031rwb; Mon, 7 Nov 2022 12:02:39 -0800 (PST) X-Google-Smtp-Source: AMsMyM5245XsolaQpB0hqxdiL4s2eSQ0us/FbEqcl5EWPBi3zdKCnipmA3IQv7zSnEnZmQI76mVo X-Received: by 2002:a17:907:3e01:b0:730:a690:a211 with SMTP id hp1-20020a1709073e0100b00730a690a211mr49276127ejc.596.1667851359735; Mon, 07 Nov 2022 12:02:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667851359; cv=none; d=google.com; s=arc-20160816; b=HdfIl5+bzGQdyS81+KYcP+dwj/spT8DfQc1m6uNgZX9IJomAney+ez63re3Xn1iUQc 9Uhh7fn8pEvaMaZsy5GRM/D0eWry/AnP6h9x39tkOOxR1rPXg+quekNlRL6ZFgn00GPv BNEx2XsY8AOXobNl3DVqCxh+aoWgzIAhMdwbcO+b9IQI1kVvsPOH+cK17bfO5vIN5lU+ jrryaEptz+6s9Xx5ifkTryw/DnMvn6mJ1yq+aSeJ9vbTObzNl/ExA+cxzf8onX062Pif UVMEYOigG/6IW8+Kxdw4mZnuMB9d+PhZwaReEK6vutf4YNa9MPADA0ie3j0wqs40cykN swrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=YzXgFOC7qw1rvpC+QP9JI1UL22LsRZhIi/U75S3SH7k=; b=ijf6bf/Q9zPjI9Gq1wCEyeN9e+RUdN6TOPs4rNnObTkZvyaHg6GkJsD6Q7pNP4qUkY LEjw6P+0HisaiLGpEYGozJrDAFfW8/uszw4WnRi3bI3aOUNUrp0WJL7J+NX4395r6Pmr af8Cfi/MOjhGM11ykY8FBIc77XTonLmhkRgkr6pbHypn2dkUyr6bYc/sAFIa2oByAfxX iUB9YTlqdSaIcvzGbM8d1tFFHiGBy5UKufyWGULyrLc2gi5As+KPbh1k0SFG43KNGgQ0 hFnifeMzPba7AwEnPv4NXmTvsbpmQ62Os1mAfNH+YRoFTOTrO6JZXhuaF0bJEgxjYXmE FUpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gOyZI/Dz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw9-20020a170907a0c900b0078df24be362si10080302ejc.496.2022.11.07.12.02.16; Mon, 07 Nov 2022 12:02:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gOyZI/Dz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232180AbiKGTLI (ORCPT + 93 others); Mon, 7 Nov 2022 14:11:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232483AbiKGTKp (ORCPT ); Mon, 7 Nov 2022 14:10:45 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ABF914D25; Mon, 7 Nov 2022 11:10:44 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 2F58DB81670; Mon, 7 Nov 2022 19:10:43 +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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220929002834.32664-1-bwicaksono@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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