Thread (60 messages) 60 messages, 14 authors, 2012-08-24

Re: [PATCH v3 00/32] provide interfaces to access PCIe capabilities registers

From: Bjorn Helgaas <bhelgaas@google.com>
Date: 2012-08-22 17:09:21
Also in: lkml

On Tue, Aug 21, 2012 at 8:59 AM, Jiang Liu [off-list ref] wrote:
Hi Bjorn,
        Thanks for your help to finalize the patchset.
        There's another suspicious issue in r8169.c, which directly writes PCI_EXP_DEVCTL_NOSNOOP_EN
to PCI_EXP_DEVCTL. I feel it should preserve other bits when setting the NOSNOOP flag.
I think you're right.  I propose the following patch on top of your
original one:

commit 300ef7967e87467656b0fe24270edba66bce45e4
Author: Bjorn Helgaas [off-list ref]
Date:   Wed Aug 22 10:29:42 2012 -0600

    r8169: Preserve other Device Control bits when setting NOSNOOP_EN

    Previously, when we turned on the "Enable No Snoop Bit," we cleared all
    the other Device Control bits, including error reporting enables,
    Max_Payload_Size, Max_Read_Request_Size, etc.  This patch preserves
    all the other bits.

    Signed-off-by: Bjorn Helgaas [off-list ref]
diff --git a/drivers/net/ethernet/realtek/r8169.c
b/drivers/net/ethernet/realtek/r8169.c
index 4104968..a7cc560 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -5385,8 +5385,8 @@ static void rtl_hw_start_8101(struct net_device *dev)

        if (tp->mac_version == RTL_GIGA_MAC_VER_13 ||
            tp->mac_version == RTL_GIGA_MAC_VER_16)
-               pcie_capability_write_word(pdev, PCI_EXP_DEVCTL,
-                                          PCI_EXP_DEVCTL_NOSNOOP_EN);
+               pcie_capability_set_word(pdev, PCI_EXP_DEVCTL,
+                                        PCI_EXP_DEVCTL_NOSNOOP_EN);

        RTL_W8(Cfg9346, Cfg9346_Unlock);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help