From 94cb0f7f2f93ccfaf57ebfa13908f9539647ce28 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Tue, 11 Dec 2012 10:09:49 +0100 Subject: [PATCH] increase WAIT_FOR_WRITE_FLAG as 600ms is not enough for swap in some cases. --- NEWS | 3 +++ ykcore/ykcore.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 9c163eb..d4cb5b5 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,9 @@ info. To use this with the api see yk_write_scan_map(). ** In the api add ykp_ndef_as_text() to export the text from a YK_NDEF structure. +** Higher timeout for configuration writes as in particular swap can take +longer than 600 ms. + * Version 1.9.0 (released 2012-11-08) ** ykinfo: New tool to print information about YubiKey. diff --git a/ykcore/ykcore.c b/ykcore/ykcore.c index e65296b..bd70a66 100644 --- a/ykcore/ykcore.c +++ b/ykcore/ykcore.c @@ -44,8 +44,12 @@ /* * Yubikey low-level interface section 2.4 (Report arbitration polling) specifies * a 600 ms timeout for a Yubikey to process something written to it. + * Where can that document be found? + * It has been discovered that for swap 600 is not enough, swapping can worst + * case take 920 ms, which we then add 25% to for safety margin, arriving at + * 1150 ms. */ -#define WAIT_FOR_WRITE_FLAG 600 +#define WAIT_FOR_WRITE_FLAG 1150 int yk_init(void) { -- 2.39.5