Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753167AbdGXI5n (ORCPT ); Mon, 24 Jul 2017 04:57:43 -0400 Received: from mail-by2nam03on0048.outbound.protection.outlook.com ([104.47.42.48]:59392 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751539AbdGXI5f (ORCPT ); Mon, 24 Jul 2017 04:57:35 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jan.Glauber@cavium.com; Date: Mon, 24 Jul 2017 10:57:18 +0200 From: Jan Glauber To: Jonathan Cameron Cc: Mark Rutland , Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v7 1/3] perf: cavium: Support memory controller PMU counters Message-ID: <20170724085718.GA6485@hc> References: <20170719120847.21183-1-jglauber@cavium.com> <20170719120847.21183-2-jglauber@cavium.com> <20170719212722.000017e1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170719212722.000017e1@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [109.193.46.47] X-ClientProxiedBy: VI1P193CA0010.EURP193.PROD.OUTLOOK.COM (10.175.177.148) To SN2PR07MB2590.namprd07.prod.outlook.com (10.167.15.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7bca3c9-addd-4c48-0c00-08d4d27205b2 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:SN2PR07MB2590; X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2590;3:jy2QHYeSHmrPfV8n1hPx9tSwKcfRrI3MGXK2D01l84q9UT+1zGCyzzd1XAohZaAjZwBC9TWX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vfijNiPT0Pj/7un4Sc5NVE7IcoOk+5oir32ugCkcwgRLCKGic1Q4eCRngOX1505F9wR8roR8owkaA6UlJy9c9hfwqrx7ls1L1zffqhYKJoxbA3cMFvmrnMiVbPcniXKrTkNBkQI1bNyViwh7XKKksKVZBZuhtBEyWU9Ms7Pk1S3/9Uzyj4ubZ3JU8ISum+6BSSLO+oRopg8FXPzuDiBLqQ8vor6z8E/ouPY9+5kEXJfasfehrXxuuBSMIKW4jc52pp26YuTMU1Ayo9IuelzTTYrPbUTs9MoAulk3VMepUTmqlJcQ== X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2590;20:8yR9PSjyDQe9AFCsOXDC6aA70ZO8N7nVXk10xqCciVGmJNP59nQO/VcydGXMSmO5JaJtpl/JTDbtVrAg0epwrfXOeV4ggVxwR3+jjyQtBO5e/5I2/9raRZ2ziQ75Bcz7vWBMnrMfMjTTFVGX0JYn/Cc9u1OlLPkGuu1BH0jmq/8IZJma7SNTRk413Uo2B4rTtwhEfMTlCwh/TNIl+zf3+cp1qTYG8GRYMtBeif1DPbjk0YQN5z+kfFld33zh7w1uvBtxc85s3/JN/gVi8gC36TtuKmmldqL7WJ5Ks7ej0vB7n8mOgzX2Psyq5aCBkJ6wdDB5cLZ7lQ91+hGCg7QDBz5Y6x5Fty6esYLeaxN/s/FUWHldvdp7vX93UlP1KT4QEar/YvwYhURBf7jSk/sfFEzXySia7igSQ7xdZZtz3NNCdYIXx8l1I7hn9f2aBDmRjXi028ZPf+M7eBNL+JWvFzir3jI6ZYkJgBto164XK3RnkEcuR9RsyljnTG3/7L7YHLKDl5GqbIQCEn37eIbqnOHc8wYkfB7odEwQt2sWMC9VljzNpf1AkqAtnj5RY4fIKkjXKhdXH9J98zwyHBqxRyRGH68Tvx+V11R4lkf/Eg4= X-Exchange-Antispam-Report-Test: UriScan:(209352067349851)(131327999870524); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(93006095)(100000703101)(100105400095)(3002001)(6041248)(20161123562025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN2PR07MB2590;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN2PR07MB2590; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR07MB2590;4:h2KOPKRX2L7DsxGAMrrKXtGBJWW73Xct/l9jzTOIEZ?= =?us-ascii?Q?98nILWnrtUOoEKy835SKnZnJUAobUQRX3M1/x/iFsy6QGbIwU5SvjH9nXkXk?= =?us-ascii?Q?vNwx54/hqSIJFxrBSB+6fMo+F7q1V9oR1VNmfFPJ0MEjoDGNIeIUHQcXWtlm?= =?us-ascii?Q?FvtzKfqdCKrAYt48i6yAT5RyzJ37to/FQB0sgetbn0ZgpTFjVf1/h35BP0iI?= =?us-ascii?Q?oQ1xD9dm4bPePmNRaVl+0ok5l1sR79SUOqRiwinPIBKRep6WoYQNz7A/gbqE?= =?us-ascii?Q?MMlrHc/c83ePLmupeLT0GwAMLwrkJQN3LL4eQKO5fwJsXhOJx8ODWG8SDDJ9?= =?us-ascii?Q?mI+s/wpu3A1GvckyHpVh0T1d8iGgzJpZgnEYGb5k1b3BK166uxt4+Or4whxk?= =?us-ascii?Q?X37KBj7MBzrj6zIiZU2M6O1xxoH1gGui5wIPdQbqxlqeAnS60wLq5OxwgS5S?= =?us-ascii?Q?Hbmt+uo/QFq2Ta8n9SGNTMsv6uHBaBYXpni3/yqgHYBLuru3jhA/xdzVFtYS?= =?us-ascii?Q?gBcCfcqJ711Zn9fVZmtSGvtnl9NQSIPnzx+336kxwS3qR9YP1bIYn2zoBdca?= =?us-ascii?Q?YQSPhhGS0XaNMkc1r2/VxLh9IstrOZvjE5Or5zYKkEeAzKoOE+ulS6hsjFnX?= =?us-ascii?Q?zEFuFMTCXuy6jeqWzmYuZAEDZMbUpmtmHMwMLmUz41dbFChHqkBVLef/mgjc?= =?us-ascii?Q?WYc1BwRA8ufhhUKxkAAwLUKUfYGcfEuAWEidcrBdTeu+NLaOTlb3M+aKDsuk?= =?us-ascii?Q?bchIuQSexLUuGZZY4b6wGNJpiA/2XxbRrIM8dOJYb2paAr21FogAG9PgIfz5?= =?us-ascii?Q?wmDIHzSQVbuSODilgmE07W/9dflFnrbyqT9Kj4jOjyFs5XwmT+oDY9jyZRK8?= =?us-ascii?Q?ZYKf/7t0iGFWoIZrwDUgccCQClvQgb2T1aF1yxyprH9Xz998831iNqII8sz9?= =?us-ascii?Q?f/BlnkkujgjL8Sg03+4qKKpsqjA2eTkOZ0M4T6hOQUXrRji/uvbFksoSH1o4?= =?us-ascii?Q?+0g+EL99WLQbhRwDw5qEDSUTLnJWwMjDrKXV9CUF9+7BaNNF2EpUmYUzI5Fs?= =?us-ascii?Q?kmHrH58Odt00ql43xlUFAKq/Nd2ve4p5DeDzdZDgQTJOYQl8UR8d17l2FZYz?= =?us-ascii?Q?H01C47G7BtAOXtZtFn0Si84OFRP17EyJhXCDgHa8EZxZxQoy3siyvAlqMZPQ?= =?us-ascii?Q?PFy+URk6hd0hMHmGfNL0/AUhHUMWoZ4gq6?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6009001)(39850400002)(39400400002)(39410400002)(39840400002)(39450400003)(189002)(51914003)(24454002)(199003)(3846002)(1076002)(81156014)(68736007)(8676002)(47776003)(66066001)(9686003)(54906002)(55016002)(25786009)(305945005)(7736002)(50466002)(83506001)(5660300001)(23726003)(6116002)(81166006)(189998001)(97736004)(76176999)(54356999)(42186005)(106356001)(105586002)(53936002)(6496005)(33656002)(2950100002)(4326008)(229853002)(110136004)(6246003)(38730400002)(101416001)(4001350100001)(7350300001)(33716001)(6666003)(6916009)(42882006)(50986999)(2906002)(478600001)(72206003)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR07MB2590;H:hc;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR07MB2590;23:wSM1oES1yzgln8+vwfPmVxAxJjYphJILTDBl6NZ0o?= =?us-ascii?Q?N2hLvJ0nr/EfD5yYwDhGyRDwcp0fSDyTgwUF6T7b7KEWvBEdy0nzdZsIEV/f?= =?us-ascii?Q?EyG0KkiozjfGcCF4/eRqXTP5FChkQelpsAVDX0aZuLGqiS8Dg8spkVFxnixF?= =?us-ascii?Q?3FMyUJxsMrDEGToPPIThIGntCNOf5/DyY5LsqRSNa0zZdKdZPacyxzag72pV?= =?us-ascii?Q?PkxzfFBb7q+f5F2N5dDsqrp1WgPxv65cAKyQ/ENwrodZQAzv+ujj1MJCbBex?= =?us-ascii?Q?nUD1ykAAAgFzS05/7032uYIHih4ccbhf7anEmSQeZwaO5CdA2PDKBpO5Qq3l?= =?us-ascii?Q?wEHvCXIcr/MkFNo6egqyk24rQECwLUoo0vTu7AnFlS/CNS1W0O4BZskA8oaC?= =?us-ascii?Q?RhFip4LOipnSXXMuMaUfLEixTIoJyJ/6c31ilyCIfhdTzsRluSQJq2Tvw965?= =?us-ascii?Q?91/K6Oi5aoRH/dD0kTCpmJLLR+SI2asDKwixsGmv9sm4NJeklLO+nXo16Oqk?= =?us-ascii?Q?3F2E1QeCk+5H89CkUbg2EoOD0/V5LFS8e85hrfZyHv3Zox1blXatY/SNZtIw?= =?us-ascii?Q?oVMKv03T+JmckaxBTP4y/211D3f3puUKHDyPnWvaWsFct5DwsLcu8HGunbAo?= =?us-ascii?Q?aMqvqQhAKzXK2SCm+oRHe0JHG7CRTGtRgG0Du3hbquuEDJK9klZ5nGtJe+zk?= =?us-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dcpDnUxQ5lJhwLvg572KhMIgvkhQb6?= =?us-ascii?Q?I=3D?= X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2590;5:5B4tC8JeBem0N0iu4hLCvpLMKhLqm9OJJr5dLpCn1bDNdpky5p+rR8ADm6VXKaiFoL8ogjrvKj9oVK8C3L6WMboeFhUSobq4CnujBzvL2mqRGb7w03qNfMnrPHwF7DRe/xPKeyxYJAj5gZTRTCgAuYahmuAfFPrx22CVVIvo1nnQ5dmB+cpk+3tdy1PMvXyzrsMv7FmNU0BUGoDGisisbpY/FQy5ShfcdQMCSb3NaIyder+VOl0cVlWJa0w//zRYdQkkeiDB2Fp6UFqBgfPxi4hBys0y3KNRqz9zFwySDYxbxuj3ou+agkFs1gFsBvKSBr5tHdDNvUgiBp90syi+Grf9vEjq/sMN3eGkJ8cb7T9U81KTVzUMbM9i9rkQRwWzarkWIGCmaACmRa+1EAltusp2Hs3h98DUAVK05Vy85d9CAqaG+B8QJF3R/1gqtqZc02nQHDW1J1MFIPdeXbmU0WrHqibm3u0fd3CxoxmwCqPgqNLHeWxRQPmX4mxnIPWR;24:p9pDnsQrFegInJ08orkp/dp4S5eGS9H4yrZ3sEGtTOMyyl9ChwsyrAFjPz3yyywolicQ88bQ2sXAGRYJLXDRxpL2KXCZ6R9CsrpGiB/HVYQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2590;7:TySBRLy+YCn42kPyRAEileVKvLTBctvXpjKwaUiuPt0pRoYxNfmVr3b/x3NCHahx7sKwHBr06fz9wUUG679pvoCs+re1dJkIZ+TrAeEpKOf/u21FbObt2kzhAGxQPpCewwxQgvkI/WB8w2HoDJgUngLl69MuZ1M8aVbH4lqW0eacf+7XUJKhvmf4aPQUn3g7/eVt0W8PghjjDt5OSo8vI5oKN1Z/0Y1X0jwAt/zZNX3veBEW7dWH+ygetngLEuXFKbmMOto/jeSTYWNPOAXGwAGJezllXBF1GD9E/o8XicMyOxi/+g1EopAEK0xCf85pCPHb9X/GalZT86JHHoPqNZN6vxWxjfDkarM3eBExjok/4Y0FzDD7WgPM6s91hQAtB/wYxtKN5fn0LLazZbO1UgIYoMzsmyr0Ce6hQ7kKIvEu3kB2hbpwmVEoKbdUo318m6gkj5FkIdFmvyBdl+H8v1RZTAOBYK8br47Y/P5Rsl+/AKOWkSjKlavHqMrbCssQr2D5HpMoLOfMubxxz9q37b24qP92vRtD1N7uyPt7285vzW9ZKoomWagZjueRn7fEKuKpoSHFLBsP/0K638xydbOaOJStiRBBjoHht7086In/FLk4DWt1S5Kwo7GEmpW2cyjbcGobAAJ2Z/42Sz9t5QcJTx3FojGc5h7m1pP3VgFInR0Qz3C8r/SmJv+UiU19tZrJWAmbYGfGMcWNBUW19i6ElGw7SsU18z+pWOvE/JdewYYUHnRub4Llvgqnm4JVV2A0KK55H5MElCVMQA0K33EXa4zEILCvZ3jExFnDTmU= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 08:57:31.7554 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2590 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8917 Lines: 306 Hi Jonathan, On Wed, Jul 19, 2017 at 09:31:01PM +0800, Jonathan Cameron wrote: > On Wed, 19 Jul 2017 14:08:45 +0200 > Jan Glauber wrote: > > > Add support for the PMU counters on Cavium SOC memory controllers. > > > > This patch also adds generic functions to allow supporting more > > devices with PMU counters. > > > > Properties of the LMC PMU counters: > > - not stoppable > > - fixed purpose > > - read-only > > - one PCI device per memory controller > > > > Signed-off-by: Jan Glauber > Hi Jan, > > A few little things I noticed whilst taking a quick look. > > Jonathan > > --- > > drivers/perf/Kconfig | 8 + > > drivers/perf/Makefile | 1 + > > drivers/perf/cavium_pmu.c | 416 +++++++++++++++++++++++++++++++++++++++++++++ > > include/linux/cpuhotplug.h | 1 + > > 4 files changed, 426 insertions(+) > > create mode 100644 drivers/perf/cavium_pmu.c > > > + > > +/* > > + * The pmu events are independent from CPUs. Provide a cpumask > > + * nevertheless to prevent perf from adding the event per-cpu and just > > + * set the mask to one online CPU. Use the same cpumask for all "uncore" > > + * devices. > > + * > > + * There is a performance penalty for accessing a device from a CPU on > > + * another socket, but we do not care. > > + */ > > +static int cvm_pmu_offline_cpu(unsigned int old_cpu, struct hlist_node *node) > > +{ > > + struct cvm_pmu_dev *pmu_dev; > > + int new_cpu; > > + > > + pmu_dev = hlist_entry_safe(node, struct cvm_pmu_dev, cpuhp_node); > > + if (!cpumask_test_and_clear_cpu(old_cpu, &pmu_dev->active_mask)) > > + return 0; > > + > > + new_cpu = cpumask_any_but(cpu_online_mask, old_cpu); > > + if (new_cpu >= nr_cpu_ids) > > + return 0; > Blank line. OK > > + perf_pmu_migrate_context(&pmu_dev->pmu, old_cpu, new_cpu); > > + cpumask_set_cpu(new_cpu, &pmu_dev->active_mask); > nitpick : blank line here would help readability. OK > > + return 0; > > +} > > + > > +static ssize_t cvm_pmu_attr_show_cpumask(struct device *dev, > > + struct device_attribute *attr, > > + char *buf) > > +{ > > + struct pmu *pmu = dev_get_drvdata(dev); > > + struct cvm_pmu_dev *pmu_dev = container_of(pmu, struct cvm_pmu_dev, pmu); > > + > > + return cpumap_print_to_pagebuf(true, buf, &pmu_dev->active_mask); > > +} > > + > > +static DEVICE_ATTR(cpumask, S_IRUGO, cvm_pmu_attr_show_cpumask, NULL); > > + > > +static struct attribute *cvm_pmu_attrs[] = { > > + &dev_attr_cpumask.attr, > > + NULL, > > +}; > > + > > +static struct attribute_group cvm_pmu_attr_group = { > > + .attrs = cvm_pmu_attrs, > > +}; > > + > > +/* > > + * LMC (memory controller) counters: > > + * - not stoppable, always on, read-only > > + * - one PCI device per memory controller > > + */ > > +#define LMC_CONFIG_OFFSET 0x188 > > +#define LMC_CONFIG_RESET_BIT BIT(17) > > + > > +/* LMC events */ > > +#define LMC_EVENT_IFB_CNT 0x1d0 > > +#define LMC_EVENT_OPS_CNT 0x1d8 > > +#define LMC_EVENT_DCLK_CNT 0x1e0 > > +#define LMC_EVENT_BANK_CONFLICT1 0x360 > > +#define LMC_EVENT_BANK_CONFLICT2 0x368 > > + > > +#define CVM_PMU_LMC_EVENT_ATTR(_name, _id) \ > > + &((struct perf_pmu_events_attr[]) { \ > > + { \ > > + __ATTR(_name, S_IRUGO, cvm_pmu_event_sysfs_show, NULL), \ > > + _id, \ > > + "lmc_event=" __stringify(_id), \ > > + } \ > > + })[0].attr.attr > > + > > +/* map counter numbers to register offsets */ > > +static int lmc_events[] = { > > + LMC_EVENT_IFB_CNT, > > + LMC_EVENT_OPS_CNT, > > + LMC_EVENT_DCLK_CNT, > > + LMC_EVENT_BANK_CONFLICT1, > > + LMC_EVENT_BANK_CONFLICT2, > > +}; > > + > > +static int cvm_pmu_lmc_add(struct perf_event *event, int flags) > > +{ > > + struct hw_perf_event *hwc = &event->hw; > > + > > + return cvm_pmu_add(event, flags, LMC_CONFIG_OFFSET, > > + lmc_events[hwc->config]); > > +} > > + > > +PMU_FORMAT_ATTR(lmc_event, "config:0-2"); > > + > > +static struct attribute *cvm_pmu_lmc_format_attr[] = { > > + &format_attr_lmc_event.attr, > > + NULL, > > +}; > > + > > +static struct attribute_group cvm_pmu_lmc_format_group = { > > + .name = "format", > > + .attrs = cvm_pmu_lmc_format_attr, > > +}; > > + > > +static struct attribute *cvm_pmu_lmc_events_attr[] = { > > + CVM_PMU_LMC_EVENT_ATTR(ifb_cnt, 0), > > + CVM_PMU_LMC_EVENT_ATTR(ops_cnt, 1), > > + CVM_PMU_LMC_EVENT_ATTR(dclk_cnt, 2), > > + CVM_PMU_LMC_EVENT_ATTR(bank_conflict1, 3), > > + CVM_PMU_LMC_EVENT_ATTR(bank_conflict2, 4), > > + NULL, > > +}; > > + > > +static struct attribute_group cvm_pmu_lmc_events_group = { > > + .name = "events", > > + .attrs = cvm_pmu_lmc_events_attr, > > +}; > > + > > +static const struct attribute_group *cvm_pmu_lmc_attr_groups[] = { > > + &cvm_pmu_attr_group, > > + &cvm_pmu_lmc_format_group, > > + &cvm_pmu_lmc_events_group, > > + NULL, > > +}; > > + > > +static bool cvm_pmu_lmc_event_valid(u64 config) > > +{ > > + return (config < ARRAY_SIZE(lmc_events)); > > +} > > + > > +static int cvm_pmu_lmc_probe(struct pci_dev *pdev) > > +{ > > + struct cvm_pmu_dev *next, *lmc; > > + int nr = 0, ret = -ENOMEM; > > + > > + lmc = kzalloc(sizeof(*lmc), GFP_KERNEL); > > + if (!lmc) > > + goto fail_nomem; > cleaner to do a direct return here as nothing to unwind. > return -ENOMEM; OK. > > + > > + lmc->map = ioremap(pci_resource_start(pdev, 0), > > + pci_resource_len(pdev, 0)); > Might be overly paranoid, but ioremap can return NULL, > so should really be checked. > I'll add the check. > > + list_for_each_entry(next, &cvm_pmu_lmcs, entry) > > + nr++; > > + lmc->pmu_name = kasprintf(GFP_KERNEL, "lmc%d", nr); > Check for error on the allocation. OK, missed that. > > + > > + lmc->pdev = pdev; > > + lmc->num_counters = ARRAY_SIZE(lmc_events); > > + lmc->pmu = (struct pmu) { > > + .task_ctx_nr = perf_invalid_context, > > + .event_init = cvm_pmu_event_init, > > + .add = cvm_pmu_lmc_add, > > + .del = cvm_pmu_del, > > + .start = cvm_pmu_start, > > + .stop = cvm_pmu_stop, > > + .read = cvm_pmu_read, > > + .attr_groups = cvm_pmu_lmc_attr_groups, > > + }; > > + > > + cpuhp_state_add_instance_nocalls(CPUHP_AP_PERF_ARM_CVM_ONLINE, > > + &lmc->cpuhp_node); > This function can fail by the look of it. Should be checking it's > return value really. > I'm ignoring the return value on purpose as I don't want probe() to fail even if this would return an error. > > + > > + /* > > + * perf PMU is CPU dependent so pick a random CPU and migrate away > > + * if it goes offline. > > + */ > > + cpumask_set_cpu(smp_processor_id(), &lmc->active_mask); > > + > > + ret = perf_pmu_register(&lmc->pmu, lmc->pmu_name, -1); > > + if (ret) > > + goto fail_hp; > > + > > + list_add(&lmc->entry, &cvm_pmu_lmcs); > > + > > + lmc->event_valid = cvm_pmu_lmc_event_valid; > These last two elements rather look like they might cause a > potential race as the perf_pmu_register has made the counters > available. Yes, they should happen before perf_pmu_register. > > + dev_info(&pdev->dev, "Enabled %s PMU with %d counters\n", > > + lmc->pmu_name, lmc->num_counters); > > + return 0; > > + > > +fail_hp: > > + kfree(lmc->pmu_name); > Convention is to unwind in the opposite order to the way things > were created / set up. Becomes more relevant once you are > checking more error codes. Agreed. > > + cpuhp_state_remove_instance(CPUHP_AP_PERF_ARM_CVM_ONLINE, > > + &lmc->cpuhp_node); > > + iounmap(lmc->map); > > + kfree(lmc); > > +fail_nomem: > > + return ret; > > +} > > + > > +static int __init cvm_pmu_init(void) > > +{ > > + unsigned long implementor = read_cpuid_implementor(); > > + unsigned int vendor_id = PCI_VENDOR_ID_CAVIUM; > > + struct pci_dev *pdev = NULL; > > + int rc; > > + > > + if (implementor != ARM_CPU_IMP_CAVIUM) > > + return -ENODEV; > > + > > + INIT_LIST_HEAD(&cvm_pmu_lmcs); > > + > > + rc = cpuhp_setup_state_multi(CPUHP_AP_PERF_ARM_CVM_ONLINE, > > + "perf/arm/cvm:online", NULL, > > + cvm_pmu_offline_cpu); > > + > > + /* detect LMC devices */ > > + while ((pdev = pci_get_device(vendor_id, 0xa022, pdev))) { > > + if (!pdev) > > + break; > > + rc = cvm_pmu_lmc_probe(pdev); > > + if (rc) > > + return rc; > > + } > > + return 0; > > +} > A comment perhaps explaining why this is a late_initcall? What > dependency are we forcing to be true? PCI probing should be finished before, I'll add a comment. thanks for the review, Jan > > +late_initcall(cvm_pmu_init); > > diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h > > index b56573b..78ac3d2 100644 > > --- a/include/linux/cpuhotplug.h > > +++ b/include/linux/cpuhotplug.h > > @@ -141,6 +141,7 @@ enum cpuhp_state { > > CPUHP_AP_PERF_ARM_QCOM_L3_ONLINE, > > CPUHP_AP_WORKQUEUE_ONLINE, > > CPUHP_AP_RCUTREE_ONLINE, > > + CPUHP_AP_PERF_ARM_CVM_ONLINE, > > CPUHP_AP_ONLINE_DYN, > > CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30, > > CPUHP_AP_X86_HPET_ONLINE, >