Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp734626ybl; Tue, 28 Jan 2020 11:05:40 -0800 (PST) X-Google-Smtp-Source: APXvYqxzt5M03rurtdY85A+2z/V8+yCeKkG7CyjaDu/SVI5W7C/R35Dfktv3cmMUKU3HVSC+mADY X-Received: by 2002:a05:6830:124b:: with SMTP id s11mr17073816otp.333.1580238340528; Tue, 28 Jan 2020 11:05:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580238340; cv=none; d=google.com; s=arc-20160816; b=qE2Sq0JGVSHRZIrTYit+nUfKuZIAdjMoRyDQZR9L6ezDrJwXAUDppnTh9+hb978QfI V/XlNjUO+FBIi0ikWX4pp184+XRERi3oKdAb7Yum8GraBVOCCZbhYJ7dkM3+6g+7CWLf uCgiEMmWP7TTMdgUWKi6KNxDIKl3KdRM8ih5mKnNK0+nbyB+JHXxn/BCb7xTD6SrNCSg XK8gYXGQUc5B0FZENX5dD172DfBHdG+xPWzCj/WhCwFWx9l1RKzMd13+IqN//6T3PIfb Wv1oPQuQwViMgYGIdoCg4HgXeCTA3GnNlaL5dN9/A3GrcaFiIZJmz2egrGy1KBIRk1fn R7QQ== 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=kp/YASAdeqzBi3QHuSWMl9Me6qAT4a9b2dQXQ1wYQBA=; b=dzYqfEBuUSrBEwzCNpvAQJ46w1x6Ikq4UHfBtKjyzmkzcqRgDrf//z5NKBzDJ0QPSI Oi8UOhYZTglfBXrWa7ZCWu8SznZOneKSj3+ozsUA+cerfuDAEeg51CWKE7sBCNxEttpH AD/ljXgORBvTBMgZSr8IKtvfiLleZa01oyUT9RsAcVqkSPoY9n9ZsFFh7Qs33dq4qLpb iCU/xBlqFgQ+XrRgSGJYGeICBw0OCMM9rHq2egzgDwwV452he4XMBT7tCD43QcqB+8r9 eC6jSHpmrQFiSxf7V+qQnUq7Qe4zsfcw+rLKQS4VdgC5YGlZRreE5Hg3ASeedgGMpkoC D8eA== 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 i12si5446246oik.171.2020.01.28.11.05.28; Tue, 28 Jan 2020 11:05:40 -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 S1726504AbgA1TER (ORCPT + 99 others); Tue, 28 Jan 2020 14:04:17 -0500 Received: from foss.arm.com ([217.140.110.172]:33906 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726320AbgA1TEQ (ORCPT ); Tue, 28 Jan 2020 14:04:16 -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 2CBA6328; Tue, 28 Jan 2020 11:04:16 -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 E15503F52E; Tue, 28 Jan 2020 11:04:15 -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> <5ab3a97d-bbc4-6d5a-fd06-f8da324339ab@huawei.com> From: Jeremy Linton Message-ID: <6be8d175-477d-d163-3fe0-3ab562874ce4@arm.com> Date: Tue, 28 Jan 2020 13:04:15 -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: <5ab3a97d-bbc4-6d5a-fd06-f8da324339ab@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 11:28 AM, John Garry wrote: > On 28/01/2020 16:56, Jeremy Linton wrote: >> Hi, >> > > Hi Jeremy, > >> 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. > > I did consider DMI, but I want something more generic, i.e. could cover > embedded/DT systems also. > > And I need to double check if DMI really has the info I require. Last > time I checked, it didn't for my dev board, but I know that some fields > are simply not filled in. Well the info is probably there, but that doesn't mean it should be used programmatically. As your board shows, its not that reliable. And looking at the linked patch I see you mention that. > >> >> 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. > > So a PMU device (/sys/bus/event_source/devices) does not have a link to > the ACPI object identifiers or uncore PMU platform device etc. > > And even if it did, there is no clear link between that ACPI object and > the events it supports for that implementation. Having a direct link isn't ideal either. It seems you do mention the pmu naming conventions, which can be controlled based on ACPI object identifiers. Something like "uncore_dmc_hsi1" where the appended bits could for example vary on _CID+_UID or DT name. Not sure that is a particularly good suggestion either, but I do think its a better idea to tie the mapping to the pmu type/man/version concept than the SOC it appears in. The sysfs-bus-event_source-devices-* ABI docs are noticeably silent on the format of the pmu name (is that somewhere else?).