Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6016318ybc; Wed, 27 Nov 2019 13:27:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzFo2E9SmyOY0QI3nbngFwDBwTm11KCuKWSh6+T6Q+YH40q3VlCzmR6Mg/fGcg1KVpa+hZP X-Received: by 2002:a05:6402:1718:: with SMTP id y24mr33753069edu.220.1574890052877; Wed, 27 Nov 2019 13:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890052; cv=none; d=google.com; s=arc-20160816; b=xb5r54xp6MbSroSr0CJ88tbyL1Rwe0IkbmNesR5TRdhGtCKzwz8et1LgMt8ad9Hmdy WOX0AUPkUvvW84CCwAX4uVK1cTWJWDX/LCeZlUnuM5sdMvhZNPUSCYc5qGRmBqmxGcQa yCBvaUxmwxcwCRCdonKWp7MI/cQOkBx7TA70tsbB8YpQ36Hlhwr8+uE8h5MPtfKSG4y8 Ui2HBhOhllaeDw2A+5p8KmJgf9/2hB6FaAlufRT9iXUW23eaTNWM6EvddvrFQoFyQrJx lxlhc0GZPcaQsD3vNPjU4+2YEDb5RlQZew3dlITCSzMKVb1CA0tP/IizCRJ7qyH+5RCq bRbw== 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=DpNVElCrVgoWmlNCw3dlLNOMqBGvoAHxbd0M0wawuho=; b=0oPMQ5tPt5tg2k3K2ouD5HPDWNWfp+kKMDt089U5C6lyrU4w3Bsx0e9RTBRPLzRpjW gPxKNvN8kS1IL54lpHd6LwiQk4rNStmURUWTavePPIRBBJEgFFLZ96kvnoQdzaL4/kab wVu2hDm1vLa1147omPc54hA8FRq1cJhASnSniScV/2puCdECOKB9EEQh11pNEMK4tVxZ SLgKQEzGqjPrga+gKRUen+9Om3a6Bpmxp8fSgw6ztDDwXLu0BVdXfmdYeD6M1/V5jXGL Ow8jUh0dxzPHrGgM2canmbUFP5N0V/e7zYuZNF1eLrZ0PS0h4ugZW08VmvJ9YgM0dqzE 3DgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="lGT/7KDi"; 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 d16si10530756edp.283.2019.11.27.13.27.09; Wed, 27 Nov 2019 13:27:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b="lGT/7KDi"; 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 S1731140AbfK0VDT (ORCPT + 99 others); Wed, 27 Nov 2019 16:03:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:56422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730860AbfK0VDP (ORCPT ); Wed, 27 Nov 2019 16:03:15 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 AF6722176D; Wed, 27 Nov 2019 21:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888595; bh=0ptIyz2rwTGU2srGHJGqVEpxkJkoXMIW8fkoSVCQ1YI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lGT/7KDiGupKPZgJtTobamnxAtmplylwvn681e8DMddj518Vv+nUCAu2DWblEa3KS AY1XFZqj5Vf5ORhkWJJtZlZOFKFEDAUVXF+Q5TofT87/QiFBj8fGHeYr02ZDuYAibg ChBxO0iSpaJF2GbpXzk3htS3MOSwjvTAcvIFWWbE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huazhong Tan , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 188/306] net: hns3: bugfix for hclge_mdio_write and hclge_mdio_read Date: Wed, 27 Nov 2019 21:30:38 +0100 Message-Id: <20191127203128.992694144@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Huazhong Tan [ Upstream commit 1c12493809924deda6c0834cb2f2c5a6dc786390 ] When there is a PHY, the driver needs to complete some operations through MDIO during reset reinitialization, so HCLGE_STATE_CMD_DISABLE is more suitable than HCLGE_STATE_RST_HANDLING to prevent the MDIO operation from being sent during the hardware reset. Fixes: b50ae26c57cb ("net: hns3: never send command queue message to IMP when reset) Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c index 398971a062f47..03491e8ebb730 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c @@ -54,7 +54,7 @@ static int hclge_mdio_write(struct mii_bus *bus, int phyid, int regnum, struct hclge_desc desc; int ret; - if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) + if (test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state)) return 0; hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MDIO_CONFIG, false); @@ -92,7 +92,7 @@ static int hclge_mdio_read(struct mii_bus *bus, int phyid, int regnum) struct hclge_desc desc; int ret; - if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) + if (test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state)) return 0; hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MDIO_CONFIG, true); -- 2.20.1