From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1D3BC32788 for ; Thu, 11 Oct 2018 11:25:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 49E2120835 for ; Thu, 11 Oct 2018 11:25:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49E2120835 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727421AbeJKSwj (ORCPT ); Thu, 11 Oct 2018 14:52:39 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36088 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbeJKSwj (ORCPT ); Thu, 11 Oct 2018 14:52:39 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 206117A9; Thu, 11 Oct 2018 04:25:51 -0700 (PDT) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DCEF83F5BC; Thu, 11 Oct 2018 04:25:48 -0700 (PDT) Subject: Re: [PATCH v3 2/3] perf: add arm64 smmuv3 pmu driver To: Shameer Kolothum , lorenzo.pieralisi@arm.com Cc: will.deacon@arm.com, mark.rutland@arm.com, guohanjun@huawei.com, john.garry@huawei.com, pabba@codeaurora.org, vkilari@codeaurora.org, rruigrok@codeaurora.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxarm@huawei.com, neil.m.leeder@gmail.com References: <20180921150803.25444-1-shameerali.kolothum.thodi@huawei.com> <20180921150803.25444-3-shameerali.kolothum.thodi@huawei.com> From: Robin Murphy Message-ID: Date: Thu, 11 Oct 2018 12:25:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180921150803.25444-3-shameerali.kolothum.thodi@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shameer, One more thing... On 21/09/18 16:08, Shameer Kolothum wrote: [...] > +static int smmu_pmu_probe(struct platform_device *pdev) > +{ > + struct smmu_pmu *smmu_pmu; > + struct resource *res_0, *res_1; > + u32 cfgr, reg_size; > + u64 ceid_64[2]; > + int irq, err; > + char *name; > + struct device *dev = &pdev->dev; > + > + smmu_pmu = devm_kzalloc(dev, sizeof(*smmu_pmu), GFP_KERNEL); > + if (!smmu_pmu) > + return -ENOMEM; > + > + smmu_pmu->dev = dev; > + > + platform_set_drvdata(pdev, smmu_pmu); > + smmu_pmu->pmu = (struct pmu) { > + .task_ctx_nr = perf_invalid_context, > + .pmu_enable = smmu_pmu_enable, > + .pmu_disable = smmu_pmu_disable, > + .event_init = smmu_pmu_event_init, > + .add = smmu_pmu_event_add, > + .del = smmu_pmu_event_del, > + .start = smmu_pmu_event_start, > + .stop = smmu_pmu_event_stop, > + .read = smmu_pmu_event_read, > + .attr_groups = smmu_pmu_attr_grps, > + }; > + > + res_0 = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + smmu_pmu->reg_base = devm_ioremap_resource(dev, res_0); We still need to solve the resource-claiming issue when one (or both) of the PMCG pages belongs to the parent device's register space. I recall we chucked a few nascent ideas about before; did anyone manage to come up with anything concrete? Robin.