Quoting Andi Shyti (2019-12-13 14:44:04) > Hi Chris, > > > > +int intel_gt_pm_debugfs_register(struct intel_gt *gt) > > > +{ > > > + struct dentry *root = gt->debugfs_entry; > > > + int i; > > > + > > > + pr_info("ANDIII function start\n"); > > > + if (unlikely(!root)) > > > + return -ENODEV; > > > + > > > + for (i = 0; i < ARRAY_SIZE(gt_pm_debugfs_files); i++) { > > > + const struct gt_pm_debugfs_files *f = >_pm_debugfs_files[i]; > > > + > > > + if (f->eval && !f->eval(gt)) > > > + continue; > > > + > > > + debugfs_create_file(f->name, 0444, root, gt, f->fops); > > > + } > > > + pr_info("ANDIII function end\n"); > > > + > > > + return 0; > > > > Looking better! > > you liked my wonderful debugging printouts? :D > > > Do we even need to keep the gt->debugfs_entry around? > > Yes, that can be removed, indeed, I was thinking that perhaps in > the future we might need that pointer, but yes, definitely not > necessary. > > > We are not going to ever do hotplug are we and so only > > need to populate once? > > for example? do you mean something like files generated in > certain conditions, like during interrupts or files generated and > destroyed depending on the power state? > > If so, you might want an interface for generating/destroying > files, but do we have such case now to really care about? No, I was trying to highlight that such a dynamic interface is hard to deal with, so we don't bother unless it inherent in the HW and we can't avoid it. i.e. we only need to populate the debugfs once on boot and then can throw away our dentry pointers. -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx