Return-path: Received: from mail-qa0-f46.google.com ([209.85.216.46]:38470 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932253Ab2EKQue convert rfc822-to-8bit (ORCPT ); Fri, 11 May 2012 12:50:34 -0400 Received: by qadb17 with SMTP id b17so1454706qad.19 for ; Fri, 11 May 2012 09:50:33 -0700 (PDT) MIME-Version: 1.0 Reply-To: sedat.dilek@gmail.com In-Reply-To: <1336740600.12801.2.camel@jlt3.sipsolutions.net> References: <1336665952-24363-1-git-send-email-johannes@sipsolutions.net> <1336665952-24363-3-git-send-email-johannes@sipsolutions.net> <1336740600.12801.2.camel@jlt3.sipsolutions.net> Date: Fri, 11 May 2012 18:50:33 +0200 Message-ID: (sfid-20120511_185037_841971_6861578E) Subject: Re: [PATCH 2/4 v2] iwlwifi: fix the Transmit Frame Descriptor rings From: Sedat Dilek To: Johannes Berg Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org, Emmanuel Grumbach Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Fri, May 11, 2012 at 2:50 PM, Johannes Berg wrote: > From: Emmanuel Grumbach > > The logic that allows to have a short TFD queue was completely wrong. > We do maintain 256 Transmit Frame Descriptors, but they point to > recycled buffers. We used to attach and de-attach different TFDs for > the same buffer and it worked since they pointed to the same buffer. > > Also zero the number of BDs after unmapping a TFD. This seems not > necessary since we don't reclaim the same TFD twice, but I like > housekeeping. > > This patch solves this warning: > > [ 6427.079855] WARNING: at lib/dma-debug.c:866 check_unmap+0x727/0x7a0() > [ 6427.079859] Hardware name: Latitude E6410 > [ 6427.079865] iwlwifi 0000:02:00.0: DMA-API: device driver tries to free DMA memory it has not allocated [device address=0x00000000296d393c] [size=8 bytes] > [ 6427.079870] Modules linked in: ... > [ 6427.079950] Pid: 6613, comm: ifconfig Tainted: G           O 3.3.3 #5 > [ 6427.079954] Call Trace: > [ 6427.079963]  [] warn_slowpath_common+0x72/0xa0 > [ 6427.079982]  [] warn_slowpath_fmt+0x33/0x40 > [ 6427.079988]  [] check_unmap+0x727/0x7a0 > [ 6427.079995]  [] debug_dma_unmap_page+0x5a/0x80 > [ 6427.080024]  [] iwlagn_unmap_tfd+0x12c/0x180 [iwlwifi] > [ 6427.080048]  [] iwlagn_txq_free_tfd+0x49/0xb0 [iwlwifi] > [ 6427.080071]  [] iwl_tx_queue_unmap+0x67/0x90 [iwlwifi] > [ 6427.080095]  [] iwl_trans_pcie_stop_device+0x341/0x7b0 [iwlwifi] > [ 6427.080113]  [] iwl_down+0x17e/0x260 [iwlwifi] > [ 6427.080132]  [] iwlagn_mac_stop+0x6c/0xf0 [iwlwifi] > [ 6427.080168]  [] ieee80211_stop_device+0x5e/0x190 [mac80211] > [ 6427.080198]  [] ieee80211_do_stop+0x288/0x620 [mac80211] > [ 6427.080243]  [] ieee80211_stop+0x17/0x20 [mac80211] > [ 6427.080250]  [] __dev_close_many+0x81/0xd0 > [ 6427.080270]  [] __dev_close+0x2d/0x50 > [ 6427.080276]  [] __dev_change_flags+0x82/0x150 > [ 6427.080282]  [] dev_change_flags+0x23/0x60 > [ 6427.080289]  [] devinet_ioctl+0x6a0/0x770 > [ 6427.080296]  [] inet_ioctl+0x95/0xb0 > [ 6427.080304]  [] sock_ioctl+0x70/0x270 > > Cc: stable@vger.kernel.org > Reported-by: Antonio Quartulli > Tested-by: Antonio Quartulli > Signed-off-by: Emmanuel Grumbach > Reviewed-by: Wey-Yi W Guy > Signed-off-by: Johannes Berg > --- > v2: rebased onto wireless.git rather than wireless-testing.git, sorry! > Tested-by: Sedat Dilek