From: Cristian Marussi <cristian.marussi@arm.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Dan Carpenter <error27@gmail.com>, linux-arm-kernel@lists.infradead.org
Subject: Re: [bug report] firmware: arm_scmi: Add per-channel Raw injection support
Date: Wed, 18 Jan 2023 12:26:45 +0000 [thread overview]
Message-ID: <Y8flhYHZ5ztIr1vf@e120937-lin> (raw)
In-Reply-To: <Y8a1e1/LW1RNAhLC@casper.infradead.org>
On Tue, Jan 17, 2023 at 02:49:31PM +0000, Matthew Wilcox wrote:
> On Tue, Jan 17, 2023 at 02:30:43PM +0000, Cristian Marussi wrote:
> > > 1118 ret = idr_alloc(&raw->queues_idr, q,
> > > 1119 channels[i], channels[i] + 1,
> > > 1120 GFP_KERNEL);
> > > 1121 if (ret != channels[i])
> > > 1122 dev_err(dev,
> > > 1123 "Fail to allocate Raw queue 0x%02X\n",
> > > 1124 channels[i]);
> > >
> > > Heh. I've never seen anyone use an IDR range of one value before...
> >
> > Well, the choice was between wasting an hashtable or a radix-tree IDR for a
> > few mapping channel--->q and I went for the 1-range IDR which is already
> > used in SCMI stack to map various refs to channel numbers.
> > (I avoid in general to put a simple plain 256 array on the stack that can
> > lead to stack-size issues especially while compiling on armv7)
>
> The "range of one" idiom is fairly frequently used, but generally it is
> an indication that you want to use the XArray API instead of the IDR API,
> which is deprecated in any case.
>
> I've given up tilting at that windmill as I'm more concerned with the
> folio work, but it'd be nice if you could convert from IDR to XArray here.
Hi,
thanks for the hint Matthew, never used XArrays till now.
I'll reworked the above with XArray in:
https://lore.kernel.org/linux-arm-kernel/20230118121426.492864-17-cristian.marussi@arm.com/T/#u
Thanks,
Cristian
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-01-18 12:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 10:43 [bug report] firmware: arm_scmi: Add per-channel Raw injection support Dan Carpenter
2023-01-17 14:30 ` Cristian Marussi
2023-01-17 14:49 ` Matthew Wilcox
2023-01-18 12:26 ` Cristian Marussi [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=Y8flhYHZ5ztIr1vf@e120937-lin \
--to=cristian.marussi@arm.com \
--cc=error27@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).