From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Subject: Re: [PATCH net-next 1/2] net: linkwatch: add check for netdevice being present to linkwatch_do_dev Date: Wed, 19 Sep 2018 10:48:44 +0200 Message-ID: References: <11beeaa9-57d5-e641-9486-f2ba202d0998@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Florian Fainelli , Andrew Lunn , "David S. Miller" , netdev , Geert Uytterhoeven To: Heiner Kallweit Return-path: Received: from mail-vs1-f65.google.com ([209.85.217.65]:40526 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727669AbeISOZt (ORCPT ); Wed, 19 Sep 2018 10:25:49 -0400 Received: by mail-vs1-f65.google.com with SMTP id y196-v6so1540697vsy.7 for ; Wed, 19 Sep 2018 01:48:56 -0700 (PDT) In-Reply-To: <11beeaa9-57d5-e641-9486-f2ba202d0998@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, Sep 18, 2018 at 9:56 PM Heiner Kallweit wrote: > When bringing down the netdevice (incl. detaching it) and calling > netif_carrier_off directly or indirectly the latter triggers an > asynchronous linkwatch event. > This linkwatch event eventually may fail to access chip registers in > the ndo_get_stats/ndo_get_stats64 callback because the device isn't > accessible any longer, see call trace in [0]. > > To prevent this scenario don't check for IFF_UP only, but also make > sure that the netdevice is present. > > [0] https://lists.openwall.net/netdev/2018/03/15/62 > > Signed-off-by: Heiner Kallweit Survived 100 suspend/resume cycles on sh73a0/kzm9g and r8a73a4/ape6evm. Tested-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds