1. 30 7月, 2010 1 次提交
    • S
      iwlwifi: fix scan abort · d28232b4
      Stanislaw Gruszka 提交于
      Fix possible double priv->mutex lock introduced by commit
      a69b03e9
      "iwlwifi: cancel scan watchdog in iwl_bg_abort_scan" .
      We can not call cancel_delayed_work_sync(&priv->scan_check) with
      priv->mutex locked because workqueue function iwl_bg_scan_check()
      take that lock internally.
      
      We do not need to synchronize when canceling priv->scan_check work.
      We can avoid races (sending double abort command or send no
      command at all) using STATUS_SCAN_ABORT bit. Moreover
      current iwl_bg_scan_check() code seems to be broken, as
      we should not send abort commands when currently aborting.
      Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
      CC: stable@kernel.org
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d28232b4
  2. 26 6月, 2010 1 次提交
  3. 16 6月, 2010 1 次提交
    • J
      iwlwifi: cancel scan watchdog in iwl_bg_abort_scan · a69b03e9
      John W. Linville 提交于
      Avoids this:
      
      WARNING: at net/mac80211/scan.c:312 ieee80211_scan_completed+0x5f/0x1f1
      [mac80211]()
      Hardware name: Latitude E5400
      Modules linked in: aes_x86_64 aes_generic fuse ipt_MASQUERADE iptable_nat
      nf_nat rfcomm sco bridge stp llc bnep l2cap sunrpc cpufreq_ondemand
      acpi_cpufreq freq_table xt_physdev ip6t_REJECT nf_conntrack_ipv6
      ip6table_filter ip6_tables ipv6 kvm_intel kvm uinput arc4 ecb
      snd_hda_codec_intelhdmi snd_hda_codec_idt snd_hda_intel iwlagn snd_hda_codec
      snd_hwdep snd_seq snd_seq_device iwlcore snd_pcm dell_wmi sdhci_pci sdhci
      iTCO_wdt tg3 dell_laptop mmc_core i2c_i801 wmi mac80211 snd_timer
      iTCO_vendor_support btusb joydev dcdbas cfg80211 bluetooth snd soundcore
      microcode rfkill snd_page_alloc firewire_ohci firewire_core crc_itu_t
      yenta_socket rsrc_nonstatic i915 drm_kms_helper drm i2c_algo_bit i2c_core video
      output [last unloaded: scsi_wait_scan]
      Pid: 979, comm: iwlagn Tainted: G        W  2.6.33.3-85.fc13.x86_64 #1
      Call Trace:
      [<ffffffff8104b558>] warn_slowpath_common+0x77/0x8f
      [<ffffffff8104b57f>] warn_slowpath_null+0xf/0x11
      [<ffffffffa01bb7d9>] ieee80211_scan_completed+0x5f/0x1f1 [mac80211]
      [<ffffffffa02a23f0>] iwl_bg_scan_completed+0xbb/0x17a [iwlcore]
      [<ffffffff81060d3d>] worker_thread+0x1a4/0x232
      [<ffffffffa02a2335>] ? iwl_bg_scan_completed+0x0/0x17a [iwlcore]
      [<ffffffff81064817>] ? autoremove_wake_function+0x0/0x34
      [<ffffffff81060b99>] ? worker_thread+0x0/0x232
      [<ffffffff810643c7>] kthread+0x7a/0x82
      [<ffffffff8100a924>] kernel_thread_helper+0x4/0x10
      [<ffffffff8106434d>] ? kthread+0x0/0x82
      [<ffffffff8100a920>] ? kernel_thread_helper+0x0/0x10
      
      Reported here:
      
      	https://bugzilla.redhat.com/show_bug.cgi?id=590436Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      Reported-by: NMihai Harpau <mishu@piatafinanciara.ro>
      Cc: stable@kernel.org
      Acked-by: NReinette Chatre <reinette.chatre@intel.com>
      a69b03e9
  4. 06 6月, 2010 2 次提交
  5. 22 5月, 2010 1 次提交
    • R
      iwlwifi: fix internal scan race · 073d5eab
      Reinette Chatre 提交于
      It is possible for internal scan to race against itself if the device is
      not returning the scan results from first requests. What happens in this
      case is the cleanup done during the abort of the first internal scan also
      cleans up part of the new scan, causing it to access memory it shouldn't.
      
      Here are details:
      * First internal scan is triggered and scan command sent to device.
      * After seven seconds there is no scan results so the watchdog timer
        triggers a scan abort.
      * The scan abort succeeds and a SCAN_COMPLETE_NOTIFICATION is received for
       failed scan.
      * During processing of SCAN_COMPLETE_NOTIFICATION we clear STATUS_SCANNING
        and queue the "scan_completed" work.
      ** At this time, since the problem that caused the internal scan in first
         place is still present, a new internal scan is triggered.
      The behavior at this point is a bit different between 2.6.34 and 2.6.35
      since 2.6.35 has a lot of this synchronized. The rest of the race
      description will thus be generalized.
      ** As part of preparing for the scan "is_internal_short_scan" is set to
      true.
      * At this point the completion work for fist scan is run. As part of this
        there is some locking missing around the "is_internal_short_scan"
        variable and it is set to "false".
      ** Now the second scan runs and it considers itself a real (not internal0
         scan and thus causes problems with wrong memory being accessed.
      
      The fix is twofold.
      * Since "is_internal_short_scan" should be protected by mutex, fix this in
        scan completion work so that changes to it can be serialized.
      * Do not queue a new internal scan if one is in progress.
      
      This fixes https://bugzilla.kernel.org/show_bug.cgi?id=15824Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      073d5eab
  6. 11 5月, 2010 2 次提交
  7. 01 5月, 2010 1 次提交
  8. 28 4月, 2010 1 次提交
  9. 17 4月, 2010 8 次提交
  10. 03 4月, 2010 1 次提交
  11. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  12. 26 3月, 2010 1 次提交
  13. 10 3月, 2010 3 次提交
  14. 12 2月, 2010 2 次提交
    • R
      iwlwifi: fix scan race · bbcbb9ef
      Reinette Chatre 提交于
      There is a problem if an "internal short scan" is in progress when a
      mac80211 requested scan arrives. If this new scan request arrives within
      the "next_scan_jiffies" period then driver will immediately return success
      and complete the scan. The problem here is that the scan has not been
      fully initialized at this time (is_internal_short_scan is still set to true
      because of the currently running scan), which results in the scan
      completion never to be sent to mac80211. At this time also, evan though the
      internal short scan is still running the state (is_internal_short_scan)
      will be set to false, so when the internal scan does complete then mac80211
      will receive a scan completion.
      
      Fix this by checking right away if a scan is in progress when a scan
      request arrives from mac80211.
      Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
      bbcbb9ef
    • W
      iwlwifi: multiple force reset mode · a93e7973
      Wey-Yi Guy 提交于
      Provide the function to perform different type of uCode reset/reload operation.
      When uCode detect error and can not fix itself, this iwl_force_reset()
      function allow driver to perform the necessary reset/reload functions and help
      to bring uCode back to normal operation state.
      
      Currently only 2 type of force reset are available:
       - reset radio
       - reload firmware
      Signed-off-by: NWey-Yi Guy <wey-yi.w.guy@intel.com>
      Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
      a93e7973
  15. 09 2月, 2010 1 次提交
  16. 26 1月, 2010 3 次提交
  17. 20 1月, 2010 1 次提交
  18. 22 12月, 2009 1 次提交
  19. 12 11月, 2009 2 次提交
  20. 03 11月, 2009 1 次提交
  21. 28 10月, 2009 1 次提交
    • Z
      iwlwifi: use paged Rx · 2f301227
      Zhu Yi 提交于
      This switches the iwlwifi driver to use paged skb from linear skb for Rx
      buffer. So that it relieves some Rx buffer allocation pressure for the
      memory subsystem. Currently iwlwifi (4K for 3945) requests 8K bytes for
      Rx buffer. Due to the trailing skb_shared_info in the skb->data,
      alloc_skb() will do the next order allocation, which is 16K bytes. This
      is suboptimal and more likely to fail when the system is under memory
      usage pressure. Switching to paged Rx skb lets us allocate the RXB
      directly by alloc_pages(), so that only order 1 allocation is required.
      
      It also adjusts the area spin_lock (with IRQ disabled) protected in the
      tasklet because tasklet guarentees to run only on one CPU and the new
      unprotected code can be preempted by the IRQ handler. This saves us from
      spawning another workqueue to make skb_linearize/__pskb_pull_tail happy
      (which cannot be called in hard irq context).
      
      Finally, mac80211 doesn't support paged Rx yet. So we linearize the skb
      for all the management frames and software decryption or defragmentation
      required data frames before handed to mac80211. For all the other frames,
      we __pskb_pull_tail 64 bytes in the linear area of the skb for mac80211
      to handle them properly.
      Signed-off-by: NZhu Yi <yi.zhu@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      2f301227
  22. 08 10月, 2009 1 次提交
  23. 29 8月, 2009 1 次提交
  24. 28 7月, 2009 1 次提交
    • J
      iwlwifi: fix up command sending · c2acea8e
      Johannes Berg 提交于
      The current command sending in iwlwifi is a bit of a mess:
       1) there is a struct, iwl_cmd, that contains both driver
          and device data in a single packed structure -- this
          is very confusing
       2) the on-stack data and the command metadata share a
          structure by embedding the latter in the former, which
          is also rather confusing because it leads to weird
          unions and similarly odd constructs
       3) each txq always has enough space for 256 commands,
          even if only 32 end up being used
      
      This patch fixes these things:
       1) rename iwl_cmd to iwl_device_cmd and keep track of
          command metadata and device command separately, in
          two arrays in each tx queue
       2) remove the 'meta' member from iwl_host_cmd and only
          put in the required members
       3) allocate the cmd/meta arrays separately instead of
          embedding them into the txq structure
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      c2acea8e
  25. 11 7月, 2009 1 次提交