Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751958AbdC0F23 (ORCPT ); Mon, 27 Mar 2017 01:28:29 -0400 Received: from mga03.intel.com ([134.134.136.65]:7969 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751915AbdC0F2X (ORCPT ); Mon, 27 Mar 2017 01:28:23 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="1147287341" Date: Mon, 27 Mar 2017 08:28:01 +0300 From: Jarkko Sakkinen To: Jerry Snitselaar Cc: tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Peter Huewe , Jason Gunthorpe , Marcel Selhorst Subject: Re: [RFC PATCH 1/1] tpm_tis: convert to using locality callbacks Message-ID: <20170327052801.pj6euzlg2bthrkin@intel.com> References: <20170325200521.19224-1-jsnitsel@redhat.com> <20170325200521.19224-2-jsnitsel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170325200521.19224-2-jsnitsel@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1307 Lines: 30 On Sat, Mar 25, 2017 at 01:05:21PM -0700, Jerry Snitselaar wrote: > This patch converts tpm_tis to use of the new tpm class ops > request_locality, and relinquish_locality. > > With the move to using the callbacks, release_locality is changed so > that we now release the locality even if there is no request pending. > > This required some changes to the tpm_tis_core_init code path to > make sure locality is requested when needed: > > - tpm2_probe code path will end up calling request/release through > callbacks, so request_locality prior to tpm2_probe not needed. > > - probe_itpm makes calls to tpm_tis_send_data which no longer calls > request_locality, so add request_locality prior to tpm_tis_send_data > calls. Also drop release_locality call in middleof probe_itpm, and > keep locality until release_locality called at end of probe_itpm. > > Cc: Peter Huewe > Cc: Jarkko Sakkinen > Cc: Jason Gunthorpe > Cc: Marcel Selhorst > Signed-off-by: Jerry Snitselaar > --- > drivers/char/tpm/tpm_tis_core.c | 35 +++++++++-------------------------- > 1 file changed, 9 insertions(+), 26 deletions(-) LGTM except what Jason said earlier. /Jarkko