From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751247AbdFARO0 (ORCPT ); Thu, 1 Jun 2017 13:14:26 -0400 Received: from mga06.intel.com ([134.134.136.31]:36105 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751163AbdFAROY (ORCPT ); Thu, 1 Jun 2017 13:14:24 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,280,1493708400"; d="scan'208";a="94452316" Date: Thu, 1 Jun 2017 20:14:20 +0300 From: Jarkko Sakkinen To: Stefan Berger Cc: tpmdd-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, jgunthorpe@obsidianresearch.com Subject: Re: [PATCH v3] tpm: vtpm_proxy: Suppress error logging when in closed state Message-ID: <20170601171420.djihd2nst7j74rdh@intel.com> References: <1495751353-28500-1-git-send-email-stefanb@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1495751353-28500-1-git-send-email-stefanb@linux.vnet.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 25, 2017 at 06:29:13PM -0400, Stefan Berger wrote: > Suppress the error logging when the core TPM driver sends commands > to the VTPM proxy driver and -EPIPE is returned in case the VTPM > proxy driver is 'closed' (closed anonymous file descriptor). This > error code is only returned by the send function and by tpm_transmit > when the VTPM proxy driver is being used. > > Signed-off-by: Stefan Berger > --- > drivers/char/tpm/tpm-interface.c | 5 +++-- > drivers/char/tpm/tpm2-cmd.c | 2 +- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c > index d711186..d2b4df6 100644 > --- a/drivers/char/tpm/tpm-interface.c > +++ b/drivers/char/tpm/tpm-interface.c > @@ -430,8 +430,9 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space, > > rc = chip->ops->send(chip, (u8 *) buf, count); > if (rc < 0) { > - dev_err(&chip->dev, > - "tpm_transmit: tpm_send: error %d\n", rc); > + if (rc != -EPIPE) > + dev_err(&chip->dev, > + "%s: tpm_send: error %d\n", __func__, rc); > goto out; > } > > diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c > index 3ee6883..3a99643 100644 > --- a/drivers/char/tpm/tpm2-cmd.c > +++ b/drivers/char/tpm/tpm2-cmd.c > @@ -840,7 +840,7 @@ void tpm2_shutdown(struct tpm_chip *chip, u16 shutdown_type) > /* In places where shutdown command is sent there's no much we can do > * except print the error code on a system failure. > */ > - if (rc < 0) > + if (rc < 0 && rc != -EPIPE) > dev_warn(&chip->dev, "transmit returned %d while stopping the TPM", > rc); > } > -- > 2.4.3 > Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen /Jarkko