From patchwork Wed Sep 6 12:40:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Brivio X-Patchwork-Id: 9940593 X-Patchwork-Delegate: johannes@sipsolutions.net 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 D216E6035F for ; Wed, 6 Sep 2017 12:41:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD0CD28C03 for ; Wed, 6 Sep 2017 12:41:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA1A328BE5; Wed, 6 Sep 2017 12:41:16 +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 CA85028C13 for ; Wed, 6 Sep 2017 12:41:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753904AbdIFMk3 (ORCPT ); Wed, 6 Sep 2017 08:40:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55096 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753586AbdIFMk2 (ORCPT ); Wed, 6 Sep 2017 08:40:28 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7A38C047B6C; Wed, 6 Sep 2017 12:40:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A7A38C047B6C Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=sbrivio@redhat.com Received: from elisabeth (unknown [10.33.36.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1ED388074E; Wed, 6 Sep 2017 12:40:24 +0000 (UTC) Date: Wed, 6 Sep 2017 14:40:19 +0200 From: Stefano Brivio To: Matteo Croce Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Berg Subject: Re: hung task in mac80211 Message-ID: <20170906144019.1c98a636@elisabeth> In-Reply-To: References: Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 06 Sep 2017 12:40:28 +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, 6 Sep 2017 13:57:47 +0200 Matteo Croce wrote: > Hi, > > I have an hung task on vanilla 4.13 kernel which I haven't on 4.12. > The problem is present both on my AP and on my notebook, > so it seems it affects AP and STA mode as well. > The generated messages are: > > INFO: task kworker/u16:6:120 blocked for more than 120 seconds. > Not tainted 4.13.0 #57 > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > kworker/u16:6 D 0 120 2 0x00000000 > Workqueue: phy0 ieee80211_ba_session_work [mac80211] > Call Trace: > ? __schedule+0x174/0x5b0 > ? schedule+0x31/0x80 > ? schedule_preempt_disabled+0x9/0x10 > ? __mutex_lock.isra.2+0x163/0x480 > ? select_task_rq_fair+0xb9f/0xc60 > ? __ieee80211_start_rx_ba_session+0x135/0x4d0 [mac80211] > ? __ieee80211_start_rx_ba_session+0x135/0x4d0 [mac80211] This is ugly and maybe wrong, but you could check perhaps...: diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c index c92df492e898..bd7512a656f2 100644 --- a/net/mac80211/ht.c +++ b/net/mac80211/ht.c @@ -320,28 +320,40 @@ void ieee80211_ba_session_work(struct work_struct *work) mutex_lock(&sta->ampdu_mlme.mtx); for (tid = 0; tid < IEEE80211_NUM_TIDS; tid++) { - if (test_and_clear_bit(tid, sta->ampdu_mlme.tid_rx_timer_expired)) + if (test_and_clear_bit(tid, sta->ampdu_mlme.tid_rx_timer_expired)) { + mutex_unlock(&sta->ampdu_mlme.mtx); ___ieee80211_stop_rx_ba_session( sta, tid, WLAN_BACK_RECIPIENT, WLAN_REASON_QSTA_TIMEOUT, true); + mutex_lock(&sta->ampdu_mlme.mtx); + } if (test_and_clear_bit(tid, - sta->ampdu_mlme.tid_rx_stop_requested)) + sta->ampdu_mlme.tid_rx_stop_requested)) { + mutex_unlock(&sta->ampdu_mlme.mtx); ___ieee80211_stop_rx_ba_session( sta, tid, WLAN_BACK_RECIPIENT, WLAN_REASON_UNSPECIFIED, true); + mutex_lock(&sta->ampdu_mlme.mtx); + } if (test_and_clear_bit(tid, - sta->ampdu_mlme.tid_rx_manage_offl)) + sta->ampdu_mlme.tid_rx_manage_offl)) { + mutex_unlock(&sta->ampdu_mlme.mtx); __ieee80211_start_rx_ba_session(sta, 0, 0, 0, 1, tid, IEEE80211_MAX_AMPDU_BUF, false, true); + mutex_lock(&sta->ampdu_mlme.mtx); + } if (test_and_clear_bit(tid + IEEE80211_NUM_TIDS, - sta->ampdu_mlme.tid_rx_manage_offl)) + sta->ampdu_mlme.tid_rx_manage_offl)) { + mutex_unlock(&sta->ampdu_mlme.mtx); ___ieee80211_stop_rx_ba_session( sta, tid, WLAN_BACK_RECIPIENT, 0, false); + mutex_lock(&sta->ampdu_mlme.mtx); + } spin_lock_bh(&sta->lock);