Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp591176ima; Wed, 6 Feb 2019 05:19:52 -0800 (PST) X-Google-Smtp-Source: AHgI3IbJOTmKjthDmAUmJJCm3gYqDYlXJ2C6m9BNKX1BsX41bNwFBIklvKPHU5ov4uV0XmIY+azw X-Received: by 2002:a63:fa58:: with SMTP id g24mr9413795pgk.390.1549459192821; Wed, 06 Feb 2019 05:19:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549459192; cv=none; d=google.com; s=arc-20160816; b=TBh2UKWjT8oJRIpR2wCgB/3PbMq+riUEOMfwoT/Yqn0zoZ5pC3s7eugXpN5j1zbFaH Ezr7ge9/39SVPyXTW2xsoART4AVHFuWyXm1aqhKbbxYXxHNv6Fi4eik+F4n378DWGZ6U cyh/uOnB/mhjUdJGSM+fuUcyijasCEdBtgDGYYQGMqWvz483Ra59tZNR0JHv7+AYf/XH FRekcAsT7pWMYiR0h6u3XbwP85EREbstsIppf79oklVTS2VvFACpTL6Ji7fzKO1DbbJ6 dR4i6aPKE24nkcWqfW0Q/L2iR8f0wTO/CUK/mkYBMiYOE54vR83qKnz4hhSqtfrcz0Nv xMxQ== 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:message-id:date:subject:cc:to:from; bh=zZ64DwdqMUgfOfZdX8i5NsS4eptaQM7Ip3DRudcqMbw=; b=ySgIfZGZ0UnQ1dIDM0Oqk/98kbO/scRn5XcZ2OFfLAuMfZnVuMY6+lIPEM5/uF7Eol fVHMfbnI/bpNAaPvFoV2oJIoPrJhWdv6VkPnyDr54y2vjM64YnTBx3VNMkA8iwiXPMSK YJdscImM8ftIm+Eo3VXopc8t2GWg+QZr5k8f05Y2/qEX3j1nuM5RIMNJfORBovQyAbmh jU9ffGkbo2gga3bDxVe/DlkIRFqHuOj5z/y93Ao00pu8P1Z5C6Duj6P5esbwKH4kHcuo dLAoA+pMGeFoGjzODSnSjHpH4QgnFgPa36RHaksDmvlnAB95sTV0S6HrOO6HRvH/5Ode Iy8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f18si5695487pgl.457.2019.02.06.05.19.36; Wed, 06 Feb 2019 05:19:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730628AbfBFNRt (ORCPT + 99 others); Wed, 6 Feb 2019 08:17:49 -0500 Received: from mga03.intel.com ([134.134.136.65]:26739 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729808AbfBFNRp (ORCPT ); Wed, 6 Feb 2019 08:17:45 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2019 05:17:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,340,1544515200"; d="scan'208";a="144639919" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 06 Feb 2019 05:17:39 -0800 Received: by black.fi.intel.com (Postfix, from userid 1001) id 8CD67F7; Wed, 6 Feb 2019 15:17:38 +0200 (EET) From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Michael Jamet , Yehezkel Bernat , Andreas Noever , Lukas Wunner , "David S . Miller" , Mika Westerberg , Andy Shevchenko , netdev@vger.kernel.org Subject: [PATCH v2 01/28] net: thunderbolt: Unregister ThunderboltIP protocol handler when suspending Date: Wed, 6 Feb 2019 16:17:11 +0300 Message-Id: <20190206131738.43696-2-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190206131738.43696-1-mika.westerberg@linux.intel.com> References: <20190206131738.43696-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The XDomain protocol messages may start as soon as Thunderbolt control channel is started. This means that if the other host starts sending ThunderboltIP packets early enough they will be passed to the network driver which then gets confused because its resume hook is not called yet. Fix this by unregistering the ThunderboltIP protocol handler when suspending and registering it back on resume. Signed-off-by: Mika Westerberg Acked-by: David S. Miller --- drivers/net/thunderbolt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/thunderbolt.c b/drivers/net/thunderbolt.c index c48c3a1eb1f8..fcf31335a8b6 100644 --- a/drivers/net/thunderbolt.c +++ b/drivers/net/thunderbolt.c @@ -1282,6 +1282,7 @@ static int __maybe_unused tbnet_suspend(struct device *dev) tbnet_tear_down(net, true); } + tb_unregister_protocol_handler(&net->handler); return 0; } @@ -1290,6 +1291,8 @@ static int __maybe_unused tbnet_resume(struct device *dev) struct tb_service *svc = tb_to_service(dev); struct tbnet *net = tb_service_get_drvdata(svc); + tb_register_protocol_handler(&net->handler); + netif_carrier_off(net->dev); if (netif_running(net->dev)) { netif_device_attach(net->dev); -- 2.20.1