Commit e081685c authored by Larry Finger's avatar Larry Finger Committed by John W. Linville

ssb: Clear RETRY_TIMEOUT in PCI Configuration for normal devices

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: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 14fb7c17
...@@ -59,6 +59,7 @@ static int ssb_pcihost_probe(struct pci_dev *dev, ...@@ -59,6 +59,7 @@ static int ssb_pcihost_probe(struct pci_dev *dev,
struct ssb_bus *ssb; struct ssb_bus *ssb;
int err = -ENOMEM; int err = -ENOMEM;
const char *name; const char *name;
u32 val;
ssb = kzalloc(sizeof(*ssb), GFP_KERNEL); ssb = kzalloc(sizeof(*ssb), GFP_KERNEL);
if (!ssb) if (!ssb)
...@@ -74,6 +75,12 @@ static int ssb_pcihost_probe(struct pci_dev *dev, ...@@ -74,6 +75,12 @@ static int ssb_pcihost_probe(struct pci_dev *dev,
goto err_pci_disable; goto err_pci_disable;
pci_set_master(dev); 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); err = ssb_bus_pcibus_register(ssb, dev);
if (err) if (err)
goto err_pci_release_regions; goto err_pci_release_regions;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment