From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752469AbcGSUiO (ORCPT ); Tue, 19 Jul 2016 16:38:14 -0400 Received: from mga09.intel.com ([134.134.136.24]:53797 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752075AbcGSUgk (ORCPT ); Tue, 19 Jul 2016 16:36:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,390,1464678000"; d="scan'208";a="1020052028" Date: Tue, 19 Jul 2016 23:36:34 +0300 From: Jarkko Sakkinen To: Jason Gunthorpe Cc: Peter Huewe , linux-security-module@vger.kernel.org, Stefan Berger , Marcel Selhorst , "moderated list:TPM DEVICE DRIVER" , open list Subject: Re: [PATCH v3 3/5] tpm: return error code from tpm_gen_interrupt() Message-ID: <20160719203634.GB26228@intel.com> References: <1468935171-7815-1-git-send-email-jarkko.sakkinen@linux.intel.com> <1468935171-7815-4-git-send-email-jarkko.sakkinen@linux.intel.com> <20160719202741.GB16042@obsidianresearch.com> <20160719203147.GA26228@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160719203147.GA26228@intel.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 On Tue, Jul 19, 2016 at 11:31:47PM +0300, Jarkko Sakkinen wrote: > On Tue, Jul 19, 2016 at 02:27:41PM -0600, Jason Gunthorpe wrote: > > On Tue, Jul 19, 2016 at 04:32:47PM +0300, Jarkko Sakkinen wrote: > > > Return error code from tpm_gen_interrupt() and fail tpm_tis family of > > > drivers on a system error. It doesn't make sense to continue if we > > > cannot even reach the TPM. > > > > > > Signed-off-by: Jarkko Sakkinen > > > drivers/char/tpm/tpm-interface.c | 6 +++--- > > > drivers/char/tpm/tpm.h | 2 +- > > > drivers/char/tpm/tpm_tis_core.c | 4 +++- > > > 3 files changed, 7 insertions(+), 5 deletions(-) > > > > > > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c > > > index 88dafcd..35b2722 100644 > > > +++ b/drivers/char/tpm/tpm-interface.c > > > @@ -466,16 +466,16 @@ ssize_t tpm_getcap(struct tpm_chip *chip, __be32 subcap_id, cap_t *cap, > > > * Returns 0 on success, < 0 in case of fatal error or a value > 0 representing > > > * a TPM error code. > > > */ > > > -void tpm_gen_interrupt(struct tpm_chip *chip) > > > +int tpm_gen_interrupt(struct tpm_chip *chip) > > > > drivers/char/tpm/st33zp24/st33zp24.c needs to be updated too. > > > > I looked at st33zp24.c and it looks broken, I don't see any logic that > > de-asserts TPM_CHIP_FLAG_IRQ if the irq test triggered by > > tpm_gen_interrupt, so presumably it should not be calling it at all. > > > > IMHO, DT binding devices should never auto-probe IRQS anyhow, we only > > do it on PC because PC is insane... > > > > If we fix st33 then I suggest just moving tpm_gen_interrupt into > > tpm_tis - nothing else should really be using it.. > > I'm happy to take fix for st33 but not the move because it does not > matter for the release. Ignore this comment, this series is not anyway going to 4.8 release. If Christophe could submit a fix for st33, I could include it to this series and make one more revision. Thank you for reviewing this! /Jarkko