Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp436016pxk; Thu, 24 Sep 2020 09:07:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzxyiL/ARtCr6l9BDXG54WSBhsoFP1jiEnkyeTutfRLQTeU0qXUyk1GluRqva3RsnC4K0V X-Received: by 2002:aa7:d585:: with SMTP id r5mr650229edq.278.1600963635439; Thu, 24 Sep 2020 09:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600963635; cv=none; d=google.com; s=arc-20160816; b=A1IVNcjwgmhfTun85Gv/E+oPvTvfC1p9X5MW/QRT4hk1Eb7EFgh6BMssvUqacsUlgb 7+RLhnoGia7PiXxueRC9Nlrmnp6X/9lrZYYf6FDyfpTSROxxKq8eFCl16wjfijb2oFRS BWnYTzsBZf+kIMoR4Bpqh1sjLx9YMG0WR6SIg9I/FDVfn4nnw8CBvSrR0ja5TPAhduqj xGV6OZsOc60AO6waDoNu7WNktTbDYrMXn7M//ghHV3WfnzImHVH9SvQRo94wjDtcYNoN d22A+fpgAb/QS6nssyaJS8N2RdRultTKT37mlHOuMWIYfsHpotn8jkSCghphYVV4vQwM awJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=4IsJd2C99IpOGM5ASzy2Nt8b3UwM1zYp9IE0WZqWDAE=; b=QgWVV8F4UIfvatwx2HG8iGDqcUYiwGhTLEf6UgA/XuSK/kIoRZ2YgtCri4SPA4w5Wu B4BqOwaTocMDMc9OfHYo+HAMoXV0jcJPDzBCKtQopW1T/SgXPPnD/tt+i8ESIKhGD4kO G5wj2oZC57woXRHKSjvk4IEf+nytd8TtHiKggOJQWshtO2VKKdPED0fqLl4GbKgd/d3k MnWPX47tsw4szQqvrUVIHVp89xskYOfIJ+o2OSnXsLeWey2qGDTSqHHee47epEJ3bRog KWX5C9/3OOWvEiI9J7WQ/pKjxLR5o+TI56WMJEMcPHZOW1xlCKL70VSzzIDA0YxlsRoL n4fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Qn3Qw8Nu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w15si2655588edf.56.2020.09.24.09.06.45; Thu, 24 Sep 2020 09:07:15 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Qn3Qw8Nu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728635AbgIXQDT (ORCPT + 99 others); Thu, 24 Sep 2020 12:03:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:34102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728501AbgIXQDO (ORCPT ); Thu, 24 Sep 2020 12:03:14 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8026D235FD; Thu, 24 Sep 2020 16:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600963394; bh=nx5fc2qT1dKDZhxupdYrhOZWNqt6L+jeM++9RJd8mCs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Qn3Qw8NuLhWrWdS/B5Pp0Xnhkr2KJ6x7oyHwbslo70YKDR/bb/jEFI3Z8X37Ov6KU IUOH8BCXVL9yXxDWV3pJOf+4Rt2ce2AjWtRWrEQn/XNGE9tojnLNJjGdZKv5u2B+YW dWg04EXwEQj9m0lmCisaJCevm9pamzB5nKcB/EqI= Date: Thu, 24 Sep 2020 09:03:11 -0700 From: Jakub Kicinski To: Saeed Mahameed Cc: David Miller , hkallweit1@gmail.com, geert+renesas@glider.be, f.fainelli@gmail.com, andrew@lunn.ch, 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" Message-ID: <20200924090311.745cac3b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <2cf4178e970d2737e7ba866ebc83a7ec30ca8ad1.camel@kernel.org> References: <20200923.172125.1341776337290371000.davem@davemloft.net> <20200923.172349.872678515629678579.davem@davemloft.net> <2cf4178e970d2737e7ba866ebc83a7ec30ca8ad1.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Sep 2020 22:49:37 -0700 Saeed Mahameed wrote: > 2) Another problematic scenario which i see is repeated in many > drivers: > > shutdown/suspend() > rtnl_lock() > netif_device_detach()//Mark !present; > stop()->carrier_off()->linkwatch_event() > // at this point device is still IFF_UP and !present > // due to the early detach above.. > rtnl_unlock(); Maybe we can solve this by providing drivers with a better helper for the suspend use case? AFAIU netif_device_detach() is used by both IO errors and drivers willingly detaching the device during normal operation (e.g. for suspend). Since the suspend path can sleep if we have a separate helper perhaps we could fire off the appropriate events synchronously, and quiescence the stack properly?