From: Heiner Kallweit Subject: Re: [PATCH RFC 12/18] r8168: switch to phy_mii_ioctl Date: Sat, 23 Dec 2017 00:01:58 +0100 Message-ID: <82fec402-6ad0-4a42-0e8f-916ca28dff14@gmail.com> References: <83321b2e-8402-26c5-9703-3fe795cc893d@gmail.com> <20171222100042.GI2431@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Realtek linux nic maintainers , Chun-Hao Lin , David Miller , "netdev@vger.kernel.org" To: Andrew Lunn Return-path: Received: from mail-wr0-f174.google.com ([209.85.128.174]:39924 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755934AbdLVXCF (ORCPT ); Fri, 22 Dec 2017 18:02:05 -0500 Received: by mail-wr0-f174.google.com with SMTP id o101so430031wrb.6 for ; Fri, 22 Dec 2017 15:02:04 -0800 (PST) In-Reply-To: <20171222100042.GI2431@lunn.ch> Sender: netdev-owner@vger.kernel.org List-ID: Am 22.12.2017 um 11:00 schrieb Andrew Lunn: >> static int rtl8168_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) >> { >> - struct rtl8168_private *tp = netdev_priv(dev); >> - struct mii_ioctl_data *data = if_mii(ifr); >> + if (!netif_running(dev)) >> + return -ENODEV; > > It is sometimes useful to be able to prod and poke the PHY when the > MAC is not running. Is this limit because of power saving? > Actually I'm not 100% sure, I just kept the existing logic. When checking other users of phy_mii_ioctl I saw that it is a typical pattern to return an error if the interface is down. > Otherwise, this patch looks good. > > Thanks > Andrew >