Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1762263pxj; Wed, 19 May 2021 13:20:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw60oCFRzpdDccFea9WTtxELNFIF11KiBR8Dp5Zy4Xcv0J6R2WrubYzKu58dhW3D4MGjXJ6 X-Received: by 2002:a02:c9c8:: with SMTP id c8mr1039756jap.71.1621455605211; Wed, 19 May 2021 13:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621455605; cv=none; d=google.com; s=arc-20160816; b=iSU2Gi6Sc8CdxIvyNlECKHrKYsZOEkxxjuabd4J9XPV4C3wnHY+UH5m9ciI1BCvQVM EJZiVFm3CKDlSpPrYuqbrK/L4lQJT8whVkgDHSltWKc86Yt8QxgCYVcJ/nEz3r8so8P7 eAwrTIxSSWadFNrD8qz226XFH7+LCt0yDRUubl5S9m0u0WjNsMJerycm6plP/Kz15gB4 chEZP30l8PunJKKdrMXVI11gwPAZJq2qwuPP7Ve0KnuGeOxiqLPyYT5oh3C69efMBNCz 4lFok3Puj30ebo6Mq408YO6iRG+tBMd5y1pd7pxcbbi0nAReoHbhB7baqXQ9CcPdCWep fjmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=QluBFGGfM4yHku67+Wc6FOyMCD25JlZXZ/whchUB7/o=; b=p6ZC+VK/oY5QnHh0PbaL2qrPCLw5iVz5NcwF+mo5OY5xwenbbgvbf6vnSALmlDWNkS P5iCnhEXoz1vmQu/y03NE/kk59GfbMUfqKVn9f7SZCofhIGQx+ZtUxW8sxYNUi+C6wl2 hg4RGCvq1MziABMFFymxEiJhud1KuJ8dTOqjMqOMVLogET6bcnIkAo1qnyYhL+eV5BQj r3p4VV/mMMZB3p7OMuvugLixgqHVqnwPeRZnYNDMSbHh7kTF2nUYwWSR3dwc9JJqhsYb tLCkAHisBPXGrxchHJvHzq0qC0j0icJhm9p+qCwaIYnyuRWj1/ywn/QzTnB4OYzDGZvO nPEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si284606ioh.5.2021.05.19.13.19.52; Wed, 19 May 2021 13:20:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229891AbhESRhG (ORCPT + 99 others); Wed, 19 May 2021 13:37:06 -0400 Received: from netrider.rowland.org ([192.131.102.5]:46621 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S229589AbhESRhF (ORCPT ); Wed, 19 May 2021 13:37:05 -0400 Received: (qmail 1174008 invoked by uid 1000); 19 May 2021 13:35:45 -0400 Date: Wed, 19 May 2021 13:35:45 -0400 From: Alan Stern To: Guido Kiener Cc: dave penkler , Dmitry Vyukov , syzbot , Greg Kroah-Hartman , "lee.jones@linaro.org" , USB list , "bp@alien8.de" , "dwmw@amazon.co.uk" , "hpa@zytor.com" , "linux-kernel@vger.kernel.org" , "luto@kernel.org" , "mingo@redhat.com" , "syzkaller-bugs@googlegroups.com" , "tglx@linutronix.de" , "x86@kernel.org" Subject: Re: Re: Re: Re: Re: Re: [syzbot] INFO: rcu detected stall in tx Message-ID: <20210519173545.GA1173157@rowland.harvard.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021 at 04:14:20PM +0000, Guido Kiener wrote: > > On Wed, May 19, 2021 at 10:48:29AM +0200, dave penkler wrote: > > > On Sat, 8 May 2021 at 16:29, Alan Stern wrote: > > > > > > > > On Sat, May 08, 2021 at 10:14:41AM +0200, dave penkler wrote: > > > > > When the host driver detects a protocol error while processing an > > > > > URB it completes the URB with EPROTO status and marks the endpoint > > > > > as halted. > > > > > > > > Not true. It does not mark the endpoint as halted, not unless it > > > > receives a STALL handshake from the device. A STALL is not a > > > > protocol error. > > > > > > > > > When the class driver resubmits the URB and the if the host driver > > > > > finds the endpoint still marked as halted it should return EPIPE > > > > > status on the resubmitted URB > > > > > > > > Irrelevant. > > > Not at all. The point is that when an application is talking to an > > > instrument over the usbtmc driver, the underlying host controller and > > > its driver will detect and silence a babbling endpoint. > > > > No, they won't. That is, they will detect a babble error and return an error status, but > > they won't silence the endpoint. What makes you think they will? > > Maybe there is a misunderstanding. I guess that Dave wanted to propose: > "EPROTO is a link level issue and needs to be handled by the host driver. > When the host driver detects a protocol error while processing an > URB it SHOULD complete the URB with EPROTO status The host controller drivers _do_ complete URBs with -EPROTO (or similar) status when a link-level error occurs... > and SHOULD mark the endpoint > as halted." but they don't mark the endpoint as halted. Even if they did, it wouldn't fix anything because the kernel allows URBs to be submitted to halted endpoints. In fact, it doesn't even keep track of which endpoints are or are not halted. > Is this a realistic fix for all host drivers? No, it isn't. An endpoint shouldn't be marked as halted unless it really is halted. Otherwise a driver might be tempted to clear the Halt feature, and some devices do not like to receive a Clear-Halt request for an endpoint that isn't halted. What we could do is what you suggested earlier: Note the fact that the endpoint is in some sort of fault condition and disallow further communication with the endpoint until the fault condition has been cleared. (It isn't entirely obvious exactly what actions should clear such a fault... I guess resetting or re-enabling the endpoint, or resetting the entire device.) Alan Stern