Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2004604imm; Thu, 24 May 2018 04:22:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqUIx89Q2tyGI8aMecGU3aMpWy4L0leGoR72WtWMwcLuaxSCVcm4g5tVDZ2LKahNJbT6M0u X-Received: by 2002:a17:902:7686:: with SMTP id m6-v6mr2099254pll.340.1527160933968; Thu, 24 May 2018 04:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160933; cv=none; d=google.com; s=arc-20160816; b=Fn+l0ueQxe5fJC9VmMVdBkNP699fzcrN+ULHM4BHERUKksPQs9/pFEjygmpObHYX2f oRUOxWsz/WFXA40vbWH60FGgKqCLwC5ocOzWipMzYBX76+hH6MkB38NQWro113GDw9IJ rcTmvAox7F1ZCjgEoUbr14jHTM1cyT/xgJgOnmV9N/ev/FPCWP+YMWpAe6ypTrL4k0fx NXBarcIBbmWdMBSzCGSUv75cHFPxUsU2CF0l2QHf8bl5GaJp6Mv0wA9M7VoFcTmCtAjc z39JAWc+GghEm0E8ajOXyd3RE4E57SGH820XtW9dEIRSN6BNO1XsBTr3f4hKdoNX4pR3 8OuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=7bWO6OuMXJR469gbiHcXKo+ZHZdkUN49CINKEV8cbt4=; b=FeuZmSl+cr7/A8gZlGmjuftVqPShy77wR0xWgpdn3WRUcgpAafeKH6UqxOTp2O/GGy F/ihQLMRx8g3w3zEZ6+Vep9JV8sANR/pfAFrgSykVWXzadMGbt65dGLqTQTsy7x84OJI pOe+29bQCQth2DfQnQDtbsjSA0OtHMpDz9Uxls1ibJQey+OXl4oCIl5u/2wU0jR++1i8 zplDqRElEVHix3X0xf+GlTAz/fZ+zI4n8nRkafgcAFmZLyiDNFs+zG5+49huLREwBmvF YGC0gcx3WfvMZ+P9PPHVG4s649FNrAsFX46SWeaD0VH2DqjkXKha3DkB+9xI+RYFPejJ LvoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tI79wDVZ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5-v6si44246pll.525.2018.05.24.04.21.58; Thu, 24 May 2018 04:22:13 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=tI79wDVZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967889AbeEXJwf (ORCPT + 99 others); Thu, 24 May 2018 05:52:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:52234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967571AbeEXJw3 (ORCPT ); Thu, 24 May 2018 05:52:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 090D420847; Thu, 24 May 2018 09:52:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155549; bh=nLeEtYCD+0pkxgiCdniaXWf7gygojCB52oG1IYkK+Yc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tI79wDVZcw1UgfhT8f5aBufmF/A19Bt3emAInLfjAZ3k1ieXQwKY5XZM5LGgiaf57 JV0IBUcAuWypzh4ByO+UdAHJZDXJbDQBSt1iyvd0Z9j4AnCWHIDA1W6AQBAZjdlx+T mmoi6bxxhMtFNKDPCewHlj9JJPD8GDaifc4pbtko= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mohammed Gamal , Stephen Hemminger , "David S. Miller" Subject: [PATCH 4.14 029/165] hv_netvsc: change GPAD teardown order on older versions Date: Thu, 24 May 2018 11:37:15 +0200 Message-Id: <20180524093623.155155824@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stephen Hemminger [ Commit 0ef58b0a05c127762f975c3dfe8b922e4aa87a29 upstream. ] On older versions of Windows, the host ignores messages after vmbus channel is closed. Workaround this by doing what Windows does and send the teardown before close on older versions of NVSP protocol. Reported-by: Mohammed Gamal Fixes: 0cf737808ae7 ("hv_netvsc: netvsc_teardown_gpadl() split") Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/hyperv/netvsc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -570,10 +570,15 @@ void netvsc_device_remove(struct hv_devi */ netdev_dbg(ndev, "net device safe to remove\n"); + /* older versions require that buffer be revoked before close */ + if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_4) + netvsc_teardown_gpadl(device, net_device); + /* Now, we can close the channel safely */ vmbus_close(device->channel); - netvsc_teardown_gpadl(device, net_device); + if (net_device->nvsp_version >= NVSP_PROTOCOL_VERSION_4) + netvsc_teardown_gpadl(device, net_device); /* Release all resources */ free_netvsc_device_rcu(net_device);