From patchwork Thu Oct 1 15:42:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 7309531 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B1B42BEEA4 for ; Thu, 1 Oct 2015 15:42:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCAB7206B8 for ; Thu, 1 Oct 2015 15:42:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CD360206BD for ; Thu, 1 Oct 2015 15:42:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756628AbbJAPmS (ORCPT ); Thu, 1 Oct 2015 11:42:18 -0400 Received: from mail-oi0-f51.google.com ([209.85.218.51]:36860 "EHLO mail-oi0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752844AbbJAPmQ (ORCPT ); Thu, 1 Oct 2015 11:42:16 -0400 Received: by oibi136 with SMTP id i136so43056015oib.3; Thu, 01 Oct 2015 08:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=TWpWyTcUNpl7yCEaxk3X5vlD84ckkd4AobesQoHAhFY=; b=B+DPhqx1c+ait7h6VrM2MHY5Mq5qDJRDW1Ce8ZYaC4yyjy+u5vqbVebSbrAGPZC267 RaPIh4Rq4FLds2hStj/WOMGcqll99uidEkFJWcnpvB3vWzXtgM97dvxsBNs3htNARvZs sFi9J1VsGDwbX2VFzYy1QLESlTzwuvuc9cnzBl8P6V/kbQszkveL8x5DcV5zkzVebSym HgFAiIlzixf1MYKifY5b8/tQM7h1HbBchEoBisNZhZmd6C3uzK+wXs55lK1x+/6s8efk JgXUrM8Rl/zayRAaxlPciuwmgRtFnL+hwInk049cXpBgRfmDhFFFtxXpYK6QbEnDzgjR Ofgw== X-Received: by 10.202.104.222 with SMTP id o91mr6164538oik.49.1443714135813; Thu, 01 Oct 2015 08:42:15 -0700 (PDT) Received: from linux.site (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id kz9sm2924993obb.0.2015.10.01.08.42.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Oct 2015 08:42:14 -0700 (PDT) Subject: Re: rtl8821ae bisected regression between 4.1 and 4.2 To: =?UTF-8?Q?Jo=c3=a3o_Paulo_Rechi_Vita?= , linux-wireless References: Cc: Vincent Fann , Shao Fu , Kalle Valo , Stable , Daniel Drake From: Larry Finger Message-ID: <560D5455.8060400@lwfinger.net> Date: Thu, 1 Oct 2015 10:42:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 10/01/2015 08:17 AM, João Paulo Rechi Vita wrote: > Hello linux-wirelless (cc'ing stable since the original patch had > cc:stable as well), > > I'm experiencing a CPU soft lockup while downloading when rtl8821ae is > loaded (even when downloading through other adapters) on a vanilla 4.2 > kernel. The problem did not happen on vanilla 4.1. Bisecting shows the > first bad commit being "rtlwifi: Remove the clear interrupt routine > from all drivers" (1277fa2ab2f9a624a4b0177119ca13b5fd65edd0). > Reverting that commit makes the problem go away. > > The system is perfectly stable until I start downloading, when the UI > becomes unresponsive, sometimes leading to a complete freeze. When the > system does not completely freezes and I'm able to kill the download, > everything seems to go back to normal after killing it, and I am able > to continue to use the computer as long as I do not download anything. > Most of the time either a soft or a hard lockup is detected, but not > always, although the freeze always occurs. > > This is the kernel log with lockdep enabled (although sometimes the > problem does not occur with lockdep enabled): > https://gist.github.com/jprvita/3aa2c0c9a66793e1fad1 > > I have the laptop where this happens as a test machine sitting on my > desk, so I'm available to test any patches or gather more information > if needed. Please advise on how I can help debugging this further. I cannot duplicate your result, and neither can the Realtek team; however, I have prepared and attached a patch to temporarily re-add the interrupt clear routine for rtl8821ae. Please try it and report the results. Larry From 97ecd2789dc71b158467fc57d0326641a4581f0d Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 1 Oct 2015 10:37:49 -0500 Subject: [PATCH] rtlwifi: rtl8821ae: Trial patch to reinstall interrupt clear routine Signed-off-by: Larry Finger --- drivers/net/wireless/rtlwifi/rtl8821ae/hw.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c index b7f18e21..6d2caa8 100644 --- a/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c @@ -2253,11 +2253,27 @@ void rtl8821ae_set_qos(struct ieee80211_hw *hw, int aci) } } +static void rtl8821ae_clear_interrupt(struct ieee80211_hw *hw) +{ + struct rtl_priv *rtlpriv = rtl_priv(hw); + u32 tmp = rtl_read_dword(rtlpriv, REG_HISR); + + rtl_write_dword(rtlpriv, REG_HISR, tmp); + + tmp = rtl_read_dword(rtlpriv, REG_HISRE); + rtl_write_dword(rtlpriv, REG_HISRE, tmp); + + tmp = rtl_read_dword(rtlpriv, REG_HSISR); + rtl_write_dword(rtlpriv, REG_HSISR, tmp); +} + void rtl8821ae_enable_interrupt(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); + rtl8821ae_clear_interrupt(hw);/*clear it here first*/ + rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] & 0xFFFFFFFF); rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & 0xFFFFFFFF); rtlpci->irq_enabled = true; -- 2.1.4