From patchwork Wed Nov 8 11:35:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 10048351 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9455B6032D for ; Wed, 8 Nov 2017 11:35:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87C442914C for ; Wed, 8 Nov 2017 11:35:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C4772A50F; Wed, 8 Nov 2017 11:35:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 355092914C for ; Wed, 8 Nov 2017 11:35:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751931AbdKHLfZ (ORCPT ); Wed, 8 Nov 2017 06:35:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59160 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751826AbdKHLfY (ORCPT ); Wed, 8 Nov 2017 06:35:24 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7D136356C1; Wed, 8 Nov 2017 11:35:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7D136356C1 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=sgruszka@redhat.com Received: from localhost (unknown [10.43.2.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id 263DB6BF7E; Wed, 8 Nov 2017 11:35:23 +0000 (UTC) Date: Wed, 8 Nov 2017 12:35:22 +0100 From: Stanislaw Gruszka To: Richard Genoud Cc: Helmut Schaa , "linux-kernel@vger.kernel.org" , linux-wireless@vger.kernel.org Subject: Re: Soft lockup in rt2x00usb_work_rxdone() Message-ID: <20171108113521.GD2641@redhat.com> References: <1509983829.10974.2.camel@gmail.com> <20171107085327.GA11380@redhat.com> <20171107101320.GA12140@redhat.com> <1510052483.24015.1.camel@gmail.com> <20171108103729.GA2641@redhat.com> <1510139235.10467.1.camel@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1510139235.10467.1.camel@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 08 Nov 2017 11:35:24 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Nov 08, 2017 at 12:07:15PM +0100, Richard Genoud wrote: > > No, that not I wanted you to do. Please remove those options and just > > do > > below on tracing directory. > > > > echo 0 > tracing_on  > > cat trace >  /dev/null > > echo "function_graph" > current_tracer  > > echo "rt2*" > set_ftrace_filter  > > echo 1 > tracing_on > > echo 1-2.2 > /sys/bus/usb/drivers/usb/unbind > > echo 0 > tracing_on > > cat trace > ~/trace.txt > > Well, there's clearly a misunderstanding here : > After the command "echo 1-2.2 > /sys/bus/usb/drivers/usb/unbind" > I can't type *anything* > The only thing I can do is plug off the board. > This command never returns, so I can't stop the tracing... > > Or I missed something ? > > (maybe if there was more than one CPU on the board, I could do > something, but that's not the case) I was not aware that soft-lock up can hung the system. Below patch should prevent/help with the issue. This is not right fix, it's for futher debugging. Regards Stanislaw diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c index e2f4f5778267..d76ca608c722 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c @@ -321,8 +321,8 @@ static bool rt2x00usb_kick_tx_entry(struct queue_entry *entry, void *data) status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC); if (status) { - if (status == -ENODEV) - clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); + printk("submit TX urb ERROR %d\n", status); + clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); set_bit(ENTRY_DATA_IO_FAILED, &entry->flags); rt2x00lib_dmadone(entry); } @@ -410,8 +410,8 @@ static bool rt2x00usb_kick_rx_entry(struct queue_entry *entry, void *data) status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC); if (status) { - if (status == -ENODEV) - clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); + printk("submit RX urb ERROR %d\n", status); + clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); set_bit(ENTRY_DATA_IO_FAILED, &entry->flags); rt2x00lib_dmadone(entry); }