Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3670170pxj; Mon, 24 May 2021 11:59:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD3q29G7nMbFvg4NomBKS8qGwpotYAloeUoI1smg6HsXlS/WJ5w7rmwkD0FvYk693J0ZJx X-Received: by 2002:a17:906:640c:: with SMTP id d12mr24090108ejm.70.1621882773641; Mon, 24 May 2021 11:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621882773; cv=none; d=google.com; s=arc-20160816; b=FQFI4olpQ4IqxePlo0O5O+YQRYHRv4neWpFaz5B+YaN0Rh7CsRtfXx22TtmQYGIEYO M0aetQEGsS7+lSWd4f96LnUujo8+V5uC9iVB+2ks2sK1+WiDX1CqKUH6m/nkKcmoqzFE gVvCFIKa3W+8Il/7Zp8vWytP3rx2EJR8VBGQNYtcyoueEEVYlsDFCN5wCL92U6LOYDsz MjF960FctAEgrtDP6bUeuxHc/g9D51KLe3Xu1h3XdeRw3QEtkmXW3pqa5jkKVTk4Xsfz nYyUyGb96fJdw2Eg9focGzko4j1Ec+NwIeaijZqTvgqgwH9qbgnPZ1z2s1qE29Rf1wtX +uyw== 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=/3UiHhGpbSUdc0qBXGpPpIGu5iSvDoz6bx63PluCZYQ=; b=CA/nm6hx3TOqV/Cq8+T64uTYh/tfvddgJmsHLKliWu4zCYKmO1lIdbSdeYrSDZRP8g aFz+TuaAUXjTGimZgqA6FAHRk3pWG8MMn6BkU5xSjnqGtFeN+pMx+lFvnDUKyRUlIhw3 WtwTqc2BvXNl8X1Ll+EPRQwItwSZS8WKBhSe+r5tHQnwscDkvd0sXyyqSbKJ3/FozQ4u VGmOJIQWVYDq9AMZ7NMfnWaYoGHd9ALOI2paxGk5QXb2K1Ep1tO8SD2rmsZnWIpkAG4H Tg232EdHjoBPnbhBDWIQeW3ztsbMiZxC8RPqxfufpQ2ohHQjhzu1p3iKy++kIQIaiTT9 JqPg== 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 nb17si13820693ejc.226.2021.05.24.11.59.10; Mon, 24 May 2021 11:59:33 -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 S233165AbhEXS4u (ORCPT + 99 others); Mon, 24 May 2021 14:56:50 -0400 Received: from netrider.rowland.org ([192.131.102.5]:40331 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S232983AbhEXS4t (ORCPT ); Mon, 24 May 2021 14:56:49 -0400 Received: (qmail 1333070 invoked by uid 1000); 24 May 2021 14:55:20 -0400 Date: Mon, 24 May 2021 14:55:20 -0400 From: Alan Stern To: Mathias Nyman Cc: Thinh Nguyen , Mathias Nyman , Guido Kiener , 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: [syzbot] INFO: rcu detected stall in tx Message-ID: <20210524185520.GA1332625@rowland.harvard.edu> References: <20210519173545.GA1173157@rowland.harvard.edu> <12088413-2f7d-a1e5-5e8a-25876d85d18a@synopsys.com> <20210520020117.GA1186755@rowland.harvard.edu> <74b2133b-2f77-c86f-4c8b-1189332617d3@synopsys.com> <37c41d87-6e30-1557-7991-0b7bca615be1@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37c41d87-6e30-1557-7991-0b7bca615be1@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021 at 06:18:59PM +0300, Mathias Nyman wrote: > On 20.5.2021 23.30, Thinh Nguyen wrote: > > As for the xhci driver, there maybe a case where the stream URB never > > gets to complete because the transaction err_count is not properly > > updated. The err_count for transaction error is stored in ep_ring, but > > the xhci driver may not be able to lookup the correct ep_ring based on > > TRB address for streams. There are cases for streams where the event > > TRBs have their TRB pointer field cleared to '0' (xhci spec section > > 4.12.2). If the xhci driver doesn't see ep_ring for transaction error, > > it automatically does a soft-retry. This is seen from one of our > > testings that the driver was repeatedly doing soft-retry until the class > > driver timed out. > > > > Hi Mathias, maybe you have some comment on this? Thanks. > > This is true, if TRB pointer is 0 then there is no retry limit for soft retry. > We should add one and prevent a loop. after e few soft resets we can end with a > hard reset to clear the host side endpoint halt. > > We don't know the URB that was being tansferred during the error, and can't > give it back with a proper error code. > In that sense we still end up waiting for a timeout and someone to cancel > the urb. That's not good. There may not be a timeout; drivers expect transfers to complete with a failure, not to be retried indefinitely. However, if you do know which endpoint/stream the error is connected to, you should be able to get the URB. It will be the first one queued for that endpoint/stream. Alan Stern