mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Michael Wu <michael@allwinnertech.com>
Cc: myungjoo.ham@samsung.com, cw00.choi@samsung.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] extcon: Fixed sysfs duplicate filename issue
Date: Wed, 15 Oct 2025 11:15:12 +0300	[thread overview]
Message-ID: <aO9YEOFkPz2IAyB6@smile.fi.intel.com> (raw)
In-Reply-To: <20251015065102.70422-1-michael@allwinnertech.com>

On Wed, Oct 15, 2025 at 02:51:02PM +0800, Michael Wu wrote:

Thank you for a fix, my comments below.

> With current extcon_dev_unregister() timing, ida_free is before
> device_unregister(), that may cause current id re-alloc to another
> device in extcon_dev_register() context but sysfs filename path not
> removal completed yet.
> 
> The right timing shows below:
> on extcon_dev_register: ida_alloc() -> device_register()
> on extcon_dev_unregister: device_unregister() -> ida_free()
> 
> stack information when an error occurs:
> sysfs: cannot create duplicate filename '/class/extcon/extcon1'
> Call trace:

>  dump_backtrace+0xe8/0x108
>  show_stack+0x18/0x28
>  dump_stack_lvl+0x50/0x6c
>  dump_stack+0x18/0x24

At least these four lines are noisy in the commit message. The Submitting
Patches documentation recommends to leave ~3-5 important lines out of a trace
back, so the below is okay in my opinion, except the last line also can be
dropped (devm call).

>  sysfs_warn_dup+0x68/0x88
>  sysfs_do_create_link_sd+0x94/0xdc
>  sysfs_create_link+0x30/0x48
>  device_add_class_symlinks+0xb4/0x12c
>  device_add+0x1e0/0x48c
>  device_register+0x20/0x34
>  extcon_dev_register+0x3b8/0x5c4
>  devm_extcon_dev_register+0x4c/0x94

> Fixes: 7bba9e81a6fb ("extcon: Use unique number for the extcon device ID")
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Better to reduce a noise in the Git history by moving the Cc:s to the...

> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
> Signed-off-by: Michael Wu <michael@allwinnertech.com>
> ---

...comment block here. It will have the same effect on the emails (tools will
Cc people listed here).

> ChangeLog:
> V1 -> V2: Update commit msg, suggested by Markus Elfring
> V1: https://lore.kernel.org/all/20251011053719.87055-1-michael@allwinnertech.com/

Code wise LGTM, FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2025-10-18 17:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15  6:51 Michael Wu
2025-10-15  8:15 ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aO9YEOFkPz2IAyB6@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=cw00.choi@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@allwinnertech.com \
    --cc=myungjoo.ham@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®