On Fri, 03 Jun 2022, "Murthy, Arun R" <arun.r.mur...@intel.com> wrote:
>> On Thu, 02 Jun 2022, Animesh Manna <animesh.ma...@intel.com> wrote:
>> > From: Arun R Murthy <arun.r.mur...@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

Reply via email to