Received: by 10.223.164.202 with SMTP id h10csp173138wrb; Tue, 7 Nov 2017 04:46:51 -0800 (PST) X-Google-Smtp-Source: ABhQp+Sii/n7lHc6GclPfXWDRCRnSizKaCkoC+kd04aNbpyJoMErpA4zDQ5RqkTthK9wnoWD1cAs X-Received: by 10.98.58.92 with SMTP id h89mr20632914pfa.106.1510058811780; Tue, 07 Nov 2017 04:46:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510058811; cv=none; d=google.com; s=arc-20160816; b=agNpLr3/q/u3lFbHTHTYc7XjK7aV5+KcTUqK7j8pYk0DPYm8ol0E0idBmX3E3lsfPG Lg7GJ0wzqPNdpAWG9g3OTR0yX+cnyzC4kKA9AFFmK6KfNHlEa8TtCXHp0M6hkC0XP8m7 cUe149cwdcMdtUPxMuYMJCadst+yt5/8kZf4oYt9pyBwIQfj9IUq+9Q3Br5DrpsUGxzU HTip6Z7ppzI0pL837O92AeuaCUcwrGA6g6+g3bzgFBc4zWX+Xy9HCFK66NBgAr5weGvK zLySZIzgNpD5bhFz1jp/1P8uofRDT2E5H3z+zT/TQXEUfe1b5a37lM9slaeTW3XRGNth hpPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=fJiimYlbwcifbmQwdl+iP7VdEZNd/8mLm764N98GZys=; b=QNC/NzCJ1JUZOBL0Xjp8bWWyRnMBTpY8NorXs/Dawd+pVdVI9E1VUx9pgHVM0mw3tL ALOHamsJv5EAbdZYYB7ikMl184q8YnIqM68EZmQ4dwdF6bOunAbBs+szRJzEONHI/XKv WXP7Tl/Lcy3rnPyGMSh6M4XN5lAZGN0ut+nyf3OZzB3LndH13nO9vJ0aMdSAG3aDq5lW soTke1yDM4Xkm4De+U4pzFXOgTFjmIRhiorS1Q2xXY7O06xHhRuFFp4xWl3o3NmwLz/7 aurZCeGBjqVB6UTr3bv917qyO3wRbH537BfjVNuOEVvY8A2cRQ0rqbpVqPE3xU2zRu2F SPJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=P+IfUesF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si1083243pgs.468.2017.11.07.04.46.38; Tue, 07 Nov 2017 04:46:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=P+IfUesF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756197AbdKGLBc (ORCPT + 91 others); Tue, 7 Nov 2017 06:01:32 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:43539 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755796AbdKGLB0 (ORCPT ); Tue, 7 Nov 2017 06:01:26 -0500 Received: by mail-wm0-f47.google.com with SMTP id r68so12522304wmr.0; Tue, 07 Nov 2017 03:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=fJiimYlbwcifbmQwdl+iP7VdEZNd/8mLm764N98GZys=; b=P+IfUesFazseWsEGizf0CeAyHqUSatjs/T6FX6t3+nafCFHf8QxP3I0JGZCzEL/pBq oyzEt2eFzhBWU+9OH0/aZk9fzqWYVogtBO3sEjThYq4d+h/ngF3Z9AM9z+D/1osNxu9b tzQGAHVMdM1Zth1nzvZn6YNelbtufZfb0efGSTZrigHYW0z76kKmARxWbT9fxqBV5kIV KIgcpF1CdQDbgTE6haDEgw6VoUOveRlfAiT5/RSP47W0Ruvv0chm12rRAZLMwK897SCg aWl77xWc3QOAsFLnR97c4W2KsHkbcFLTU25RObn3Ang6QIefr8dZT4pQN+FUEdu7PTE8 kleA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=fJiimYlbwcifbmQwdl+iP7VdEZNd/8mLm764N98GZys=; b=T5gDI4zhjAe0jY/OWJDp7IAnrOhwL+uBtL5cMgE3XFlcEGLsHjspikkfcVr+EUGUUV EcvfjKnEZe0MqCsP3FogwKI/sfORBfwsongTAPtgmzBz5WkmPblYNYa9GkM0ircFf++D s58l/RG5t0WsKhRVT0Ouy3YfUfsQWs4ZW91HjexmRhEV9JMPtMvM8quMda7NCGfr+ZIu FliXrJDcWXc79KagX9/+XpJmqPAbuDX7+0FN9HBNgf1c68CCgnB76EhtDvCmxZfou5DD x9zqLEqOIhGHdXvoVomgzW3Q+pvkH1L6YanxpU+dOmiWRE851ckLoD1kGMabuqLQ3C6W 6XAA== X-Gm-Message-State: AMCzsaXwfnhx9dxhDZ8biGpOFkppjwTFyZh9qqvl919z/01i7iu01ZI7 09gVKytWu0k7ux9w++Ao4sA3Y1Jx X-Received: by 10.80.180.214 with SMTP id x22mr23822560edd.230.1510052484843; Tue, 07 Nov 2017 03:01:24 -0800 (PST) Received: from lnx-rg ([46.227.18.67]) by smtp.googlemail.com with ESMTPSA id b36sm1057671edd.67.2017.11.07.03.01.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2017 03:01:24 -0800 (PST) Message-ID: <1510052483.24015.1.camel@gmail.com> Subject: Re: Soft lockup in rt2x00usb_work_rxdone() From: Richard Genoud To: Stanislaw Gruszka Cc: Helmut Schaa , "linux-kernel@vger.kernel.org" , linux-wireless@vger.kernel.org Date: Tue, 07 Nov 2017 12:01:23 +0100 In-Reply-To: <20171107101320.GA12140@redhat.com> References: <1509983829.10974.2.camel@gmail.com> <20171107085327.GA11380@redhat.com> <20171107101320.GA12140@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le mardi 07 novembre 2017 à 11:13 +0100, Stanislaw Gruszka a écrit : > On Tue, Nov 07, 2017 at 11:06:39AM +0100, Richard Genoud wrote: > > > 3 short articles how to configure and use ftrace are here: > > > https://lwn.net/Articles/365835/ > > > https://lwn.net/Articles/366796/ > > > https://lwn.net/Articles/370423/ > > > > > > > I tried with ftrace, but I don't think there's a way to dump the > > trace > > when there's a soft lock-up > > (I can't do anything after the unbind, even the heartbeat led > > stopped blinking). > > I saw the /proc/sys/kernel/ftrace_dump_on_oops file, but there's no > > /proc/sys/kernel/ftrace_dump_on_soft_lock-up file :) > > You should configure function trace with rt2x* functions. After that > start tracing, unbind the device, then stop tracing and provide trace > output. Ok, I found a way to display the trace (after the unbind, the board is frozen and I can't type anything). Adding CONFIG_SOFTLOCKUP_DETECTOR=y CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y along with echo 1 > /proc/sys/kernel/ftrace_dump_on_oops does the trick (trace is after the stack dump) # cd /sys/kernel/debug/tracing/ # echo 1 > /proc/sys/kernel/ftrace_dump_on_oops # # echo rt2x00usb* > set_ftrace_filter # echo 0 > tracing_on # echo function > current_tracer # echo 1 > tracing_on # echo 1-2.2 > /sys/bus/usb/drivers/usb/unbind [board frozen] watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [kworker/u2:3:188] CPU: 0 PID: 188 Comm: kworker/u2:3 Not tainted 4.14.0-rc8-00040-g53fb1fe423ba #13 Hardware name: Atmel AT91SAM9 Workqueue: phy0 rt2x00usb_work_rxdone task: c7b34400 task.stack: c7b4e000 PC is at rb_commit+0x1a8/0x2e4 LR is at ring_buffer_unlock_commit+0x20/0xa4 pc : [] lr : [] psr: 80000013 sp : c7b4fda8 ip : 00000000 fp : c7b4fdc4 r10: c664ee34 r9 : c7b2ed18 r8 : 60000013 r7 : 001c4851 r6 : c780a0e0 r5 : c7319340 r4 : 00008a48 r3 : c7319340 r2 : c664e000 r1 : 00000e38 r0 : 00000e24 Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none Control: 0005317f Table: 27270000 DAC: 00000053 CPU: 0 PID: 188 Comm: kworker/u2:3 Not tainted 4.14.0-rc8-00040-g53fb1fe423ba #13 Hardware name: Atmel AT91SAM9 Workqueue: phy0 rt2x00usb_work_rxdone [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [] (show_stack) from [] (dump_stack+0x20/0x28) [] (dump_stack) from [] (show_regs+0x1c/0x20) [] (show_regs) from [] (watchdog_timer_fn+0x148/0x1ac) [] (watchdog_timer_fn) from [] (hrtimer_run_queues+0x128/0x250) [] (hrtimer_run_queues) from [] (run_local_timers+0x18/0x68) [] (run_local_timers) from [] (update_process_times+0x38/0x6c) [] (update_process_times) from [] (tick_nohz_handler+0xc0/0x10c) [] (tick_nohz_handler) from [] (ch2_irq+0x30/0x38) [] (ch2_irq) from [] (__handle_irq_event_percpu+0x74/0x1dc) [] (__handle_irq_event_percpu) from [] (handle_irq_event_percpu+0x2c/0x68) [] (handle_irq_event_percpu) from [] (handle_irq_event+0x38/0x4c) [] (handle_irq_event) from [] (handle_fasteoi_irq+0xa0/0x114) [] (handle_fasteoi_irq) from [] (generic_handle_irq+0x28/0x38) [] (generic_handle_irq) from [] (__handle_domain_irq+0x90/0xb8) [] (__handle_domain_irq) from [] (aic_handle+0xb0/0xb8) [] (aic_handle) from [] (__irq_svc+0x68/0x84) Exception stack(0xc7b4fd58 to 0xc7b4fda0) fd40: 00000e24 00000e38 fd60: c664e000 c7319340 00008a48 c7319340 c780a0e0 001c4851 60000013 c7b2ed18 fd80: c664ee34 c7b4fdc4 00000000 c7b4fda8 c006d724 c006c694 80000013 ffffffff [] (__irq_svc) from [] (rb_commit+0x1a8/0x2e4) [] (rb_commit) from [] (ring_buffer_unlock_commit+0x20/0xa4) [] (ring_buffer_unlock_commit) from [] (trace_function+0xe0/0xf0) [] (trace_function) from [] (function_trace_call+0xbc/0x11c) [] (function_trace_call) from [] (ftrace_graph_call+0x0/0xc) [] (ftrace_graph_call) from [] (rt2x00usb_kick_rx_entry+0x14/0x118) [] (rt2x00usb_kick_rx_entry) from [] (rt2x00usb_clear_entry+0x30/0x34) [] (rt2x00usb_clear_entry) from [] (rt2x00lib_rxdone+0x58c/0x5b8) [] (rt2x00lib_rxdone) from [] (rt2x00usb_work_rxdone+0x60/0x7c) [] (rt2x00usb_work_rxdone) from [] (process_one_work+0x1e4/0x3a0) [] (process_one_work) from [] (worker_thread+0x2c8/0x45c) [] (worker_thread) from [] (kthread+0x114/0x130) [] (kthread) from [] (ret_from_fork+0x14/0x2c) Kernel panic - not syncing: softlockup: hung tasks CPU: 0 PID: 188 Comm: kworker/u2:3 Tainted: G L 4.14.0-rc8-00040-g53fb1fe423ba #13 Hardware name: Atmel AT91SAM9 Workqueue: phy0 rt2x00usb_work_rxdone [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [] (show_stack) from [] (dump_stack+0x20/0x28) [] (dump_stack) from [] (panic+0xc8/0x260) [] (panic) from [] (watchdog_timer_fn+0x180/0x1ac) [] (watchdog_timer_fn) from [] (hrtimer_run_queues+0x128/0x250) [] (hrtimer_run_queues) from [] (run_local_timers+0x18/0x68) [] (run_local_timers) from [] (update_process_times+0x38/0x6c) [] (update_process_times) from [] (tick_nohz_handler+0xc0/0x10c) [] (tick_nohz_handler) from [] (ch2_irq+0x30/0x38) [] (ch2_irq) from [] (__handle_irq_event_percpu+0x74/0x1dc) [] (__handle_irq_event_percpu) from [] (handle_irq_event_percpu+0x2c/0x68) [] (handle_irq_event_percpu) from [] (handle_irq_event+0x38/0x4c) [] (handle_irq_event) from [] (handle_fasteoi_irq+0xa0/0x114) [] (handle_fasteoi_irq) from [] (generic_handle_irq+0x28/0x38) [] (generic_handle_irq) from [] (__handle_domain_irq+0x90/0xb8) [] (__handle_domain_irq) from [] (aic_handle+0xb0/0xb8) [] (aic_handle) from [] (__irq_svc+0x68/0x84) Exception stack(0xc7b4fd58 to 0xc7b4fda0) fd40: 00000e24 00000e38 fd60: c664e000 c7319340 00008a48 c7319340 c780a0e0 001c4851 60000013 c7b2ed18 fd80: c664ee34 c7b4fdc4 00000000 c7b4fda8 c006d724 c006c694 80000013 ffffffff [] (__irq_svc) from [] (rb_commit+0x1a8/0x2e4) [] (rb_commit) from [] (ring_buffer_unlock_commit+0x20/0xa4) [] (ring_buffer_unlock_commit) from [] (trace_function+0xe0/0xf0) [] (trace_function) from [] (function_trace_call+0xbc/0x11c) [] (function_trace_call) from [] (ftrace_graph_call+0x0/0xc) [] (ftrace_graph_call) from [] (rt2x00usb_kick_rx_entry+0x14/0x118) [] (rt2x00usb_kick_rx_entry) from [] (rt2x00usb_clear_entry+0x30/0x34) [] (rt2x00usb_clear_entry) from [] (rt2x00lib_rxdone+0x58c/0x5b8) [] (rt2x00lib_rxdone) from [] (rt2x00usb_work_rxdone+0x60/0x7c) [] (rt2x00usb_work_rxdone) from [] (process_one_work+0x1e4/0x3a0) [] (process_one_work) from [] (worker_thread+0x2c8/0x45c) [] (worker_thread) from [] (kthread+0x114/0x130) [] (kthread) from [] (ret_from_fork+0x14/0x2c) Dumping ftrace buffer: --------------------------------- CPU:0 [LOST 1781327 EVENTS] kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone kworker/-188 0.n.. 24110000us : rt2x00usb_kick_rx_entry <-rt2x00usb_clear_entry kworker/-188 0.n.. 24110000us : rt2x00usb_clear_entry <-rt2x00lib_rxdone [forever] > Thanks > Stanislaw Thanks, Richard From 1583409302231621663@xxx Tue Nov 07 12:13:03 +0000 2017 X-GM-THRID: 1583337302329883239 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread