From mboxrd@z Thu Jan 1 00:00:00 1970 From: "shenjian (K)" Subject: Question about default m88e1510 LED configuration of marvell phy Date: Tue, 15 Jan 2019 11:07:17 +0800 Message-ID: <1a4ecb58-7835-85f9-51b7-88b0cfca7eba@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit Cc: David Miller , , "Zhuangyuzeng (Yisen)" , Salil Mehta , "lipeng (Y)" , Yunsheng Lin , Dengweiwei To: Wang Dongsheng , Andrew Lunn Return-path: Received: from szxga06-in.huawei.com ([45.249.212.32]:56084 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726769AbfAODH2 (ORCPT ); Mon, 14 Jan 2019 22:07:28 -0500 Sender: netdev-owner@vger.kernel.org List-ID: Hi, all We encounted a problem when using the marvel 88e151x phy driver, the link(LED[0])/ack(LED[1]) leds worked abnormally since we updated our kernel to v4.19. The act led kept on and never blink. It works well when we use genphy driver, aslo works well when use marvell phy in kernel v4.18. I found that the default led configuration had been changed to 0x1177 by commit commit 077772468ec1(net: phy: marvell: change default m88e1510 LED configuration). +static void marvell_config_led(struct phy_device *phydev) +{ + u16 def_config; + int err; + + switch (MARVELL_PHY_FAMILY_ID(phydev->phy_id)) { + /* Default PHY LED config: LED[0] .. Link, LED[1] .. Activity */ + case MARVELL_PHY_FAMILY_ID(MARVELL_PHY_ID_88E1121R): + case MARVELL_PHY_FAMILY_ID(MARVELL_PHY_ID_88E1318S): + def_config = MII_88E1121_PHY_LED_DEF; + break; + /* Default PHY LED config: + * LED[0] .. 1000Mbps Link + * LED[1] .. 100Mbps Link + * LED[2] .. Blink, Activity + */ + case MARVELL_PHY_FAMILY_ID(MARVELL_PHY_ID_88E1510): + def_config = MII_88E1510_PHY_LED_DEF; + break; + default: + return; + } + + err = phy_write_paged(phydev, MII_MARVELL_LED_PAGE, MII_PHY_LED_CTRL, + def_config); + if (err < 0) + pr_warn("Fail to config marvell phy LED.\n"); +} + For the led configuration is very flexible for m88e1510, people may use different function for each led, I think it's quite reasonable to change its default configuration when phy init. If there are any better info or suggestion regarding this problem, it would be very helpful, thanks in advance. reference: [1] https://patchwork.ozlabs.org/patch/937682/ [2] https://lore.kernel.org/patchwork/patch/687718/ [3] http://lkml.iu.edu/hypermail/linux/kernel/1606.1/03283.html [4] https://web.pa.msu.edu/hep/atlas/l1calo/htm/hardware/components/Enet_Phy/marvell_alaska_phy_88e151x_datasheet_jan18.pdf