From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751688AbdFTN3C (ORCPT ); Tue, 20 Jun 2017 09:29:02 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:57080 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751038AbdFTN3B (ORCPT ); Tue, 20 Jun 2017 09:29:01 -0400 Date: Tue, 20 Jun 2017 15:28:57 +0200 From: Andrew Lunn To: l00371289 Cc: Florian Fainelli , davem@davemloft.net, huangdaode@hisilicon.com, xuwei5@hisilicon.com, liguozhu@hisilicon.com, Yisen.Zhuang@huawei.com, gabriele.paoloni@huawei.com, john.garry@huawei.com, linuxarm@huawei.com, salil.mehta@huawei.com, lipeng321@huawei.com, yankejian@huawei.com, tremyfr@gmail.com, xieqianqian@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test Message-ID: <20170620132857.GE13704@lunn.ch> References: <1497605091-94725-1-git-send-email-linyunsheng@huawei.com> <7500513f-e263-838c-12a1-4343f7281f1a@gmail.com> <20170619215435.GA13704@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >> 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