Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp881671yba; Thu, 18 Apr 2019 11:08:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyDpK8/TpXwPm8FHGgOwcpXvhPBzWwpEObQVrIxM8w+jYQmet8O6fPvhbsvRznvbUvwp1D X-Received: by 2002:a17:902:2b81:: with SMTP id l1mr97773771plb.289.1555610883859; Thu, 18 Apr 2019 11:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555610883; cv=none; d=google.com; s=arc-20160816; b=N3Q/l9CWA3Nzzdigq65TN0wnofjyfITDDU6YOAGvqqe00iG9G7/0P9U1LrftVEVlHo VwqKWgAV5s2zIAYe56xz2JOXUjqOi06Nm3OW+dx3G9ImaHmOEO89F5OjUWs64Quu8/Ap U8Oyz7jouWhbutFrQmb6QBr2f5O5wOUoFKNlvoa7VESO67yGpKI7sljoMLOyc+rLHekX /8CJ0Z3y/i75ck9LMy+bbFKYTXAo4kjhsJNNaS1rNoj4VxW89VgOl5DLwkV4mEL54vvO Uw03od+rocTzSsYsiObPPu0VzDCtPE+rtm37hbMXYY6NhDYvuILTHzXHGBWjE/Y+9koV BAHQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OyVqC68lhleWhX58IEFGRPiq+een7hmFo7JOMkEjnmw=; b=uI//8xtaLcmuCPIhKXxJk03ucUJgz0TIpyzzgMj9a3V9p/ffb6hfEO2Q+cxv+YF4fz tm5V4K/sKr8mqPC9e+oc4t0yt4eeJIbuyxN4Pzb9n4nFBWPEQnr7g+nMs1N834LAEx6o 3mRw3+imyTeLbNDsrSD5yKi8ogRQup9utKFENeuHeKnKYGInfD7TakGtIMZ1OTvEFCei te8KBtbthIFFh1HKUvISRm0airm45jtcugrowwZ0qqOB0ctSbnW3X0UHlZslQR776xF0 bqUaqeEpEwFJDu8Ob2MQBszOsZRL5/i1fxRw29GRMs7A9UmimNhxCwgRrZO0BWFz2S0b Zi5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Zs/ZNnEs"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 60si2713908pla.335.2019.04.18.11.07.48; Thu, 18 Apr 2019 11:08:03 -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; dkim=pass header.i=@kernel.org header.s=default header.b="Zs/ZNnEs"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390418AbfDRSE4 (ORCPT + 99 others); Thu, 18 Apr 2019 14:04:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:34062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391176AbfDRSEy (ORCPT ); Thu, 18 Apr 2019 14:04:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 455C2206B6; Thu, 18 Apr 2019 18:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610693; bh=pkzGvBQSwiZVsnJsH9MSTLUl6m8IndwiPjURJPXby3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zs/ZNnEs8un0EIJNLIm6fTB98ke+PG5DgxTn+IRQc3AvCr100Em0fTxzXWmOMj2Cm J1jfmQWLnDPMyTs6JazsU2uSte8WRYd0e0IC9Cl7VqiNBKitXDntvHUYYIR/vCGd0J 3Iayi4xKY2NdmBJY0aRUsT5MTNun9GNz6RljXzgo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Dieter , Valentina Manea , Shuah Khan , linux-usb@vger.kernel.org, =?UTF-8?q?Maciej=20=C5=BBenczykowski?= , Sasha Levin Subject: [PATCH 4.14 49/92] usbip: fix vhci_hcd controller counting Date: Thu, 18 Apr 2019 19:57:07 +0200 Message-Id: <20190418160434.377300492@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160430.325165109@linuxfoundation.org> References: <20190418160430.325165109@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 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 [ Upstream commit e0a2e73e501c77037c8756137e87b12c7c3c9793 ] 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 Acked-by: Shuah Khan (Samsung OSG) Tested-by: Jonathan Dieter Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 ed8c9d360c0f..4225d462701d 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.1