From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D49EC43387 for ; Thu, 17 Jan 2019 02:58:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B77920657 for ; Thu, 17 Jan 2019 02:58:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727595AbfAQC6S (ORCPT ); Wed, 16 Jan 2019 21:58:18 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2245 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727541AbfAQC6R (ORCPT ); Wed, 16 Jan 2019 21:58:17 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 0E32AE5329E2D7FB2C05; Thu, 17 Jan 2019 10:58:16 +0800 (CST) Received: from [127.0.0.1] (10.65.91.35) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Thu, 17 Jan 2019 10:58:09 +0800 Subject: Re: Question about default m88e1510 LED configuration of marvell phy To: Andrew Lunn CC: Wang Dongsheng , Andrew Lunn , David Miller , , "Zhuangyuzeng (Yisen)" , Salil Mehta , "lipeng (Y)" , Yunsheng Lin , Dengweiwei References: <1a4ecb58-7835-85f9-51b7-88b0cfca7eba@huawei.com> <20190115033910.GA11722@lunn.ch> <20190116160434.GD29244@lunn.ch> From: "shenjian (K)" Message-ID: Date: Thu, 17 Jan 2019 10:58:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20190116160434.GD29244@lunn.ch> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.65.91.35] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org ÔÚ 2019/1/17 0:04, Andrew Lunn дµÀ: >> Thanks, Andrew. >> >> But we are using acpi mode, is there any ohter way to poke values into registers ? > > You can register a PHY fixup. > > phy_register_fixup_for_uid(), mach-orion5x/dns323-setup.c > > Andrew > > . > Thanks Andrew! I have tried phy_register_fixup_for_uid(), but it doesn't work . Maybe I missed something important, phy_scan_fixups() is called before drv->config_init() in function phy_init_hw(). So even though I configure the led ctrl register in fixup callbacks, the configuration will be overrided by m88e1510_config_init()->m88e1318_config_init()->marvell_config_init(). test log is below: [ 105.703297] Hardware name: Huawei D06/D06, BIOS Hisilicon D06 UEFI RC0 - V1.10.01 01/03/2019 [ 105.720192] Workqueue: events work_for_cpu_fn [ 105.728902] Call trace: [ 105.733782] dump_backtrace+0x0/0x180 [ 105.741099] show_stack+0x14/0x20 [ 105.747720] dump_stack+0x90/0xb4 [ 105.754342] hclge_phy_marvell_fixup+0x14/0x90 [hclge] <-- configure the led ctrl reg to 0x1040 here [ 105.764620] phy_scan_fixups+0x80/0x108 [ 105.772285] phy_init_hw+0x4c/0x78 [ 105.779080] phy_attach_direct+0x1cc/0x240 [ 105.787267] phy_connect_direct+0x20/0x70 [ 105.795283] hclge_mac_connect_phy+0x54/0xb0 [hclge] [ 105.805214] hns3_client_init+0x24c/0x330 [hns3] [ 105.814448] hclge_init_client_instance+0xcc/0x1a0 [hclge] [ 105.825423] hnae3_match_n_instantiate+0x4c/0x110 [hnae3] [ 105.836223] hnae3_register_ae_dev+0xd4/0x1a8 [hnae3] [ 105.846329] hns3_probe+0x5c/0x88 [hns3] [ 105.854169] local_pci_probe+0x3c/0xb0 [ 105.861659] work_for_cpu_fn+0x18/0x28 [ 105.869151] process_one_work+0x1e4/0x458 [ 105.877165] worker_thread+0x228/0x450 [ 105.884655] kthread+0x12c/0x130 [ 105.891102] ret_from_fork+0x10/0x18 [ 105.899661] iommu: Adding device 0000:bd:00.0 to group 21 [ 105.912042] hns3 0000:bd:00.0: The firmware version is b0600114 [ 105.939661] hclge driver initialization finished. estuary:/home$ estuary:/home$ estuary:/home$ ethtool -i eth2 <-- I add debug code here to print the led reg value [ 154.466599] hns3 0000:7d:00.2 eth2: phy led reg vaule: 0x1177 driver: hns3 version: 4.19.13-g1962b78-dirty SMP pree firmware-version: 0xb0600114 expansion-rom-version: bus-info: 0000:7d:00.2 supports-statistics: yes supports-test: yes supports-eeprom-access: no supports-register-dump: yes supports-priv-flags: no estuary:/home$ uname -a Linux (none) 4.19.13-g1962b78-dirty #2 SMP PREEMPT Mon Jan 14 16:28:34 HKT 2019 aarch64 GNU/Linux