Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751582AbdHaLiY (ORCPT ); Thu, 31 Aug 2017 07:38:24 -0400 Received: from mail-sn1nam01on0057.outbound.protection.outlook.com ([104.47.32.57]:64784 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750972AbdHaLiV (ORCPT ); Thu, 31 Aug 2017 07:38:21 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jan.Glauber@cavium.com; Date: Thu, 31 Aug 2017 13:38:03 +0200 From: Jan Glauber To: Mark Rutland , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Suzuki K Poulose , Borislav Petkov , David Daney Subject: Re: [RFC PATCH v9 0/7] Cavium ARM64 uncore PMU support Message-ID: <20170831113803.GF15906@hc> References: <20170829131238.4988-1-jglauber@cavium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170829131238.4988-1-jglauber@cavium.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [88.67.130.225] X-ClientProxiedBy: HE1PR09CA0068.eurprd09.prod.outlook.com (10.174.50.140) To CO2PR07MB2582.namprd07.prod.outlook.com (10.166.201.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c37cca5f-85b4-4834-2fb9-08d4f064c6b7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CO2PR07MB2582; X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB2582;3:Mxu9DPb0I190XNEL7stZ8JsIy12fwAFdmzBqeCvH9CH0go1EycuwaG1bvgX+mcoRmdQubjIcACm0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GlNVlp7AIbRh5WBoLoUsARcHL1RLSxHzTrcOUiRiWCpGqxD6Y4liE6EjgGNpranpJaas2i6Sk0jDN9V0i7BX8S3yCMtydIk3SHiwW5Pk2TauHNMyyjtx1h9G5FVu2uihnWtYidSdFKqoXSVaTEfJD3wPVGElze1II89xte7ELN+t+0QEPEQe+xrDZev8YMh72E2I5QxZZoStV6V8shsZzGJ+KoUh/3LXQ3zhgszkGz7XfDTk+wlDzNrtV3EuHGQKykWexQZSJJrgSHcqGkGEeDbXsPfdIaJACK3xQ4317TbwAKGaCZIfrvJG8F486yt4+qd2lVQ79Xrk3RNh6oEqpmUv2qVtbP0Y7ly6zfbIu6ALKnXE0A=;4:RboAKtoREXkmrdi838nuyPMZcC4loK5oWqcN2z3fcj2vKNxkSOUXhRY6fqdCohI02eXXXm90zfITBdV1FJWrK/DZADg+Hd+8Kf1xd/b83Mm9KnTpWPsVXHlwkRAL37i5WTo1ZQpBzepUh+pyHU6JlR+6rPwNm1cZ94wkQc8ag+hkZpOGVqvwN2lcIhYmOUZfyGeHUdRByBjSkHRB97sO65TdFMs0cdwXPqjm/hVfCz82KGunqAM5ZXLmpdM9u4XR X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CO2PR07MB2582;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CO2PR07MB2582; X-Forefront-PRVS: 04163EF38A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(189002)(24454002)(199003)(7736002)(305945005)(6496005)(2950100002)(5660300001)(83506001)(8936002)(81156014)(81166006)(229853002)(3846002)(42882006)(1076002)(4001350100001)(6116002)(66066001)(23726003)(47776003)(33656002)(97736004)(50986999)(72206003)(105586002)(189998001)(9686003)(33716001)(106356001)(6306002)(25786009)(2906002)(76176999)(54356999)(4326008)(53936002)(101416001)(50466002)(966005)(6246003)(8676002)(68736007)(107886003)(42186005)(6666003)(54906002)(55016002)(478600001)(18370500001)(217873001)(6606295002);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR07MB2582;H:hc;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CO2PR07MB2582;23:8bvnncnYPJSZJWVyQxDMJhDGwqd2R9HqPNSk2jvMi?= =?us-ascii?Q?W5nWxLo2bCEWMcLiNb9+iQfNXhTBlbf2GQOqfkBYHLpcBI5gFuv/EiUIQY2H?= =?us-ascii?Q?Ia5Gvgz8+YTpc9cYjwYPimnuNxfkZgwAGLHINe0vxh6HckKpl/pI3b/M/jQW?= =?us-ascii?Q?jRwX1ER6Yf+HLAwanq+2KCQwusgmXJr3XlHb8lIEzD9NT6rC7O2S8M+5W/tu?= =?us-ascii?Q?0mt9lMEfzaRxGXzZE+xQZVLep8bQQkNX7LZtE/hOLkr2s62/c68fCOtIan1Z?= =?us-ascii?Q?pfOWBFfNwIFmw1VDDa+5Z2oaoCOeQ3XUCrCS+osrgu5Sv8aNEkuzjlj+SRw1?= =?us-ascii?Q?vbvsbgXsJJCIJ75xXdW7KOXmN9P1gddjIEQgN2i7tPH9XMs7RqlQdW3+/XIK?= =?us-ascii?Q?5jqcFBKG6550ExsNUi4hbBUPBudqtNPL6bDpwk0In4klXUvL0Zqy+dgyn3VH?= =?us-ascii?Q?n77uYtbhkRrRiHhYP34bR3s+6jWMPUwLS8LD8cyx1enq/iEZz7kZgT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0abEZBq4FGDqmQIgLsCAxAFnQkyQGzF7EpEJxEUIirFh9rEBsW/CB2KipaSeXeYW6YTk17Ae4ZWjZ6C6fJCvOin6MiUGXTfCtbaZXmOPSpmbgvHgNYhn6XXS00aPzMyl2cyRRM9tP156t57weE5JqkpcOvDGDhMLj8p8WY7VVFdpM0XQq5irdRIillLG5pNnmpols3sD+PtJLcd5ObXNgOIXUYZqdvdr+XxQA8GmiZig==;5:XRml4Ro8XnPehofL86EBXzDmm8LC03o9mpjBo7tiNWlV7C5IV8QVltM5zGuuqcAxSR0FEhdShT4PAjJH83Q8t4wYwpbV8HO2lU7DqfhBULhYTe8PfIvO0yLOysaZN6GQ8EM/qvd1gl5WdFKCJy5Rtw==;24:W1/xsPEc9s5L+5JXer5+tlINZc4EIIE3LXOyizN3wBbbx/E9UTHwHEYW6dVB/3pyeJFVMR85l4TJ4tUzWYvu6I/xYlXgjTrJF2g8MgRY/Vk=;7:mI3SViLFm6rBb2FXL5LgsVxUx9eOu/vGG7R9s2Hh2Mc9mlxGspEvLLQxNxr/FKz3FM7+ze1TwYMV3U45eJwlWTSk+15/YArfwRMyA/G9JVSFFDnksKwKJK05B8pHemDEPh1KoNz08x6b8kIJlV/gjqCXhyzf0Is1CRDnKGBvYGJgAJ/A5rDJ0xK7T79gr1e6XWc6uzvBa8crMX7yf5Y2LkhVl/IzSU++3OkxRPn2SHM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 11:38:16.3778 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2582 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2878 Lines: 69 So what about the general idea with the wrapper, does this look sane? Any objections to that? thanks, Jan On Tue, Aug 29, 2017 at 03:12:31PM +0200, Jan Glauber wrote: > I'm posting this as RFC following this discussion: > https://marc.info/?l=linux-arm-kernel&m=150099526923838&w=2 > > I've implemented the wrapper for the PCI devices and put it under > drivers/soc/cavium which I found more appropriate than drivers/misc. > > I was not able to find a way to build the EDAC driver and the PMU driver > with all combinations (builtin and module) so I limited the build options > to module only. The problem is that the select from EDAC or PMU > sets the wrappers build type to whatever EDAC or PMU choose. > But all parts must be either built-in or modules, having the wrapper > builtin and calling into module code will not work. If there is a better > solution please let me know. > > The PMU code is the same as in v8. > > Add support for various PMU counters found on the Cavium ThunderX and > OcteonTx SoC. > > The PMU driver provides common "uncore" functions to avoid code duplication > and support adding more device PMUs (like L2 cache) in the future. > > Changes to v8: > - Wrapper for PCI devices > > Jan Glauber (7): > edac: thunderx: Remove suspend/resume support > edac,soc: thunderx: Add wrapper for EDAC LMC PCI device > edac,soc: thunderx: Add wrapper for EDAC OCX PCI device > perf: export perf_event_update_userpage() > perf: cavium: Support memory controller PMU counters > perf: cavium: Support transmit-link PMU counters > perf: cavium: Add Documentation > > Documentation/perf/cavium-pmu.txt | 75 +++++ > drivers/edac/Kconfig | 3 + > drivers/edac/thunderx_edac.c | 92 +----- > drivers/perf/Kconfig | 15 + > drivers/perf/Makefile | 1 + > drivers/perf/cavium_pmu.c | 680 ++++++++++++++++++++++++++++++++++++++ > drivers/soc/Kconfig | 1 + > drivers/soc/Makefile | 1 + > drivers/soc/cavium/Kconfig | 14 + > drivers/soc/cavium/Makefile | 2 + > drivers/soc/cavium/cavium_lmc.c | 53 +++ > drivers/soc/cavium/cavium_ocx.c | 49 +++ > include/linux/cpuhotplug.h | 1 + > include/linux/soc/cavium/lmc.h | 12 + > include/linux/soc/cavium/ocx.h | 12 + > kernel/events/core.c | 1 + > 16 files changed, 933 insertions(+), 79 deletions(-) > create mode 100644 Documentation/perf/cavium-pmu.txt > create mode 100644 drivers/perf/cavium_pmu.c > create mode 100644 drivers/soc/cavium/Kconfig > create mode 100644 drivers/soc/cavium/Makefile > create mode 100644 drivers/soc/cavium/cavium_lmc.c > create mode 100644 drivers/soc/cavium/cavium_ocx.c > create mode 100644 include/linux/soc/cavium/lmc.h > create mode 100644 include/linux/soc/cavium/ocx.h > > -- > 2.9.0.rc0.21.g7777322