From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751125AbdAMRkX (ORCPT ); Fri, 13 Jan 2017 12:40:23 -0500 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:45986 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750906AbdAMRkU (ORCPT ); Fri, 13 Jan 2017 12:40:20 -0500 Message-ID: <1484329208.2527.18.camel@HansenPartnership.com> Subject: Re: [tpmdd-devel] [PATCH RFC v2 5/5] tpm2: expose resource manager via a device link /dev/tpms From: James Bottomley To: Jason Gunthorpe , Jarkko Sakkinen Cc: open list , linux-security-module@vger.kernel.org, tpmdd-devel@lists.sourceforge.net Date: Fri, 13 Jan 2017 09:40:08 -0800 In-Reply-To: <20170113172537.GA31125@obsidianresearch.com> References: <20170112174612.9314-1-jarkko.sakkinen@linux.intel.com> <20170112174612.9314-6-jarkko.sakkinen@linux.intel.com> <20170112205628.qh3yf2jcargtw6qv@intel.com> <20170113172537.GA31125@obsidianresearch.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2017-01-13 at 10:25 -0700, Jason Gunthorpe wrote: > On Thu, Jan 12, 2017 at 10:56:28PM +0200, Jarkko Sakkinen wrote: > > > > dev_t tpm_devt; > > > > But they should have different major device numbers. > > major/minors don't really matter these days since they are dynamic Right, although we have this weird piece of code: if (chip->dev_num == 0) chip->dev.devt = MKDEV(MISC_MAJOR, TPM_MINOR); else chip->dev.devt = MKDEV(MAJOR(tpm_devt), chip->dev_num); So the first TPM device gets the MISC_MAJOR with TPM_MINOR and the rest get the dynamic major/minor. It means when you do an ls on a complex system you get something like: crw------- 1 root root 10, 224 Jan 13 06:21 /dev/tpm0 crw------- 1 root root 246, 1 Jan 13 09:38 /dev/tpm1 crw-rw-rw- 1 root root 246, 65536 Jan 13 06:21 /dev/tpms0 crw-rw-rw- 1 root root 246, 65537 Jan 13 09:38 /dev/tpms1 Perhaps it's time just to junk the reserved misc minor? James