Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1271834pxk; Sat, 12 Sep 2020 18:36:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsV+D5/JyWYv3knoOTBT54ti1BZUDYpjYAczNHIN3w6g05EyCDvfTuaM4h2TJ35ac+tWJS X-Received: by 2002:a17:906:cb92:: with SMTP id mf18mr8624465ejb.485.1599961012507; Sat, 12 Sep 2020 18:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599961012; cv=none; d=google.com; s=arc-20160816; b=VxWEFWiKlG0oMTurOo7+huk3gwtbClJePwPZiYZHCZ42uTsbzPlK5yMIPz/jmA0l0P EaismTdx666lNkEuAULTe//Rdsoxx+hqM2OHn8+XQqYR07k0N7cfNdSnXKDdLaIo3cxr +eHxM4CDhtq+SRkqSnuCF09M06nVhd1K18WC+ed7nXeCatlgxuuyKbsydW8KEGO8LRke DHW/C5m2A1PuhsltKlz0a/YyVw5Xdy6J4+GHsyLtg22z0FGqND2gk9jBd7o0KyDbcdEt BX6J6zD13YGfYSiFciDawI6PB3gM0149VOylZ0Z8Zb/89hWDJsAl4XhFyN8Fdxw2YMBp 5i2g== 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=AhTUwTimlDegMmXOWcoN8zG8h7+xxcgawe3a7cN6PUI=; b=lXQaw+uqtUTjjdr/VGR6d2wngUDe1+irT+qEcGP/+cdrrrDlr6cjhYjFClKFgp4e2z HGBWmGjqEta51pzSUpYCWwYexbciFqduf2PJsp0m0JbFf8hajldW6TJhO15qTjJ7HiGi RzzV39ELdpN3LNIjAtbWX/qgy1IRg13wmznXBE+/4WgKhLcOI0ifgK9gqLVeRzPXGykt 4jWsVoMXQch4HBu/IU0uIaHsDFagI9V7akkFHJV4Qu6vHHYLseHnSt3QkacCQEOLs/Bx +TW0VqjP9fhSl8hK1dIl6Q6y9THhblsWqGsgNIXcH/RzwmMsewW9cuZPzuM6WjYFhPOZ HI8Q== 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 f7si4997308edc.112.2020.09.12.18.36.29; Sat, 12 Sep 2020 18:36:52 -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 S1725921AbgIMBel (ORCPT + 99 others); Sat, 12 Sep 2020 21:34:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbgIMBek (ORCPT ); Sat, 12 Sep 2020 21:34:40 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34A43C061573; Sat, 12 Sep 2020 18:34:40 -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 D4FB412919DED; Sat, 12 Sep 2020 18:17:51 -0700 (PDT) Date: Sat, 12 Sep 2020 18:34:37 -0700 (PDT) Message-Id: <20200912.183437.1205152743307947529.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: <20200911.174400.306709791543819081.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]); Sat, 12 Sep 2020 18:17:52 -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: Sat, 12 Sep 2020 14:33:59 +0200 > "dev" is not the bridge device, but the physical Ethernet interface, which > may already be suspended during s2ram. Hmmm, ok. Looking more deeply NETDEV_CHANGE causes br_port_carrier_check() to run which exits early if netif_running() is false, which is going to be true if netif_device_present() is false: *notified = false; if (!netif_running(br->dev)) return; The only other work the bridge notifier does is: if (event != NETDEV_UNREGISTER) br_vlan_port_event(p, event); and: /* Events that may cause spanning tree to refresh */ if (!notified && (event == NETDEV_CHANGEADDR || event == NETDEV_UP || event == NETDEV_CHANGE || event == NETDEV_DOWN)) br_ifinfo_notify(RTM_NEWLINK, NULL, p); So some vlan stuff, and emitting a netlink message to any available listeners. Should we really do all of this for a device which is not even present? This whole situation seems completely illogical. The device is useless, it logically has no link or other state that can be managed or used, while it is not present. So all of these bridge operations should only happen when the device transitions back to present again.