From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [PATCH 1/2] sh_eth: Fix sleeping function called from invalid context Date: Tue, 25 Nov 2014 14:02:34 +0300 Message-ID: <547461CA.8000506@cogentembedded.com> References: <1415862135-27972-1-git-send-email-ykaneko0929@gmail.com> <1415862135-27972-2-git-send-email-ykaneko0929@gmail.com> <546531D6.3090009@cogentembedded.com> <20141125021709.GA22983@verge.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Yoshihiro Kaneko , netdev@vger.kernel.org, "David S. Miller" , Magnus Damm , linux-sh@vger.kernel.org To: Simon Horman Return-path: Received: from mail-la0-f43.google.com ([209.85.215.43]:47092 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752488AbaKYLCh (ORCPT ); Tue, 25 Nov 2014 06:02:37 -0500 Received: by mail-la0-f43.google.com with SMTP id q1so301766lam.2 for ; Tue, 25 Nov 2014 03:02:36 -0800 (PST) In-Reply-To: <20141125021709.GA22983@verge.net.au> Sender: netdev-owner@vger.kernel.org List-ID: Hello. On 11/25/2014 5:17 AM, Simon Horman wrote: >>> From: Mitsuhiro Kimura >>> Fix the bug as follows: >>> ---- >>> [ 1238.161349] BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:952 >>> [ 1238.188279] in_atomic(): 1, irqs_disabled(): 0, pid: 1388, name: cat >>> [ 1238.207425] CPU: 0 PID: 1388 Comm: cat Not tainted 3.10.31-ltsi-00046-gefa0b46 #1087 >>> [ 1238.230737] Backtrace: >>> [ 1238.238123] [] (dump_backtrace+0x0/0x10c) from [] (show_stack+0x18/0x1c) >>> [ 1238.263499] r6:000003b8 r5:c06160c0 r4:c0669e00 r3:00404000 >>> [ 1238.280583] [] (show_stack+0x0/0x1c) from [] (dump_stack+0x20/0x28) >>> [ 1238.304631] [] (dump_stack+0x0/0x28) from [] (__might_sleep+0xf8/0x118) >>> [ 1238.329734] [] (__might_sleep+0x0/0x118) from [] (__pm_runtime_resume+0x38/0x90) >>> [ 1238.357170] r7:d616f000 r6:c049c458 r5:00000004 r4:d6a17210 >>> [ 1238.374251] [] (__pm_runtime_resume+0x0/0x90) from [] (sh_eth_get_stats+0x44/0x280) >>> [ 1238.402468] r7:d616f000 r6:c049c458 r5:d5c21000 r4:d5c21000 >>> [ 1238.419552] [] (sh_eth_get_stats+0x0/0x280) from [] (dev_get_stats+0x54/0x88) >>> [ 1238.446204] r5:d5c21000 r4:d5ed7e08 >>> [ 1238.456980] [] (dev_get_stats+0x0/0x88) from [] (netstat_show.isra.15+0x54/0x9c) >>> [ 1238.484413] r6:d5c21000 r5:d5c21238 r4:00000028 r3:00000001 >>> [ 1238.501495] [] (netstat_show.isra.15+0x0/0x9c) from [] (show_tx_errors+0x18/0x1c) >>> [ 1238.529196] r7:d5f945d8 r6:d5f945c0 r5:c049716c r4:c0650e7c >>> [ 1238.546279] [] (show_tx_errors+0x0/0x1c) from [] (dev_attr_show+0x24/0x50) >>> [ 1238.572157] [] (dev_attr_show+0x0/0x50) from [] (sysfs_read_file+0xb0/0x140) >>> [ 1238.598554] r5:c049716c r4:d5c21240 >>> [ 1238.609326] [] (sysfs_read_file+0x0/0x140) from [] (vfs_read+0xb0/0x13c) >>> [ 1238.634679] [] (vfs_read+0x0/0x13c) from [] (SyS_read+0x44/0x74) >>> [ 1238.657944] r8:bef45bf0 r7:00000000 r6:d6ac0600 r5:00000000 r4:00000000 >>> [ 1238.678172] [] (SyS_read+0x0/0x74) from [] (ret_fast_syscall+0x0/0x30) >>> ---- >> How to reproduce this? > I have spoken with Kimura-san and the problem may be reproduced by > building the kernel with CONFIG_DEBUG_ATOMIC_SLEEP=y and reading network > statistics while the network interface is down. > e.g.: > ifconfig eth0 down > cat /sys/class/net/eth0/statistics/tx_errors > I have confirmed that the problem above appears in net-next > and appears to be resolved by this patch. Shouldn't we target 'net' for the fixes instead? > Would you be happy with this patch if the changelog was enhanced > and the minor issue you point our below was resolved? Most probably yes. >>> Signed-off-by: Mitsuhiro Kimura >>> Signed-off-by: Yoshihiro Kaneko [...] WBR, Sergei