Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21164334ybl; Sun, 5 Jan 2020 22:09:24 -0800 (PST) X-Google-Smtp-Source: APXvYqxmxnnUvyeFrTJADudWrKyWsyQDcBF96wq8UdwPyy4lJJFmUeDVANb0DknALeyXX6680hQ/ X-Received: by 2002:a9d:6196:: with SMTP id g22mr118017177otk.204.1578290964274; Sun, 05 Jan 2020 22:09:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578290964; cv=none; d=google.com; s=arc-20160816; b=aIVD4eGjsVDoPTDkxV3RJFT4fDitMVBBD5OJJfbrU6hEjmUm3n2xGGz+dc7h/QOV6i hOgoAckNIIREbTFkfUokKVQcjkC4LWBoIu2+ISYtHL6wv9DWt88XdqhlVV6LwVEVFS1R iJ46Vh0w2n/bYXmIE+C+nJwiWRfOx2OS/GFPXvS5wrsmnemtB+46v4yxel50hzZhZ+q9 PC+AbfnP+LHF8iCyYu/ZXqErvsi/CjWlNQay7hhVVTVgTx68LAtDSxQc1YbVZl4z6t35 SoVFDmxdx4WxexMFiPc/FectLmtoCCJyavtmDgjYm3vI2LJ59yku4XCbwZ7/ukQun9st UcvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2Al5tPt/sk2z/3ZmPk6OVEwLabbpjDPnr+Yv9BgMsVU=; b=Pkzi5wUo1g1skxuAM45xmYnDk4eRoOktTMsej5QRFBDJOmHxir2qIhONidiFzdQB3Q DqXM/SUCLJybEsc99e3LzSBPjEz8Mo/2ofmcBB5+hpaVDo9BBRPy/ocEgDF16+06AVvy 1K/13xOoB2ZG7ct9JRxjk3x5wP6hBZY95WIr20wngLgZCoFUVaKWnRjQYi6wS3NsFmJs nzhzFlH/c3FfJGaAcmRu5JHRSIpy9X+nGdo3UpFr+/0aDYWclkLR+Pa6erMFkSONR8X1 Qc5lVR4yo6h0zNcagKkxaYkaqeiaucZAkwF50ocnRgZ3bfcFkhTQtBZho25tw2Hx9NPc 0qnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 v202si31448694oie.79.2020.01.05.22.09.02; Sun, 05 Jan 2020 22:09:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726770AbgAFGIz (ORCPT + 99 others); Mon, 6 Jan 2020 01:08:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:37024 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726338AbgAFGIz (ORCPT ); Mon, 6 Jan 2020 01:08:55 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 40CA6AC46; Mon, 6 Jan 2020 06:08:53 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 53217E048A; Mon, 6 Jan 2020 07:08:51 +0100 (CET) Date: Mon, 6 Jan 2020 07:08:51 +0100 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Andrew Lunn , "David S. Miller" , Maya Erez , Kalle Valo , linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com, Francois Romieu , linux-kernel@vger.kernel.org, Florian Fainelli Subject: Re: [PATCH net-next 3/3] epic100: allow nesting of ethtool_ops begin() and complete() Message-ID: <20200106060851.GE22387@unicorn.suse.cz> References: <146ace9856b8576eea83a1a5dc6329315831c44e.1578257976.git.mkubecek@suse.cz> <20200105220832.GA21914@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200105220832.GA21914@lunn.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Sun, Jan 05, 2020 at 11:08:32PM +0100, Andrew Lunn wrote: > > @@ -1435,8 +1436,10 @@ static int ethtool_begin(struct net_device *dev) > > struct epic_private *ep = netdev_priv(dev); > > void __iomem *ioaddr = ep->ioaddr; > > > > + if (ep->ethtool_ops_nesting == U32_MAX) > > + return -EBUSY; > > /* power-up, if interface is down */ > > - if (!netif_running(dev)) { > > + if (ep->ethtool_ops_nesting++ && !netif_running(dev)) { > > ew32(GENCTL, 0x0200); > > ew32(NVCTL, (er32(NVCTL) & ~0x003c) | 0x4800); > > } > > Hi Michal > > In the via-velocity you added: > > + if (vptr->ethtool_ops_nesting == U32_MAX) > + return -EBUSY; > + if (!vptr->ethtool_ops_nesting++ && !netif_running(dev)) > velocity_set_power_state(vptr, PCI_D0); > return 0; > > These two fragments differ by a ! . Is that correct? You are right, thank you for catching it. This should be if (!ep->ethtool_ops_nesting++ && !netif_running(dev)) { as well, we only want to wake the device up in the first (outermost) ->begin(). (It would probably do no harm to do it each time but not doing it in the first would be wrong.) I'll send v2 in a moment. Michal