From patchwork Wed Sep 9 11:27:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 249447 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp307564ilg; Wed, 9 Sep 2020 04:28:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0mfaEqSooChQLhVnPxmvT38elORZ3cHme9rsuPBq9Pae+Szy6e+EiQ/ab0Aqo9NWXK/yR X-Received: by 2002:a25:dc0c:: with SMTP id y12mr4913819ybe.395.1599650908691; Wed, 09 Sep 2020 04:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599650908; cv=none; d=google.com; s=arc-20160816; b=RHvOuMIyWCSGAwDyJtDiNAn0x2+X72Y49ojiIZz57f6lWiQWIsjOSPNFsus3WymySC uBF2QSmpr6wrhiFEChK7c+klSfsrLi4KPVFPv8AYczkeDa6wZY+GnBvY3WT7DeqV68iD 3Q2G0c9yuYTGrhaC68aF74CECPEnglINg4njZTQF6gDKn7EZrnBNrhWjS0uQw0BmkSFC mSijGbzfgh/so1khMcNZog584C9aDPug0bi97Fj7ZDibEGbZYJdkRsPn1oU53weB7Has pbGg4StF/tKdWqyGmLc5B1yVRfsqI1uRz4/YLjaQNsF6/doE4lqP0opqBbus7vojctd/ ZMXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=BRPNz1a1sR08C7hdTMgMEJxgHmTXfMUSkTnilwnfZ1E=; b=NLxtvbuEY4gzU3yZuICnNNvQKLlWLmqEpQi8B8gpha9Uh6V77SeZlnY20Vc+9p+8w+ N3HC4hiJyYs0kIxopxOTA1NTwHua4vBDnMbzZJH12K+iHcxaISOfcLjWT2lTYgNWiQPd vvFFOK/ZGcry3Izt7KwVRPKBo8vY0B314NPAPUEhdyOZH2FeBGVn/jcBeNORo//yGolg q1NfqHkXngzCbfwdPRMw1PNJ2D7Hd0oDfj4XmSvP8TXHHVjwpQY4NxuWa+Kv9xqoPHxU WV08s8b7/0foEw0sVfZNi3T+KJsxxfi8uSHqVGl6Yy4xpEp9A8mZ1qEbDrRrUPAw/Zxl aKqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lQ87BerI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s69si3130832ybi.280.2020.09.09.04.28.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Sep 2020 04:28:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lQ87BerI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFyH6-0008Rv-7B for patch@linaro.org; Wed, 09 Sep 2020 07:28:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFyGU-0008Q6-EH for qemu-devel@nongnu.org; Wed, 09 Sep 2020 07:27:50 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:55743) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFyGS-0006Wg-LI for qemu-devel@nongnu.org; Wed, 09 Sep 2020 07:27:50 -0400 Received: by mail-wm1-x343.google.com with SMTP id a65so1910806wme.5 for ; Wed, 09 Sep 2020 04:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BRPNz1a1sR08C7hdTMgMEJxgHmTXfMUSkTnilwnfZ1E=; b=lQ87BerI/6IInv7C4UVMyrr/koYsPu7o6IJ/xepOPuhg6JsgkiQusgnYfIyKJOI81s UEWXUeXrTCDhIYWQQW4XhO/NyLub0eiAgHJ/UmLmsvuog9jtTqVcN8OS9E11GVL4mJHc Krj8HQip/EW7yTtor6oVQZcHu8eKtoH1oOLLN5r725Y2fL3HjD3V7MY3PjcgYi804PBo 31ba175OH+a81gI2v8VG9shuW9TKV4jjg3uP3fRWYVuoercIia7TnvLk1JdV9B8gGvOW hk86M+iSgYVjhYrXZh44wIjVbGBp4dBNzZDaUlg+LcZduc4aIGYwzr4FL99VsTD3Y1If N1vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BRPNz1a1sR08C7hdTMgMEJxgHmTXfMUSkTnilwnfZ1E=; b=uINBK+LaNoAr6LhxO8ziaZJOHq31HpH8GYxdob6ZqKDAMr8cmCJPVGXBG+zZpwZtKh QeQ5LMO5P8pFiFy/ExfD0g/atksjijMb5KGvJe0KiXn6Mp6Sh7bx3YvDt/Tf7rbzcdoY YrCibJlEo4/OzcP/6wnESCWYVkxzVbOrS+CTqQOHv5EnYafM/YTQ93d1MDfi7FyYCgLr dXom69MFwOPce1J/5VbnHgyAxI6Sm89l86LtdhB5Jx32UHqqxVThp3F++J4TcPiisam1 pEtOFXeY0/N4ndDPeH7ZjnWomS8XkFKcpFPtm5bLnraEj5IP+2RWzqJjmBDzqCb0nSXc Ipsg== X-Gm-Message-State: AOAM533JNtfXWoVU/iFm/efhtNwIyNvbI/ce7fel1lLz4aTxSBK4TaWa jUtmrupsUaioqp3ycJkRssqKog== X-Received: by 2002:a1c:9697:: with SMTP id y145mr3052305wmd.174.1599650867099; Wed, 09 Sep 2020 04:27:47 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d6sm3780191wrq.67.2020.09.09.04.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 04:27:42 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3CF3F1FF8C; Wed, 9 Sep 2020 12:27:42 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 02/10] usb-host: restrict workaround to new libusb versions Date: Wed, 9 Sep 2020 12:27:33 +0100 Message-Id: <20200909112742.25730-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200909112742.25730-1-alex.bennee@linaro.org> References: <20200909112742.25730-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, Gerd Hoffmann , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Fixes build failures with old kernels (USBDEVFS_GET_SPEED missing), on the assumtion that distros with old kernels also have old libusb. Reported-by: Alex Bennée Signed-off-by: Gerd Hoffmann Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200902081445.3291-1-kraxel@redhat.com> Message-Id: <20200903112107.27367-5-alex.bennee@linaro.org> --- hw/usb/host-libusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 08604f787fd..c5d38cb09c0 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -942,7 +942,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd) usb_host_ep_update(s); libusb_speed = libusb_get_device_speed(dev); -#ifdef CONFIG_LINUX +#if LIBUSB_API_VERSION >= 0x01000107 && defined(CONFIG_LINUX) if (hostfd && libusb_speed == 0) { /* * Workaround libusb bug: libusb_get_device_speed() does not