* [PATCH] ssb: Clear RETRY_TIMEOUT in PCI Configuration for normal devices
@ 2010-10-20 14:59 Larry Finger
2010-10-20 20:52 ` Michael Büsch
0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2010-10-20 14:59 UTC (permalink / raw)
To: John W Linville, Michael Buesch; +Cc: b43-dev, linux-wireless
The previous patch of this type fixed the case where a PCI device is behind
an SSB->PCI bridge as found on an embedded device. This one treats the normal
case of a "normal" Broadcom wireless PCI core on an SSB interconnect.
MMIO log traces obtained using the Broadcom wl hybrid driver show that
the RETRY_TIMEOUT register (0x41) in PCI configuration space is cleared
if non-zero. Similar code found in other drivers such as ipw2100 show
this operation is needed to keep PCI Tx retries from interfering with
C3 CPU state. There are no known cases where omission of this code has
caused a problem, but this patch is offered just in case such a situation
occurs.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
John,
No particular urgency for this patch.
Larry
---
Index: wireless-testing/drivers/ssb/pcihost_wrapper.c
===================================================================
--- wireless-testing.orig/drivers/ssb/pcihost_wrapper.c
+++ wireless-testing/drivers/ssb/pcihost_wrapper.c
@@ -59,6 +59,7 @@ static int ssb_pcihost_probe(struct pci_
struct ssb_bus *ssb;
int err = -ENOMEM;
const char *name;
+ u32 val;
ssb = kzalloc(sizeof(*ssb), GFP_KERNEL);
if (!ssb)
@@ -74,6 +75,12 @@ static int ssb_pcihost_probe(struct pci_
goto err_pci_disable;
pci_set_master(dev);
+ /* 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);
+
err = ssb_bus_pcibus_register(ssb, dev);
if (err)
goto err_pci_release_regions;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ssb: Clear RETRY_TIMEOUT in PCI Configuration for normal devices
2010-10-20 14:59 [PATCH] ssb: Clear RETRY_TIMEOUT in PCI Configuration for normal devices Larry Finger
@ 2010-10-20 20:52 ` Michael Büsch
0 siblings, 0 replies; 2+ messages in thread
From: Michael Büsch @ 2010-10-20 20:52 UTC (permalink / raw)
To: Larry Finger; +Cc: John W Linville, b43-dev, linux-wireless
On Wed, 2010-10-20 at 09:59 -0500, Larry Finger wrote:
> The previous patch of this type fixed the case where a PCI device is behind
> an SSB->PCI bridge as found on an embedded device. This one treats the normal
> case of a "normal" Broadcom wireless PCI core on an SSB interconnect.
Note that the other patch is not needed anymore, if this is applied.
Also note that this patch will also have an effect on b44 hardware.
Do we want that?
> MMIO log traces obtained using the Broadcom wl hybrid driver show that
> the RETRY_TIMEOUT register (0x41) in PCI configuration space is cleared
> if non-zero. Similar code found in other drivers such as ipw2100 show
> this operation is needed to keep PCI Tx retries from interfering with
> C3 CPU state. There are no known cases where omission of this code has
> caused a problem, but this patch is offered just in case such a situation
> occurs.
--
Greetings Michael.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-20 20:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-20 14:59 [PATCH] ssb: Clear RETRY_TIMEOUT in PCI Configuration for normal devices Larry Finger
2010-10-20 20:52 ` Michael Büsch
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).