Re: [PATCH 3/6] perf/marvell : Odyssey LLC-TAD performance monitor support

From: Will Deacon
Date: Tue Aug 15 2023 - 06:00:26 EST


On Sat, Aug 12, 2023 at 01:51:00PM +0000, Gowthami Thiagarajan wrote:
> > > +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.

Please can you be a bit more specific here? Which information is not
provided?

Will