lkml.org 
[lkml]   [2019]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 004/211] net/phy: fix DP83865 10 Mbps HDX loopback disable function
    Date
    From: Peter Mamonov <pmamonov@gmail.com>

    [ Upstream commit e47488b2df7f9cb405789c7f5d4c27909fc597ae ]

    According to the DP83865 datasheet "the 10 Mbps HDX loopback can be
    disabled in the expanded memory register 0x1C0.1". The driver erroneously
    used bit 0 instead of bit 1.

    Fixes: 4621bf129856 ("phy: Add file missed in previous commit.")
    Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/phy/national.c | 9 ++++++---
    1 file changed, 6 insertions(+), 3 deletions(-)

    --- a/drivers/net/phy/national.c
    +++ b/drivers/net/phy/national.c
    @@ -110,14 +110,17 @@ static void ns_giga_speed_fallback(struc

    static void ns_10_base_t_hdx_loopack(struct phy_device *phydev, int disable)
    {
    + u16 lb_dis = BIT(1);
    +
    if (disable)
    - ns_exp_write(phydev, 0x1c0, ns_exp_read(phydev, 0x1c0) | 1);
    + ns_exp_write(phydev, 0x1c0,
    + ns_exp_read(phydev, 0x1c0) | lb_dis);
    else
    ns_exp_write(phydev, 0x1c0,
    - ns_exp_read(phydev, 0x1c0) & 0xfffe);
    + ns_exp_read(phydev, 0x1c0) & ~lb_dis);

    pr_debug("10BASE-T HDX loopback %s\n",
    - (ns_exp_read(phydev, 0x1c0) & 0x0001) ? "off" : "on");
    + (ns_exp_read(phydev, 0x1c0) & lb_dis) ? "off" : "on");
    }

    static int ns_config_init(struct phy_device *phydev)

    \
     
     \ /
      Last update: 2019-10-03 19:27    [W:4.452 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site