Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp723728rdb; Tue, 5 Dec 2023 19:39:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBHK7oooOtB+4bRsfes/+TeW0N8egmSTrDBnK16QcBkBUkcYlooe87eVe11Pq2OeK3W594 X-Received: by 2002:a17:90a:bd88:b0:286:c040:e6cd with SMTP id z8-20020a17090abd8800b00286c040e6cdmr339344pjr.46.1701833974040; Tue, 05 Dec 2023 19:39:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701833974; cv=none; d=google.com; s=arc-20160816; b=qsa2EKezYbevQH41+Gp8aWp49L7jlOzKnCD+CIUOhfectkMFAlG2wjJN7tyhmhI/mU 4TBGIPFRi34aAoOm2LZRoccHTeXlWfA6eFMCM0KTXTQYZZZ5M6/pdKCvYnCNRjMS7ubg Y8UDh1we9uSFJmKvNkd5ElMUonNWIAjy8LGnF0ePuXxJXkiSf3unPbkNP9N9tnH6ZgUx BVpTkgUmRkAaAYGpsOCPP9vDoEngtEi2+hXdng68TEM8dBQSjinmL9ZGQVruqCSIUtId rB8e70BnbXl92RRoq8CEcJAuCKlL/XwdcorXAY2Qus7AWdwjGgqGQaMphkCQ6EHpvTLS IicA== 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:dkim-signature; bh=f13XgZBJdZnTQKl6QFTurdyGivfnB6mu0DXAGWcDHp0=; fh=PcB35nrEl7xSqOFlSM9aB4wXx1Z1W36MjHlCuI0UWYM=; b=BHOTbOC5r5on0HnpTLpZP2eDo1AW/zlSEGcozB+91n763LA5yohkeZ25s9If0hUg29 2MHh1WFPi1quGz/5ZfCy55Br05wUrtx1X0tOOOwaoasFHr9PH4sA5Lonbj4OxDU0Mh5e MZx71YpcIYI8jLT3wPKB21BKb+IUxht+IUWqwpT8zXXgv+pmk91KKoIMomylCTq+OIV/ YeptTpn5KVgPncEqhEngt/27OODgxeGPlVqERnyNHt5sTFgoBX+uqWmyV8TFL6/iAYW+ tSdenBn26fNvr387WI0AMyC1Y1vJ2BOB6s2A1GlIGDdqK7N7N2jlhnBEjCmXHXcgKQ5f XYGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YIQ0ECqQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id l11-20020a17090ac58b00b00286c168876asi3563835pjt.54.2023.12.05.19.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 19:39:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YIQ0ECqQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D168D822034E; Tue, 5 Dec 2023 19:39:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229920AbjLFDi5 (ORCPT + 99 others); Tue, 5 Dec 2023 22:38:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjLFDi4 (ORCPT ); Tue, 5 Dec 2023 22:38:56 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EA7E1AA for ; Tue, 5 Dec 2023 19:39:03 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24730C433C9; Wed, 6 Dec 2023 03:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1701833942; bh=I58oH3gxaXTUpHLr44iFAtoJDHEru7JOv1e8S71m5zs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YIQ0ECqQT8hbMvrqpOzxYPz7G9yKPp/RgU8FHNILKdDyJno0My3V3wxFoWrJWsGvo Ix/RkIyAhokLtuxzUxKLGKVQ+f2lw9vDEvBkAQb15LnkgAppWu2CiMae6R2Tkxo7rP j2RPl1DxZ+byeBOsS1CQGqNsac9fvtgMgD397Zb4= Date: Wed, 6 Dec 2023 12:38:59 +0900 From: Greg Kroah-Hartman To: Simon Holesch Cc: Valentina Manea , Shuah Khan , Hongren Zheng , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] usbip: Don't submit special requests twice Message-ID: <2023120641-krypton-presume-a375@gregkh> References: <20231130231650.22410-1-simon@holesch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231130231650.22410-1-simon@holesch.de> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 05 Dec 2023 19:39:31 -0800 (PST) On Fri, Dec 01, 2023 at 12:10:13AM +0100, Simon Holesch wrote: > Skip submitting URBs, when identical requests were already sent in > tweak_special_requests(). Instead call the completion handler directly > to return the result of the URB. > > Even though submitting those requests twice should be harmless, there > are USB devices that react poorly to some duplicated requests. > > One example is the ChipIdea controller implementation in U-Boot: The > second SET_CONFIURATION request makes U-Boot disable and re-enable all > endpoints. Re-enabling an endpoint in the ChipIdea controller, however, > was broken until U-Boot commit b272c8792502 ("usb: ci: Fix gadget > reinit"). > > Signed-off-by: Simon Holesch > --- > > Changes in v3: > - handle errors in tweak_* routines: send URB if tweaking fails > > Changes in v2: > - explain change in commit message > > Thanks again for the feedback! > > drivers/usb/usbip/stub_rx.c | 73 +++++++++++++++++++++++-------------- > 1 file changed, 46 insertions(+), 27 deletions(-) > > diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c > index fc01b31bbb87..76a6f46b8676 100644 > --- a/drivers/usb/usbip/stub_rx.c > +++ b/drivers/usb/usbip/stub_rx.c > @@ -144,53 +144,62 @@ static int tweak_set_configuration_cmd(struct urb *urb) > if (err && err != -ENODEV) > dev_err(&sdev->udev->dev, "can't set config #%d, error %d\n", > config, err); > - return 0; > + return err; > } > > static int tweak_reset_device_cmd(struct urb *urb) > { > struct stub_priv *priv = (struct stub_priv *) urb->context; > struct stub_device *sdev = priv->sdev; > + int err; > > dev_info(&urb->dev->dev, "usb_queue_reset_device\n"); > > - if (usb_lock_device_for_reset(sdev->udev, NULL) < 0) { > + err = usb_lock_device_for_reset(sdev->udev, NULL) You didn't actually build this change, so how was it tested? {sigh} greg k-h