r8169: correct settings of rtl8102e for 2.6.32.y and 2.6.34.y

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi @all,

after a bug report of a user of 2.6.32.60 I searched the changes for r8169 in newer kernel trees. The user had a RTL8102E, which is not correctly working with the vanilla r8169.c.

There is a change for correctly driving rtl8102:

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commitdiff;h=d24e9aafe5d5dfdf6d114b29e67f8afd5fae5ef0


This change was not backported to 2.6.3x.y. Can you tell me the reason why?


This is the backported version for 2.6.32.y:

kernel26test 2.0.3 # diff -Nurp r8169.c.orig r8169.c
--- r8169.c.orig        2012-10-07 23:41:24.000000000 +0200
+++ r8169.c     2013-02-28 01:41:46.000000000 +0100
@@ -3076,7 +3076,7 @@ rtl8169_init_one(struct pci_dev *pdev, c
                goto err_out_mwi_3;
        }

-       tp->cp_cmd = PCIMulRW | RxChkSum;
+       tp->cp_cmd = RxChkSum;

        if ((sizeof(dma_addr_t) > 4) &&
            !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) {
@@ -3824,8 +3824,7 @@ static void rtl_hw_start_8168(struct net
        Cxpl_dbg_sel | \
        ASF | \
        PktCntrDisable | \
-       PCIDAC | \
-       PCIMulRW)
+       Mac_dbgo_sel)

static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
 {
@@ -3855,8 +3854,6 @@ static void rtl_hw_start_8102e_1(void __
        if ((cfg1 & LEDS0) && (cfg1 & LEDS1))
                RTL_W8(Config1, cfg1 & ~LEDS0);

-       RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK);
-
        rtl_ephy_init(ioaddr, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1));
 }

@@ -3868,8 +3865,6 @@ static void rtl_hw_start_8102e_2(void __

        RTL_W8(Config1, MEMMAP | IOMAP | VPD | PMEnable);
        RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
-
-       RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK);
 }

static void rtl_hw_start_8102e_3(void __iomem *ioaddr, struct pci_dev *pdev)
@@ -3895,6 +3890,8 @@ static void rtl_hw_start_8101(struct net
                }
        }

+       RTL_W8(Cfg9346, Cfg9346_Unlock);
+
        switch (tp->mac_version) {
        case RTL_GIGA_MAC_VER_07:
                rtl_hw_start_8102e_1(ioaddr, pdev);
@@ -3909,14 +3906,13 @@ static void rtl_hw_start_8101(struct net
                break;
        }

-       RTL_W8(Cfg9346, Cfg9346_Unlock);
+       RTL_W8(Cfg9346, Cfg9346_Lock);

        RTL_W8(EarlyTxThres, EarlyTxThld);

        rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);

-       tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW;
-
+       tp->cp_cmd &= ~R810X_CPCMD_QUIRK_MASK;
        RTL_W16(CPlusCmd, tp->cp_cmd);

        RTL_W16(IntrMitigate, 0x0000);
@@ -3926,14 +3922,10 @@ static void rtl_hw_start_8101(struct net
        RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
        rtl_set_rx_tx_config_registers(tp);

-       RTL_W8(Cfg9346, Cfg9346_Lock);
-
        RTL_R8(IntrMask);

        rtl_set_rx_mode(dev);

-       RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
-
        RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000);

        RTL_W16(IntrMask, tp->intr_event);




While at it, I backported

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commitdiff;h=3a42cce923b0242d0293cae0a162601afa89d552
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commitdiff;h=7106159f8bd33bd5e5b0ea2c87e499117fc22c69

also.


kernel26test 2.0.3 # diff -Nurp r8169.c.orig r8169.c
--- r8169.c.orig        2013-02-28 01:41:46.000000000 +0100
+++ r8169.c     2013-02-28 01:57:26.000000000 +0100
@@ -4571,13 +4571,6 @@ static int rtl8169_rx_interrupt(struct n
                        dev->stats.rx_bytes += pkt_size;
                        dev->stats.rx_packets++;
                }
-
-               /* Work around for AMD plateform. */
-               if ((desc->opts2 & cpu_to_le32(0xfffe000)) &&
-                   (tp->mac_version == RTL_GIGA_MAC_VER_05)) {
-                       desc->opts2 = 0;
-                       cur_rx++;
-               }
        }

        count = cur_rx - tp->cur_rx;



kernel26test 2.0.3 # diff -Nurp r8169.c.orig r8169.c
--- r8169.c.orig        2013-02-28 01:57:26.000000000 +0100
+++ r8169.c     2013-02-28 01:58:58.000000000 +0100
@@ -176,6 +176,7 @@ static struct pci_device_id rtl8169_pci_
        { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8168), 0, 0, RTL_CFG_1 },
        { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8169), 0, 0, RTL_CFG_0 },
        { PCI_DEVICE(PCI_VENDOR_ID_DLINK,       0x4300), 0, 0, RTL_CFG_0 },
+       { PCI_DEVICE(PCI_VENDOR_ID_DLINK,       0x4302), 0, 0, RTL_CFG_0 },
        { PCI_DEVICE(PCI_VENDOR_ID_AT,          0xc107), 0, 0, RTL_CFG_0 },
        { PCI_DEVICE(0x16ec,                    0x0116), 0, 0, RTL_CFG_0 },
        { PCI_VENDOR_ID_LINKSYS,                0x1032,



--
der tom
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]