Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp653875pxk; Fri, 11 Sep 2020 17:46:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2jPeXlhjHputIgPAU4UbW62t+eeDhELAJRwScfRSUHxegZvoK1uKskecdXXOmgWTGlftG X-Received: by 2002:a50:f69a:: with SMTP id d26mr5278578edn.21.1599871616257; Fri, 11 Sep 2020 17:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599871616; cv=none; d=google.com; s=arc-20160816; b=O+We12bR84hG+mnD3JiYWcgvCYzy6TEqwNdba2DLbBwh7oDjiTmnJQ7SyP6hqu8Tae PIqIjAaQ8AylKWUWZT0M7ujiqc2HrW+6YgABsP7tPvyPBOxsvCDzbt5/h1UpKXmNucu4 onunhybeNNVvE/qBZTK75GlvOwzZn2zMFCzvT1sqad2ZazcYlroBoMNVYTy+OYw+VeqG LDHR4v5XpVXYjB1ulKQee4LpzSL3SUXyE4gLqsyFvRl+cz+WzkReO9FZzQZczx3UvOJQ EM7IcPPHy4PbunYZt9FVAZEix769m1ahfKvh9v3lHCb+lntaCaj0WBc2Twg+zy9pTF0C 8ydQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=dGwU4WCKLUaICwUcMUcpER91e/nVpTp/n5wl1txwcag=; b=XXUibKB+3GQrAb5aTHjmVvsFzzR0SGg/6zmYE9Y5kx/CPATuJftI2kz91iM4si3AV2 d81DFJDikfiyvjie8dbiK16zuZgAuNNeBwa43MqpfVF6ixAkUh/A4DfgKnDWsV9BulnD lfxtoG1QYYeUt/G3/u/TuFSdBhxWQS2Tm4Se10Oln2xoAxWO6+6Fx/2vjh2yXFzVvaKp t6Wq3oQjbfYaedkASBiHCAh9wTW/73ycyPx90yEnozZ/rY8p5jWP7xV4//9o5TBNJRmk LlXAgsfMUCeszVoC/sSBhURpHgzeReVcAvbwv3RQjiCf4uKKMNZo3I0obUCXZ7IlG6ii dOsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h19si2383730ejl.253.2020.09.11.17.46.32; Fri, 11 Sep 2020 17:46:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725939AbgILAoM (ORCPT + 99 others); Fri, 11 Sep 2020 20:44:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbgILAoE (ORCPT ); Fri, 11 Sep 2020 20:44:04 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77E86C061573; Fri, 11 Sep 2020 17:44:03 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 515A112354CAB; Fri, 11 Sep 2020 17:27:14 -0700 (PDT) Date: Fri, 11 Sep 2020 17:44:00 -0700 (PDT) Message-Id: <20200911.174400.306709791543819081.davem@davemloft.net> To: geert@linux-m68k.org Cc: hkallweit1@gmail.com, f.fainelli@gmail.com, andrew@lunn.ch, kuba@kernel.org, gaku.inami.xh@renesas.com, yoshihiro.shimoda.uh@renesas.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Revert "net: linkwatch: add check for netdevice being present to linkwatch_do_dev" From: David Miller In-Reply-To: References: <20200901150237.15302-1-geert+renesas@glider.be> <20200910.122033.2205909020498878557.davem@davemloft.net> X-Mailer: Mew version 6.8 on Emacs 27.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [2620:137:e000::1:9]); Fri, 11 Sep 2020 17:27:14 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven Date: Fri, 11 Sep 2020 08:32:55 +0200 > Hi David, > > On Thu, Sep 10, 2020 at 9:20 PM David Miller wrote: >> From: Geert Uytterhoeven >> Date: Tue, 1 Sep 2020 17:02:37 +0200 >> >> > This reverts commit 124eee3f6955f7aa19b9e6ff5c9b6d37cb3d1e2c. >> > >> > Inami-san reported that this commit breaks bridge support in a Xen >> > environment, and that reverting it fixes this. >> > >> > During system resume, bridge ports are no longer enabled, as that relies >> > on the receipt of the NETDEV_CHANGE notification. This notification is >> > not sent, as netdev_state_change() is no longer called. >> > >> > Note that the condition this commit intended to fix never existed >> > upstream, as the patch triggering it and referenced in the commit was >> > never applied upstream. Hence I can confirm s2ram on r8a73a4/ape6evm >> > and sh73a0/kzm9g works fine before/after this revert. >> > >> > Reported-by Gaku Inami >> > Signed-off-by: Geert Uytterhoeven >> >> Maybe you cannot reproduce it, but the problem is there and it still >> looks very real to me. >> >> netdev_state_change() does two things: >> >> 1) Emit the NETDEV_CHANGE notification >> >> 2) Emit an rtmsg_ifinfo() netlink message, which in turn tries to access >> the device statistics via ->ndo_get_stats*(). >> >> It is absolutely wrong to do #2 when netif_device_present() is false. >> >> So I cannot apply this patch as-is, sorry. > > Thanks a lot for looking into this! > > But doing #1 is still safe? That is the part that calls into the bridge > code. So would moving the netif_device_present() check from > linkwatch_do_dev() to netdev_state_change(), to prevent doing #2, be > acceptable? I have a better question. Why is a software device like the bridge, that wants to effectively exist and still receive netdev event notifications, marking itself as not present? That's seems like the real bug here.