Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6888903ybe; Wed, 18 Sep 2019 10:40:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzU1mpcf7OUXFqyBAVIU3OZPtN9N5WRj/kpXhlPzz/spXc9ssTTzhzU+Qm9cvkmESiCdAta X-Received: by 2002:a05:6402:1549:: with SMTP id p9mr11753510edx.221.1568828422269; Wed, 18 Sep 2019 10:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568828422; cv=none; d=google.com; s=arc-20160816; b=GtIKJ6UNwXna7kvYzwIpTIMM/1J4eFgU5ECTplKJxo9LgjPzbPLTGPjbePJiFblEKY tiwIHD9YTdvjn3N0Dib63aQWBb3vUZMyBeg/FbKrouJBkdNwY6m3rmjoXsZz3igowrJi wH8+lqBPAuP5bpD/4+MnFlH6TibFHA/oiR/2KZnbBymiN+70MmKw2md577ub9Ru9+LpS 17xOOCxkj3cF1mq5/mi1j1xCM+uL4eYo9tcZzcbQL6E75qxNn6or1Gvmx1N5iRKd4lOT 73wrXovYZ8fIOhmKVknacgI4W554j4ZNk4NFyfdBOThSu+pDBIM3IyivBhXlo/hR2clb WjmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+0ntiwXvSESB7iaOoEKUuKoBv5qu2y9dPZxgAsEks4E=; b=on7jFGw92oI/fEGe13Jvj8J0A1Gxdvsf59U1rtgEPitOzV1c5jqlSU2NFiJ8ydLb1I kP9h5JJoUwEV4JaSWnA5yZ+hO3g5RoSwIObl6gUyx4lXMMZSiKUc8CsXWzdioC/3c7lM jb/ASe5yAqnl0qP3N4SBYKAz6lJfrNU1Q2MCXAQrpcjd+XMxWzX+JynvC3p16c27jLCi vOQIvEEOe8JudJqY+1jqZxQ5fbzygt0z3gXxmNcI9lZJEdZiop27Zsew+ez3Qz9F6nCY FHEYzRfN8Vo2pGA5HuUbaaJbiZwU/ATA1kiutbMvY5GmYR2GTLgKAjASOCN5kMw2ksNd ZdFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j6O8OoOR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si3143333ejc.337.2019.09.18.10.39.58; Wed, 18 Sep 2019 10:40:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j6O8OoOR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387615AbfIRQ24 (ORCPT + 99 others); Wed, 18 Sep 2019 12:28:56 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46753 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387520AbfIRQ2z (ORCPT ); Wed, 18 Sep 2019 12:28:55 -0400 Received: by mail-wr1-f68.google.com with SMTP id o18so43845wrv.13; Wed, 18 Sep 2019 09:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+0ntiwXvSESB7iaOoEKUuKoBv5qu2y9dPZxgAsEks4E=; b=j6O8OoORqIJ+c0lJiu2c0OGPlmDy8cgQxd+S7wBYq/FYyzcR6HqvTzfPGNAAmF0LzZ xJQlouhwYeHYD04CjRw/xergiWhEqN5sCG7UsEMr2/voKxYCmw9lyK7z4lytRKhbR4DV PemaPb9jBUkuK4/mtg/oB/F8Bqc2mX43MHnLsSzRbkUDeokIVGpgSVIMyx8hdU9MX7P1 lCRUjZmozXQZ0SLXlHSJRoGFind96cnphL2WyyFIxEunuaT/SgtjBOGcNF7mjgW8pFoQ bU4X0T03b9hTDi9z9se2KZ6m67rxguHeNSm4o92Far5TP/mKg3VDC4SB5JA70aJlfl10 6pmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+0ntiwXvSESB7iaOoEKUuKoBv5qu2y9dPZxgAsEks4E=; b=kBDbE+rT9GL15soSBwcIMcnZS7Ro7ZrDpO98Q7oK/w7uPDcGoAdmE8jz39tXVSG7aA 3Q+d7o00lZKAav3mqwHDN21ZIQIFXSAqX2hCYUQpojRrbkMkvFp8gMHIAU8KI+YQoHoZ nNlIft2xJlfBZm6OV9Z4JjYcmqMFGEkcZ93mBGJd3ICOy1GComrwy5FAcbVpDdAJj+FW 7phNtyibiA0wLD8sqoEjyteRsLtvwUtiBg1UK+hvky890g7vAusTio9T3g5Bv8yMeckI nW2SOGr2y9wldJvp13T3F2376If8+KbbtB26eQZqAgtKirE0yFOp5N3pKhXe4C3eId+j E1gA== X-Gm-Message-State: APjAAAXn6WRFuzFyG5mExgzFWupJFgwSW6uvC74c6p8yefzdmd0FCjaM 7R2nhwP9+iQZtiLOAd8Pw2A= X-Received: by 2002:a5d:49c3:: with SMTP id t3mr3940934wrs.151.1568824132964; Wed, 18 Sep 2019 09:28:52 -0700 (PDT) Received: from bfk-3-vm8-e4.cs.niisi.ras.ru (t109.niisi.ras.ru. [193.232.173.109]) by smtp.gmail.com with ESMTPSA id q19sm11468214wra.89.2019.09.18.09.28.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2019 09:28:52 -0700 (PDT) From: Peter Mamonov To: andrew@lunn.ch Cc: Peter Mamonov , Florian Fainelli , Heiner Kallweit , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net v3] net/phy: fix DP83865 10 Mbps HDX loopback disable function Date: Wed, 18 Sep 2019 19:27:55 +0300 Message-Id: <20190918162755.24024-1-pmamonov@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Changes since v2: - None Changes since v1: - use BIT() macro - fix debug message as well drivers/net/phy/national.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/national.c b/drivers/net/phy/national.c index a221dd552c3c..a5bf0874c7d8 100644 --- a/drivers/net/phy/national.c +++ b/drivers/net/phy/national.c @@ -105,14 +105,17 @@ static void ns_giga_speed_fallback(struct phy_device *phydev, int mode) 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) -- 2.23.0