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

Merge branches 'topic/hwspinlock' and 'topic/nolock' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into regmap-const

+25 -1
+8
drivers/base/regmap/internal.h
··· 77 77 int async_ret; 78 78 79 79 #ifdef CONFIG_DEBUG_FS 80 + bool debugfs_disable; 80 81 struct dentry *debugfs; 81 82 const char *debugfs_name; 82 83 ··· 216 215 extern void regmap_debugfs_initcall(void); 217 216 extern void regmap_debugfs_init(struct regmap *map, const char *name); 218 217 extern void regmap_debugfs_exit(struct regmap *map); 218 + 219 + static inline void regmap_debugfs_disable(struct regmap *map) 220 + { 221 + map->debugfs_disable = true; 222 + } 223 + 219 224 #else 220 225 static inline void regmap_debugfs_initcall(void) { } 221 226 static inline void regmap_debugfs_init(struct regmap *map, const char *name) { } 222 227 static inline void regmap_debugfs_exit(struct regmap *map) { } 228 + static inline void regmap_debugfs_disable(struct regmap *map) { } 223 229 #endif 224 230 225 231 /* regcache core declarations */
+3
drivers/base/regmap/regmap-debugfs.c
··· 529 529 struct regmap_range_node *range_node; 530 530 const char *devname = "dummy"; 531 531 532 + if (map->debugfs_disable) 533 + return; 534 + 532 535 /* If we don't have the debugfs root yet, postpone init */ 533 536 if (!regmap_debugfs_root) { 534 537 struct regmap_debugfs_node *node;
+9 -1
drivers/base/regmap/regmap.c
··· 457 457 hwspin_unlock_irqrestore(map->hwlock, &map->spinlock_flags); 458 458 } 459 459 460 + static void regmap_lock_unlock_none(void *__map) 461 + { 462 + 463 + } 464 + 460 465 static void regmap_lock_mutex(void *__map) 461 466 { 462 467 struct regmap *map = __map; ··· 672 667 goto err; 673 668 } 674 669 675 - if (config->lock && config->unlock) { 670 + if (config->disable_locking) { 671 + map->lock = map->unlock = regmap_lock_unlock_none; 672 + regmap_debugfs_disable(map); 673 + } else if (config->lock && config->unlock) { 676 674 map->lock = config->lock; 677 675 map->unlock = config->unlock; 678 676 map->lock_arg = config->lock_arg;
+5
include/linux/regmap.h
··· 264 264 * field is NULL but precious_table (see below) is not, the 265 265 * check is performed on such table (a register is precious if 266 266 * it belongs to one of the ranges specified by precious_table). 267 + * @disable_locking: This regmap is either protected by external means or 268 + * is guaranteed not be be accessed from multiple threads. 269 + * Don't use any locking mechanisms. 267 270 * @lock: Optional lock callback (overrides regmap's default lock 268 271 * function, based on spinlock or mutex). 269 272 * @unlock: As above for unlocking. ··· 336 333 bool (*readable_reg)(struct device *dev, unsigned int reg); 337 334 bool (*volatile_reg)(struct device *dev, unsigned int reg); 338 335 bool (*precious_reg)(struct device *dev, unsigned int reg); 336 + 337 + bool disable_locking; 339 338 regmap_lock lock; 340 339 regmap_unlock unlock; 341 340 void *lock_arg;