From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53C62C63797 for ; Tue, 17 Jan 2023 14:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/KK4LXvCqXlQaxAyYLeQZbOz8gsWoKpMgpl78PRmL/E=; b=FFduAevg4IWJXh AFZsna2Iy3I7VaE9L1nW8ABZOY+/FNa8JEXmqYRi8Ay3rp0yETifCkfDqlpPzJNXA84ak1w1dLZ4a 901FwNLNvNFX5GkiOVyLffF7pgHAzJDz4bdkJdJWMnzsgA4GmlAPp1ZLJLd9No0ZOxkFpBIPxa4ba R/FgLqyGh8+pADjtqaEp9MMPoLHFcZfmkaW08Ss/Fi7QpcWNliHz5VCMUrLZW/L5wvh79zPdcSILu xQMNI9jkVuBau+Rj1Y292b3cbCvGpSBpRvT7RuoIeXdjtyl7oPgEeAE6uaQk9dsS4V4HYX0Yj6g8u mUGPr+R4GC5VnGEUA5ow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHnH8-00EfhF-WB; Tue, 17 Jan 2023 14:49:23 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHnH7-00Efh3-KJ for linux-arm-kernel@bombadil.infradead.org; Tue, 17 Jan 2023 14:49:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=SqKfIjqxMj++ChsMg3mgqdUhgnOcoIvbzVnRAyVc6W4=; b=PCtWbJ49NpcVWEDedw/yV02zaO E3Csx5XBpOqYzx/OoABVhk/5gzej2Q/6fwzkWQw+oPMuXfWY75cg01hxbeXuyImss9xtzNVFDWqmn let/Xp93MPu6zYokS7RQFy+13R43iyHv4R3Y1A7cQLzBXADppvlsEX5/G/R+tBS9s0FuvS4raWmeY QcMMryExh8ePHxHwsNLXrjhwHUyF5jaJrRquMyMeamfZsQJUqj2VRdr+JBN/MCw8zioZSTNHuIvx3 kqWMnZWUAaoxbrMMryJrho3DJr7WfCaF6t3hbbjye438sIaiSvoWuguLBkxhhFgbJGs9jKZkm8UKH U9fFNSww==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHnHI-009l97-15; Tue, 17 Jan 2023 14:49:32 +0000 Date: Tue, 17 Jan 2023 14:49:31 +0000 From: Matthew Wilcox To: Cristian Marussi Cc: Dan Carpenter , linux-arm-kernel@lists.infradead.org Subject: Re: [bug report] firmware: arm_scmi: Add per-channel Raw injection support Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel