Re: [PATCH v5 1/4] perf/amlogic: Add support for Amlogic meson G12 SoC DDR PMU driver

From: Krzysztof Kozlowski
Date: Thu Aug 18 2022 - 04:30:40 EST


On 17/08/2022 14:34, Jiucheng Xu wrote:
> This patch adds support Amlogic meson G12 series SoC
> DDR bandwidth PMU driver framework and interfaces.
>
> The PMU not only can monitor the total DDR bandwidth,
> but also the bandwidth which is from individual IP module.
>
> Example usage:

Thank you for your patch. There is something to discuss/improve.

}
> +
> +static int dmc_g12_irq_handler(struct dmc_info *info,
> + struct dmc_counter *counter)
> +{
> + unsigned int val;
> + int ret = -EINVAL;
> +
> + val = readl(info->ddr_reg[0] + DMC_MON_G12_CTRL0);
> + if (val & DMC_QOS_IRQ) {
> + dmc_g12_get_counters(info, counter);
> + /* clear irq flags */
> + writel(val, info->ddr_reg[0] + DMC_MON_G12_CTRL0);
> + ret = 0;
> + }
> + return ret;
> +}
> +
> +static struct dmc_hw_info g12a_dmc_info = {

This and other ones should be also const.

> + .enable = dmc_g12_counter_enable,
> + .disable = dmc_g12_counter_disable,
> + .irq_handler = dmc_g12_irq_handler,
> + .get_counters = dmc_g12_get_counters,
> + .set_axi_filter = dmc_g12_set_axi_filter,
> +
> + .dmc_nr = 1,
> + .chann_nr = 4,
> + .capability = 0X7EFF00FF03DF,
> + .fmt_attr = g12_pmu_format_attrs,
> +};
> +

Best regards,
Krzysztof