Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1724414pxj; Wed, 19 May 2021 12:22:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznOuQX886mjO1FCBPWXIHzhSR1KUgO1EL6exRj1opgKJhUfZ8C8n2x5jmPaqDNd61MnThz X-Received: by 2002:a5d:8246:: with SMTP id n6mr1218336ioo.73.1621452173857; Wed, 19 May 2021 12:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621452173; cv=none; d=google.com; s=arc-20160816; b=ZKe/Tui/rolgi1XkfdfctNVSr+r0aKc4QfnjggLOXCkqgxSGTK09vtos7TuYd+TxbV dOQOw/XyLuT+7L0uQW1jE2+7xpAjH+8izXhbzkX4diq/LqwkUd+sitmV1c2t0xR2kdBq qEIOlfCL2tcyeqbMUdBVNQPkMFsSD4D01jjM0yH96/sOMCl1a94VkMquYJ1yiHC8km6l ORGD4vt2UZWIWwb6XxkZgdpUy/2UwUbSkolZODfc6oNUCcVWJPjxRqBCBB248W/CS8aQ 1oM9/9ZyqmwxvpZw5GSzg7vspfdvN7qVOA/15VigXA4Heqyc84RKn0dj2sFY3JOtDzDv gRXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FfSUR09C1mHiwJhD3QNYQuarzezJOYlVWsneR6uo6gQ=; b=S2dB7/I14DXPk/DINBCXsWtjdLtyikmK84FAPR2YdU2QRVwcYt0ne2ueAGQLvVmQGi uUSBJF2F/JQ3eLsV38eEEuI5B43i1axV+geDv2ty93YD0HroeqyruvfdCgax8cBL6ukj 564CU5o1nPyWoUmx62uFr14Vfj0qRSb5MoL4e6hlWq7lWUWS9TwtRZxO3bRtfljAQ9NF XHSQqyyrbsnwRnDW+J6o0mInm2Fr6xpVfAyEuZtSUVamBjsnDDI799zUMeWWLc+qtQoI W1JuAOcHP7U2+RByHL8OAds/aMp5iYJcOmY1IEKg5H4ygJcV+mm5qzcAB3cdejj5rLJ7 KYQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jm4Dv6mZ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x4si413875ilm.150.2021.05.19.12.22.40; Wed, 19 May 2021 12:22:53 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jm4Dv6mZ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233512AbhESIuJ (ORCPT + 99 others); Wed, 19 May 2021 04:50:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238703AbhESIuF (ORCPT ); Wed, 19 May 2021 04:50:05 -0400 Received: from mail-oo1-xc2f.google.com (mail-oo1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B39D6C06175F; Wed, 19 May 2021 01:48:46 -0700 (PDT) Received: by mail-oo1-xc2f.google.com with SMTP id o14-20020a4a384e0000b029020ec48a2358so753219oof.13; Wed, 19 May 2021 01:48:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FfSUR09C1mHiwJhD3QNYQuarzezJOYlVWsneR6uo6gQ=; b=Jm4Dv6mZdZvRgrowObSeo84niFMzgAfsuB6DzP7V9cHEu7sf9U4BfAsPlqP7hN49aX s+SbN2pfJfyCOLpyIrztipE8q0YpsExXUKldMsaFEfT4zTzmyy199n1fqVJdr/4jvR6s 0DqaxSkXRlVbQuIyBuo4c8mMed9fj1V82yIBRoytp61gcALRZBxk3cy67UkFSJ9hzMKd sixgfX5xDIHR9a2Hif2imyyavZmpKlzPOvgKYEloRYJ5BujyF5ZzxmPA6DEw69COZQDX 5kQp5Bn29IrbvHEl6RUsUC12TvJ/VEARJ3gLIn/76/CY4mIjtR/zre84vTH/EDN+6nO1 2fmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FfSUR09C1mHiwJhD3QNYQuarzezJOYlVWsneR6uo6gQ=; b=QXEOOVak/K2lSI46Rw7rcSxZnPAOsXcpMxz00dUBCYmybGmb/BBQueTCyShjXqbCGk FbaZYP2bp5U/nBXKUwVf6Jl84LjYLfLHbhHIEXm+9a4Qn9Q/MhPWlMN4pxGvL3VeIqdZ M3E1IUx/6/C1RkUSeASK4XxMEQLiZPs6j/r5BWUFuzDN0eDTqOqpWzMAk7c/W4w3ujaf EPEcSF9QU/ewYm2yipFNzVXf53hM/ydsWldou9kXqb8fAg2RBOqjZduGybB+W+q5whab if/i/LDbEbWQZzCM9zNMo2kjjCgdseW0eFgti8jvPpCdoG5/YDAhSWROv4cJ9WGZSg6K L/5Q== X-Gm-Message-State: AOAM530EimlUBn21McX8jF8nHgI7rGwOWdohGV8zzeoqjyvFBKlcezTW WD6Wy4wTEToBqLUEJQBOPtP974HHBLkG0IPd2e4= X-Received: by 2002:a4a:8311:: with SMTP id f17mr8075257oog.83.1621414126064; Wed, 19 May 2021 01:48:46 -0700 (PDT) MIME-Version: 1.0 References: <6cffd7eebba54ed8acd043d51d212ec1@rohde-schwarz.com> <20210508142947.GB810516@rowland.harvard.edu> In-Reply-To: <20210508142947.GB810516@rowland.harvard.edu> From: dave penkler Date: Wed, 19 May 2021 10:48:29 +0200 Message-ID: Subject: Re: Re: Re: Re: Re: [syzbot] INFO: rcu detected stall in tx To: Alan Stern Cc: Guido Kiener , 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" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 8 May 2021 at 16:29, Alan Stern wrote: > > On Sat, May 08, 2021 at 10:14:41AM +0200, dave penkler wrote: > > On Thu, 6 May 2021 at 22:31, Guido Kiener > > wrote: > > > > > > > -----Original Message----- > > > > From: Alan Stern > > > > Sent: Thursday, May 6, 2021 8:32 PM > > > > To: Kiener Guido 14DS1 > > > > > > > > On Thu, May 06, 2021 at 05:44:55PM +0000, Guido Kiener wrote: > > > > > > -----Original Message----- > > > > > > From: Alan Stern > > > > > > Sent: Thursday, May 6, 2021 3:49 PM > > > > > > To: Kiener Guido 14DS1 > > > > > > > > > > > > > > Thanks for your assessment. I agree with the general feeling. I > > > > > > > counted about hundred specific usb drivers, so wouldn't it be > > > > > > > better to fix the > > > > > > problem in some of the host drivers (e.g. urb.c)? > > > > > > > We could return an error when calling usb_submit_urb() on an erroneous > > > > pipe. > > > > > > > I cannot estimate the side effects and we need to check all > > > > > > > drivers again how they deal with the error situation. Maybe there > > > > > > > are some special driver > > > > > > that need a specialized error handling. > > > > > > > In this case these drivers could reset the (new?) error flag to > > > > > > > allow calling usb_submit_urb() again without error. This could work, isn't it? > > > > > > > > > > > > That is feasible, although it would be an awkward approach. As you > > > > > > said, the side effects aren't clear. But it might work. > > > > > > > > > > Otherwise I see only the other approach to change hundred drivers and > > > > > add the cases EPROTO, EILSEQ and ETIME in each callback handler. The > > > > > usbtmc driver already respects the EILSEQ and ETIME, and only EPROTO is > > > > missing. > > > > > The rest should be more a management task. > > > > > BTW do you assume it is only a problem for INT pipes or is it also a > > > > > problem for isochronous and bulk transfers? > > > > > > > > All of them. Control too. > > > > > > > > > > Will you be able to test patches? > > > > > > > > > > I only can test the USBTMC function in some different PCs. I do not > > > > > have automated regression tests for USB drivers or Linux kernels. > > > > > Maybe there is company who could do that. > > > > > > > > Well then, if I do find time to write a patch, I'll ask you to try it out with the usbtmc > > > > driver. > > > > > > You mean that you will do a patch in urb.c or a host driver? Or just add a line in usbtmc.c? > > > Anyhow there is no hurry. On May 20 I will send you a mail if I'm able to > > > provoke one of these hardware errors EPROTO, EILSQ, or ETIME. Otherwise > > > it doesn't make sense to test it. > > > > > > -Guido > > > > EPROTO is a link level issue and needs to be handled by the host driver. > > Are you referring to the host controller driver, or to the class device > driver running on the host? The host controller driver is responsible > for creating the -EPROTO error code in the first place. The class > device driver is responsible for taking an appropriate action in > response. host controller driver > > > 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. Hence no EPROTO loop will ensue in this case and therefore no changes are needed in usbtmc. > > > When the class driver and usbtmc in particular receives an URB with > > EPIPE status it cleans up and does not resubmit. > > Can someone from syzbot land please confirm whether usbtmc running on > > the xhci host driver causes an RCU stall to be detected ? > > That is not an easy thing to test, and syzbot is not capable of testing > it. You would need a USB device which could deliberately be set to > create a protocol error; I don't know of any devices like that. > > Alan Stern