mwifiex: Make resume actually do something useful again on SDIO cards [Linux 5.1]

mwifiex: Make resume actually do something useful again on SDIO cards [Linux 5.1]

This Linux kernel change "mwifiex: Make resume actually do something useful again on SDIO cards" is included in the Linux 5.1 release. This change is authored by Douglas Anderson <dianders [at] chromium.org> on Wed Apr 3 21:01:06 2019 -0700. The commit for this change in Linux stable tree is b82d6c1 (patch).

mwifiex: Make resume actually do something useful again on SDIO cards

The commit fc3a2fcaa1ba ("mwifiex: use atomic bitops to represent
adapter status variables") had a fairly straightforward bug in it.  It
contained this bit of diff:

 - if (!adapter->is_suspended) {
 + if (test_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags)) {

As you can see the patch missed the "!" when converting to the atomic
bitops.  This meant that the resume hasn't done anything at all since
that commit landed and suspend/resume for mwifiex SDIO cards has been
totally broken.

After fixing this mwifiex suspend/resume appears to work again, at
least with the simple testing I've done.

Fixes: fc3a2fcaa1ba ("mwifiex: use atomic bitops to represent adapter status variables")
Cc: <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Reviewed-by: Brian Norris <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index a856483..d5a7034 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -181,7 +181,7 @@ static int mwifiex_sdio_resume(struct device *dev)

    adapter = card->adapter;

-   if (test_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags)) {
+   if (!test_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags)) {
        mwifiex_dbg(adapter, WARN,
                "device already resumed\n");
        return 0;

Leave a Reply

Your email address will not be published. Required fields are marked *