Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp839936rwd; Thu, 15 Jun 2023 02:49:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6N9aIHOLJkg/KDr1m6Noq8uJAgiq9bGkWKkmj/TO+QqzrfL74mN5en9RTvsxhdAQV2zxD9 X-Received: by 2002:a17:90b:e8d:b0:24d:f77c:71e7 with SMTP id fv13-20020a17090b0e8d00b0024df77c71e7mr3076396pjb.41.1686822585567; Thu, 15 Jun 2023 02:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686822585; cv=none; d=google.com; s=arc-20160816; b=EkA62noW6HajQ4f9eeOeFJ5cCGrtI3ng+Z3VdsGMJobWbf9X5rPLRxbGj7gBBmI5r0 WcBE4oI/FxE25FPSsly2ZZ/qufnTbTW1ymSFqaHy7slRiZch6C4eaTqZygUcvXPairty 67h09GokkBxnsFHl2DDKoTizgkPTDxJgqOk5MXYEBDBpq/5J10IY2YnscWpn2+UQY5SL LfBltwslA0jBJZPt7ec5JvMMAwjnhd6KMVkHz1HC9jhK+e9kK7IrJzm5menkC0IdBukV s3TfGonAfwAYr09V969nFFOhKwhl+Zwnfqh5BdSLPk/ZX33jp8ts7PNOzdaEylWbrmIw tfEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=q7BSUT89A/aXArhEITi0Q0tDDFi5JVVB2hi3WwVGlig=; b=rHmSG8HXZB3Rr9DzKrq6ynDvUL4V5aoh5/uUsTOu6yhEN6zEUKnVLIF7mmBk+7Z6lX HQWrxr9k0o5d6kMOnbBPiZClB0jVJqwQZR+V3No7c9nPa6eHFJeR3HRBcWhrucCxr533 kZbJGAFNd4z1x2LBY3OP+eGbWfic683sPVck7Q1YVpS5Vc+MExoiSZDaOvBphc/0LdQw i2bxB8mZuWAVw10wAAwUtg/Zf3NAZUFO1BeGDNK+eUEIh7iX8sXau21fiMosS86YkDXJ 7BjUZ5YssoVjQ7rrSHIN4bGZIKMUdTr2PAOpAUEJKofGrI5l810JHL9CdYgYYNaF8WkB IfCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mi9-20020a17090b4b4900b0025bc95b20b8si9052627pjb.15.2023.06.15.02.49.33; Thu, 15 Jun 2023 02:49:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245537AbjFOJW2 (ORCPT + 99 others); Thu, 15 Jun 2023 05:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240323AbjFOJWQ (ORCPT ); Thu, 15 Jun 2023 05:22:16 -0400 Received: from mail.actia.se (mail.actia.se [212.181.117.226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B0CD2726; Thu, 15 Jun 2023 02:22:10 -0700 (PDT) Received: from W388ANL (10.12.12.26) by S035ANL.actianordic.se (10.12.31.116) with Microsoft SMTP Server id 15.1.2507.23; Thu, 15 Jun 2023 11:22:07 +0200 Date: Thu, 15 Jun 2023 11:22:05 +0200 From: Jonas Blixt To: Greg KH CC: , , , , Subject: Re: [PATCH] USB: usbip: fix stub_dev hub disconnect Message-ID: <20230615092205.GA1212960@W388ANL> References: <20230613092918.4191895-1-jonas.blixt@actia.se> <2023061347-reverse-staleness-e4f3@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <2023061347-reverse-staleness-e4f3@gregkh> X-Originating-IP: [10.12.12.26] X-EsetResult: clean, is OK X-EsetId: 37303A294A191A536D7367 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 13, 2023 at 11:50:31AM +0200, Greg KH wrote: > On Tue, Jun 13, 2023 at 11:29:18AM +0200, Jonas Blixt wrote: > > If a hub is disconnected that has device(s) that's attached to the usbip layer > > the disconnect function might fail because it tries to release the port > > on an already disconnected hub. > > > > Fixes: 6080cd0e9239 ("staging: usbip: claim ports used by shared devices") > > Signed-off-by: Jonas Blixt > > --- > > drivers/usb/usbip/stub_dev.c | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c > > index 2305d425e6c9..257861787cdf 100644 > > --- a/drivers/usb/usbip/stub_dev.c > > +++ b/drivers/usb/usbip/stub_dev.c > > @@ -427,8 +427,12 @@ static void stub_disconnect(struct usb_device *udev) > > /* release port */ > > rc = usb_hub_release_port(udev->parent, udev->portnum, > > (struct usb_dev_state *) udev); > > - if (rc) { > > - dev_dbg(&udev->dev, "unable to release port\n"); > > + /* > > + * NOTE: If a HUB disconnect triggered disconnect of the down stream > > + * device usb_hub_release_port will return -ENODEV. > > How about adding, "so we can safely ignore that error here." > > thanks, > > greg k-h Yes, I'll update the comment and prepare a V2 patch. Jonas