r8169: fix RTL8168DP power off issue.
- fix the RTL8111DP turn off the power when DASH is enabled. - RTL_GIGA_MAC_VER_27 must wait for tx finish before reset. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
This commit is contained in:
Родитель
d24e9aafe5
Коммит
5d2e19572a
|
@ -2869,8 +2869,11 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
|
||||||
{
|
{
|
||||||
void __iomem *ioaddr = tp->mmio_addr;
|
void __iomem *ioaddr = tp->mmio_addr;
|
||||||
|
|
||||||
if (tp->mac_version == RTL_GIGA_MAC_VER_27)
|
if (((tp->mac_version == RTL_GIGA_MAC_VER_27) ||
|
||||||
|
(tp->mac_version == RTL_GIGA_MAC_VER_28)) &&
|
||||||
|
(ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (((tp->mac_version == RTL_GIGA_MAC_VER_23) ||
|
if (((tp->mac_version == RTL_GIGA_MAC_VER_23) ||
|
||||||
(tp->mac_version == RTL_GIGA_MAC_VER_24)) &&
|
(tp->mac_version == RTL_GIGA_MAC_VER_24)) &&
|
||||||
|
@ -2892,6 +2895,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
|
||||||
switch (tp->mac_version) {
|
switch (tp->mac_version) {
|
||||||
case RTL_GIGA_MAC_VER_25:
|
case RTL_GIGA_MAC_VER_25:
|
||||||
case RTL_GIGA_MAC_VER_26:
|
case RTL_GIGA_MAC_VER_26:
|
||||||
|
case RTL_GIGA_MAC_VER_27:
|
||||||
|
case RTL_GIGA_MAC_VER_28:
|
||||||
RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80);
|
RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2901,12 +2906,17 @@ static void r8168_pll_power_up(struct rtl8169_private *tp)
|
||||||
{
|
{
|
||||||
void __iomem *ioaddr = tp->mmio_addr;
|
void __iomem *ioaddr = tp->mmio_addr;
|
||||||
|
|
||||||
if (tp->mac_version == RTL_GIGA_MAC_VER_27)
|
if (((tp->mac_version == RTL_GIGA_MAC_VER_27) ||
|
||||||
|
(tp->mac_version == RTL_GIGA_MAC_VER_28)) &&
|
||||||
|
(ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (tp->mac_version) {
|
switch (tp->mac_version) {
|
||||||
case RTL_GIGA_MAC_VER_25:
|
case RTL_GIGA_MAC_VER_25:
|
||||||
case RTL_GIGA_MAC_VER_26:
|
case RTL_GIGA_MAC_VER_26:
|
||||||
|
case RTL_GIGA_MAC_VER_27:
|
||||||
|
case RTL_GIGA_MAC_VER_28:
|
||||||
RTL_W8(PMCH, RTL_R8(PMCH) | 0x80);
|
RTL_W8(PMCH, RTL_R8(PMCH) | 0x80);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3319,7 +3329,8 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
|
||||||
/* Disable interrupts */
|
/* Disable interrupts */
|
||||||
rtl8169_irq_mask_and_ack(ioaddr);
|
rtl8169_irq_mask_and_ack(ioaddr);
|
||||||
|
|
||||||
if (tp->mac_version == RTL_GIGA_MAC_VER_28) {
|
if (tp->mac_version == RTL_GIGA_MAC_VER_27 ||
|
||||||
|
tp->mac_version == RTL_GIGA_MAC_VER_28) {
|
||||||
while (RTL_R8(TxPoll) & NPQ)
|
while (RTL_R8(TxPoll) & NPQ)
|
||||||
udelay(20);
|
udelay(20);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче