From patchwork Thu May 25 21:39:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Berger X-Patchwork-Id: 9749201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DCA3C601E9 for ; Thu, 25 May 2017 21:39:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDD67283CA for ; Thu, 25 May 2017 21:39:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C26DC283CE; Thu, 25 May 2017 21:39:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3DC4E283CA for ; Thu, 25 May 2017 21:39:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1dE0To-0003R3-Gd; Thu, 25 May 2017 21:39:36 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1dE0Tn-0003Qx-Hl for tpmdd-devel@lists.sourceforge.net; Thu, 25 May 2017 21:39:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From; bh=X+vayUxSmV8i0tkL0LY2u8KhWwFq0wp5hMoNeRKAtnI=; b=FRiToHVyIZKVXTIh+mbz/mqL5BnLWWQpMlyhumQVgzHlHhwdgflzzXeAquIbpOn5lgnJYBBnDOG/6ZKChgc4WzZaEnMcKLGlWqbLAxHJ3i/Rr1vJomLh9kXMSp1rna/doglRo1R5avjHLf8hGmayMdl4YC0sgMPDZUYiARoRGmE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x; h=Message-Id:Date:Subject:Cc:To:From; bh=X+vayUxSmV8i0tkL0LY2u8KhWwFq0wp5hMoNeRKAtnI=; b=FmbbKOUcUlgQitWyq1jc6Unhu/k7J1EuCcdYLUYdLMfwwvW+A1f0vH9mgUUbPGLTgXuFMxmqyiaXddT4GhhXe/EB1gLUAwdwagXAD1PTSDdK9SrvXTFjdH1T4wR7uJjY4iyxX1mOt8EKzNLy3MFwS6WzUFPm3RP6a5wd6DC+3mo=; X-ACL-Warn: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1dE0Tm-00005R-JG for tpmdd-devel@lists.sourceforge.net; Thu, 25 May 2017 21:39:35 +0000 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4PLcpuT146034 for ; Thu, 25 May 2017 17:39:29 -0400 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ap6k09rm5-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 25 May 2017 17:39:28 -0400 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 May 2017 17:39:27 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 25 May 2017 17:39:26 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4PLdPnX63504638; Thu, 25 May 2017 21:39:25 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 595C4B2050; Thu, 25 May 2017 17:37:02 -0400 (EDT) Received: from sbct-3.watson.ibm.com (unknown [9.2.141.158]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 3A546B2046; Thu, 25 May 2017 17:37:02 -0400 (EDT) From: Stefan Berger To: jarkko.sakkinen@linux.intel.com, tpmdd-devel@lists.sourceforge.net Date: Thu, 25 May 2017 17:39:20 -0400 X-Mailer: git-send-email 2.5.5 X-TM-AS-GCONF: 00 x-cbid: 17052521-0008-0000-0000-00000229FF4D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007117; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00865573; UDB=6.00429829; IPR=6.00645389; BA=6.00005375; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015583; XFM=3.00000015; UTC=2017-05-25 21:39:27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17052521-0009-0000-0000-000035697179 Message-Id: <1495748360-26558-1-git-send-email-stefanb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-25_17:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705250394 X-Headers-End: 1dE0Tm-00005R-JG Subject: [tpmdd-devel] [PATCH v2] tpm: vtpm_proxy: Suppresse error logging when in closed state X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP 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 | 4 ++-- drivers/char/tpm/tpm2-cmd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c index d711186..4826fcf 100644 --- a/drivers/char/tpm/tpm-interface.c +++ b/drivers/char/tpm/tpm-interface.c @@ -429,11 +429,11 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space, goto out; rc = chip->ops->send(chip, (u8 *) buf, count); - if (rc < 0) { + if (rc < 0 && rc != -EPIPE) dev_err(&chip->dev, "tpm_transmit: tpm_send: error %d\n", rc); + if (rc < 0) goto out; - } if (chip->flags & TPM_CHIP_FLAG_IRQ) goto out_recv; 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); }