* Re: [PATCH net-next 6/6] r8169: support RTL8168G
[not found] <c558386b836ee97762e12495101c6e373f20e69d.1341872752.git.romieu@fr.zoreil.com>
@ 2012-07-10 5:36 ` Hayes Wang
2012-07-10 6:50 ` Francois Romieu
2012-07-10 7:12 ` Hayes Wang
0 siblings, 2 replies; 5+ messages in thread
From: Hayes Wang @ 2012-07-10 5:36 UTC (permalink / raw)
To: romieu; +Cc: netdev, linux-kernel, wfg, Hayes Wang
fix incorrct argument in rtl_hw_init_8168g.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/ethernet/realtek/r8169.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 7ff3423..c29c5fb 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6753,14 +6753,14 @@ static void __devinit rtl_hw_init_8168g(struct rtl8169_private *tp)
msleep(1);
RTL_W8(MCU, RTL_R8(MCU) & ~NOW_IS_OOB);
- data = r8168_mac_ocp_read(ioaddr, 0xe8de);
+ data = r8168_mac_ocp_read(tp, 0xe8de);
data &= ~(1 << 14);
r8168_mac_ocp_write(tp, 0xe8de, data);
if (!rtl_udelay_loop_wait_high(tp, &rtl_link_list_ready_cond, 100, 42))
return;
- data = r8168_mac_ocp_read(ioaddr, 0xe8de);
+ data = r8168_mac_ocp_read(tp, 0xe8de);
data |= (1 << 15);
r8168_mac_ocp_write(tp, 0xe8de, data);
--
1.7.10.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 6/6] r8169: support RTL8168G
2012-07-10 5:36 ` [PATCH net-next 6/6] r8169: support RTL8168G Hayes Wang
@ 2012-07-10 6:50 ` Francois Romieu
2012-07-11 8:29 ` David Miller
2012-07-10 7:12 ` Hayes Wang
1 sibling, 1 reply; 5+ messages in thread
From: Francois Romieu @ 2012-07-10 6:50 UTC (permalink / raw)
To: Hayes Wang; +Cc: David S. Miller, netdev, linux-kernel, wfg
Hayes Wang <hayeswang@realtek.com> :
> fix incorrct argument in rtl_hw_init_8168g.
>
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Thanks Hayes.
It's available with proper attribution and subject at:
git://violet.fr.zoreil.com/romieu/linux davem-next.r8169
--
Ueimor
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 6/6] r8169: support RTL8168G
2012-07-10 5:36 ` [PATCH net-next 6/6] r8169: support RTL8168G Hayes Wang
2012-07-10 6:50 ` Francois Romieu
@ 2012-07-10 7:12 ` Hayes Wang
2012-07-10 9:00 ` Francois Romieu
1 sibling, 1 reply; 5+ messages in thread
From: Hayes Wang @ 2012-07-10 7:12 UTC (permalink / raw)
To: romieu; +Cc: netdev, linux-kernel, Hayes Wang
1. Remove rtl_ocpdr_cond. No waiting is needed for mac_ocp_{write / read}.
2. Set ocp_base to OCP_STD_PHY_BASE after rtl8168g_1_hw_phy_config.
---
drivers/net/ethernet/realtek/r8169.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index c29c5fb..7269175 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -1043,13 +1043,6 @@ static void rtl_w1w0_phy_ocp(struct rtl8169_private *tp, int reg, int p, int m)
r8168_phy_ocp_write(tp, reg, (val | p) & ~m);
}
-DECLARE_RTL_COND(rtl_ocpdr_cond)
-{
- void __iomem *ioaddr = tp->mmio_addr;
-
- return RTL_R32(OCPDR) & OCPAR_FLAG;
-}
-
static void r8168_mac_ocp_write(struct rtl8169_private *tp, u32 reg, u32 data)
{
void __iomem *ioaddr = tp->mmio_addr;
@@ -1058,8 +1051,6 @@ static void r8168_mac_ocp_write(struct rtl8169_private *tp, u32 reg, u32 data)
return;
RTL_W32(OCPDR, OCPAR_FLAG | (reg << 15) | data);
-
- rtl_udelay_loop_wait_low(tp, &rtl_ocpdr_cond, 25, 10);
}
static u16 r8168_mac_ocp_read(struct rtl8169_private *tp, u32 reg)
@@ -1071,8 +1062,7 @@ static u16 r8168_mac_ocp_read(struct rtl8169_private *tp, u32 reg)
RTL_W32(OCPDR, reg << 15);
- return rtl_udelay_loop_wait_high(tp, &rtl_ocpdr_cond, 25, 10) ?
- RTL_R32(OCPDR) : ~0;
+ return RTL_R32(OCPDR);
}
#define OCP_STD_PHY_BASE 0xa400
@@ -3417,6 +3407,8 @@ static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp)
rtl_w1w0_phy_ocp(tp, 0xa438, 0x8000, 0x0000);
rtl_w1w0_phy_ocp(tp, 0xc422, 0x4000, 0x2000);
+
+ rtl_writephy(tp, 0x1f, 0x0000);
}
static void rtl8102e_hw_phy_config(struct rtl8169_private *tp)
--
1.7.10.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 6/6] r8169: support RTL8168G
2012-07-10 7:12 ` Hayes Wang
@ 2012-07-10 9:00 ` Francois Romieu
0 siblings, 0 replies; 5+ messages in thread
From: Francois Romieu @ 2012-07-10 9:00 UTC (permalink / raw)
To: Hayes Wang; +Cc: netdev, linux-kernel
(you should include a Signed-off-by)
Hayes Wang <hayeswang@realtek.com> :
> 1. Remove rtl_ocpdr_cond. No waiting is needed for mac_ocp_{write / read}.
Nit: it would not hurt to do a better job than me and save some commit noise
getting these things right before they pollute the history. :o)
> 2. Set ocp_base to OCP_STD_PHY_BASE after rtl8168g_1_hw_phy_config.
Can't it be stuffed into the firmware ?
The code does not explicitely switch from the PHY access context to
the extra OCP registers one and anything else in rtl8168g_1_hw_phy_config
seems to directly use the addresses it needs. So I'd expect the current
imbalance to come from the firmware, where it would make as much sense to
fix it
-> no imbalance after the firmware is applied
-> no useless instruction if the firmware is not used
--
Ueimor
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 6/6] r8169: support RTL8168G
2012-07-10 6:50 ` Francois Romieu
@ 2012-07-11 8:29 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2012-07-11 8:29 UTC (permalink / raw)
To: romieu; +Cc: hayeswang, netdev, linux-kernel, wfg
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Tue, 10 Jul 2012 08:50:10 +0200
> Hayes Wang <hayeswang@realtek.com> :
>> fix incorrct argument in rtl_hw_init_8168g.
>>
>> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
>
> Thanks Hayes.
>
> It's available with proper attribution and subject at:
>
> git://violet.fr.zoreil.com/romieu/linux davem-next.r8169
Pulled, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-07-11 8:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <c558386b836ee97762e12495101c6e373f20e69d.1341872752.git.romieu@fr.zoreil.com>
2012-07-10 5:36 ` [PATCH net-next 6/6] r8169: support RTL8168G Hayes Wang
2012-07-10 6:50 ` Francois Romieu
2012-07-11 8:29 ` David Miller
2012-07-10 7:12 ` Hayes Wang
2012-07-10 9:00 ` Francois Romieu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®