Hardware registers of devices under control of power management cannot be accessed at all times. If such a device is suspended, register accesses may lead to undefined behavior, like reading bogus values, or causing exceptions or system lock-ups. Extend struct debugfs_regset32 with an optional field to let device drivers specify the device the registers in the set belong to. This allows debugfs_show_regset32() to make sure the device is resumed while its registers are being read.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -35,6 +35,7 @@ struct debugfs_regset32 { · 34 unmodified lines | |||
| 35 | const struct debugfs_reg32 *regs; | 35 | const struct debugfs_reg32 *regs; |
| 36 | int nregs; | 36 | int nregs; |
| 37 | void __iomem *base; | 37 | void __iomem *base; |
| 38 | struct device *dev; /* Optional device for Runtime PM */ | ||
| 38 | }; | 39 | }; |
| 39 | 40 | ||
| 40 | extern struct dentry *arch_debugfs_dir; | 41 | extern struct dentry *arch_debugfs_dir; |