Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp29820imm; Thu, 20 Sep 2018 13:32:49 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb3OshCXwMFqAFBBkjqOiloohzjbIWOEjfXnAyCiCS3Yo+BsEE/QC3XA0Gmp9emX5ZX1Esz X-Received: by 2002:a62:cd3:: with SMTP id 80-v6mr43607156pfm.184.1537475569857; Thu, 20 Sep 2018 13:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537475569; cv=none; d=google.com; s=arc-20160816; b=Rw5v4ZLCaJ2IUcE1EepBqWFyoztvNUctThmURASZdGXm4XlHwvWNHBlmS8vJbhZ3O+ zGp6hUumPhIGrB+IN0QnUhIVwiAHUQoJMprAR+DStmf0/+oMWGQ5z43uZnjGLkAk5FYh KA3T5lstrDD/Xf9gNxUwcNBOHEuUGDo2fD2Y8FvDrlbOdt2ellGli/J3T7LkZ6eooJWG /asl4F/j0w3Tpol7O9XFtQGlJZxOq8AWTGtCa6Zz1cMrwQ+NRwrlZzrGeiBicGXTLVav kSbVjlBIjlu7CvcSVD4LjEXyRFKG4D933aj089+r/LScL5CqiLYED1i1qKoLwMlfsXnQ V+YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:from :subject:mime-version:message-id:date; bh=2xNyXSaI1WCpGZW6G3dsFMSS0M3Im2dJ2a5mwLr3JM4=; b=uOw+9wPV9nvI85UKQgRQCsixU0UfSc0zFqXjZsPPO30Fy2rLscJphAStA+HpzvUfqK YHKHkzTd5uDIFwLyHpiO951Up0TPBxocamqtULSN9cGRIq3uU+x+b/ztifNooAWvpIDl VrzVP3O5Jqdj/h3llIC5ArXX+mmU91e+4vPPkN8mD9vJUiWTfEF6C0EyXOZ2eFeZB3mB R5z2TBroc9DuxcDmserrpDIyckiMp11+0y/HY900kyhV//U5LUjI0m1GGlqFgAT5X9mC lSSxnhv1fTdpNLhaXKvOEz4FekUU1eXkwrnFijyHx96obnA5RZdqCxCt8iuFUAGoM8uf ZxOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n19-v6si24002736pgb.3.2018.09.20.13.32.27; Thu, 20 Sep 2018 13:32:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388202AbeIUCPd convert rfc822-to-8bit (ORCPT + 99 others); Thu, 20 Sep 2018 22:15:33 -0400 Received: from mail-ua1-f74.google.com ([209.85.222.74]:50206 "EHLO mail-ua1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbeIUCPd (ORCPT ); Thu, 20 Sep 2018 22:15:33 -0400 Received: by mail-ua1-f74.google.com with SMTP id g9-v6so2445252uam.17 for ; Thu, 20 Sep 2018 13:30:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=oosC3zBRlLJuSxO84A2MdK513CIgTm7cyXI638jW6VA=; b=Nh9QOkg0GLzufaQqJKcEj+O+Cv1NAY5UAYgx32xY0kr/gnZMKLRDIZWt+yqp6jmhkn ZELznpYnM7Rb7IQa+hOESobFvpAIPLvrSNlVoRUQ1QmtjfPrCgtWhOKv9VAw57GfD/+p IKsJ8vqjigVDTV8IsPJwQHFW2DdZPgnkS8c2oS7k/e5AAiib1pUb2R1U7zHYWdywywWZ mYMmCz8StuPFHaiGvJnrk1Nvx5o3f4nZ+R/WdB3N0o/GX/w/qxXHilu+RCP9GxbeG28X gauucJ/85PpaVd/o+08JgDGHxl1m7RXVX7KuMlqrPFaUZEdSukQYmBU+ZhPAyZ4T/rVk WO/A== X-Gm-Message-State: APzg51DextLot+q1ticvZGNOta91B9vh5zNIn3jIhMWuWVkCEzshnAVK 2yP581ZNIbiIU/g/ITQZNFOw3g== X-Received: by 2002:a1f:9349:: with SMTP id v70-v6mr8303393vkd.58.1537475417665; Thu, 20 Sep 2018 13:30:17 -0700 (PDT) Date: Thu, 20 Sep 2018 13:29:42 -0700 Message-Id: <20180920202942.208509-1-zenczykowski@gmail.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.19.0.444.g18242da7ef-goog Subject: [PATCH] usbip: fix vhci_hcd controller counting From: "=?UTF-8?q?Maciej=20=C5=BBenczykowski?=" To: "=?UTF-8?q?Maciej=20=C5=BBenczykowski?=" Cc: Linux Kernel Mailing List , Jonathan Dieter , Valentina Manea , Shuah Khan , linux-usb@vger.kernel.org, "=?UTF-8?q?Maciej=20=C5=BBenczykowski?=" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maciej Żenczykowski Without this usbip fails on a machine with devices that lexicographically come after vhci_hcd. ie. $ ls -l /sys/devices/platform ... drwxr-xr-x. 4 root root 0 Sep 19 16:21 serial8250 -rw-r--r--. 1 root root 4096 Sep 19 23:50 uevent drwxr-xr-x. 6 root root 0 Sep 20 13:15 vhci_hcd.0 drwxr-xr-x. 4 root root 0 Sep 19 16:22 w83627hf.656 Because it detects 'w83627hf.656' as another vhci_hcd controller, and then fails to be able to talk to it. Note: this doesn't actually fix usbip's support for multiple controllers... that's still broken for other reasons ("vhci_hcd.0" is hardcoded in a string macro), but is enough to actually make it work on the above machine. See also: https://bugzilla.redhat.com/show_bug.cgi?id=1631148 Cc: Jonathan Dieter Cc: Valentina Manea Cc: Shuah Khan Cc: linux-usb@vger.kernel.org Signed-off-by: Maciej Żenczykowski --- tools/usb/usbip/libsrc/vhci_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/usb/usbip/libsrc/vhci_driver.c b/tools/usb/usbip/libsrc/vhci_driver.c index 4204359c9fee..8159fd98680b 100644 --- a/tools/usb/usbip/libsrc/vhci_driver.c +++ b/tools/usb/usbip/libsrc/vhci_driver.c @@ -150,7 +150,7 @@ static int get_nports(struct udev_device *hc_device) static int vhci_hcd_filter(const struct dirent *dirent) { - return strcmp(dirent->d_name, "vhci_hcd") >= 0; + return !strncmp(dirent->d_name, "vhci_hcd.", 9); } static int get_ncontrollers(void) -- 2.19.0.444.g18242da7ef-goog