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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5C60C001DB for ; Tue, 15 Aug 2023 13:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s+UMU419ZB0OE1fV41MIiVj2ULE4YX8ncqwz1UB+cWw=; b=cycbeH03PJAZru chieLWm0TdLcVs8PO6lvyCrkJ/9syQ4nzLPbVztnzseNk+VoZzDkru7J/0bd/vhB0+fpg1Mv9nZUK AAmQ6iLqG6nJEDL0bFpug3pnPVwGa1tYEqjyj47Tif06yoRw9Lf96WEFHysPebq1m8XOFD0LdZV0T U5Ev9xdP/Kmy4vVY4LTmDmcYEZ6D6Crev78Vdwv0vWB//wG+B+zax8VRBH9c/RW4NK5bCzbmlAzw4 cs5Mf+3wGUfYLGmFwbV3u4lHHleDwNNwzr2Yz+cQcNH1EsAHHAksy/x84zf9tzH1QGuaeO0BoLYUW C0WZf7ovnRKoctrJSiJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVu24-001gdR-0M; Tue, 15 Aug 2023 13:24:24 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVu21-001gcw-14 for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2023 13:24:23 +0000 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 F058F143D; Tue, 15 Aug 2023 06:25:01 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.3.119]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5DCF43F6C4; Tue, 15 Aug 2023 06:24:18 -0700 (PDT) Date: Tue, 15 Aug 2023 14:24:15 +0100 From: Mark Rutland To: Gowthami Thiagarajan Cc: "will@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Sunil Kovvuri Goutham , Bharat Bhushan , George Cherian , Linu Cherian Subject: Re: [PATCH 3/6] perf/marvell : Odyssey LLC-TAD performance monitor support Message-ID: References: <20230630120351.1143773-1-gthiagarajan@marvell.com> <20230630120351.1143773-4-gthiagarajan@marvell.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230815_062421_462689_BD15BBC7 X-CRM114-Status: GOOD ( 21.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Aug 12, 2023 at 01:51:00PM +0000, Gowthami Thiagarajan wrote: > > -----Original Message----- > > From: Mark Rutland > > Sent: Friday, July 28, 2023 9:08 PM > > To: Gowthami Thiagarajan > > Cc: will@kernel.org; linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Sunil Kovvuri > > Goutham ; Bharat Bhushan ; George Cherian > > ; Linu Cherian > > Subject: [EXT] Re: [PATCH 3/6] perf/marvell : Odyssey LLC-TAD performance monitor support > > > > External Email > > > > ---------------------------------------------------------------------- > > On Fri, Jun 30, 2023 at 05:33:48PM +0530, Gowthami Thiagarajan wrote: > > > +static int tad_pmu_event_counter_add(struct perf_event *event, int flags) > > > +{ > > > + if (!event->attr.disabled) > > > + return -EINVAL; > > > > Why? > Just checks the default disabled attribute. Why does it matter? What's the problem with opening an event which is *not* disabled? [...] > > > +static int tad_pmu_probe(struct platform_device *pdev) > > > +{ > > > + struct device *dev = &pdev->dev; > > > + struct tad_region *regions; > > > + struct tad_pmu *tad_pmu; > > > + struct resource *res; > > > + u32 tad_pmu_page_size; > > > + u32 tad_page_size; > > > + u32 tad_cnt; > > > + int i, ret; > > > + char *name; > > > + > > > + tad_pmu = devm_kzalloc(&pdev->dev, sizeof(*tad_pmu), GFP_KERNEL); > > > + if (!tad_pmu) > > > + return -ENOMEM; > > > + > > > + platform_set_drvdata(pdev, tad_pmu); > > > + > > > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > > + if (!res) { > > > + dev_err(&pdev->dev, "Mem resource not found\n"); > > > + return -ENODEV; > > > + } > > > + > > > + ret = device_property_read_u32(dev, "marvell,tad-page-size", &tad_page_size); > > > + if (ret) { > > > + dev_err(&pdev->dev, "Can't find tad-page-size property\n"); > > > + return ret; > > > + } > > > + > > > + ret = device_property_read_u32(dev, "marvell,tad-pmu-page-size", > > > + &tad_pmu_page_size); > > > + if (ret) { > > > + dev_err(&pdev->dev, "Can't find tad-pmu-page-size property\n"); > > > + return ret; > > > + } > > > > Why do you think these properties are necessary? > > > > These should almost certainly be provided by IO resources, and shouldn't need a > > custom property. > > IO resources don't provide all the information in this case. Need to vary these values > at different boot times. So, kept these custom properties. I think the only rason the information is missing is that your DT binding isn't quite right. Later on you do: + for (i = 0; i < tad_cnt && res->start < res->end; i++) { + regions[i].base = devm_ioremap(&pdev->dev, + res->start, + tad_pmu_page_size); + if (IS_ERR(regions[i].base)) { + dev_err(&pdev->dev, "TAD%d ioremap fail\n", i); + return -ENOMEM; + } + res->start += tad_page_size; + } ... which means you're splitting one reg entry into multiple mappings, whereas you could have multiple reg entries, one per TAD page. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel