Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp20889820ybl; Sun, 5 Jan 2020 14:09:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwti/qpIwgCxmj+xsFO3ujvX29otfD92j39Rob1v5mk9M4Nbr0izpjA5Etnu8ryrQKowz6t X-Received: by 2002:a9d:4d86:: with SMTP id u6mr86989901otk.42.1578262191323; Sun, 05 Jan 2020 14:09:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578262191; cv=none; d=google.com; s=arc-20160816; b=Adz3/XtTI5OvJp/b9w6GqcNXjo2+f/ro5/IAXgWq9b3Iqb/Xrl4U9TRAvCHWb3hq2C pdlIo79XficYLOLRZmtjxM5ZrGU2+N8OJIiZciuyqci4XaZl0T4CMA3WOepoN//l/GG0 Ave5M0NWePTUuh7XVmZEXePsAVMbeERAXYE9OT02s6H3noFtECTxmfS7ZHjOXEV4f1D5 BuhNOJJeqyf7JkOZx8LhEKETsH5Nu12N7gcl5jOgCDxM8nTPCjqYnDD5ci2W81UO7yXw BJ/XlcgA7RU/OYNFaNQeJ0ozjbhWU2hzYaI/iYgKkS2Eqfh7qASJTxQH0yZ4wzWLXppr 6KGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=aEHWEEo6XrkuQmxbIi/VOLDO1KN+ijDmrPx0ATskWBA=; b=dV6oF4rRRpGXkFH8GV7/e4J1ggRI9hLol3z0Vb11pAUfkbRs2jujtwjROfHfwgsBL5 6wnWvk8FfAnU8L7yx1jbpLHjjZLb+vSBF/KZc/M9kH4C7YSrNjGI4t3939kswrQBwR15 4U6GFylFgUCY6HGy4wVyHu4z4PEyisTDYysqUGsPnAOaTqxSyfOHss26ETBt3zSUxsgm Z0DvPqvVg6NQI2J6xjJPluWv/LBI/+SzrViWXnn0Dk87uR8QrsTSMgXeYCvssdu2FsYr ryfmbQv1j97kw8rwKCJ/TPpTTID7NFcgWHViVEyV57dQ8cxJNvEMOHgRghBucNDRiOxG pI5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=idZIs0K6; 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 r10si35469077otn.241.2020.01.05.14.09.30; Sun, 05 Jan 2020 14:09:51 -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; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=idZIs0K6; 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 S1727166AbgAEWIq (ORCPT + 99 others); Sun, 5 Jan 2020 17:08:46 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:48182 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbgAEWIq (ORCPT ); Sun, 5 Jan 2020 17:08:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=aEHWEEo6XrkuQmxbIi/VOLDO1KN+ijDmrPx0ATskWBA=; b=idZIs0K6tVwGiyWJKDRknZN0An cRoK7GkFfUEADbdBu9CL598ESka2Oin0LiGpIE4vWlU5iTY9VUTiavkoUe/iUb7Cbzm9MGMQv1lig XWKrMnskOLwxGWAliUaeS1KKZGFf94dkS4jFTQzTGVNZcgco3owQkWJkj/kCgA8ESaYc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1ioE4W-0000rJ-HB; Sun, 05 Jan 2020 23:08:32 +0100 Date: Sun, 5 Jan 2020 23:08:32 +0100 From: Andrew Lunn To: Michal Kubecek Cc: "David S. Miller" , netdev@vger.kernel.org, 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: <20200105220832.GA21914@lunn.ch> References: <146ace9856b8576eea83a1a5dc6329315831c44e.1578257976.git.mkubecek@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <146ace9856b8576eea83a1a5dc6329315831c44e.1578257976.git.mkubecek@suse.cz> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > @@ -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? Andrew