From patchwork Thu Jan 7 22:24:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 59304 Delivered-To: patches@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp194539lbb; Thu, 7 Jan 2016 14:24:57 -0800 (PST) X-Received: by 10.67.7.101 with SMTP id db5mr153676133pad.53.1452205497132; Thu, 07 Jan 2016 14:24:57 -0800 (PST) Return-Path: Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com. [2607:f8b0:400e:c03::22b]) by mx.google.com with ESMTPS id qg5si71797332pab.45.2016.01.07.14.24.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jan 2016 14:24:56 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c03::22b as permitted sender) client-ip=2607:f8b0:400e:c03::22b; Authentication-Results: mx.google.com; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c03::22b as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-pa0-x22b.google.com with SMTP id uo6so251946545pac.1 for ; Thu, 07 Jan 2016 14:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=/AOor2IBn06JfuZVj6BpUiXY+1hlm+t/uMPYkBSTOq8=; b=JaoltECrE/VXS1xqmjrkPq1FbRkIk0JsQNuMJHr2jRYGvlxZL5o5ReiMpnT+14UcM7 NHQRcCZsFXMUqdLDGHjqArEFCDgBd6rWr1nKzxFaP/HjJdeKG4+TESDp15Cg90p866b9 +A9mdCZTtQKvP8Ry9LG0u9jHkcOaeRdjTv8+Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/AOor2IBn06JfuZVj6BpUiXY+1hlm+t/uMPYkBSTOq8=; b=DqrwsSihcmDfW3rlJRRwryf1SgBE2sxtee3PVPA+EFGCKJZP6x8+Y+mX4BvHn+zMxd XutN7D1i0+Bv5cMd82Cm2CyO639yBCc48Ui6/pqsTWskox/cidtznYkT6PIY16JEKpjF e5nDwMwv2Nk5eIK5nMGOCfCtXllphUYs0US0YG0+kPROBkDDzCjSPaZxf0GlPGo5gjoq NjOSWMdRZQIC/GENK9A8Co+nkCUqBPnnzDriojhCgj76py2voc85gOMAYLJJEypyaGfC YdscIW/zitgYsoWR26hq2l6eCsa+1VCNeVMAji74sDufMIIC/HkZllhDb6+2zr/7fdTA Rp+g== X-Gm-Message-State: ALoCoQlZ8zRpnbzwkWGjY7hWMSkeLf1hYAlxyHcZQvMODpyFeKngPKFDMIzJEIWxedtDkcMmYbfz1D5GWLuTlFS/p/jKBFQgMw== X-Received: by 10.67.14.3 with SMTP id fc3mr156335602pad.134.1452205496404; Thu, 07 Jan 2016 14:24:56 -0800 (PST) Return-Path: Received: from localhost.localdomain (c-76-115-103-22.hsd1.or.comcast.net. [76.115.103.22]) by smtp.gmail.com with ESMTPSA id sy5sm162304613pac.5.2016.01.07.14.24.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jan 2016 14:24:55 -0800 (PST) From: John Stultz To: Cc: John Stultz , Dmitry Shmidt , Haojian Zhuang , Vishal Bhoj , Guodong Xu , Scott Bambrough , Tom Gall , Christian Bejram Subject: [RFC][PATCH] arm-trusted-firmware: Fixup fastboot getvar hang on unknown var Date: Thu, 7 Jan 2016 14:24:52 -0800 Message-Id: <1452205492-4598-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 The fastboot implementation doesn't return an error if queried for a varable it doesn't know. This results in host's fastboot hanging if it tries to query for an unsupported variable. This patch addresses this by returning an error in the case that the var is unkonwn. (I've never touched this code before, so while this seems to work, careful review would be appreciated.) Cc: Dmitry Shmidt Cc: Haojian Zhuang Cc: Vishal Bhoj Cc: Guodong Xu Cc: Scott Bambrough Cc: Tom Gall Cc: Christian Bejram Signed-off-by: John Stultz --- plat/hikey/usb.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 1.9.1 diff --git a/plat/hikey/usb.c b/plat/hikey/usb.c index 538912f..2184bec 100644 --- a/plat/hikey/usb.c +++ b/plat/hikey/usb.c @@ -1248,6 +1248,12 @@ static void fb_getvar(char *cmdbuf) response[bytes] = '\0'; tx_status(response); rx_cmd(); + } else { + bytes = sprintf(response, "FAIL%s", + "unknown var"); + response[bytes] = '\0'; + tx_status(response); + rx_cmd(); } }