From patchwork Thu Sep 10 13:14:56 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: 249610 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp721078ilk; Thu, 10 Sep 2020 06:16:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXOBchDNYwDt9KB29BIrPqx50/ykQA2kA4e+nnFH0rWGm4o7TS0ZFrb+Gn15N+h5S8xhbe X-Received: by 2002:a25:fc0e:: with SMTP id v14mr13043535ybd.195.1599743783689; Thu, 10 Sep 2020 06:16:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599743783; cv=none; d=google.com; s=arc-20160816; b=vwvAg5V2bODmhAiQhMybSnxkZ2D4sgs62o4kLa4J8S/DeH9wzEHSMwoaRGmdGHd6Op 4yJVr5li1MYU70PqRcLZrCP1VrDHSUWwzhwktfjqVkWlszo294c5ZI9vI+8YH0y0cPk2 cyoYbk34Bfd/gp+j/RYvi4IiPsIfkFh0IYBabRH7ekQ5IY4R/HlYBAvWElB0Xkj2vhrP idQELIS13tTyIjxXHOkZ2VvVku114OeXiP1dmEXAoB8oGKzcCbrPEqN1qeat+k1/ZOdR /AunWkIx7BLtoQunM/DjbBda2OAgIHPlsf9iK+Yyv05ZMdWvTpwvu43LrcIUehfkAs/Z eqiA== 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=2cx8jHS3LDXcAjC1Gi1p55lLhOOKCtECYIqvv44WK10=; b=vTvb53fwrJ4WMh3b+Ya0tq4BRe7Eahj8dzdlTBtgyBwUJlrjr0w3rN19bG5z/1S3Ug eInxVK6+J0/DSQi1OpW0tqg5MNh77hxQvFTI4gOY+3XtutEiGClWBWe+B1128WjNzDWE Yl9cAOH8CKmSsYcKTPAmAOUqJ1sBMiajEgwc8mGFxrNzRB6OW5iwJmuWyALVMJ6qC+LL 5kVw4qf90+Bq41SpnYElP9yCdSBdEab9zE6KTup9oU486wpvTb636EIgaBCDgTMXXnW0 JqjFfQ2PO4JwDerm5bDnwmcFh1qEe07Q6tvolNCQkavfDOQO+L5eE55zPjL4OL6oeVJh R/Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hqaQz8ME; 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 i67si6477276ybi.220.2020.09.10.06.16.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Sep 2020 06:16:23 -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=hqaQz8ME; 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]:54978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGMR5-0004BD-1q for patch@linaro.org; Thu, 10 Sep 2020 09:16:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGMPx-00040M-19 for qemu-devel@nongnu.org; Thu, 10 Sep 2020 09:15:13 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:44137) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGMPv-00066x-BA for qemu-devel@nongnu.org; Thu, 10 Sep 2020 09:15:12 -0400 Received: by mail-wr1-x42f.google.com with SMTP id s12so6632211wrw.11 for ; Thu, 10 Sep 2020 06:15:10 -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=2cx8jHS3LDXcAjC1Gi1p55lLhOOKCtECYIqvv44WK10=; b=hqaQz8MEie1GF6oYswJDmywE8n12EtaZ4paup5LTS7qqWM++rSPPcSXwJvcG3Ub3q2 Ze2LoN+xyT+FA5ITATgl9MrCxjg6cmbL6PsYKwKvMFoHoguDZkQsM7sRXcQ2qWE9VeHT MuL/CQoDO10jZX8hJN98uFnfv0Tvc4Oafcir6J9RU0NDloXo9iiwkivJZ0dETjJ09lbC MEDaZtXrpxCVB0hNCCEJ0d8o/hwoDRlWsOeWbExa52fgPSYh+gEz85xDz9wu3UnnsKlV 250AREmaUjcynCdAlhNGIl33wKYV0OJgq0r29ZKudcbs0MYjJlQHM++FZ0dwcLfiXwkb q9dA== 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=2cx8jHS3LDXcAjC1Gi1p55lLhOOKCtECYIqvv44WK10=; b=E+NAZV5pEUjUXwL27Q8LqkpU8lFlPLkVvPbqJoAfdXe+jAjg6Ou5gKdIMHZPlWr1t6 +evVPd/sm1E0VMW2mPVAc+jADt1vd9jAx/uLynRWiAp/lXIy2kRkxaDH4+RNfjI4MwTd Tl3aatXPFe4uePVYImNnrEbLmlK4ljZCS3CpyKjV8x05y2z7mnzUBjY1O4UHhmY+isBK sEmrINpinsVywibhi7Mje/XYM5And8K2aP69U1dbkNlmSbdZR3lhBCTdDIiMQQuYGxxH sYAC7d+lF15+IXTi4NCSO3GU7JA3rNZyhyO1uirXeQdm89VYim7mpsbS6rluxkvqKq08 R/qg== X-Gm-Message-State: AOAM530fI9+mGQ7X3GGlr6p+0dZVb4CZfat35ubDjjlFDDnavTeEbEGa AUtxM4oUJEU/yQKU9Pb9pppbew== X-Received: by 2002:a5d:458e:: with SMTP id p14mr9053965wrq.61.1599743709923; Thu, 10 Sep 2020 06:15:09 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id i1sm11364022wrc.49.2020.09.10.06.15.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 06:15:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8F60A1FF8C; Thu, 10 Sep 2020 14:15:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 02/10] usb-host: restrict workaround to new libusb versions Date: Thu, 10 Sep 2020 14:14:56 +0100 Message-Id: <20200910131504.11341-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200910131504.11341-1-alex.bennee@linaro.org> References: <20200910131504.11341-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Gerd Hoffmann 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: <20200909112742.25730-3-alex.bennee@linaro.org> -- 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