[Intel-gfx] [RFC PATCH 4/5] drm/i915/display: prepend connector name to the backlight
Jani Nikula
jani.nikula at intel.com
Fri Jun 3 07:02:18 UTC 2022
On Fri, 03 Jun 2022, "Murthy, Arun R" <arun.r.murthy at intel.com> wrote:
>> On Thu, 02 Jun 2022, Animesh Manna <animesh.manna at intel.com> wrote:
>> > From: Arun R Murthy <arun.r.murthy at intel.com>
>> >
>> > With the enablement of dual eDP, there will have to exist two entries
>> > of backlight sysfs file. In order to avoid sysfs file name
>> > duplication, the file names are prepended with the connector name.
>>
>> Fixed by 20f85ef89d94 ("drm/i915/backlight: use unique backlight device
>> names") about a year ago.
>>
> This patches checks if the return value is -EEXIST and then acts accordingly, but -EEXIST is not returned.
> struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
> const char *name,
> umode_t mode, kuid_t uid, kgid_t gid,
> loff_t size,
> const struct kernfs_ops *ops,
> void *priv, const void *ns,
> struct lock_class_key *key)
> {
> struct kernfs_node *kn;
> unsigned flags;
> int rc;
>
> flags = KERNFS_FILE;
>
> kn = kernfs_new_node(parent, name, (mode & S_IALLUGO) | S_IFREG,
> uid, gid, flags);
> if (!kn)
> return ERR_PTR(-ENOMEM);
>
> So the condition check with not be satisfied and the backlight registration will fail for the 2nd backlight device.
But the file isn't added by kernfs_new_node(), it just allocates the
node. See the kernfs_add_one() later in __kernfs_create_file().
BR,
Jani.
>
> Thanks and Regards,
> Arun R Murthy
> --------------------
--
Jani Nikula, Intel Open Source Graphics Center
More information about the Intel-gfx
mailing list