Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1650946 > unrolled thread
| Started by | Stefan Berger <stefanb@linux.vnet.ibm.com> |
|---|---|
| First post | 2017-05-26 00:40 +0200 |
| Last post | 2017-06-01 19:20 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v3] tpm: vtpm_proxy: Suppress error logging when in closed state Stefan Berger <stefanb@linux.vnet.ibm.com> - 2017-05-26 00:40 +0200
Re: [PATCH v3] tpm: vtpm_proxy: Suppress error logging when in closed state Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-30 07:00 +0200
Re: [PATCH v3] tpm: vtpm_proxy: Suppress error logging when in closed state Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-06-01 19:20 +0200
| From | Stefan Berger <stefanb@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-05-26 00:40 +0200 |
| Subject | [PATCH v3] tpm: vtpm_proxy: Suppress error logging when in closed state |
| Message-ID | <tL9Ad-5OM-5@gated-at.bofh.it> |
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 <stefanb@linux.vnet.ibm.com>
---
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
[toc] | [next] | [standalone]
| From | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
|---|---|
| Date | 2017-05-30 07:00 +0200 |
| Subject | Re: [PATCH v3] tpm: vtpm_proxy: Suppress error logging when in closed state |
| Message-ID | <tMHq9-2qm-7@gated-at.bofh.it> |
| In reply to | #1650946 |
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 <stefanb@linux.vnet.ibm.com>
Reviwed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
/Jarkko
> ---
> 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
>
[toc] | [prev] | [next] | [standalone]
| From | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
|---|---|
| Date | 2017-06-01 19:20 +0200 |
| Subject | Re: [PATCH v3] tpm: vtpm_proxy: Suppress error logging when in closed state |
| Message-ID | <tNBVo-5uA-27@gated-at.bofh.it> |
| In reply to | #1650946 |
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 <stefanb@linux.vnet.ibm.com>
> ---
> 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 <jarkko.sakkine@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkine@linux.intel.com>
/Jarkko
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web