From mboxrd@z Thu Jan 1 00:00:00 1970 From: gregkh@linuxfoundation.org (Greg Kroah-Hartman) Date: Mon, 20 Apr 2015 18:05:45 +0200 Subject: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem In-Reply-To: <20150420155648.GA7676@obsidianresearch.com> References: <1429257057-7935-1-git-send-email-jens.wiklander@linaro.org> <1429257057-7935-2-git-send-email-jens.wiklander@linaro.org> <20150417163054.GA28241@obsidianresearch.com> <20150418090147.GF12732@n2100.arm.linux.org.uk> <20150418172923.GA10605@obsidianresearch.com> <20150418215755.GM12732@n2100.arm.linux.org.uk> <20150420050800.GA12928@obsidianresearch.com> <20150420145432.GD7261@kroah.com> <20150420155648.GA7676@obsidianresearch.com> Message-ID: <20150420160545.GA11296@kroah.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, Apr 20, 2015 at 09:56:48AM -0600, Jason Gunthorpe wrote: > On Mon, Apr 20, 2015 at 04:54:32PM +0200, Greg Kroah-Hartman wrote: > > On Sun, Apr 19, 2015 at 11:08:00PM -0600, Jason Gunthorpe wrote: > > > I still suspect the expected way to write a new mid layer is to create > > > your own struct device and not rely on misc_device, > > > > Yes, that is the way. You can not use misc_device for anything other > > than creating the char node that your driver can use through the fileops > > you pass to it. > > > > Do not use a misc_device to create sysfs files for, or anything else, it > > will be wrong and racy, as you have pointed out. > > Thanks! > > Can you quickly comment on when a misc device should be used compared to > alloc_chrdev_region & cdev_add ? If you need more than one character device node, don't use a misc device. If you only need one, and nothing "special" or "fancy", and don't want to put sysfs attribute files on your device, then use a misc device. thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Kroah-Hartman Subject: Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem Date: Mon, 20 Apr 2015 18:05:45 +0200 Message-ID: <20150420160545.GA11296@kroah.com> References: <1429257057-7935-1-git-send-email-jens.wiklander@linaro.org> <1429257057-7935-2-git-send-email-jens.wiklander@linaro.org> <20150417163054.GA28241@obsidianresearch.com> <20150418090147.GF12732@n2100.arm.linux.org.uk> <20150418172923.GA10605@obsidianresearch.com> <20150418215755.GM12732@n2100.arm.linux.org.uk> <20150420050800.GA12928@obsidianresearch.com> <20150420145432.GD7261@kroah.com> <20150420155648.GA7676@obsidianresearch.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20150420155648.GA7676-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Jason Gunthorpe Cc: Russell King - ARM Linux , Jens Wiklander , valentin.manea-hv44wF8Li93QT0dZR+AlfA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, javier-5MUHepqpBA1BDgjK7y7TUQ@public.gmane.org, emmanuel.michel-qxv4g6HH51o@public.gmane.org, Herbert Xu , Arnd Bergmann , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, jean-michel.delorme-qxv4g6HH51o@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Mon, Apr 20, 2015 at 09:56:48AM -0600, Jason Gunthorpe wrote: > On Mon, Apr 20, 2015 at 04:54:32PM +0200, Greg Kroah-Hartman wrote: > > On Sun, Apr 19, 2015 at 11:08:00PM -0600, Jason Gunthorpe wrote: > > > I still suspect the expected way to write a new mid layer is to create > > > your own struct device and not rely on misc_device, > > > > Yes, that is the way. You can not use misc_device for anything other > > than creating the char node that your driver can use through the fileops > > you pass to it. > > > > Do not use a misc_device to create sysfs files for, or anything else, it > > will be wrong and racy, as you have pointed out. > > Thanks! > > Can you quickly comment on when a misc device should be used compared to > alloc_chrdev_region & cdev_add ? If you need more than one character device node, don't use a misc device. If you only need one, and nothing "special" or "fancy", and don't want to put sysfs attribute files on your device, then use a misc device. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755495AbbDTQGD (ORCPT ); Mon, 20 Apr 2015 12:06:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35821 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754966AbbDTQFv (ORCPT ); Mon, 20 Apr 2015 12:05:51 -0400 Date: Mon, 20 Apr 2015 18:05:45 +0200 From: Greg Kroah-Hartman To: Jason Gunthorpe Cc: Russell King - ARM Linux , Jens Wiklander , valentin.manea@huawei.com, devicetree@vger.kernel.org, javier@javigon.com, emmanuel.michel@st.com, Herbert Xu , Arnd Bergmann , linux-kernel@vger.kernel.org, jean-michel.delorme@st.com, tpmdd-devel@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org Subject: Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem Message-ID: <20150420160545.GA11296@kroah.com> References: <1429257057-7935-1-git-send-email-jens.wiklander@linaro.org> <1429257057-7935-2-git-send-email-jens.wiklander@linaro.org> <20150417163054.GA28241@obsidianresearch.com> <20150418090147.GF12732@n2100.arm.linux.org.uk> <20150418172923.GA10605@obsidianresearch.com> <20150418215755.GM12732@n2100.arm.linux.org.uk> <20150420050800.GA12928@obsidianresearch.com> <20150420145432.GD7261@kroah.com> <20150420155648.GA7676@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150420155648.GA7676@obsidianresearch.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 20, 2015 at 09:56:48AM -0600, Jason Gunthorpe wrote: > On Mon, Apr 20, 2015 at 04:54:32PM +0200, Greg Kroah-Hartman wrote: > > On Sun, Apr 19, 2015 at 11:08:00PM -0600, Jason Gunthorpe wrote: > > > I still suspect the expected way to write a new mid layer is to create > > > your own struct device and not rely on misc_device, > > > > Yes, that is the way. You can not use misc_device for anything other > > than creating the char node that your driver can use through the fileops > > you pass to it. > > > > Do not use a misc_device to create sysfs files for, or anything else, it > > will be wrong and racy, as you have pointed out. > > Thanks! > > Can you quickly comment on when a misc device should be used compared to > alloc_chrdev_region & cdev_add ? If you need more than one character device node, don't use a misc device. If you only need one, and nothing "special" or "fancy", and don't want to put sysfs attribute files on your device, then use a misc device. thanks, greg k-h