Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936026AbcJFLZL (ORCPT ); Thu, 6 Oct 2016 07:25:11 -0400 Received: from mga06.intel.com ([134.134.136.31]:40475 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754586AbcJFLZE (ORCPT ); Thu, 6 Oct 2016 07:25:04 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,453,1473145200"; d="scan'208";a="17262009" Date: Thu, 6 Oct 2016 14:23:57 +0300 From: Jarkko Sakkinen To: Jason Gunthorpe Cc: "Winkler, Tomas" , "tpmdd-devel@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] tpm: don't destroy chip device prematurely Message-ID: <20161006112357.GA10533@intel.com> References: <1475393971-12715-1-git-send-email-tomas.winkler@intel.com> <20161002101755.GA25844@intel.com> <20161002102455.GA27464@intel.com> <20161002212126.GA25872@obsidianresearch.com> <5B8DA87D05A7694D9FA63FD143655C1B542F466B@hasmsx108.ger.corp.intel.com> <20161003124836.GE9990@intel.com> <20161004051946.GA10572@intel.com> <20161004164738.GA17149@obsidianresearch.com> <20161005100234.GA20851@intel.com> <20161005162741.GA18636@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161005162741.GA18636@obsidianresearch.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 696 Lines: 18 On Wed, Oct 05, 2016 at 10:27:41AM -0600, Jason Gunthorpe wrote: > On Wed, Oct 05, 2016 at 01:02:34PM +0300, Jarkko Sakkinen wrote: > > > I'll repeat my question: what worse can happen than returning -EPIPE? I > > though the whole rw lock scheme was introduced just for this purpose. > > I thought I explained this, if device_del is moved after ops = null > then if sysfs looses the race it will oops the kernel. device_del hard > fences sysfs. Sorry, I missed that comment somehow. Looking at the code it is like that. I think that they should be fenced then for the sake of consistency. I do not see why sysfs code is privileged not to do fencing while other peers have to do it. /Jarkko