Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp2083877ybb; Fri, 29 Mar 2019 18:38:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+IjGGLgmikWmux7JjnzpcFXBDO9ecJS3z1d1ecMD7wCoM+Su0SWXoooiW74hJvVdIc9Rw X-Received: by 2002:a63:e850:: with SMTP id a16mr48747225pgk.195.1553909895469; Fri, 29 Mar 2019 18:38:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553909895; cv=none; d=google.com; s=arc-20160816; b=Vk/BPuUnqm/2/rg+5eqaMxeunBfAB76P2SVOtdpmVzLuZi1h28L9ssQ4MbE3vrJgrY Qh2CItAYS3xCzcX4/H4V74Oz1pjTozonou8GWLj/solhK2wvej8VP9dxF9GbEFbpHJZV l85RqvPRACCC3eQ8wkYL/OiCx8wTZ8nErXHsbKxJBIobf7w/QI1stg8h0JIyclU5wvin sAHdy+NP2qFNoYDzimVT0XV+7U0YHpqtjUj8O1NPB2DF+qJ1Z8GxWrMZds9KtuQ37tXw aLq7qGOxScJ1HxMkcfMYeDkDfpakiP+WHCeZ9J7QgcqyV0xfdBwxfvbe+Tr3iXFHl8Kk tU/A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fbCU0Oz4OxsjyV9PvF3K5xFd/gH2V4537X2zKxevP74=; b=WqtfSc5oCEi1HLv7TsgBac/AT8WuRAbOUe8dv2wfpbIkgGWNHO/REEacksohshGJXW tsXG2lpbVK8+xHZvwQFwEBJXbCrGyIyKeHTcv/yOz2/jwgxYKFVmeR5L50Ia09KZA8Fb SSZWvLk5fGLEjBPEQ5/HvtChuQSEa7TbpC/xIpGib5r8mtJzXs4b7+OAt7EDvGYxbls/ tXjaUzTIGUufNw46R8s2r1LnzhWN9s18dG1f5KRzD4MnTs91GryCwEhK3z0Vpp5iHIgy /6ymS0pmIcB8jbZJHbM//d6U96Ktx6RITTYxX/FYG0afSnZqqKOBEBtQkS7f3e9w6g8a 9lLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OiVImN3T; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si3121997pga.209.2019.03.29.18.38.00; Fri, 29 Mar 2019 18:38:15 -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=OiVImN3T; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731524AbfC3Bh2 (ORCPT + 99 others); Fri, 29 Mar 2019 21:37:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:38136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731759AbfC3Baw (ORCPT ); Fri, 29 Mar 2019 21:30:52 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E25712184C; Sat, 30 Mar 2019 01:30:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553909452; bh=kWhj8/bIaPGCa6WIfHjsvItK2SOu/uykrgSNdmB1U2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OiVImN3Tn8vWFgCX4wpmeOMjGCtb/uiHwJB9NKRgkosXxPmjSoOp79EeGLq+IDNzf 2UhpRWwk4mKW+0prZIkiGP+65Rwc2q2ftPQqB6t36pvU+wTfo0jNFLqFY8Gh+BnWAI 6Fbr952QZPjwrHYPkGBlpJIXfMnBoys3b1Pl+TEo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= , Jonathan Dieter , Valentina Manea , Shuah Khan , linux-usb@vger.kernel.org, =?UTF-8?q?Maciej=20=C5=BBenczykowski?= , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 4.14 12/37] usbip: fix vhci_hcd controller counting Date: Fri, 29 Mar 2019 21:29:55 -0400 Message-Id: <20190330013020.379-12-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190330013020.379-1-sashal@kernel.org> References: <20190330013020.379-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore 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 [ 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