Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1489928ybj; Fri, 20 Sep 2019 11:19:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqybuvwpDaOqLVtEnPIovbc2wNiaxjvruIaR5V6ptez0x+CwzMIbQrWKjqwF6qlLCYbrhMnF X-Received: by 2002:aa7:d803:: with SMTP id v3mr23555228edq.146.1569003574822; Fri, 20 Sep 2019 11:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569003574; cv=none; d=google.com; s=arc-20160816; b=soz5dsj38eTEjvMQlKqvT00OKoJloobJA24yAbXasU+unFj7cVWNdGNfHq5rN1X+9I RcSoA39PshNa0OOhPO8I4lcrSSVFLMy80kx2qmfPKdbgd+8MEt/RjakdRiRfWByiaw7N aPq2j5EMpnQfXG1N3D+d75cOMHGTGTldyq2ihG0hUCSuIODdFEwEOgp+q6KBPjEq+6CB +gDsfVhlJJIPc5bOllANUOvh9rt+IaAJdPzVeh1FK38fIZitpA/OSwcig2ZW72ZFzJFv 8q4G5U3KuObH2nTgkyrF/9pb0b34mrwFH8uODMOcXQU64OZ4SsN14tRpdi4I8Fvm5e10 G+cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:authenticated-by; bh=7qx1vTB6f9txVrWQjUWNW4a+0rXvo8wim6pUI7b13Ug=; b=iO9by6/bVaYziCz6mSVGt5nwu75glIeOSWVhpgeAPnxgk8ozvTzGqqF5DZp4ejKBIE 9J9weo4Vf3kCAjTgOPQthUiV91K6nnE+fNc+AssDF3kM1I5s7jnoXcJIbv1CLjtmKnDb 8njpUlXCp0iJU/B2zdJHKzbzuavemROqhvUbyM2tCe68JqCAssGiYkBDmp3CUkf/yzEo mxZbOD+CgTRmuhDeLPDuuldP55W0YdUMt/JaiijNnkxRiladnlJLIa/8r0ZBAp5gT7yK J2mnQ8BGMDh4jqbLP1h66pEZ5Y8Nz+qfKVktO5liQMR92mnKHDb58xEocJd0U5jfpXGQ wqQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14si2137141edk.315.2019.09.20.11.19.00; Fri, 20 Sep 2019 11:19:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405471AbfITI32 convert rfc822-to-8bit (ORCPT + 99 others); Fri, 20 Sep 2019 04:29:28 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:58287 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405437AbfITI30 (ORCPT ); Fri, 20 Sep 2019 04:29:26 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x8K8TGRL010410, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTITCASV02.realtek.com.tw[172.21.6.19]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x8K8TGRL010410 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 20 Sep 2019 16:29:17 +0800 Received: from RTITMBSVM04.realtek.com.tw ([fe80::e404:880:2ef1:1aa1]) by RTITCASV02.realtek.com.tw ([::1]) with mapi id 14.03.0468.000; Fri, 20 Sep 2019 16:29:16 +0800 From: Tony Chuang To: Kalle Valo , Brian Norris CC: linux-wireless Subject: RE: [PATCH 05/15] rtw88: pci: release tx skbs DMAed when stop Thread-Topic: [PATCH 05/15] rtw88: pci: release tx skbs DMAed when stop Thread-Index: AQHVb4S4hQTPSGBi5kOtH0MxIMGahqc0OmmA Date: Fri, 20 Sep 2019 08:29:15 +0000 Message-ID: References: <1568617425-28062-1-git-send-email-yhchuang@realtek.com> <1568617425-28062-6-git-send-email-yhchuang@realtek.com> <87tv97ctsp.fsf@codeaurora.org> In-Reply-To: <87tv97ctsp.fsf@codeaurora.org> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.68.183] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > Brian Norris writes: > > > On Tue, Sep 17, 2019 at 7:10 PM Tony Chuang > wrote: > >> > On Mon, Sep 16, 2019 at 12:03 AM wrote: > >> > > > >> > > From: Yan-Hsuan Chuang > >> > > > >> > > Interrupt is disabled to stop PCI, which means the skbs > >> > > queued for each TX ring will not be released via DMA > >> > > interrupt. > >> > > >> > In what cases do you hit this? I think you do this when entering PS > >> > mode, no? But then, see below. > >> > >> I'll hit this when ieee80211_ops::stop, or rtw_power_off. > >> Both are to turn off the device, so there's no more DMA activities. > >> If we don't release the SKBs that are not released by DMA interrupt > >> when powering off, these could be leaked. > > > > Ah, I was a bit confused. So it does get called from "PS" routines: I thought you're talking about IEEE80211_CONF_PS instead of IEEE80211_CONF_IDLE. > > rtw_enter_ips() -> rtw_core_stop() > > but that "IPS" mode means "Inactive" Power Save, and it's only used > > when transitioning into idle states (IEEE80211_CONF_IDLE). > > > > Incidentally, I think this also may explain many of the leaks I've > > been seeing elsewhere, when I leave a device sitting and scanning for > > a very long time -- each scan attempt is making a single transition > > out-and-back to IPS mode, which meant it may be leaking any > > outstanding TX DMA. And testing confirms this: if I just bring up the > > interface, run a scan, then bring it down, I see many fewer unmaps > > than maps. Doing this enough times, I run out of contiguous DMA memory > > and the device stops working. This fixes that problem for me. So: > > > > Reviewed-by: Brian Norris > > Tested-by: Brian Norris > > > > I wonder if, given the problems I've seen (the driver can become > > totally ineroperable), this patch and the previous patch (its only > > real dependency) should be fast-tracked to the current release. > > I agree, this sounds like a serious problem. So I'm planning to queue > patches 4 and 5 to v5.4, if it's ok for Tony. It's OK for me, didn't realize that this is a serious problem, so I missed it. Also if possible you should queue patch 2, that reordering will cause two H2C skbs not be released because HCI hasn't started, everytime enter/leave IDLE state (rtw_power_[on|off]). Should I resend and add a v5.4 prefix or something? Yan-Hsuan