Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp738431ybc; Sat, 16 Nov 2019 07:51:13 -0800 (PST) X-Google-Smtp-Source: APXvYqyk3z79lVG1SgyjZzntIbTBT+3LOz0EqVjYu9LwE0fWErGuUEIooN5qN3YkLADTsigZP+2Y X-Received: by 2002:a17:906:742:: with SMTP id z2mr10952174ejb.32.1573919473851; Sat, 16 Nov 2019 07:51:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573919473; cv=none; d=google.com; s=arc-20160816; b=LgYU+yrDSO5yFzvkb+57L541SHLzLZfA5ZX3FRbNqnpXmHn0TXWB7SWcEVcRAnAp/D 5zI7IEhZj6DjUlhSG6/L0sLj2l7np6uvtG0yjCj3TauqBnFJqHKU8vuTWGBkZGd8Bw5/ +0ftQNzgSJGBkLinSc+GPyvXYvqwFRmb9QvEHsiByorLfFyrT/hJ0nnTPWW6xiyMQKw/ M3UlaXB7xPv2lhCTQvZ1DQhL4Dq8od37O0qwODw+Oit+368qBRZkUiKvomHe1sl03UNi exdv+DH8gdqqnZNcfynniy+Hm2EWZWjNrWbsmXU7Wf6wlrAOK9SB6Vo6OT87jochxCpp D1Uw== 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 :dkim-signature; bh=DpNVElCrVgoWmlNCw3dlLNOMqBGvoAHxbd0M0wawuho=; b=mgdU5ygv7oYju5PSCH2qX1xGfgOp/yv7+RNY3e425o3CaV2vOpU73WUsIX9S0LUZvv XbJPTK0STY/lRAlTvWqX1h4AFQ90TEP+VE/OiBBisiirLFU9WMz2H3XPvc5IXVEE2qD6 XlmUpkjAJ9eNkMsK7bSZRueCv2BGWBsT6jl4Dytc2Tk5m2CeZQHLwXrtldtijPHcdNUE S1sNWAJo4CJq6uqj4XjniPqZlqfz0pmG2xMrzPIPlUdnKeJ09kQ5P0Iq5KDnZmx8acRG lknf/yLOjWkQuX3XfVoU8mvQ0GA7xqbbf0kVseDJaM6IMUO9d81LIIkEKTWXyxAiy9OF EzUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0WkOjB+F; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si9370227edl.273.2019.11.16.07.50.49; Sat, 16 Nov 2019 07:51:13 -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=0WkOjB+F; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729413AbfKPPqa (ORCPT + 99 others); Sat, 16 Nov 2019 10:46:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:52184 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729277AbfKPPqE (ORCPT ); Sat, 16 Nov 2019 10:46:04 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C3DCC20833; Sat, 16 Nov 2019 15:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919164; bh=0ptIyz2rwTGU2srGHJGqVEpxkJkoXMIW8fkoSVCQ1YI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0WkOjB+FkjbZcSnJuSCV3ZaylgPrPkD6cbvzVyPPzUZv1IcS+zxsGK+ejVu07MLxA i286l6d4B4Jo5e1iGVPfpJ4mNfv0bhcZa1iYcbVCEsC19TUtAmU0wx+3uR/fKE9wu4 QiNNNBUsF2zKocpTog1pVPlOcNOTcFn7yTkWezdI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Huazhong Tan , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 171/237] net: hns3: bugfix for hclge_mdio_write and hclge_mdio_read Date: Sat, 16 Nov 2019 10:40:06 -0500 Message-Id: <20191116154113.7417-171-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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