From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [1/4,RFCv2] net: phy: realtek: Support RTL8366RB variant Date: Tue, 29 May 2018 22:17:54 +0200 Message-ID: <20180529201754.GE13697@lunn.ch> References: <20180528174752.6806-2-linus.walleij@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Heiner Kallweit , Vivien Didelot , Florian Fainelli , netdev , OpenWrt Development List , LEDE Development List , Antti =?iso-8859-1?Q?Sepp=E4l=E4?= , Roman Yeryomin , Colin Leitner , Gabor Juhos To: Linus Walleij Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:48797 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966179AbeE2USA (ORCPT ); Tue, 29 May 2018 16:18:00 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Tue, May 29, 2018 at 10:01:14PM +0200, Linus Walleij wrote: > On Tue, May 29, 2018 at 8:51 PM, Heiner Kallweit wrote: > > >> +#define RTL8366RB_POWER_SAVE 0x21 > > > Typically PHY register addresses are 5 bits wide, is 0x21 correct > > and I miss something? Heiner is correct, MDIO only supports 32 register, when using clause 22. However, your device is not clause 22, it is its own thing. So one danger you have is that we put some checks in the generic code testing for values > 31, and return -EINVAL. I think you have two choices: 1) A comment explaining what is going on here, how 0x21 is valid in this context. And check the return value and give out a good warning which will point somebody in the right direction to notice this 0x21. 2) Move this into the DSA driver, which does not have this restriction. Andrew