From: "Arend van Spriel" <arend@broadcom.com>
To: "Seth Forshee" <seth.forshee@canonical.com>
Cc: "Hauke Mehrtens" <hauke@hauke-m.de>,
linux-wireless@vger.kernel.org,
"Stefano Brivio" <stefano.brivio@polimi.it>,
"Rafał Miłecki" <zajec5@gmail.com>
Subject: Re: BCM4331 tx failures after S3
Date: Fri, 25 May 2012 18:47:27 +0200 [thread overview]
Message-ID: <4FBFB79F.4060609@broadcom.com> (raw)
In-Reply-To: <20120525141339.GB2895@thinkpad-t410>
On 05/25/2012 04:13 PM, Seth Forshee wrote:
> On Thu, May 24, 2012 at 11:34:37PM +0200, Hauke Mehrtens wrote:
>> Hi Seth,
>>
>> rmmod and insmod of b43 does not help but doing this with b43 and bcma
>> works is that correct?
>> Have you tried to add this code from bcma_host_pci_probe() to resume:
>>
>> /* Disable the RETRY_TIMEOUT register (0x41) to keep
>> * PCI Tx retries from interfering with C3 CPU state */
>> pci_read_config_dword(dev, 0x40, &val);
>> if ((val & 0x0000ff00) != 0)
>> pci_write_config_dword(dev, 0x40, val & 0xffff00ff);
>>
>> Could you also try to run bcma_sprom_get() after resume.
>
> Okay, this one fixes it. The part that's needed seems to be:
>
> if (bus->chipinfo.id == 0x4331)
> bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true);
>
> I could have sworn I tried adding this to resume before, but apparently
> I didn't.
>
> Hmm. It turns out that BCMA_CC_CHIPCTL is completely reset to 0 when on
> S3 without AC power, meaning all other fields in the register get
> cleared as well. On this MBP that's affecting
> BCMA_CHIPCTL_4331_BT_COEXIST. So we could save the value at suspend and
> restore it during resume, but maybe the initialization of this register
> also needs to be improved. Thoughts?
>
> Thanks,
> Seth
>
>
Well let me explain some behaviour. Upon suspend mac80211 takes down the
driver with the last callback being .stop(). Upon resume mac80211 calls
the driver with .start() callback.
The brcmsmac driver has two bool states that are in play here: driver_up
and hw_up. Upon .stop() callback the driver_up is set to false, but
hw_up remains true. A subsequent .start() will perform some
reconfiguration and driver_up will be made true.
The suspend/resume scenario is different for brcmsmac. bcma will call
brcmsmac .suspend() callback in which we set hw_up to false. This
changes the behaviour of the .start() callback after resume. Basically,
it reinitializes the hardware.
Not sure why having AC connected would make a difference. Maybe the
device is not completely turned off (for WoWL maybe?).
Gr. AvS
next prev parent reply other threads:[~2012-05-25 16:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-22 16:52 BCM4331 tx failures after S3 Seth Forshee
2012-05-23 9:15 ` Hauke Mehrtens
2012-05-23 13:51 ` Seth Forshee
2012-05-23 9:30 ` Arend van Spriel
2012-05-23 13:55 ` Seth Forshee
2012-05-24 9:36 ` Arend van Spriel
2012-05-24 21:21 ` Seth Forshee
2012-05-24 21:34 ` Hauke Mehrtens
2012-05-25 10:16 ` Arend van Spriel
2012-05-25 14:13 ` Seth Forshee
2012-05-25 16:47 ` Arend van Spriel [this message]
2012-05-25 18:34 ` Seth Forshee
2012-05-25 20:19 ` Arend van Spriel
2012-05-25 20:44 ` Seth Forshee
2012-05-25 20:59 ` Arend van Spriel
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=4FBFB79F.4060609@broadcom.com \
--to=arend@broadcom.com \
--cc=hauke@hauke-m.de \
--cc=linux-wireless@vger.kernel.org \
--cc=seth.forshee@canonical.com \
--cc=stefano.brivio@polimi.it \
--cc=zajec5@gmail.com \
/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).