Received: by 10.223.176.46 with SMTP id f43csp371032wra; Thu, 18 Jan 2018 18:51:47 -0800 (PST) X-Google-Smtp-Source: ACJfBovetcepD5SkL2U5ZeL4k85SBdqqBn5sNpNc9ayo20ojO2cvW8/90/n3vy4upUz1hVVPTxns X-Received: by 10.98.51.130 with SMTP id z124mr44049404pfz.21.1516330306964; Thu, 18 Jan 2018 18:51:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516330306; cv=none; d=google.com; s=arc-20160816; b=HAattawmbMBO8f5uAp6SXj2+ZqMr8rZjWoG8Slto23RXYYKlc0q5oglDhok+BltV/N AvdJIcFzriaTbLRQgg12ym3bXb6vJ2IITVudkcyjcvZ9GG70+NphxQbLNKJHchevU0XU bKAFk9BWakQmHDbbZyTP/Hlb3bRJ7+KSXzD9Z4hiVTf94ju6PE+fyIi2cCRjlgmiWwXM pNSWAoi5SAHExT11rcDH6s90CIczE57pO5PXsJj/Ctc4W8deOvEFkQTU0R7VvWjwqsZm bRk23sOxQl+hO06wdWYEEcF3EN0Q7By1MYHXL1My5qtC5eA8Rmg3AgORoUHcHXqv0xAg 8lCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=4lCFMnTqMGwrTUckZjGJG2O4sMoxyRqUSuvvbIjYS+k=; b=Sg0/BGjWl4GM17F/aCSVA8rAZngnIuNFHlJ1bNidcO3YmhaCWlabWb3QBeC9h0eBqV 9rdfx9NwkxmEPBhxubgYvfVHMIdxOLGgvApz4qk6xbUTyDD+DIUSx/l/yMerJJ6ekf// jQtKHS1dFDWR8SgNFCUBui+0t2wVHlDRjhg3EVY6G2FRzv9DJ/z2oKcPOByM0f2p5/LO SHv7rlGya2/C1kuKVpHLNIHkxdA1aliz+IeFWq033CCcIRa9lhybx0BOO5ytGDQyMEnB h9NP0PjswKTjqphiYo8oDc92agozrdsF1Oko7ZayK7jINKDBUeU8R96gUc+scFYIzrUJ kdsQ== 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 v11si7504083pgf.326.2018.01.18.18.51.32; Thu, 18 Jan 2018 18:51:46 -0800 (PST) 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 S1755307AbeASCvH (ORCPT + 99 others); Thu, 18 Jan 2018 21:51:07 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:33620 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752855AbeASCvA (ORCPT ); Thu, 18 Jan 2018 21:51:00 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2FDDF105310E2; Fri, 19 Jan 2018 10:50:45 +0800 (CST) Received: from [127.0.0.1] (10.63.173.108) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.361.1; Fri, 19 Jan 2018 10:50:37 +0800 Subject: Re: [PATCH net-next 3/5] net: hns3: add ethtool -p support for phy device To: Andrew Lunn CC: , , , , References: <1516259632-85088-1-git-send-email-lipeng321@huawei.com> <1516259632-85088-4-git-send-email-lipeng321@huawei.com> <20180118142515.GI5894@lunn.ch> From: "lipeng (Y)" Message-ID: Date: Fri, 19 Jan 2018 10:50:09 +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: <20180118142515.GI5894@lunn.ch> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.63.173.108] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/1/18 22:25, Andrew Lunn wrote: >> +static int hclge_set_led_status_phy(struct phy_device *phydev, int value) >> +{ >> + int ret, cur_page; >> + >> + mutex_lock(&phydev->lock); >> + >> + ret = phy_read(phydev, HCLGE_PHY_PAGE_REG); >> + if (ret < 0) >> + goto out; >> + else >> + cur_page = ret; >> + >> + ret = phy_write(phydev, HCLGE_PHY_PAGE_REG, HCLGE_PHY_PAGE_LED); >> + if (ret) >> + goto out; >> + >> + ret = phy_write(phydev, HCLGE_LED_FC_REG, value); >> + if (ret) >> + goto out; >> + >> + ret = phy_write(phydev, HCLGE_PHY_PAGE_REG, cur_page); >> + >> +out: >> + mutex_unlock(&phydev->lock); >> + return ret; >> +} > Sorry, but NACK. > > Please add an interface to phylib and the phy driver you are using to > do this. > >> #define HCLGE_PHY_PAGE_MDIX 0 >> #define HCLGE_PHY_PAGE_COPPER 0 >> +#define HCLGE_PHY_PAGE_LED 3 >> >> /* Page Selection Reg. */ >> #define HCLGE_PHY_PAGE_REG 22 >> @@ -73,6 +74,15 @@ >> /* Copper Specific Status Register */ >> #define HCLGE_PHY_CSS_REG 17 >> >> +/* LED Function Control Register */ >> +#define HCLGE_LED_FC_REG 16 >> + >> +/* LED Polarity Control Register */ >> +#define HCLGE_LED_PC_REG 17 >> + >> +#define HCLGE_LED_FORCE_ON 9 >> +#define HCLGE_LED_FORCE_OFF 8 >> + > By the looks of these defines, you assume you have a Marvell PHY. > Please make this generic so anybody with a Marvell PHY can use it. > > Andrew Hi  Andrw, As your suggestion, we need add  interface to  phylib and the phy driver. We will consider your suggestion and push this patch after we fix your comments. so we will remove this patch  in V2 patch-set. Thanks Peng Li > . >