Commit Graph

17 Commits

Author SHA1 Message Date
Jose Ignacio Tornos Martinez 860ce34398 wifi: iwlwifi: mvm: fix hibernation
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit cb347bd29d0d106213a0cf4f86b72dffd08d3454
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Sun Aug 25 19:17:02 2024 +0300

    wifi: iwlwifi: mvm: fix hibernation
    
    Fast resume is a feature that was recently introduced to speed up the
    resume time. It basically keeps the firmware alive while the system
    is suspended and that avoids starting again the whole device.
    
    This flow can't work for hibernation, since when the system boots,
    before the frozen image is loaded, the kernel may touch the device. As a
    result, we can't assume the device is in the exact same state as before
    the hibernation.
    
    Detect that we are resuming from hibernation through the PCI device and
    forbid the fast resume flow. We also need to shut down the device
    cleanly when that happens.
    
    In addition, in case the device is power gated during S3, we won't be
    able to keep the device alive. Detect this situation with BE200 at least
    with the help of the CSR_FUNC_SCRATCH register and reset the device upon
    resume if it was power gated during S3.
    
    Fixes: e8bb19c1d590 ("wifi: iwlwifi: support fast resume")
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240825191257.24eb3b19e74f.I3837810318dbef0a0a773cf4c4fcf89cdc6fdbd3@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:18:43 +01:00
Jose Ignacio Tornos Martinez 0a96bfe22b wifi: iwlwifi: don't assume op_mode_nic_config exists
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 2b94a6f792b0844a98c187eb35e090ce16bf5810
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Tue Jun 18 19:44:07 2024 +0300

    wifi: iwlwifi: don't assume op_mode_nic_config exists
    
    The new op_mode won't have this callback.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://patch.msgid.link/20240618194245.718983e7b832.I02fb130aa3d2044958cba7dced357031b92e33bb@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:18:12 +01:00
Jose Ignacio Tornos Martinez 756dd53a07 wifi: iwlwifi: pcie: don't allow hw-rfkill to stop device on gen2
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit a20ac99b5f5ee768866b42d28138d90d89158042
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Mon Feb 5 00:06:05 2024 +0200

    wifi: iwlwifi: pcie: don't allow hw-rfkill to stop device on gen2
    
    On new devices the HW rfkill shutdown doesn't need to be handled
    "as fast as possible", so disallow the immediate shutdown mode
    here via documentation and a warning.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240204235836.794c5387e67e.I064365428815ec3135afa345fbbde78449b60203@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:19:21 +02:00
Jose Ignacio Tornos Martinez bb0f5f7171 wifi: iwlwifi: remove async command callback
JIRA: https://issues.redhat.com/browse/RHEL-28754

commit 14c1b6f430e3582b3ef2ce1e3016de829b520f77
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Thu Dec 7 04:50:15 2023 +0200

    wifi: iwlwifi: remove async command callback
    
    There's only one user of this code, which is STA unblock
    during sleep for uAPSD on really old devices. Instead of
    having this all through the API with calls up and down,
    just implemented a special-case CMD_BLOCK_TXQS flag for
    this, it's only needed in the old gen1 transport.
    
    While at it, fix a complain that lockdep would have, as
    we lock the cmd queue and then the TXQs in the reclaim
    by using spin_lock_nested(). We no longer need to disable
    BHs in iwl_trans_pcie_block_txq_ptrs() since it's called
    with them disabled already.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20231207044813.2bd95e0570fc.I16486dbc82570d2f73a585872f5394698627310d@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-03-18 17:57:57 +01:00
Íñigo Huguet 6f14a20cad iwlwifi: prepare for synchronous error dumps
Bugzilla: http://bugzilla.redhat.com/2033354

commit b8221b0f750a05a7ae9cbca84932e2a36a3ee658
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Mon Aug 2 17:09:39 2021 +0300

    iwlwifi: prepare for synchronous error dumps
    
    In some cases it may be necessary to synchronously create
    a firmware error report, add the necessary infrastructure
    for this.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
    Link: https://lore.kernel.org/r/iwlwifi.20210802170640.481b6642f0fc.I7c9c958408a285e3d19aceed2a5a3341cfc08382@changeid
    Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2021-12-22 13:45:57 +01:00
