Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp905062yba; Thu, 18 Apr 2019 11:32:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVoCQQy8fuYRRpZALJbrxBpUVoKVCDXErB/52LARGmHYzmg00IAvZ2H99jZFZDRlCtXg8V X-Received: by 2002:a62:3849:: with SMTP id f70mr98653383pfa.46.1555612355218; Thu, 18 Apr 2019 11:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555612355; cv=none; d=google.com; s=arc-20160816; b=bFyt2BExB+kUKTub8xxzeWillX/rTZF4bH21osSBlTDislaYqgcE4ps68GAy36ux90 uxs19ch55tKfmguUpMqIUhRbQtDQDaGqMCIRGmEH6UiBNF/qvdcrTQFvbsK/Uo9TmUIN 0pzbkxQGJjG78Sg3D43iTSkg/CsWGWyZGa9yPslRe83K5oX/htM7EIFhveR2jNXIWfL8 GfxEIyAGnls568k+8c6dZBkD6It1MdLDlqG0dX0UdGGu7CbDHw6GQs3NxbWLlggRN9qz TCPD0mEl540ZBsXznxZeqW3T9gU3HoasmNIiqhcVmB2DrOzWwfCdgR9iMtNd6VPWbFj9 uMcQ== 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=GP6Z3V7VSg6xPpbbCoLMowbEw/yWpku22PKY8jEZWHw=; b=oZdKXCtz7x/kOWBJvNMlAtlsLySOfpfZlTSTISakwik5PyHQ5j0WWygTPc2c8rZiHF U88v/Vo8Rj9P1knYnFmilKrM6odx0qFG0CWesc0cv/oEZZ/TUB1++qR1I6UOZYEqb9KH i777LMMtRTLK0MBzK2M/4kTVGn4xuKZKUwunmADpOLtLenQfmARD/vViR2DpL1B9O8B7 CIMt6+DGOI7qllEONE01UcgO9/XIaH3VEheCyJv3xJ2gkeXtWdQqXyB2xB3Ojhu+HKQ0 XRQdDRhpZOvEIuj6sPnXobwTuSsyQlieqb1GcAcCHoKdFliB+LAiDE/nBhUuQ2voTWO2 tNEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L7ewULW1; 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.32.19; Thu, 18 Apr 2019 11:32:35 -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=L7ewULW1; 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 S2388301AbfDRSA7 (ORCPT + 99 others); Thu, 18 Apr 2019 14:00:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:56380 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390451AbfDRSA4 (ORCPT ); Thu, 18 Apr 2019 14:00:56 -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 66B76206B6; Thu, 18 Apr 2019 18:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610455; bh=5V62lUEdLmCtaS+NBlXGPV8GZQJwJkOClSPYavQmJNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L7ewULW1AvD5aL22SsHNzw6vNFJtzQpa57Svvf2Sbo//lsN2gw0P67P1oOLtYSGPg 3Hb1YveolDJyL43t3NNVIInU1UJ64YGJYN3aj6Y7VElF6SqNTb4h8qhxyjkWIBr0/U b9XEoKSPkXJjKxqqdrWcqLXxfsIIOtsF89xM6cII= 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.19 069/110] usbip: fix vhci_hcd controller counting Date: Thu, 18 Apr 2019 19:56:58 +0200 Message-Id: <20190418160444.880926530@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160437.484158340@linuxfoundation.org> References: <20190418160437.484158340@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 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.1