1. 28 Feb, 2013 4 commits
    • Johannes Berg's avatar
      iwlwifi: use coherent DMA memory for command header · 38c0f334
      Johannes Berg authored
      Recently in commit 8a964f44
      ("iwlwifi: always copy first 16 bytes of commands") we fixed
      the problem that the hardware writes back to the command and
      that could overwrite parts of the data that was still needed
      and would thus be corrupted.
      
      Investigating this problem more closely we found that this
      write-back isn't really ordered very well with respect to
      other DMA traffic. Therefore, it sometimes happened that the
      write-back occurred after unmapping the command again which
      is clearly an issue and could corrupt the next allocation
      that goes to that spot, or (better) cause IOMMU faults.
      
      To fix this, allocate coherent memory for the first 16 bytes
      of each command, containing the write-back part, and use it
      for all queues. All the dynamic DMA mappings only need to be
      TO_DEVICE then. This ensures that even when the write-back
      happens "too late" it can't hit memory that has been freed
      or a mapping that doesn't exist any more.
      
      Since now the actual command is no longer modified, we can
      also remove CMD_WANT_HCMD and get rid of the DMA sync that
      was necessary to update the scratch pointer.
      Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      38c0f334
    • Emmanuel Grumbach's avatar
      iwlwifi: disable 8K A-MSDU by default · aed7d9ac
      Emmanuel Grumbach authored
      Supporting 8K A-MSDU means that we need to allocate order 1
      pages for every Rx packet. Even when there is no traffic.
      This adds stress on the memory manager. The handling of
      compound pages is also less trivial for the memory manager
      and not using them will make the allocation code run faster
      although I didn't really measure.
      Eric also pointed out that having huge buffers with little
      data in them is not very nice towards the TCP stack since
      the truesize of the skb is huge. This doesn't allow TCP
      to have a big Rx window.
      See https://patchwork.kernel.org/patch/2167711/ for details.
      
      Note that very few vendors will actually send A-MSDU.
      Disable this feature by default.
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      aed7d9ac
    • Johannes Berg's avatar
      iwlwifi: rename IWL_MAX_CMD_TFDS to IWL_MAX_CMD_TBS_PER_TFD · 1afbfb60
      Johannes Berg authored
      The IWL_MAX_CMD_TFDS name for this constant is wrong, the
      constant really indicates how many TBs we can use in the
      driver for a single command TFD, rename the constant and
      also add a comment explaining it.
      Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      1afbfb60
    • Johannes Berg's avatar
      iwlwifi: don't map complete commands bidirectionally · 98891754
      Johannes Berg authored
      The reason we mapped them bidirectionally was that not doing
      so had caused IOMMU exceptions, due to the fact that the HW
      writes back into the command. Now that the first part of the
      command including the write-back part is always in the first
      buffer, we don't need to map the remaining buffer(s) bidi
      and can get rid of the special-casing for commands.
      
      This is a requisite patch for another one to fix DMA mapping.
      Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      98891754
  2. 27 Feb, 2013 2 commits
  3. 26 Feb, 2013 2 commits
    • Johannes Berg's avatar
      iwlwifi: mvm: fix AP/GO mode station removal · 38a12b5b
      Johannes Berg authored
      When stations are removed while packets are in the queue,
      we drain the queues first, and then remove the stations.
      If this happens in AP mode while the interface is removed
      the MAC context might be removed from the firmware before
      we removed the station(s), resulting in a SYSASSERT 3421.
      This is because we remove the MAC context from the FW in
      stop_ap(), but only flush the station drain work later in
      remove_interface().
      
      Refactor the code a bit to have a common MAC context
      removal preparation first to solve this.
      Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      38a12b5b
    • Johannes Berg's avatar
      iwlwifi: always copy first 16 bytes of commands · 8a964f44
      Johannes Berg authored
      The FH hardware will always write back to the scratch field
      in commands, even host commands not just TX commands, which
      can overwrite parts of the command. This is problematic if
      the command is re-used (with IWL_HCMD_DFL_NOCOPY) and can
      cause calibration issues.
      
      Address this problem by always putting at least the first
      16 bytes into the buffer we also use for the command header
      and therefore make the DMA engine write back into this.
      
      For commands that are smaller than 16 bytes also always map
      enough memory for the DMA engine to write back to.
      
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      8a964f44
  4. 22 Feb, 2013 3 commits
  5. 18 Feb, 2013 24 commits
  6. 15 Feb, 2013 5 commits
    • Seth Forshee's avatar
      mac80211: Fix incorrect use of STA_PR_FMT in trace points · 15ac7c47
      Seth Forshee authored
      Several tracepoints are using STA_PR_FMT where STA_PR_ARG should be
      used, resulting in messages like "phy0 sta:ARG TYPE NOT FIELD BUT 1".
      Change these to STA_PR_ARG.
      Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      15ac7c47
    • John W. Linville's avatar
    • John W. Linville's avatar
    • Bob Copeland's avatar
      mac80211: enable vif.cab_queue for mesh · 8ffb5c00
      Bob Copeland authored
      Since mesh powersaving was added, pending bcast/mcast frames may go out the
      CAB queue now.  Unfortunately, the queue was only set up for AP mode, so we
      would try to tx on the IEEE80211_INVAL_HW_QUEUE.  Allow cab_queue for mesh
      interfaces as well.
      
      Fixes the following warning (or crash without MAC80211_VERBOSE_DEBUG):
      
      WARNING: at net/mac80211/tx.c:1223 __ieee80211_tx+0x162/0x35f [mac80211]()
      Modules linked in: mac80211_hwsim mac80211 cfg80211 [...]
      Pid: 3085, comm: avahi-daemon Tainted: G        W    3.8.0-rc1+ #377
      Call Trace:
       [<ffffffff81045c20>] warn_slowpath_common+0x83/0x9c
       [<ffffffff81045c53>] warn_slowpath_null+0x1a/0x1c
       [<ffffffffa083aef0>] __ieee80211_tx+0x162/0x35f [mac80211]
       [<ffffffffa083cb1d>] ieee80211_tx+0xd3/0xf9 [mac80211]
       [<ffffffffa083cc0f>] ieee80211_xmit+0xcc/0xd5 [mac80211]
       [<ffffffffa083db59>] ieee80211_subif_start_xmit+0xc53/0xcd8 [mac80211]
       [<ffffffff81319acd>] dev_hard_start_xmit+0x259/0x3ce
       [<ffffffff81333d6b>] sch_direct_xmit+0x74/0x17d
       [<ffffffff8131a0b1>] dev_queue_xmit+0x230/0x414
       [<ffffffff8134877a>] ip_finish_output2+0x348/0x3aa
       [<ffffffff81349029>] ip_finish_output+0x6c/0x71
       [<ffffffff81349046>] NF_HOOK_COND.constprop.44+0x18/0x58
       [<ffffffff8134a03a>] ip_mc_output+0x134/0x13c
       [<ffffffff8134835a>] dst_output+0x18/0x1c
       [<ffffffff81349a24>] ip_local_out+0x20/0x24
       [<ffffffff8134a8cf>] ip_send_skb+0x16/0x3c
       [<ffffffff8136bfba>] udp_send_skb+0x254/0x2b9
       [<ffffffff8136c85e>] udp_sendmsg+0x5a8/0x7d4
      Signed-off-by: default avatarBob Copeland <bob@cozybit.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      8ffb5c00
    • Johannes Berg's avatar
      mac80211: clean up mesh code · bf7cd94d
      Johannes Berg authored
      There's various code with strange indentation,
      questionable loop and locking constructs, etc.
      
      The bigger change is moving the "sdata" argument
      to the first argument of all functions, like all
      other mac80211 functions that have one.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      bf7cd94d