Skip to contentSkip to conversation

regmap: debugfs: Add a registers `range' file

PATCH In review Dimitris Papastamos 2 participants 3 messages Feb 14, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 regmap: debugfs: Add a registers `range' file

This file lists the register ranges in the register map. The condition to split the range is based on the actual register attributes. A range is a contiguous block of registers with the same register attributes.

---
 drivers/base/regmap/internal.h       |   1 +
 drivers/base/regmap/regmap-debugfs.c | 122 +++++++++++++++++++++++++++++++++++
 2 files changed, 123 insertions(+)
drivers/base/regmap/internal.h +1 -0
index 5a22bd3..b4e55a0 100644
@@ -27,6 +27,7 @@ struct regmap_debugfs_off_cache {
 	off_t max;
 	unsigned int base_reg;
 	unsigned int max_reg;
+	unsigned int reg_attr;
 };
 
 struct regmap_format {
drivers/base/regmap/regmap-debugfs.c +122 -0

152 lines not on this page · raw message

Signature · 1 line
1.8.1.3
#1 lore raw

drivers/base/regmap/regmap-debugfs.c static unsigned int regmap_debugfs_get_dump_start(struct regmap *map, · line 122

Quoted 8 lines · Dimitris Papastamos
drivers/base/regmap/regmap-debugfs.c +1 -0
@@ -96,6 +116,7 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map,
 				if (c) {
 					c->max = p - 1;
 					c->max_reg = i - 1;
+					c->reg_attr = regmap_attr_bitmap(map, c->max_reg);
 					list_add_tail(&c->list,
 						      &map->debugfs_off_cache);
 					c = NULL;

What happens if we have three registers like below?

X: read, write
X+1: read, write, volatile
X+2: read, write

It looks like we'll not flag X+1 as volatile, we'll just take the last value we saw.

#2 lore raw
Quoted 13 lines · Mark Brown

drivers/base/regmap/regmap-debugfs.c static unsigned int regmap_debugfs_get_dump_start(struct regmap *map, · line 122

Quoted 8 lines · Dimitris Papastamos
drivers/base/regmap/regmap-debugfs.c +1 -0
@@ -96,6 +116,7 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map,
 				if (c) {
 					c->max = p - 1;
 					c->max_reg = i - 1;
+					c->reg_attr = regmap_attr_bitmap(map, c->max_reg);
 					list_add_tail(&c->list,
 						      &map->debugfs_off_cache);
 					c = NULL;

What happens if we have three registers like below?

Quoted 6 lines

X: read, write
X+1: read, write, volatile
X+2: read, write

It looks like we'll not flag X+1 as volatile, we'll just take the last value we saw.

Hm yes, right. So the problem here is that we split on the condition that is something is printable or not. We do not actually split on any of the possible changes of the register attributes. Any of the blocks of registers should have registers that have exactly the same set of attributes.

I will look into this to fix.

Thanks,
Dimitris