1. 13 Oct, 2017 22 commits
  2. 11 Oct, 2017 1 commit
    • Kalle Valo's avatar
      Merge tag 'iwlwifi-next-for-kalle-2017-10-06-2' of... · 20d879e7
      Kalle Valo authored
      Merge tag 'iwlwifi-next-for-kalle-2017-10-06-2' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
      
      First batch of iwlwifi patches for 4.15 (v2)
      
      * Cleanups: - remove an unused value that we read from the NVM;
                  - remove link quality measurement code that was never used;
      * One FW command API update;
      * A fix and an addition for PCI devices for the A000 family;
      * Tiny refactor of ref/unref code used by runtime-PM;
      * Some debugging improvements;
      * Implementation of a more flexible way to define command queue sizes;
      * ACPI code refactoring;
      * Some coding-style fixes;
      * Avoid redundant command to the firmware;
      * Add a struct with the format of one FW command;
      * Change an error log to a warning when the FW API is not aligned with
        the driver (important during development);
      * Change a WARN_ON to WARN_ONCE to make it more descriptive and less
        noisy (i.e. no repeated warnings on a firmware triggered error);
      * Dump PCI registers when an error occurs, to make it easier to debug;
      20d879e7
  3. 10 Oct, 2017 3 commits
    • Karthik Ananthapadmanabha's avatar
      mwifiex: Random MAC address during scanning · 073a435d
      Karthik Ananthapadmanabha authored
      Driver will advertise RANDOM_MAC support only if the device
      supports this feature.
      Signed-off-by: default avatarKarthik Ananthapadmanabha <karthida@marvell.com>
      Signed-off-by: default avatarGanapathi Bhat <gbhat@marvell.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      073a435d
    • Dan Carpenter's avatar
      rtlwifi: silence underflow warning · 64e79426
      Dan Carpenter authored
      My static checker complains that we have an upper bound but no lower
      bound.  I suspect neither are really required but it doesn't hurt to add
      a check for negatives.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      64e79426
    • Andrey Konovalov's avatar
      p54: don't unregister leds when they are not initialized · fc09785d
      Andrey Konovalov authored
      ieee80211_register_hw() in p54_register_common() may fail and leds won't
      get initialized. Currently p54_unregister_common() doesn't check that and
      always calls p54_unregister_leds(). The fix is to check priv->registered
      flag before calling p54_unregister_leds().
      
      Found by syzkaller.
      
      INFO: trying to register non-static key.
      the code is fine but needs lockdep annotation.
      turning off the locking correctness validator.
      CPU: 1 PID: 1404 Comm: kworker/1:1 Not tainted
      4.14.0-rc1-42251-gebb2c243-dirty #205
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
      Workqueue: usb_hub_wq hub_event
      Call Trace:
       __dump_stack lib/dump_stack.c:16
       dump_stack+0x292/0x395 lib/dump_stack.c:52
       register_lock_class+0x6c4/0x1a00 kernel/locking/lockdep.c:769
       __lock_acquire+0x27e/0x4550 kernel/locking/lockdep.c:3385
       lock_acquire+0x259/0x620 kernel/locking/lockdep.c:4002
       flush_work+0xf0/0x8c0 kernel/workqueue.c:2886
       __cancel_work_timer+0x51d/0x870 kernel/workqueue.c:2961
       cancel_delayed_work_sync+0x1f/0x30 kernel/workqueue.c:3081
       p54_unregister_leds+0x6c/0xc0 drivers/net/wireless/intersil/p54/led.c:160
       p54_unregister_common+0x3d/0xb0 drivers/net/wireless/intersil/p54/main.c:856
       p54u_disconnect+0x86/0x120 drivers/net/wireless/intersil/p54/p54usb.c:1073
       usb_unbind_interface+0x21c/0xa90 drivers/usb/core/driver.c:423
       __device_release_driver drivers/base/dd.c:861
       device_release_driver_internal+0x4f4/0x5c0 drivers/base/dd.c:893
       device_release_driver+0x1e/0x30 drivers/base/dd.c:918
       bus_remove_device+0x2f4/0x4b0 drivers/base/bus.c:565
       device_del+0x5c4/0xab0 drivers/base/core.c:1985
       usb_disable_device+0x1e9/0x680 drivers/usb/core/message.c:1170
       usb_disconnect+0x260/0x7a0 drivers/usb/core/hub.c:2124
       hub_port_connect drivers/usb/core/hub.c:4754
       hub_port_connect_change drivers/usb/core/hub.c:5009
       port_event drivers/usb/core/hub.c:5115
       hub_event+0x1318/0x3740 drivers/usb/core/hub.c:5195
       process_one_work+0xc7f/0x1db0 kernel/workqueue.c:2119
       process_scheduled_works kernel/workqueue.c:2179
       worker_thread+0xb2b/0x1850 kernel/workqueue.c:2255
       kthread+0x3a1/0x470 kernel/kthread.c:231
       ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Acked-by: default avatarChristian Lamparter <chunkeey@googlemail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      fc09785d
  4. 06 Oct, 2017 14 commits
    • Luca Coelho's avatar
      iwlwifi: remove dflt_pwr_limit from the transport · f2abcfa6
      Luca Coelho authored
      The default power limit read from the SPLC method in ACPI doesn't
      have anything to do with the transport and is only used in the opmode,
      so we can remove it from the trans.  Additionally, this value is only
      user when the opmode is starting, so we don't need to store it
      anywhere.
      
      Remove the dflt_pwr_limit element from the trans and move call to
      iwl_acpi_get_pwr_limit() call to mvm.
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      f2abcfa6
    • Johannes Berg's avatar
      iwlwifi: mvm: warn on invalid statistics size · 42fa5e0e
      Johannes Berg authored
      Getting the wrong statistics size is a problem, having a warning
      will help us catch it quicker during firmware/driver development.
      In released firmware/driver versions, we obviously make sure this
      won't happen.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      42fa5e0e
    • Luca Coelho's avatar
      iwlwifi: acpi: move code that reads SPLC to acpi · 1184611e
      Luca Coelho authored
      Move most of the set_dflt_pwr_limit() function to acpi.c and make it
      return the pwr_limit value instead of setting directly.  Also rename
      it to iwl_acpi_get_pwr_limit().
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      1184611e
    • Johannes Berg's avatar
      iwlwifi: fix indentation in a000 family configuration · e59a00f4
      Johannes Berg authored
      Fix the double indentation in the configuration structs
      for a000 family devices.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      e59a00f4
    • Luca Coelho's avatar
      iwlwifi: acpi: move function to get mcc into acpi code · 45f65569
      Luca Coelho authored
      The iwl_get_bios_mcc() function was in the iwl-nvm-parse.c file, but
      it has nothing to do with the NVM.  Move it to fw/acpi.c and rename it
      to iwl_acpi_get_mcc().
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      45f65569
    • Luca Coelho's avatar
      iwlwifi: acpi: remove a couple of unnecessary ifdefs · d953cdb8
      Luca Coelho authored
      Some of the #ifdef CONFIG_ACPI are not needed anymore, so they can be
      removed.
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      d953cdb8
    • Luca Coelho's avatar
      iwlwifi: acpi: make iwl_get_bios_mcc() use the common acpi functions · ed1a962d
      Luca Coelho authored
      The way iwl_get_bios_mcc() gets the WiFi package and checks for its
      integrity is almost identical to the new iwl_acpi_get_wifi_pkg()
      function.  Instead of having duplicate code, convert it to use the
      common code.
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      ed1a962d
    • Luca Coelho's avatar
      iwlwifi: acpi: use iwl_acpi_get_wifi_pkg when reading reading SPLC · 45a5c6f6
      Luca Coelho authored
      Instead of finding the wifi package with its own code, we can reuse
      the new iwl_acpi_get_wifi_pkg() function when reading the default
      power limit from SPLC.
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      45a5c6f6
    • Luca Coelho's avatar
      iwlwifi: acpi: generalize iwl_mvm_sar_find_wifi_pkg() · 2fa388cf
      Luca Coelho authored
      Move this function to acpi.c, renaming it to iwl_acpi_get_wifi_pkg(),
      because it can also be used with other methods (i.e. SPLC and WRDD).
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      2fa388cf
    • Luca Coelho's avatar
      iwlwifi: acpi: move ACPI-related definitions to acpi.h · e7a3b8d8
      Luca Coelho authored
      The ACPI table size definitions were spread around the different files
      that used them.  Move them all to a common place.
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      e7a3b8d8
    • Luca Coelho's avatar
      iwlwifi: acpi: move ACPI method definitions to acpi.h · 1c73acf5
      Luca Coelho authored
      Instead of defining each method where they are used and re-defining
      WIFI_DOMAIN in each one of them, move all the definitions to a central
      place and define the domain only a single time.
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      1c73acf5
    • Luca Coelho's avatar
      iwlwifi: acpi: add common code to read from ACPI · 813df5ce
      Luca Coelho authored
      There are many places where the same process of invoking a method from
      ACPI is used, causing a lot of duplicate code.  To improve this,
      introduce a new function to get an ACPI object by invoking an ACPI
      method that can be reused.
      
      Additionally, since this function needs to be called when we only have
      the trans, the opmode or the device, introduce a new debug macro that
      gets the device as a parameter so it can be used in the new function.
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      813df5ce
    • Sara Sharon's avatar
      iwlwifi: mvm: change warning to warn_once() · 417795a3
      Sara Sharon authored
      In case there is a FW bug where the BAID value in the
      metadata is not properly initialized we hit the warning for
      every RX packet.
      Change it to warn once and add elaborate message.
      Signed-off-by: default avatarSara Sharon <sara.sharon@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      417795a3
    • Rajat Jain's avatar
      iwlwifi: pcie: dump registers when HW becomes inaccessible · a6d24fad
      Rajat Jain authored
      We conclude the HW became inaccessible when we timeout waiting for
      a bit to be set in a memory mapped register (CSR_GP_CNTRL). This
      conclusion may not be true because the bit may not get set due to:
      - a firmware issue
      - a driver issue
      - a PCI bus issue
      - a platform issue
      There are a lot of such reports with really no good debug information
      beyond this message to help us.
      
      Add some debug information and attempt to dump the different register
      spaces at such a failure:
      
      * Dump some configuration space of device - this will tell us if
      something very basic is broken in the PCIe bus (so that configuration
      accesses are failing). If this works, the PCIe bus seems OK. If this
      does not work, it is definitely an PCIe issue.
      
      * Dump some memory mapped registers - if we're reading some sane'ish
      values, this will tell us that the PCIe bus is OK, but may be a firmware
      / driver issue. If this does not work, it may be a PCI configuration
      issue or a driver/firmware issue.
      
      * Dump parent and device's AER registers, will give us some straws to
      chew on.
      
      This is the sample output:
      [   13.082651] ------------[ cut here ]------------
      [   13.086791] iwlwifi 0000:01:00.0: iwlwifi transaction failed, dumping registers
      [   13.086793] iwlwifi 0000:01:00.0: iwlwifi device config registers:
      [   13.086893] iwlwifi 0000:01:00.0: 00000000: 095a8086 00100406 02800059 00000000 00000004 00000000 00000000 00000000
      [   13.086895] iwlwifi 0000:01:00.0: 00000020: 00000000 00000000 00000000 50108086 00000000 000000c8 00000000 00000100
      [   13.086901] iwlwifi 0000:01:00.0: iwlwifi device memory mapped registers:
      [   13.086989] iwlwifi 0000:01:00.0: 00000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
      [   13.086991] iwlwifi 0000:01:00.0: 00000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
      [   13.086999] iwlwifi 0000:01:00.0: iwlwifi device AER capability structure:
      [   13.087033] iwlwifi 0000:01:00.0: 00000000: 14010001 00100000 00000000 00462031 00002000 00002000 00000014 40000001
      [   13.087034] iwlwifi 0000:01:00.0: 00000020: 0000000f d140000c 00000000
      [   13.087036] iwlwifi 0000:01:00.0: iwlwifi parent port (0000:00:1c.0) config registers:
      [   13.087074] iwlwifi 0000:00:1c.0: 00000000: 9d108086 00100506 060400f1 00810010 00000000 00000000 00010100 200000f0
      [   13.087075] iwlwifi 0000:00:1c.0: 00000020: d140d140 0001fff1 00000000 00000000 00000000 00000040 00000000 0006010b
      [   13.087087] ------------[ cut here ]------------
      [   13.087095] WARNING: CPU: 0 PID: 1759 at drivers/net/wireless/iwl7000/iwlwifi/pcie/trans.c:2082 iwl_trans_pcie_reclaim+0x1ee4/0x2b9a [iwlwifi]()
      [   13.087096] Timeout waiting for hardware access (CSR_GP_CNTRL 0xffffffff)
      Signed-off-by: default avatarRajat Jain <rajatja@google.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      a6d24fad