From: Klas Lindfors Date: Tue, 11 Dec 2012 09:09:49 +0000 (+0100) Subject: increase WAIT_FOR_WRITE_FLAG as 600ms is not enough for swap in some cases. X-Git-Tag: v1.10.0~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94cb0f7f2f93ccfaf57ebfa13908f9539647ce28;p=yubikey-personalization increase WAIT_FOR_WRITE_FLAG as 600ms is not enough for swap in some cases. --- 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) {