Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752220Ab2KRR4O (ORCPT ); Sun, 18 Nov 2012 12:56:14 -0500 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:44724 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752003Ab2KRR4N (ORCPT ); Sun, 18 Nov 2012 12:56:13 -0500 Date: Sun, 18 Nov 2012 17:47:20 +0000 From: Russell King - ARM Linux To: Josh Coombs Cc: linux ARM , wlanfae@realtek.com, Larry.Finger@lwfinger.net, florian.c.schilhabel@googlemail.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Andrew Lunn Subject: Re: [Patch v1 1/1] RTL8712 alignment bug in 3.6.5 on ARM Message-ID: <20121118174720.GX3290@n2100.arm.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2830 Lines: 57 On Sun, Nov 18, 2012 at 12:06:40PM -0500, Josh Coombs wrote: > Starting with 3.6.5 on a Marvell Kirkwood based GoFlex Net I began > observing scheduler bugs when using a USB based RTL8712 WiFi NIC. > These would eventually overwhelm systemd's logger under moderate > network activity and crash the box. Cool, yet another systemd feature :) sysvinit was less hastle... > [ 53.173973] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready > [ 54.191655] BUG: scheduling while atomic: crond/144/0x40000300 > [ 54.197537] Modules linked in: rmd160 sha1_generic hmac > blowfish_generic blowfish_common sr_mod cdrom fbcon bitblit softcursor > font udlfb syscopyarea sysfillrect sysimgblt fb_sys_fops fb > hid_generic snd_usb_audio snd_usbmidi_lib snd_hwdep mct_u232 > snd_rawmidi snd_seq_device snd_pcm snd_page_alloc usbhid usbserial > snd_timer snd hid soundcore mv_cesa cryptodev(O) ipv6 autofs4 > [ 54.231214] [] (unwind_backtrace+0x0/0xe0) from > [] (__schedule_bug+0x48/0x60) > [ 54.240171] [] (__schedule_bug+0x48/0x60) from > [] (__schedule+0x4c/0x4bc) > [ 54.248773] [] (__schedule+0x4c/0x4bc) from [] > (__cond_resched+0x24/0x34) > [ 54.257365] [] (__cond_resched+0x24/0x34) from > [] (_cond_resched+0x3c/0x44) > [ 54.266134] [] (_cond_resched+0x3c/0x44) from > [] (do_alignment+0x29c/0x784) > [ 54.274895] [] (do_alignment+0x29c/0x784) from > [] (do_DataAbort+0x34/0x98) This is actually a known problem... and I have a patch which resolves it but I've lost track of where things are with that patch through being distracted by modern platforms... that said, it does seem to be pointing at a problem which can be sorted in the driver which makes it more efficient on ARM hardware. > diff -ruN a/drivers/staging/rtl8712/rtl871x_sta_mgt.c > b/drivers/staging/rtl8712/rtl871x_sta_mgt.c > --- a/drivers/staging/rtl8712/rtl871x_sta_mgt.c 2012-11-05 > 03:57:06.000000000 -0500 > +++ b/drivers/staging/rtl8712/rtl871x_sta_mgt.c 2012-11-13 > 12:54:28.000000000 -0500 > @@ -55,8 +55,8 @@ > NUM_STA + 4); > if (pstapriv->pallocated_stainfo_buf == NULL) > return _FAIL; > - pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 - > - ((addr_t)(pstapriv->pallocated_stainfo_buf) & 3); > + pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 8 - > + ((addr_t)(pstapriv->pallocated_stainfo_buf) & 7); Are you sure this is safe? Is the allocated buffer large enough for those additional 4 bytes of alignment you're adding? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/