From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967778AbdAKSEA (ORCPT ); Wed, 11 Jan 2017 13:04:00 -0500 Received: from quartz.orcorp.ca ([184.70.90.242]:56356 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932918AbdAKSD6 (ORCPT ); Wed, 11 Jan 2017 13:03:58 -0500 Date: Wed, 11 Jan 2017 11:03:28 -0700 From: Jason Gunthorpe To: Andreas Fuchs Cc: Jarkko Sakkinen , Ken Goldman , tpmdd-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, greg@enjellic.com, linux-kernel@vger.kernel.org Subject: Re: [tpmdd-devel] [PATCH RFC 0/4] RFC: in-kernel resource manager Message-ID: <20170111180328.GB22783@obsidianresearch.com> References: <201701041612.v04GCfPK031525@wind.enjellic.com> <20170109231635.6wh25qoy7svcnys6@intel.com> <20170110200558.GA5102@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.156 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 11, 2017 at 11:00:43AM +0100, Andreas Fuchs wrote: > could we please get an ioctl, that switches the "mode" of the fd entirely. > I'd like to see the write()/read() support still intact. > All my current code uses main-loop based poll on the fd and I don't want > to be force to start using threads... We currently do not support poll in the kernel for /dev/tpmX. ie we do not supply a poll method for 'struct file_operations'. Even worse, the current implementation blocks returning from write() until the TPM has completed its work, so it doesn't even make sense to combine it with poll. Jason From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH RFC 0/4] RFC: in-kernel resource manager Date: Wed, 11 Jan 2017 11:03:28 -0700 Message-ID: <20170111180328.GB22783@obsidianresearch.com> References: <201701041612.v04GCfPK031525@wind.enjellic.com> <20170109231635.6wh25qoy7svcnys6@intel.com> <20170110200558.GA5102@obsidianresearch.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Andreas Fuchs Cc: Ken Goldman , greg-R92VP3DqSWVWk0Htik3J/w@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On Wed, Jan 11, 2017 at 11:00:43AM +0100, Andreas Fuchs wrote: > could we please get an ioctl, that switches the "mode" of the fd entirely. > I'd like to see the write()/read() support still intact. > All my current code uses main-loop based poll on the fd and I don't want > to be force to start using threads... We currently do not support poll in the kernel for /dev/tpmX. ie we do not supply a poll method for 'struct file_operations'. Even worse, the current implementation blocks returning from write() until the TPM has completed its work, so it doesn't even make sense to combine it with poll. Jason ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi