From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E761BCA9EAF for ; Wed, 30 Oct 2019 05:51:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9B282080F for ; Wed, 30 Oct 2019 05:51:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726568AbfJ3FvI (ORCPT ); Wed, 30 Oct 2019 01:51:08 -0400 Received: from smtprelay0135.hostedemail.com ([216.40.44.135]:39252 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725855AbfJ3FvI (ORCPT ); Wed, 30 Oct 2019 01:51:08 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id A3105180388F1; Wed, 30 Oct 2019 05:51:06 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: nest43_60c9df2ab6455 X-Filterd-Recvd-Size: 2239 Received: from XPS-9350.home (unknown [47.151.135.224]) (Authenticated sender: joe@perches.com) by omf14.hostedemail.com (Postfix) with ESMTPA; Wed, 30 Oct 2019 05:51:05 +0000 (UTC) Message-ID: Subject: Re: [net-next 2/8] e1000e: Use rtnl_lock to prevent race conditions between net and pci/pm From: Joe Perches To: Jeff Kirsher , davem@davemloft.net Cc: Alexander Duyck , netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, Morumuri Srivalli , David Dai , Aaron Brown Date: Tue, 29 Oct 2019 22:50:57 -0700 In-Reply-To: <20191030043633.26249-3-jeffrey.t.kirsher@intel.com> References: <20191030043633.26249-1-jeffrey.t.kirsher@intel.com> <20191030043633.26249-3-jeffrey.t.kirsher@intel.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 2019-10-29 at 21:36 -0700, Jeff Kirsher wrote: > From: Alexander Duyck > > This patch is meant to address possible race conditions that can exist > between network configuration and power management. A similar issue was > fixed for igb in commit 9474933caf21 ("igb: close/suspend race in > netif_device_detach"). [] > diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c [] > @@ -4715,12 +4715,12 @@ int e1000e_close(struct net_device *netdev) > > pm_runtime_get_sync(&pdev->dev); > > - if (!test_bit(__E1000_DOWN, &adapter->state)) { > + if (netif_device_present(netdev)) { > e1000e_down(adapter, true); > e1000_free_irq(adapter); > > /* Link status message must follow this format */ > - pr_info("%s NIC Link is Down\n", adapter->netdev->name); > + pr_info("%s NIC Link is Down\n", netdev->name); This change is already a minor optimization, but perhaps this should instead be: netdev_info(netdev, "NIC Link is Down\n"); And whatever pr_ uses should use netdev_ where possible in the driver.