summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Ulmer <tobiasu@cvs.openbsd.org>2015-03-08 01:54:05 +0000
committerTobias Ulmer <tobiasu@cvs.openbsd.org>2015-03-08 01:54:05 +0000
commitad688a866ff42d6b5f36dd75f86fc11b80e333e8 (patch)
treedc603de6865de1440615cf9f3b454b8322036ea6
parent7dc1b8a5ec66388433d5a494da6ecd82d49e4bb0 (diff)
Revert patch responsible for locking up machines with
"Realtek 8168" rev 0x01: RTL8168 2 (0x3800). You will never guess who commited it without OK ;) ok deraadt revision 1.45 date: 2015/01/26 09:58:47; author: brad; state: Exp; lines: +22 -2; commitid: AppNYocFYbD7Hqgj; Set PCIe max read request size to 2K to help with TX performance. From FreeBSD Tested with 8168C, 8168D and 8168G. revision 1.46 date: 2015/02/19 04:58:34; author: dlg; state: Exp; lines: +2 -2; commitid: GSWXECXQW0LeGFmq; when reading the max packet size in the pcie device config and status register, correctly mask things so we're left with the mps field instead of everything but the mps field. tested by bcallah@ and jim smith
-rw-r--r--sys/dev/ic/rtl81x9reg.h3
-rw-r--r--sys/dev/pci/if_re_pci.c24
2 files changed, 3 insertions, 24 deletions
diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h
index c5244baa07a..dbd71d4d32e 100644
--- a/sys/dev/ic/rtl81x9reg.h
+++ b/sys/dev/ic/rtl81x9reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9reg.h,v 1.91 2015/01/26 09:58:47 brad Exp $ */
+/* $OpenBSD: rtl81x9reg.h,v 1.92 2015/03/08 01:54:04 tobiasu Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -833,7 +833,6 @@ struct rl_softc {
bus_space_handle_t rl_bhandle; /* bus space handle */
bus_space_tag_t rl_btag; /* bus space tag */
bus_dma_tag_t sc_dmat;
- u_int32_t rl_expcap;
bus_dma_segment_t sc_rx_seg;
bus_dmamap_t sc_rx_dmamap;
struct arpcom sc_arpcom; /* interface info */
diff --git a/sys/dev/pci/if_re_pci.c b/sys/dev/pci/if_re_pci.c
index 00700de277b..a5efdf2ba61 100644
--- a/sys/dev/pci/if_re_pci.c
+++ b/sys/dev/pci/if_re_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_re_pci.c,v 1.46 2015/02/19 04:58:34 dlg Exp $ */
+/* $OpenBSD: if_re_pci.c,v 1.47 2015/03/08 01:54:04 tobiasu Exp $ */
/*
* Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org>
@@ -130,8 +130,6 @@ re_pci_attach(struct device *parent, struct device *self, void *aux)
pci_chipset_tag_t pc = pa->pa_pc;
pci_intr_handle_t ih;
const char *intrstr = NULL;
- pcireg_t reg;
- int rrs;
pci_set_powerstate(pa->pa_pc, pa->pa_tag, PCI_PMCSR_STATE_D0);
@@ -176,26 +174,8 @@ re_pci_attach(struct device *parent, struct device *self, void *aux)
* PCI Express check.
*/
if (pci_get_capability(pc, pa->pa_tag, PCI_CAP_PCIEXPRESS,
- &sc->rl_expcap, NULL)) {
- if (!(PCI_VENDOR(pa->pa_id) == PCI_VENDOR_REALTEK &&
- PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RT8101E)) {
- /* Set PCIe maximum read request size to 2048. */
- reg = pci_conf_read(pa->pa_pc, pa->pa_tag,
- sc->rl_expcap + PCI_PCIE_DCSR);
- reg &= PCI_PCIE_DCSR_MPS;
- reg >>= 12;
- rrs = (1 << (reg + 7));
- if (rrs < 2048) {
- reg = pci_conf_read(pa->pa_pc, pa->pa_tag,
- sc->rl_expcap + PCI_PCIE_DCSR);
- reg = (reg & ~PCI_PCIE_DCSR_MPS) |
- (fls(2048) - 8) << 12;
- pci_conf_write(pa->pa_pc, pa->pa_tag,
- sc->rl_expcap + PCI_PCIE_DCSR, reg);
- }
- }
+ NULL, NULL))
sc->rl_flags |= RL_FLAG_PCIE;
- }
if (!(PCI_VENDOR(pa->pa_id) == PCI_VENDOR_REALTEK &&
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RT8139)) {