Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp618347ybl; Tue, 28 Jan 2020 08:58:25 -0800 (PST) X-Google-Smtp-Source: APXvYqyNBRoF3tqpHMxYPsF2LIBsjteJFGMxPNdIm/0Uva0TC4r7V30RWa1FnDVqJZ0txyWoaXiF X-Received: by 2002:a9d:7757:: with SMTP id t23mr17681608otl.315.1580230704953; Tue, 28 Jan 2020 08:58:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580230704; cv=none; d=google.com; s=arc-20160816; b=qBiabWCVDes86isN/o7c+klnm/oAxSz8g2bwg54lpysyrBpzuQdMRV6xquU4wxr9BI w4PH01+SB17Oal89G7OKwmPgD6SexxdovxQk6h3TnvhoMCIF4U/y2hA8xwZuM2r0vmLL Kg2nt+QH6ravmdt8aQgw8/o5BYdBhyNkdoo9U/DJB11QTAsb9hYvPgEocOzf59TfL+R/ lVKYf7tEgen/swvUvi8UIlyL0LcOjHVHXvpJeIP/8aeRa5VTJxRq0Gz2VKFN7106sg4p buZqdrxBVwBdqzFATurnAePVzjrfA0aXu32Wgkrgtq++08Y/AxOjP5DVwf9IY+5pB0Jf MTIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=a/L7u1NBYwkEzgAAj31t3VAfzctS3tgZTY0v5VvLcgc=; b=aCj1i1BXFfdmWlbixSTr7O+fnlcyVK3ZXtfJKDg6oOOpSh14IrK50vxy9WFRekwoBQ 44EK7aeJN7tEODYRJ/6qA5puYtHrlqO8gBefb06aL1gFXQtZ3CiFtI9rv7sdlMtXRWmr JjSENYdCctgepAD77c/6Rq4JIt5ohA96x0FHObZG9K2JFqOPuffAXCvIbTLzgz2KrZ4t qKyfWD15qVpLzNzXp6Id7E1UrGdGXvh+OevDHwFv61f19hWQWh9/soYNv8fo8R1Vr69G /0MT3DCB4QUIql55EsLAG3lb8hGprVcwCfQspB8N5UvHkuYSyKF1UyeoXlselF0ZDSVs ZCYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si3322025oti.155.2020.01.28.08.58.13; Tue, 28 Jan 2020 08:58:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726705AbgA1Q4W (ORCPT + 99 others); Tue, 28 Jan 2020 11:56:22 -0500 Received: from foss.arm.com ([217.140.110.172]:60626 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbgA1Q4W (ORCPT ); Tue, 28 Jan 2020 11:56:22 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 29B78328; Tue, 28 Jan 2020 08:56:21 -0800 (PST) Received: from [192.168.122.167] (unknown [10.118.28.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B3DBC3F52E; Tue, 28 Jan 2020 08:56:20 -0800 (PST) Subject: Re: [PATCH RFC 0/2] Add basic generic ACPI soc driver To: John Garry , rjw@rjwysocki.net, lenb@kernel.org Cc: arnd@arndb.de, olof@lixom.net, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, guohanjun@huawei.com, gregkh@linuxfoundation.org References: <1580210059-199540-1-git-send-email-john.garry@huawei.com> From: Jeremy Linton Message-ID: Date: Tue, 28 Jan 2020 10:56:18 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <1580210059-199540-1-git-send-email-john.garry@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 1/28/20 5:14 AM, John Garry wrote: > A requirement has come up recently to be able to read system SoC packages > identifiers from userspace [0]. > > For device tree FW-based systems, this would be quite straightforward, in > that we could add a soc driver for that system and use the DT model > identifier as the soc id - that's how most soc drivers seem to do it. > > For ACPI-based systems, the only place I know to get (put) such SoC > information is in the PPTT, specifically the ID Type Structure for a > processor package node. A processor package node describes a physical > boundary of a processor topology. Well presumably that is one of the use cases for DMI, which has fields for the processor/socket as well as the machine vendor. But, quickly looking at the use case, I can't help but think you don't really want any of the above, or the PPTT id. It seems the mapping should actually be tied directly to the uncore PMU definition, rather than a soc/machine/whatever identifier. Which would imply keying off one of the ACPI object identifiers for the PMU itself. > > The ACPI spec does not declare how the fields in this structure must be > used, however it does provide pretty clear examples, which I would expect > most implementers to follow. As such, I try to solve the problem in 2 > parts: > - Add ACPI PPTT API to get opaque package structure > - Add basic ACPI generic soc driver, which can interpret the fields > for known platforms to fill in the ID Type Structure as per example > in the spec. > > So I'm hoping here for some comments on this approach - hence the RFC. > I've cc'ed some folks which may have suggestions. > > [0] https://lore.kernel.org/linux-arm-kernel/1579876505-113251-6-git-send-email-john.garry@huawei.com/ , > https://lore.kernel.org/linux-arm-kernel/1579876505-113251-1-git-send-email-john.garry@huawei.com/ > > John Garry (2): > ACPI/PPTT: Add acpi_pptt_get_package_info() API > soc: Add a basic ACPI generic driver > > drivers/acpi/pptt.c | 81 +++++++++++++++++++++++++++++ > drivers/soc/Makefile | 1 + > drivers/soc/acpi_generic.c | 102 +++++++++++++++++++++++++++++++++++++ > include/linux/acpi.h | 13 +++++ > 4 files changed, 197 insertions(+) > create mode 100644 drivers/soc/acpi_generic.c >