From: Bart Van Assche <bvanassche@acm.org>
To: Badhri Jagan Sridharan <badhri@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
stable@vger.kernel.org, Amit Sunil Dhamne <amitsd@google.com>
Subject: Re: [PATCH] usb: roles: Fix a false positive recursive locking complaint
Date: Wed, 4 Sep 2024 14:15:29 -0700 [thread overview]
Message-ID: <8feac105-fa35-4c35-bbac-5d0265761c2d@acm.org> (raw)
In-Reply-To: <CAPTae5+gX8TW2xtN2-7yDt3C-2AmMB=jSwKsRtqPxftOf-A9hQ@mail.gmail.com>
On 9/4/24 2:00 PM, Badhri Jagan Sridharan wrote:
> https://lore.kernel.org/all/ZsiYRAJST%2F2hAju1@kuha.fi.intel.com/ was
> already accepted
Thanks, I hadn't noticed this yet.
> and is perhaps better than what you are suggesting as
> it does not use the internal methods of mutex_init().
Although I do not have a strong opinion about which patch is sent to
Linus, I think my patch has multiple advantages compared to the patch
mentioned above:
- Cleaner. lockdep_set_class() is not used. Hence, it is not possible
that the wrong lockdep key is used (the one assigned by
mutex_init()).
- The lock_class_key declaration occurs close to the sw->lock
declaration.
- The lockdep_register_key() call occurs close to __mutex_init() call
that uses the registered key.
- Needs less memory in debug kernels. The advantage of __mutex_init()
compared to mutex_init() is that it does not allocate (static) memory
for a lockdep key.
Thanks,
Bart.
next prev parent reply other threads:[~2024-09-04 21:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 20:18 [PATCH] usb: roles: Fix a false positive recursive locking complaint Bart Van Assche
2024-09-04 21:00 ` Badhri Jagan Sridharan
2024-09-04 21:15 ` Bart Van Assche [this message]
2024-09-04 22:34 ` Amit Sunil Dhamne
2024-09-05 15:01 ` Bart Van Assche
2024-09-05 18:13 ` Andy Shevchenko
2024-09-05 18:14 ` Andy Shevchenko
2024-09-05 18:22 ` Bart Van Assche
2024-09-05 19:23 ` Amit Sunil Dhamne
2024-09-05 19:24 ` Andy Shevchenko
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=8feac105-fa35-4c35-bbac-5d0265761c2d@acm.org \
--to=bvanassche@acm.org \
--cc=amitsd@google.com \
--cc=andy.shevchenko@gmail.com \
--cc=badhri@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-usb@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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