Johannes Berg 70c9101d0a iwlwifi: warn on SKB free w/o op-mode
If this ever happens, and it looks like some code in PCIe is
a bit broken and might lead to this, we want to know without
crashing, so add a WARN_ON_ONCE().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124418.a18b7443dc55.Ia29836738acf14a55af5504aba90c6fea9fff785@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-04-14 12:07:20 +03:00
Johannes Berg 4538c5ed0f iwlwifi: avoid crash on unsupported debug collection
If the opmode doesn't support debug collection (DVM) then don't
crash, but just skip the callback.

Fixes: d01293154c ("iwlwifi: dbg: add op_mode callback for collecting debug data.")
Reported-by: Andy Lavr <andy.lavr@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210219133506.ecabe285bc7d.I73d230d555c595fa2d9bf284f80078729fe18aa4@changeid
2021-02-22 09:22:16 +02:00
Mordechay Goodstein d01293154c iwlwifi: dbg: add op_mode callback for collecting debug data.
The first use is collecting debug data when transport stops the device.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210142629.d282d0a9ee7b.I9a0ad29f80daba8956a6aa077ba865e19b2150be@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-02-10 14:39:39 +02:00
Johannes Berg 8e99ea8d09 iwlwifi: use SPDX tags
Use SPDX tags instead of the long copyright notices.  Also cleanup
some duplicate copyright notices and combine the years where possible.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20201210000603.481bcb512a6f.I8146abe5a637079e7336209f23cb26af98b12b31@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-12-10 00:15:31 +02:00
Gustavo A. R. Silva 45c21a0e5b iwlwifi: Replace zero-length array with flexible-array
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

sizeof(flexible-array-member) triggers a warning because flexible array
members have incomplete type[1]. There are some instances of code in
which the sizeof operator is being incorrectly/erroneously applied to
zero-length arrays and the result is zero. Such instances may be hiding
some bugs. So, this work (flexible-array member conversions) will also
help to get completely rid of those sorts of issues.

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 7649773293 ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200507185538.GA14674@embeddedor
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-06-10 15:22:16 +03:00
Emmanuel Grumbach ea74343aeb iwlwifi: remove the opmode's d0i3 handlers
Remove the now unneeded functions that called those from the
transport layer.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:16 +03:00
Emmanuel Grumbach 58d3bef416 iwlwifi: remove all the d0i3 references
As part of the d0i3 removal.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:13 +03:00
Luca Coelho 754f890a3a iwlwifi: remove all occurrences of the FSF address paragraph
The Free Software Foundation address is superfluous and causes
checkpatch to issue a warning when present.  Remove all paragraphs
with FSF's address to prevent that.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-08-31 11:38:33 +03:00
Golan Ben Ami 33bdccb71a iwlwifi: remove FSF's address from the license notice
The Free Software Foundation's address shouldn't be in the license
notice anymore, and some of our check scripts complain about it
(via checkpatch.pl).  Remove the address to silence it.

Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-08-31 11:38:26 +03:00
Emmanuel Grumbach cb2f827795 iwlwifi: change the Intel Wireless email address
ilw@linux.intel.com is not available anymore.
linuxwifi@intel.com should be used instead.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-12-20 14:48:22 +02:00
Emmanuel Grumbach dcbb474628 iwlwifi: trans: support a callback for ASYNC commands
This allows the op_mode to request from the transport to
call a callback when an ASYNC commands is completed by
the firmware. The same callback will be called for all the
commands. Pass the command whose response triggers the
callback as a parameter to the callback itself.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-12-13 08:52:52 +02:00
Kalle Valo e705c12146 iwlwifi: move under intel vendor directory
Part of reorganising wireless drivers directory and Kconfig.

Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-11-18 14:28:30 +02:00