Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp2085406ybb; Fri, 29 Mar 2019 18:41:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqya5XvaRkLsg3y8/BD/I6mTb/TR0McRWlQszlp1yTQyrMPHbCLzw6ErLi7xsQ5TLt8NCh1c X-Received: by 2002:a17:902:1a9:: with SMTP id b38mr51816241plb.37.1553910077422; Fri, 29 Mar 2019 18:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553910077; cv=none; d=google.com; s=arc-20160816; b=J2BHyuuHFtolT/UHH4SOEp+EadV2vLiauP17M9azxu+38gMX5gkkUmDmTNpyY/cGYi BZEX4q6E0ofN9nhjMQ18p+XpiqnrGPO7dbJOl3O9GuunxG3Gc0gf6JysOP6ej5K7ONZg vAHodMFNxQZhg7qpxMQeh2DX4hbZFkGPUEkiD8Pn8b2+WHxLCgoqa0dfUGnFEbqG41n5 u8xZ44DTf/HIBjawsU2frJPDspBMvWeNIlgJqOoo73YpyzB3azNhou9j80Hkhzj9RNdo 1B5XkYecx0q3mlqUGLm90eZDEhn1tJikmYD2t0bVX7+l7HmWW89j4VmK0kKLmIgga9w1 8q5Q== 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=R9ZZg5Qmj/D9p7ux4TtGWeh4fkpBm7KB/Ldx9NFqqsw=; b=qUMEE/Ongj0PY6t2zMdxLFnycjLDE2BTLv0+QoP9sYplCWxxsGdWlQGCU3I+j17hDN vU5b8HdbRHalM8kd427NBJWdt3Bhu2tuM8IbR9uqvaXn6NGLS1Y4OcSII21xhgAzzSQ/ 07NjDn+AtKnOCwsIrdJON/JYGXB6qczDobk6yemPZ16fJhHEOLkt2URkd2SP2cXGKMjx pKKGRb962r9gEultKI5LMFCMBg5DhbNnKSfZCleB4aw9IHIKKUmuvzpo1+sNz7PmmVhA q5OJtVFwKwajn8z/H7cZsbAPoAtlIzEEFoNfjKaV4L/LmJ3tXcdjyhbhxP4YVQ/50zk+ m4xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2X7mRByM; 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 i69si3292416plb.75.2019.03.29.18.41.02; Fri, 29 Mar 2019 18:41:17 -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=2X7mRByM; 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 S1731582AbfC3Bka (ORCPT + 99 others); Fri, 29 Mar 2019 21:40:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:36422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730996AbfC3B3c (ORCPT ); Fri, 29 Mar 2019 21:29:32 -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 08B4621773; Sat, 30 Mar 2019 01:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553909372; bh=tAFuqHnDKVjgSvsagGL8Irm1UNCB4Fab8wZHcV8DhpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2X7mRByM/FytXx0nnYxdG41gRmSTvBX/DRackdMxK7tfNOzB3n2RmDLnnDOAk+/rS x2t+BtyzNpM0RHTL0SkqTBUcyAYXe7Y1CFcUOgAj6NEb9bLIT9EzlXbYQHjUnlv1VD c7YWCC0sKQ33QAkx3CYwbAACzOLabmdk7aipwRL4= 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.19 17/57] usbip: fix vhci_hcd controller counting Date: Fri, 29 Mar 2019 21:28:10 -0400 Message-Id: <20190330012854.32212-17-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190330012854.32212-1-sashal@kernel.org> References: <20190330012854.32212-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 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