Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1253236ybj; Fri, 20 Sep 2019 07:33:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0/oyFtMVa1zigIuAr9t9GYYaUrMycAY9xsU+yHN6H/4znGedJrcMKpx11U4heUajhexTP X-Received: by 2002:a17:906:1f03:: with SMTP id w3mr19281211ejj.31.1568990029296; Fri, 20 Sep 2019 07:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568990029; cv=none; d=google.com; s=arc-20160816; b=jiWv9cPzc5B6kIduu39AJSvkBmOJw1Rs7ZzGAUC7n4Vn+zXmiJDCg5IIbLCldZ+sbh LwQaq0x4qZyt3kFvFEWDjwXnScG3l7mzMrTaulSK7vz+chG34YEFPkVBXzDTA3dLQbA8 CLXuBHxlqn+iPZ/VWqFs04l4rtFeo8/oGq3i9I4TAFoPvULinId2aksxv6IWcbTXOMdz TeheVK3oTtIVCMhjTRfFoeLTbdtr2RsIKeMqQhM7fWrhwFFgCvpzDCAqPDJx/mRoRKrK GoMNc0WLmKy9ZEiUnQN++d6BclGpRJq2qS5F3IDYMH/qzAk4VAVHOJJQNecCkms7/3cg D+yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=stg+GpIDtHLmRJfVFeaiidOrRaZK5aB+gDLGzBpnstM=; b=AazKh7mCNGJ+esDHQkL6OINP9/6RiD2zH8MqsYyBucDQaDbORLtieH2aOsuJRgR1ui 6l3uX8xWtcr2ZdiwKUFzwKOUyoN+wrYQvh65DSYW/KZJx+BNWHtLoerRiaGI3lglgzuK v2dbZIlL8Td9AEs5lgrfE42fpbY6VXdXWa4hZlP3mcIGiyIK2ru1j7qGRTCIP6aXmP7k v8QAZIQdw8iMc3iDC/7QAdmUkXUItkF/ZfVX/nZEkSWpfA+ggyhfBNmDGAv6+VBg/4ti TmIqq+HiXqWDJsw6NZ3iko1+2OkuUtPCupiAt+5wY/90oeHzeRoYCQL7jU1bhU0HzxxT Ai6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=k2iaeOhC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r18si1166947ejr.189.2019.09.20.07.33.13; Fri, 20 Sep 2019 07:33:49 -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; dkim=pass header.i=@chromium.org header.s=google header.b=k2iaeOhC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391613AbfITAgM (ORCPT + 99 others); Thu, 19 Sep 2019 20:36:12 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:46541 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390299AbfITAgM (ORCPT ); Thu, 19 Sep 2019 20:36:12 -0400 Received: by mail-qk1-f194.google.com with SMTP id 201so5407359qkd.13 for ; Thu, 19 Sep 2019 17:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=stg+GpIDtHLmRJfVFeaiidOrRaZK5aB+gDLGzBpnstM=; b=k2iaeOhCEz6eOKlGxqJcc/E+rroYDws2+YpFC8MfpD75tieXZpYWYoyVxPwoNMzfyb eHUWzoSVvZEOR3n+d4yQWUsu+bC2aY1JR6LHk1pbJ/IVWzvJ4pi45mY6UjTlq3Bn6UKa /uvO3Vm9A2gLaG5AHE4hQ7Lrko6vDKHlQHWCg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=stg+GpIDtHLmRJfVFeaiidOrRaZK5aB+gDLGzBpnstM=; b=laIlg9Yd9q4W6aD0AyYJKvr1YIuZXEQVajxCkhLp3JDATMEUpO/h1vFIjCMS67t5cb qeaqeniB/kvi+krw0ykRUqH/etBCdS3SRNc6nuAcUviHWwUPqDMZKQ9fr1T/IPaVRton SAqSllWQbZrg8LUPZRk/WqG/HFxhBqgrAyuXTYe/a9l2w4taNwvVFBNtTm6Az2Av3qLi 4rUy8eoL7EklTvmDI7kYWhviNcJruxv7t273Kt+yo6+LYNdIyNI8+YNzPoz4JOwKY3+U Zogn7JwBvhn9oFXPc06ia8Mvy/lI1BNYQuPZxZUDFS+Yd1e8RfqiPQoTthPgcKH0gf8I nrPg== X-Gm-Message-State: APjAAAVj9I0YHt/aDeOhULQeNqUb6r2kv/QJZFyw8Xi/PDeA5TBH1gUI 6FCX5AJq0GtFuKUmO6NYYL9YUwBLuxg= X-Received: by 2002:ae9:edc1:: with SMTP id c184mr632657qkg.336.1568939771008; Thu, 19 Sep 2019 17:36:11 -0700 (PDT) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com. [209.85.222.178]) by smtp.gmail.com with ESMTPSA id q5sm185120qte.38.2019.09.19.17.36.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Sep 2019 17:36:09 -0700 (PDT) Received: by mail-qk1-f178.google.com with SMTP id w2so5486064qkf.2 for ; Thu, 19 Sep 2019 17:36:08 -0700 (PDT) X-Received: by 2002:a37:5a06:: with SMTP id o6mr606203qkb.279.1568939767810; Thu, 19 Sep 2019 17:36:07 -0700 (PDT) MIME-Version: 1.0 References: <1568617425-28062-1-git-send-email-yhchuang@realtek.com> <1568617425-28062-6-git-send-email-yhchuang@realtek.com> In-Reply-To: From: Brian Norris Date: Thu, 19 Sep 2019 17:35:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 05/15] rtw88: pci: release tx skbs DMAed when stop To: Tony Chuang Cc: Kalle Valo , linux-wireless Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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: 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. Brian