[Intel-gfx] [PATCH] drm/i915/gt: make a gt sysfs group and move power management files
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Fri Feb 14 13:41:33 UTC 2020
On 14/02/2020 13:18, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2020-02-14 12:54:35)
>>
>> On 14/02/2020 11:03, Andi Shyti wrote:
>>> +struct intel_gt *intel_gt_sysfs_get_drvdata(struct device *dev)
>>> +{
>>> + struct kobject *kobj = &dev->kobj;
>>> + /*
>>> + * We are interested at knowing from where the interface
>>> + * has been called, whether it's called from gt/ or from
>>> + * the parent directory.
>>> + * From the interface position it depends also the value of
>>> + * the private data.
>>> + * If the interface is called from gt/ then private data is
>>> + * of the "struct intel_gt *" type, otherwise it's * a
>>> + * "struct drm_i915_private *" type.
>>> + */
>>> + if (strcmp(dev->kobj.name, "gt")) {
>>> + struct drm_i915_private *i915 = kdev_minor_to_i915(dev);
>>> +
>>> + drm_warn(&i915->drm, "the interface is obsolete, use gt/\n");
>>
>> Can you log current->name & pid?
>>
>> I am also thinking is a level down from warn would be better. Notice
>> sounds intuitively correct to me.
>
> git grep -e 'pr.*obsolete' | grep warn | wc -l
> 21
> git grep -e 'pr.*obsolete' | grep notice | wc -l
> 1
> git grep -e 'pr.*obsolete' | grep info | wc -l
> 4
>
> Looks like warn's back on the menu, boys.
Majority is just wrong. :P
>> I am also tempted by the _once alternative, but then it makes less sense
>> to include name & pid.
>
> I'm more afraid that there are users out there that frequently poke
> these files.
Agreed, I think best option is to go with ratelimited and name & pid
logged. And more verbosity about what has been access and what should be
accessed instead.
Regards,
Tvrtko
More information about the Intel-gfx
mailing list