From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:48315 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932847AbbJHRol (ORCPT ); Thu, 8 Oct 2015 13:44:41 -0400 Message-ID: <5616AB7D.9070803@codeaurora.org> (sfid-20151008_194446_035003_8811CDE0) Date: Thu, 08 Oct 2015 10:44:29 -0700 From: Peter Oh MIME-Version: 1.0 To: Kalle Valo , Peter Oh CC: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: Re: [PATCH] ath10k: use pre-allocated DMA buffer in Tx References: <1443117270-16790-1-git-send-email-poh@qca.qualcomm.com> <87fv1lvauk.fsf@kamboji.qca.qualcomm.com> <5616A511.5060705@codeaurora.org> In-Reply-To: <5616A511.5060705@codeaurora.org> Content-Type: text/plain; charset=windows-1252; format=flowed Sender: linux-wireless-owner@vger.kernel.org List-ID: I did quick glance on the warning. The dma unmap warning is caused by dma_unmap_single called per every received packet in ath10k_pci_htt_tx_cb() <- ath10k_pci_htt_rx_cb(). The physical address is assigned by rx refill function for rx ring. So it looks like copy engine patchset has a bug. FYI, pre-allocated dma is coherent dma used in Tx only and only freed when ath10k driver stops. On 10/08/2015 10:17 AM, Peter Oh wrote: > Does it happen after you applied copy engine patchset or even without > the patchset? > I saw ath10k_pci_htt_tx_cb in backtrace which is not merged to master > branch yet. > If it only happens after the patchset, I'll apply them and look into > it if any possibilities are there. > > On 10/08/2015 04:49 AM, Kalle Valo wrote: >> Peter Oh writes: >> >>> ath10k driver is using dma_pool_alloc per packet and dma_pool_free >>> in coresponding at Tx completion. >>> Use of pre-allocated DMA buffer in Tx will improve saving CPU resource >>> by 5% while it consumes about 56KB memory more as trade off. >>> >>> Signed-off-by: Peter Oh >> I see randomly the warning below with ath.git master branch commit >> 2e88ba7ebe8d1. Can this patch cause that? >> >> [ 53.637883] ------------[ cut here ]------------ >> [ 53.637999] WARNING: CPU: 2 PID: 0 at lib/dma-debug.c:1090 >> check_unmap+0x815/0x940() >> [ 53.638070] ath10k_pci 0000:02:00.0: qca99x0 hw2.0 (0x01000000, >> 0x003801ff bmi 1:1) fw 10.4.1.00007 fwapi 5 bdapi 2 htt-ver 2.2 wmi-op 6 >> htt-op 4 cal otp max-sta 512 raw 0 hwcrypto 1 features no-p2p >> [ 53.638077] ath10k_pci 0000:02:00.0: debug 1 debugfs 1 tracing 1 dfs > 1 >> testmode 1 >> [ 53.638205] ath10k_pci 0000:02:00.0: DMA-API: device driver tries to >> free an invalid DMA memory address >> [ 53.638270] Modules linked in: ath10k_pci ath10k_core ath mac80211 >> cfg80211 [last unloaded: cfg80211] >> [ 53.638800] CPU: 2 PID: 0 Comm: swapper/2 Not tainted > 4.3.0-rc3-wl-ath+ >> #1082 >> [ 53.638880] Hardware name: Hewlett-Packard HP ProBook 6540b/1722, > BIOS >> 68CDD Ver. F.04 01/27/2010 >> [ 53.638951] 00000000 00000000 f4445de4 c133dd94 00000000 f4445e14 >> c10562de c1b3e12c >> [ 53.639551] f4445e40 00000000 c1b3d3b9 00000442 c13693c5 c13693c5 >> f422e840 f4445eb4 >> [ 53.640169] 00000000 f4445e2c c10563c3 00000009 f4445e24 c1b3e12c >> f4445e40 f4445ea4 >> [ 53.640802] Call Trace: >> [ 53.640874] [] dump_stack+0x48/0x64 >> [ 53.640953] [] warn_slowpath_common+0x8e/0xd0 >> [ 53.641031] [] ? check_unmap+0x815/0x940 >> [ 53.641115] [] ? check_unmap+0x815/0x940 >> [ 53.641201] [] warn_slowpath_fmt+0x33/0x40 >> [ 53.641277] [] check_unmap+0x815/0x940 >> [ 53.641356] [] ? local_clock+0x25/0x30 >> [ 53.641432] [] debug_dma_unmap_page+0x8c/0xa0 >> [ 53.641511] [] ath10k_pci_htt_tx_cb+0x8f/0xb0 [ath10k_pci] >> [ 53.641589] [] ath10k_pci_htt_rx_cb+0x20/0x30 [ath10k_pci] >> [ 53.641668] [] ath10k_ce_per_engine_service+0x5c/0xa0 >> [ath10k_pci] >> [ 53.641746] [] ath10k_ce_per_engine_service_any+0x77/0x90 >> [ath10k_pci] >> [ 53.641825] [] ath10k_pci_tasklet+0x1b/0x50 [ath10k_pci] >> [ 53.642064] [] tasklet_action+0x9e/0xb0 >> [ 53.642142] [] __do_softirq+0xbb/0x3c0 >> [ 53.642222] [] ? >> trace_event_raw_event_irq_handler_entry+0xa0/0xa0 >> [ 53.642300] [] do_softirq_own_stack+0x29/0x40 >> [ 53.642375] [] irq_exit+0x86/0xb0 >> [ 53.642526] [] do_IRQ+0x60/0x120 >> [ 53.642604] [] ? trace_hardirqs_off+0xb/0x10 >> [ 53.642680] [] common_interrupt+0x31/0x38 >> [ 53.642760] [] ? cpuidle_enter_state+0xc9/0x350 >> [ 53.642835] [] ? menu_select+0x239/0x4b0 >> [ 53.642925] [] cpuidle_enter+0x14/0x20 >> [ 53.643063] [] call_cpuidle+0x3c/0x70 >> [ 53.643140] [] cpu_startup_entry+0x1a9/0x390 >> [ 53.643218] [] start_secondary+0x105/0x150 >> [ 53.643294] ---[ end trace a5dc1d40148089eb ]--- >> > > > _______________________________________________ > ath10k mailing list > ath10k@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/ath10k