All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] selftests: tpm2: Open tpm dev in unbuffered mode
@ 2019-02-05 20:28 ` tadeusz.struk
  0 siblings, 0 replies; 15+ messages in thread
From: Tadeusz Struk @ 2019-02-05 20:28 UTC (permalink / raw)
  To: jarkko.sakkinen
  Cc: linux-kselftest, shuah, linux-kernel, linux-integrity,
	linux-security-module, PeterHuewe, jgg

In order to have control over how many bytes are read or written
the device needs to be opened in unbuffered mode.

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
---
 tools/testing/selftests/tpm2/tpm2.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/tpm2/tpm2.py b/tools/testing/selftests/tpm2/tpm2.py
index 40ea95ce2ead..c2b9f2b1a0ac 100644
--- a/tools/testing/selftests/tpm2/tpm2.py
+++ b/tools/testing/selftests/tpm2/tpm2.py
@@ -357,9 +357,9 @@ class Client:
         self.flags = flags
 
         if (self.flags & Client.FLAG_SPACE) == 0:
-            self.tpm = open('/dev/tpm0', 'r+b')
+            self.tpm = open('/dev/tpm0', 'r+b', buffering=0)
         else:
-            self.tpm = open('/dev/tpmrm0', 'r+b')
+            self.tpm = open('/dev/tpmrm0', 'r+b', buffering=0)
 
     def close(self):
         self.tpm.close()


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-02-12 23:07 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-05 20:28 [PATCH 1/2] selftests: tpm2: Open tpm dev in unbuffered mode Tadeusz Struk
2019-02-05 20:28 ` Tadeusz Struk
2019-02-05 20:28 ` tadeusz.struk
2019-02-05 20:28 ` [PATCH 2/2] selftests: tpm2: Extend tests to cover partial reads Tadeusz Struk
2019-02-05 20:28   ` Tadeusz Struk
2019-02-05 20:28   ` tadeusz.struk
2019-02-11 16:48   ` Jarkko Sakkinen
2019-02-11 16:48     ` Jarkko Sakkinen
2019-02-11 16:48     ` jarkko.sakkinen
2019-02-11 17:55     ` Tadeusz Struk
2019-02-11 17:55       ` Tadeusz Struk
2019-02-11 17:55       ` tadeusz.struk
2019-02-12 23:06       ` Jarkko Sakkinen
2019-02-12 23:06         ` Jarkko Sakkinen
2019-02-12 23:06         ` jarkko.sakkinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.