linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bing Zhao <bzhao@marvell.com>
To: "quozl@laptop.org" <quozl@laptop.org>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [RFC] mwifiex: block work queue while suspended
Date: Thu, 22 May 2014 21:12:30 -0700	[thread overview]
Message-ID: <477F20668A386D41ADCC57781B1F70430F70F5DCA2@SC-VEXCH1.marvell.com> (raw)
In-Reply-To: <20140522054618.GL6184@us.netrek.org>

Hi James,

> > > [ 1302.923009] mmc0: Timeout waiting for hardware interrupt.
> > > [ 1302.923050] ------------[ cut here ]------------
> > > [ 1302.923075] WARNING: at drivers/net/wireless/mwifiex/sdio.c:688
> mwifiex_sdio_interrupt+0xcc/0x21c
> > > [mwifiex_sdio]()
> > > [ 1302.923204] [<bf0c089c>] (mwifiex_sdio_interrupt+0xcc/0x21c [mwifiex_sdio])
> > > [ 1302.923218] [<c0302be4>] (sdio_irq_thread+0x178/0x2f0)
> > > [ 1302.923218] [<c00464d0>] (kthread+0x9c/0xac)
> > > [ 1302.923235] ---[ end trace 7e9f40af36cc200c ]---
> > > [ 1302.923240] mwifiex_sdio mmc0:0001:1: read mp_regs failed, will retry ...
> > > [ 1302.923291] mwifiex_sdio mmc0:0001:1: read mp_regs worked on retry
> >
> > I guess the driver and firmware are out of sync here. If firmware is
> > sleeping we will get this failure.
> 
> I'm a little alarmed at this possibility.  What you say implies an
> interrupt from the device arrives after the firmware is in host sleep
> mode, yet the device is not available to take the read mp_regs
> transaction.  Have I understood correctly?

No, that depends on that wakeup (device to host) is through GPIO or SDIO interface.
In case of SDIO wakeup, does the MMC call driver's interrupt routing first or resume handler first?
If MMC calls driver's ISR first, we will see an interrupt arrives after firmware is in host sleep mode.

> 
> We never see this "mmc0: Timeout ..." _except_ when the host has gone
> through suspend and resume, so it seemed more likely to be caused by
> SDHCI.

I overlooked this SDHCI error. So it could be the reason why read mp_regs failed.

> > > @@ -833,6 +833,8 @@ static void mwifiex_main_work_queue(struct work_struct *work)
> > >
> > >  	if (adapter->surprise_removed)
> > >  		return;
> > > +	if (adapter->is_suspended)
> > > +		return;
> >
> > If we can find the root cause and fix it, this change won't be
> > necessary.
> 
> Okay.  How will the work queue not be executed?

Actually I can take this change before we figure out what the real problem is.
For other users without this problem this code shouldn't get executed during suspended.
Please resend it as a [PATCH].

Thanks,
Bing



  reply	other threads:[~2014-05-23  4:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16  1:24 [RFC] mwifiex: block work queue while suspended James Cameron
2014-05-22  3:50 ` Bing Zhao
2014-05-22  5:46   ` James Cameron
2014-05-23  4:12     ` Bing Zhao [this message]
2014-05-26  8:01   ` James Cameron
2014-05-27 23:39     ` Bing Zhao
2014-05-28  2:01       ` James Cameron
2014-05-28  4:35         ` Bing Zhao
2014-05-28  4:49           ` James Cameron
2014-05-28  5:04             ` Bing Zhao
2014-05-29  1:22       ` James Cameron
2014-05-29  2:10         ` Bing Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=477F20668A386D41ADCC57781B1F70430F70F5DCA2@SC-VEXCH1.marvell.com \
    --to=bzhao@marvell.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quozl@laptop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).