mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Aviv Levinson <levinson.aviv@gmail.com>
Cc: dtwlin@gmail.com, johan@kernel.org, elder@kernel.org,
	greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: greybus: uart: replace IDR with XArray
Date: Thu, 12 Nov 2026 07:37:14 -0500	[thread overview]
Message-ID: <2026111219-guacamole-quality-2ecf@gregkh> (raw)
In-Reply-To: <20261111182330.77824-1-levinson.aviv@gmail.com>

On Wed, Nov 11, 2026 at 08:23:30PM +0200, Aviv Levinson wrote:
> Migrate the minor number allocation from the legacy IDR API to the
> modern XArray API to take advantage of its built-in thread safety.

But why?

> As part of this migration, the global `table_lock` mutex has been
> removed. Mutating operations now rely on XArray's internal spinlocks,
> and the lookup logic in get_gb_by_minor() has been updated to use
> rcu_read_lock() combined with kref_get_unless_zero() to safely
> pin the device reference without blocking.

How was this found and generated and tested?

And kref_get_unless_zero() is almost always a call you never want to
make.

> Signed-off-by: Aviv Levinson <levinson.aviv@gmail.com>
> ---
>  drivers/staging/greybus/uart.c | 37 ++++++++++++++++++----------------
>  1 file changed, 20 insertions(+), 17 deletions(-)

So now there is more code?  That feels like a step backwards, don't you
think?

thanks,

greg k-h

  reply	other threads:[~2026-11-12 12:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 18:23 Aviv Levinson
2026-11-12 12:37 ` Greg KH [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-06-16 19:07 Jack Lee
2026-06-17  1:26 ` Greg KH

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=2026111219-guacamole-quality-2ecf@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dtwlin@gmail.com \
    --cc=elder@kernel.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=levinson.aviv@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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®