Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM / devfreq: rockchip-dfi: give variable a better name

struct dmc_count_channel::total counts the clock cycles of the DDR
controller. Rename it accordingly to give the reader a better idea
what this is about. While at it, at some documentation to struct
dmc_count_channel.

Link: https://lore.kernel.org/all/20231018061714.3553817-16-s.hauer@pengutronix.de/
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Sascha Hauer and committed by
Chanwoo Choi
2785cc00 d724f4a4

+12 -7
+12 -7
drivers/devfreq/event/rockchip-dfi.c
··· 46 46 #define DDRMON_CH1_COUNT_NUM 0x3c 47 47 #define DDRMON_CH1_DFI_ACCESS_NUM 0x40 48 48 49 + /** 50 + * struct dmc_count_channel - structure to hold counter values from the DDR controller 51 + * @access: Number of read and write accesses 52 + * @clock_cycles: DDR clock cycles 53 + */ 49 54 struct dmc_count_channel { 50 55 u32 access; 51 - u32 total; 56 + u32 clock_cycles; 52 57 }; 53 58 54 59 struct dmc_count { ··· 156 151 continue; 157 152 count->c[i].access = readl_relaxed(dfi_regs + 158 153 DDRMON_CH0_DFI_ACCESS_NUM + i * 20); 159 - count->c[i].total = readl_relaxed(dfi_regs + 154 + count->c[i].clock_cycles = readl_relaxed(dfi_regs + 160 155 DDRMON_CH0_COUNT_NUM + i * 20); 161 156 } 162 157 } ··· 188 183 struct rockchip_dfi *dfi = devfreq_event_get_drvdata(edev); 189 184 struct dmc_count count; 190 185 struct dmc_count *last = &dfi->last_event_count; 191 - u32 access = 0, total = 0; 186 + u32 access = 0, clock_cycles = 0; 192 187 int i; 193 188 194 189 rockchip_dfi_read_counters(dfi, &count); 195 190 196 191 /* We can only report one channel, so find the busiest one */ 197 192 for (i = 0; i < dfi->max_channels; i++) { 198 - u32 a, t; 193 + u32 a, c; 199 194 200 195 if (!(dfi->channel_mask & BIT(i))) 201 196 continue; 202 197 203 198 a = count.c[i].access - last->c[i].access; 204 - t = count.c[i].total - last->c[i].total; 199 + c = count.c[i].clock_cycles - last->c[i].clock_cycles; 205 200 206 201 if (a > access) { 207 202 access = a; 208 - total = t; 203 + clock_cycles = c; 209 204 } 210 205 } 211 206 212 207 edata->load_count = access * 4; 213 - edata->total_count = total; 208 + edata->total_count = clock_cycles; 214 209 215 210 dfi->last_event_count = count; 216 211