From 9aee76a3a557fb9fed06c4df73dfebe4837a3abd Mon Sep 17 00:00:00 2001 From: Oron Peled Date: Sun, 17 Aug 2014 17:07:19 +0300 Subject: [PATCH] xpp: revert USB "clear_halt" change and better overrides. Why: * Doing "clear_halt" is normally the right thing to do on startup. * The original observed problem is better fixed via USB bios settings. * Defaulting to no "clear_halt" cause more problems on other platform combinations (hardware/kernel). The change: * We now reverted to do "clear_halt" by default. * The XTALK_OPTIONS may now contain either "use-clear-halt" (the default) or "no-use-clear-halt" to override for debugging/testing. Original commit: ca7c04e9cbdfc182c9c9672dec884f5ac87f90b9 Signed-off-by: Tzafrir Cohen --- xpp/xtalk/xusb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xpp/xtalk/xusb.c b/xpp/xtalk/xusb.c index dcc694a..d33f013 100644 --- a/xpp/xtalk/xusb.c +++ b/xpp/xtalk/xusb.c @@ -67,6 +67,8 @@ static void xusb_init(); * variable of that name. Existing options: * * - "use-clear-halt" -- force USB "clear_halt" operation during + * device initialization (this is the default) + * - "no-use-clear-halt" -- force no USB "clear_halt" operation during * device initialization * - "no-lock" -- prevent using global sempahore to serialize libusb * initialization. Previously done via "XUSB_NOLOCK" @@ -888,7 +890,7 @@ static void xusb_init() } /* XTALK option handling */ -static int use_clear_halt = 0; +static int use_clear_halt = 1; static int libusb_no_lock = 0; static int xtalk_one_option(const char *option_string) @@ -897,6 +899,10 @@ static int xtalk_one_option(const char *option_string) use_clear_halt = 1; return 0; } + if (strcmp(option_string, "no-use-clear-halt") == 0) { + use_clear_halt = 0; + return 0; + } if (strcmp(option_string, "no-lock") == 0) { libusb_no_lock = 1; return 0;