From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751632AbbCTHoB (ORCPT ); Fri, 20 Mar 2015 03:44:01 -0400 Received: from mga14.intel.com ([192.55.52.115]:42819 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751092AbbCTHn7 (ORCPT ); Fri, 20 Mar 2015 03:43:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,435,1422950400"; d="scan'208";a="668015681" Message-ID: <1426837435.15442.2.camel@linux.intel.com> Subject: Re: [tpmdd-devel] [PATCH v2] tpm: fix: sanitized code paths in tpm_chip_register() From: Jarkko Sakkinen To: Scot Doyle Cc: Peter Huewe , Marcel Selhorst , jason.gunthorpe@obsidianresearch.com, christophe.ricard@gmail.com, linux-kernel@vger.kernel.org, tpmdd-devel@lists.sourceforge.net Date: Fri, 20 Mar 2015 09:43:55 +0200 In-Reply-To: References: <1426659434-4003-1-git-send-email-jarkko.sakkinen@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11-0ubuntu3 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 Wed, 2015-03-18 at 16:05 +0000, Scot Doyle wrote: > On Wed, 18 Mar 2015, Jarkko Sakkinen wrote: > > I started to work with PPI interface so that it would be available > > under character device sysfs directory and realized that chip > > registeration was still too messy. > > > > In TPM 1.x in some rare scenarios (errors that almost never occur) > > wrong order in deinitialization steps was taken in teardown. I > > reproduced these scenarios by manually inserting error codes in the > > place of the corresponding function calls. > > > > The key problem is that the teardown is messy with two separate code > > paths (this was inherited when moving code from tpm-interface.c). > > > > Moved TPM 1.x specific register/unregister functionality to own helper > > functions and added single code path for teardown in tpm_chip_register(). > > Now the code paths have been fixed and it should be easier to review > > later on this part of the code. > > > > Signed-off-by: Jarkko Sakkinen > > CONFIG_TCG_TPM=y > CONFIG_TCG_TIS=y > # CONFIG_TCG_TIS_I2C_ATMEL is not set > # CONFIG_TCG_TIS_I2C_INFINEON is not set > # CONFIG_TCG_TIS_I2C_NUVOTON is not set > # CONFIG_TCG_NSC is not set > # CONFIG_TCG_ATMEL is not set > # CONFIG_TCG_INFINEON is not set > # CONFIG_TCG_CRB is not set > > [0.236145] tpm_tis 00:08: 1.2 TPM (device-id 0xB, rev-id 16) > [0.292769] tpm_tis 00:08: [Firmware Bug]: TPM interrupt not working, polling instead > > and suspend/resume continue to function. > > Tested-by: Scot Doyle Thanks! /Jarkko