From: Hauke Mehrtens <hauke@hauke-m.de>
To: Seth Forshee <seth.forshee@canonical.com>
Cc: "Arend van Spriel" <arend@broadcom.com>,
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: Wed, 23 May 2012 11:15:08 +0200 [thread overview]
Message-ID: <4FBCAA9C.10209@hauke-m.de> (raw)
In-Reply-To: <20120522165251.GA31347@thinkpad-t410>
[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]
On 05/22/2012 06:52 PM, Seth Forshee wrote:
> Hi Arend,
>
> I've inquired about this issue on the list once before, but I thought
> I'd try once again to see if Broadcom can offer any suggestions.
>
> Recent MacBook Pros with BCM4331 wireless have a strange problem. Tx
> doesn't work after S3, but only if no external power is applied during
> the resume. mac80211 reports mostly timeouts for responses to probe
> requests, but analysis with wireshark shows no frames from the BCM4331
> on the air. The only way I've found to recover is to reload both b43 and
> bcma; reloading b43 alone is not enough.
>
> I've checked the values of MACCTL and the DMA TXCTL registers, since
> these are the ones used by brcmsmac to mute tx, but those look okay. Any
> suggestions of other things to check? My next step would be to start
> looking at the state of the phy and radio, but since we don't have much
> information about what the registers there actually do some suggestions
> would be helpful.
>
> Thanks,
> Seth
Hi Seth,
as reloading bcma helps could you try the attached patch which runs the
code for pci core initialisation on resume again. I saw some comments
about some functions which should be called on resume for pci core
initialisation in brcmsmac.
The other patch adds some pci workarounds for recent apple devices like
yours.
Both patches are not even compile tested.
Hauke
[-- Attachment #2: 0001-bcma-run-pci-init-on-resume.patch --]
[-- Type: text/x-patch, Size: 813 bytes --]
>From aaa99211d85738de8baf413ac7284133139187eb Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 23 May 2012 11:12:21 +0200
Subject: [PATCH 1/2] bcma: run pci init on resume
---
drivers/bcma/main.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 7e138ec..cfa9624 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -276,6 +276,13 @@ int bcma_bus_resume(struct bcma_bus *bus)
bcma_core_chipcommon_init(&bus->drv_cc);
}
+ /* Init PCIE core */
+ core = bcma_find_core(bus, BCMA_CORE_PCIE);
+ if (core) {
+ bus->drv_pci.setup_done = false;
+ bcma_core_pci_init(&bus->drv_pci);
+ }
+
list_for_each_entry(core, &bus->cores, list) {
struct device_driver *drv = core->dev.driver;
if (drv) {
--
1.7.9.5
[-- Attachment #3: 0002-bcma-add-some-workarround-for-apple.patch --]
[-- Type: text/x-patch, Size: 2158 bytes --]
>From a9870cd156dbe7564960ad5db411143bbb0f63f2 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 23 May 2012 11:12:40 +0200
Subject: [PATCH 2/2] bcma: add some workarround for apple
---
drivers/bcma/driver_pci.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index 9a96f14..fd1fc9a 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -55,7 +55,7 @@ static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u8 phy)
}
}
-static u16 bcma_pcie_mdio_read(struct bcma_drv_pci *pc, u8 device, u8 address)
+static u16 bcma_pcie_mdio_read(struct bcma_drv_pci *pc, u16 device, u8 address)
{
int max_retries = 10;
u16 ret = 0;
@@ -98,7 +98,7 @@ static u16 bcma_pcie_mdio_read(struct bcma_drv_pci *pc, u8 device, u8 address)
return ret;
}
-static void bcma_pcie_mdio_write(struct bcma_drv_pci *pc, u8 device,
+static void bcma_pcie_mdio_write(struct bcma_drv_pci *pc, u16 device,
u8 address, u16 data)
{
int max_retries = 10;
@@ -203,6 +203,23 @@ static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc)
}
}
+static void bcma_core_pci_apple_fixup(struct bcma_drv_pci *pc)
+{
+ struct bcma_bus *bus = pc->core->bus;
+
+ if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE) {
+ if (bus->boardinfo.type == 0x8d) {
+ /* change the TX drive strength to max */
+ bcma_pcie_mdio_write(pc, 0x820, 0x18, 0x7f);
+ bcma_pcie_mdio_read(pc, 0x820, 0x18);
+ } else if (bus->chipinfo.id == 0x4331) {
+ /* change the drive strength for X19b & X28 to 700mv */
+ bcma_pcie_mdio_write(pc, 0x820, 0x18, 0x70);
+ bcma_pcie_mdio_read(pc, 0x820, 0x18);
+ }
+ }
+}
+
/**************************************************
* Init.
**************************************************/
@@ -212,6 +229,7 @@ static void __devinit bcma_core_pci_clientmode_init(struct bcma_drv_pci *pc)
bcma_core_pci_fixcfg(pc);
bcma_pcicore_serdes_workaround(pc);
bcma_core_pci_config_fixup(pc);
+ bcma_core_pci_apple_fixup(pc);
}
void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc)
--
1.7.9.5
next prev parent reply other threads:[~2012-05-23 9:15 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 [this message]
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
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=4FBCAA9C.10209@hauke-m.de \
--to=hauke@hauke-m.de \
--cc=arend@broadcom.com \
--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).