From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753114AbdFUCHW (ORCPT ); Tue, 20 Jun 2017 22:07:22 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:8364 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752917AbdFUCHV (ORCPT ); Tue, 20 Jun 2017 22:07:21 -0400 Subject: Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test To: Andrew Lunn CC: Florian Fainelli , , , , , , , , , , , , , , , References: <1497605091-94725-1-git-send-email-linyunsheng@huawei.com> <7500513f-e263-838c-12a1-4343f7281f1a@gmail.com> <20170619215435.GA13704@lunn.ch> <20170620132857.GE13704@lunn.ch> From: l00371289 Message-ID: <199ec218-f7ab-4c6a-5896-e34bce262481@huawei.com> Date: Wed, 21 Jun 2017 10:06:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170620132857.GE13704@lunn.ch> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.74.190.125] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.5949D4C6.0095,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 4ba83d7ea8dfdee36bff688559aeba62 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Andrew On 2017/6/20 21:28, Andrew Lunn wrote: >>>> The question really is, why is not this properly integrated into the PHY >>>> driver and PHYLIB such that the only thing the Ethernet MAC driver has >>>> to call is a function of the PHY driver putting it in self-test? >>> >>> This whole driver pokes various PHY registers, rather than use >>> phylib. And it does so without taking the PHY lock. >> I will consider using phylib as much as possible, thanks. >> >> It also assumes it >>> is a Marvell PHY and i don't see anywhere it actually verifies this. >> When it said Marvell Phy , I meant Marvell Phy with fibre support. >> I will send anther patch to only setting bit in Fiber Control when >> it is a Marvell Phy with fibre support. > > There is a lot more broken than just that. > > You really should remove all code which is accessing the PHY, and add > support to phylib and the drivers for what you need. > > Andrew After adding genphy_loopback support, I will try it. Thanks for pointing out. Best Regards Yunsheng Lin