Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3926547imm; Mon, 8 Oct 2018 11:48:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV60Go8GLj7bcpO03GQpmxXl6KzETigPBeiY1nReLnzwIL7xvJTcXHSE8fkHJIdT7Cp9fStRF X-Received: by 2002:a62:cd45:: with SMTP id o66-v6mr26359355pfg.12.1539024523564; Mon, 08 Oct 2018 11:48:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024523; cv=none; d=google.com; s=arc-20160816; b=oXdKxFAjunVcla6g5qWX6mPOy0vYUDcjrrw1a6vcbbn80g+tvCbPjPbqsBk2oWCjcC I02w2SnRV90iTyLcP4UqT0cAEI8P5rLYSC2nrIY8+bwV6Eui0rHqCPUgZWW8vVNgiTaY qgYJ+ZdeXsbredxwmIDHy+aEyq56L7rfoBryfO0pHG13qdcu8XN7rqNmSVWcrsXemW1l WsT2TWz2DaxWMNMIp8yIOGNxKrNeSHIYuIT1sLrlXa3JO9uLFHega/UPeBv6w0VulhnU tY3hdnm9yZ9/jRXx5iOdh1nJ5Cm7mc5m3+cWIbmUWB5zcOnMy7XYcVHJBeJMLnezOjQu j7mg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Y5tvWrkjd24H5qnxGMJeFx72RcHHjgiy87Y5YlwxUrc=; b=OTHSIn636TrWptkQ3v2SyyXWiXCJwF5yI9Lw3AESo6BsOmEuQ6WiPLj/sIi5y40Ift TPv6uvE6SzIMwutQnZmWBhkTe7/gv0s3Ch83H4mBFFJm/7s8r3fAcWE3kS46VU46vBBF yfrMOz8DpvEAQq+kk5Y57ApK5LdVG8ioR+G09o3PWe4Sw9qL5W9VK+d6nfddBRwv7QbI pQqVwllz2YImNjed60enyXC+OY7nlz3bfi6uN8yqgztpB5ux4hQPIrVL1RxcD/e9M/OY 9LJfXtHEO6QiUuPn5u2gniuRtagBf41ICAk6GxxLUfE2j05VKOHfyIyzQOkhR/+uKbzn bTcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ux7peitx; 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 e26-v6si16743046pgb.161.2018.10.08.11.48.28; Mon, 08 Oct 2018 11:48:43 -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=ux7peitx; 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 S1730917AbeJICAJ (ORCPT + 99 others); Mon, 8 Oct 2018 22:00:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:48534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727510AbeJICAI (ORCPT ); Mon, 8 Oct 2018 22:00:08 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (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 7EFC32064A; Mon, 8 Oct 2018 18:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024422; bh=D81P50hhM4xRL2htHpotgICtZIu+XEDMxZFZPAT81K4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ux7peitxPl9QC5mFh6tQ0f84MYljYMp9x6/ZhUQs9FnKrXOzBXgV2preA5RQBBAVO IHHfR7qGKEF1UVFPv7hJPJP/Fy1ETtCMlXn5oMLcSnSTpxdK9YXVn0Cn6qjwyiZulR 2DCIBWvkW6Wrvs9axw6pQBthGIOrWIAZfw3ZeM7s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Li , "David S. Miller" , Sasha Levin Subject: [PATCH 4.18 033/168] net: hns: add netif_carrier_off before change speed and duplex Date: Mon, 8 Oct 2018 20:30:13 +0200 Message-Id: <20181008175621.304668362@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peng Li [ Upstream commit 455c4401fe7a538facaffb35b906ce19f1ece474 ] If there are packets in hardware when changing the speed or duplex, it may cause hardware hang up. This patch adds netif_carrier_off before change speed and duplex in ethtool_ops.set_link_ksettings, and adds netif_carrier_on after complete the change. Signed-off-by: Peng Li Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c @@ -243,7 +243,9 @@ static int hns_nic_set_link_ksettings(st } if (h->dev->ops->adjust_link) { + netif_carrier_off(net_dev); h->dev->ops->adjust_link(h, (int)speed, cmd->base.duplex); + netif_carrier_on(net_dev); return 0; }