From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH v4 06/10] tpm: Replace device number bitmap with IDR Date: Mon, 29 Feb 2016 12:31:03 -0700 Message-ID: <20160229193103.GD15042@obsidianresearch.com> References: <1456766996-9300-1-git-send-email-stefanb@linux.vnet.ibm.com> <1456766996-9300-7-git-send-email-stefanb@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1456766996-9300-7-git-send-email-stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Stefan Berger Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On Mon, Feb 29, 2016 at 12:29:52PM -0500, Stefan Berger wrote: > Replace the device number bitmap with IDR. Extend the number of devices we > can create to 64k. > Since an IDR allows us to associate a pointer with an ID, we use this now > to rewrite tpm_chip_find_get() to simply look up the chip pointer by the > given device ID. > > Protect the IDR calls with a mutex. > > Signed-off-by: Stefan Berger Reviewed-by: Jason Gunthorpe - TPM_NUM_DEVICES = 256, + TPM_NUM_DEVICES = 65536, rc = alloc_chrdev_region(&tpm_devt, 0, TPM_NUM_DEVICES, "tpm"); Although I do still wonder if passing such a large number to alloc_chrdev_region is a good idea. Should it be MINORMASK instead or something? Jason ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140