Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6655362ybi; Sun, 21 Jul 2019 23:03:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcwAIQT2zV0RIuxw5zZTCfp9aThCqDmDLqGM+by8L7zch3dpgTWlqoTITwn+PK2T+G+FHh X-Received: by 2002:a65:51c1:: with SMTP id i1mr48418957pgq.417.1563775388157; Sun, 21 Jul 2019 23:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563775388; cv=none; d=google.com; s=arc-20160816; b=M/jvt3NhytuOcKii+Ux/7KXwleNK5GcEh8gbRoJDXeMShlGvwKet6VcYx1cOO9JeGf XMgMnOdJGiEs7ZSjyRwzEeZ0ATZTQ/Kd+G3HGw1xNpPzSNiORSnLc2IIPYgRrstVg5sb GS0pRKvDK6bOYkHDcIu5s86pcSNt1yRayZXDYxhJlfpj4WeUuFhZPMwtLro9x/sxRGSV EfgZGFodZC5aoVGmEQr/I8DDfv43F2MIdq65JfowaM2vCbR+95QMzOEeyCDx2R8W7PYL bBXk+uTDJk6o5GXFVQu2IQ+d0AyZJDn3m+E8IJ1GIO6ArV6nnLyEJlddU+iuW2+rChdk uTRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=MhRAR0+15dtizaK+KupEvwnY2HZ/qS46cQ8cEb9d0iM=; b=JGPCrwOMhz3Lq+DuKVXVZIaJNr6YF6P9xX/6Dv9Y2mf0W1zoinh0eewx8sVuzy6hEc PJfo8G38NBUBt/3wwsbvHH8rLQDcLzOezhPr+eD1RGgpAW26rvhVfRTTX30JKTlFlDil YzfbowsAVKI1Pt9rgiXutFcMlNqAau1VD/TGNjporLM0PHVDAObe+kcjkLhSRii9BbTv Uits8cgjnLtrg7KT3ebSzqaJE6umikqEvOTcyPU+4y8cO4TH1tU0XCWS9fjiWZeZU3Um 77122REDKyDsWYzOFf2dCPP+URntkeTbjplYwwC7XlbqwxmbGPA6aF2C4K0ZG7TB8Rj0 9r6A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si11099562pld.32.2019.07.21.23.02.52; Sun, 21 Jul 2019 23:03:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726952AbfGVGCd (ORCPT + 99 others); Mon, 22 Jul 2019 02:02:33 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2733 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725879AbfGVGCc (ORCPT ); Mon, 22 Jul 2019 02:02:32 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D98A4B0725B57E8EB4CC; Mon, 22 Jul 2019 14:02:30 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Mon, 22 Jul 2019 14:02:19 +0800 From: Yonglong Liu To: CC: , , , , , Subject: [PATCH net] net: hns: fix LED configuration for marvell phy Date: Mon, 22 Jul 2019 13:59:12 +0800 Message-ID: <1563775152-21369-1-git-send-email-liuyonglong@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit(net: phy: marvell: change default m88e1510 LED configuration), the active LED of Hip07 devices is always off, because Hip07 just use 2 LEDs. This patch adds a phy_register_fixup_for_uid() for m88e1510 to correct the LED configuration. Fixes: 077772468ec1 ("net: phy: marvell: change default m88e1510 LED configuration") Signed-off-by: Yonglong Liu Reviewed-by: linyunsheng --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c index 2235dd5..5b213eb 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -1149,6 +1150,13 @@ static void hns_nic_adjust_link(struct net_device *ndev) } } +static int hns_phy_marvell_fixup(struct phy_device *phydev) +{ + phydev->dev_flags |= MARVELL_PHY_LED0_LINK_LED1_ACTIVE; + + return 0; +} + /** *hns_nic_init_phy - init phy *@ndev: net device @@ -1174,6 +1182,16 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h) if (h->phy_if != PHY_INTERFACE_MODE_XGMII) { phy_dev->dev_flags = 0; + /* register the PHY fixup (for Marvell 88E1510) */ + ret = phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1510, + MARVELL_PHY_ID_MASK, + hns_phy_marvell_fixup); + /* we can live without it, so just issue a warning */ + if (ret) + netdev_warn(ndev, + "Cannot register PHY fixup, ret=%d\n", + ret); + ret = phy_connect_direct(ndev, phy_dev, hns_nic_adjust_link, h->phy_if); } else { @@ -2430,8 +2448,11 @@ static int hns_nic_dev_remove(struct platform_device *pdev) hns_nic_uninit_ring_data(priv); priv->ring_data = NULL; - if (ndev->phydev) + if (ndev->phydev) { + phy_unregister_fixup_for_uid(MARVELL_PHY_ID_88E1510, + MARVELL_PHY_ID_MASK); phy_disconnect(ndev->phydev); + } if (!IS_ERR_OR_NULL(priv->ae_handle)) hnae_put_handle(priv->ae_handle); -- 2.8.1