Received: by 10.192.165.156 with SMTP id m28csp1328065imm; Wed, 11 Apr 2018 17:17:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/mOPs0tzeQ9hJ4ZXUZ3jo2jPFxGJHsuLjJSmSn/jo55zZOhYCWbwKBsfVHc8glDqMX02pz X-Received: by 2002:a17:902:8602:: with SMTP id f2-v6mr7112780plo.73.1523492242572; Wed, 11 Apr 2018 17:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523492242; cv=none; d=google.com; s=arc-20160816; b=a8fmbmI3oHVrDZz7829rSpSNtCvqUENdBLJViOW+2vqeCEBcXpOZ2vlYswFL5z7RH/ ktQDBt6l/mxI5xFrTEi0liWxtHIvz8hPfoigZ/Ay3wCFbFGJ/QGyj1QYAhhBFm9syRYD eaWUg4sENIMtZk8m8pJtcNLaak7E7E7a9N/+JaSLimNg3ztcLstU4kc2RTTmYyLui6NH v6tE13xnym8tuTBSeSgde829cL0UYFYfW1N0dGouDIf5G5zcgWh6OOasQEh3kSSUMLOF MqKD/ZvK/vQIjS1o7ByaeAu4nHnuSScZWnu570/iTXDdCThqy7RKv8wc1sTYHYiwBwbc kJoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8Wf89IVSyuxOMoRDwhuVcvRBuw1OP5xFna9hSfSZWo4=; b=on7wiG7b/DIk125lxuDpwnlgd23I2c7kzsONPHgLoZY+Oxsf8gZB2UnTnWdGrz0sOe 2yz7fl2bS5MCk/ilttS5coBC/8i5Ch0t79KPFtjZad5CFaa/9ZO1tBEBjRZNaPGy+EWH xd0G5E2uH2/aIVIl7K5c5wXsWakjyUwQMxxz8Uk4G/XLuwj8NH4eqTpizqjs/L94jL7S neHSXJ4t9n+Esn/00+I1mT3bfK4mmFO3WTQOlgnmejsfHM8C+/6lrF3qrig6VbZDK0Ns 4mKws2eg3oKfpoYgfRWh9NoZk+lvO9mo8PtqP+ojv8h0X3WhYDmdcKH9rtZ598iOe6v+ oLvQ== 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=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10-v6si2225783plr.398.2018.04.11.17.16.44; Wed, 11 Apr 2018 17:17:22 -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=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752320AbeDLAN7 (ORCPT + 99 others); Wed, 11 Apr 2018 20:13:59 -0400 Received: from osg.samsung.com ([64.30.133.232]:52127 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751553AbeDLAN5 (ORCPT ); Wed, 11 Apr 2018 20:13:57 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 03D161A919; Wed, 11 Apr 2018 17:13:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QZQ8g8P-PQgU; Wed, 11 Apr 2018 17:13:55 -0700 (PDT) Received: from localhost.localdomain (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) by osg.samsung.com (Postfix) with ESMTPSA id 6B5061A903; Wed, 11 Apr 2018 17:13:55 -0700 (PDT) From: Shuah Khan To: valentina.manea.m@gmail.com, shuah@kernel.org, gregkh@linuxfoundation.org Cc: Shuah Khan , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] usbip: usbip_host: delete device from busid_table after rebind Date: Wed, 11 Apr 2018 18:13:31 -0600 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Device is left in the busid_table after unbind and rebind. Rebind initiates usb bus scan and the original driver claims the device. After rescan the device should be deleted from the busid_table as it no longer belongs to usbip_host. Fix it to delete the device after device_attach() succeeds. Signed-off-by: Shuah Khan --- drivers/usb/usbip/stub_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c index d41d0cdeec0f..fb46bd62d538 100644 --- a/drivers/usb/usbip/stub_main.c +++ b/drivers/usb/usbip/stub_main.c @@ -186,6 +186,9 @@ static ssize_t rebind_store(struct device_driver *dev, const char *buf, if (!bid) return -ENODEV; + /* mark the device for deletion so probe ignores it during rescan */ + bid->status = STUB_BUSID_OTHER; + /* device_attach() callers should hold parent lock for USB */ if (bid->udev->dev.parent) device_lock(bid->udev->dev.parent); @@ -197,6 +200,9 @@ static ssize_t rebind_store(struct device_driver *dev, const char *buf, return ret; } + /* delete device from busid_table */ + del_match_busid((char *) buf); + return count; } -- 2.14.1