Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4823590ybl; Wed, 22 Jan 2020 05:25:53 -0800 (PST) X-Google-Smtp-Source: APXvYqwXYX2yxvaJ677VKZQQV+3XQpIk2SdPMRfAcTrxh5AYjXoLNvzZOONSeVfjUydX/UVmMJBi X-Received: by 2002:a05:6830:10c4:: with SMTP id z4mr7518926oto.120.1579699553692; Wed, 22 Jan 2020 05:25:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699553; cv=none; d=google.com; s=arc-20160816; b=FHxyd9yDwLHLIGMfB+hgBr8zuQbv/rIAaavDYfiRO5IPYu8lRsVRn18tnw5j6cbN9U 8BgNB1Rop1op4ukCa4dUcxKTrZTjxBg82mtNaT5rea97Wa4uXnMSp7txluiZee9+nZsl jBGSF6q27DVZ6cQgPnblcMMBOdWvRyF43phvGmEDQFM3h+1OI6VXBwllnzSPO9v8SEgp Rv9IqN4rulx7x712UOE//ClEZJGrZg8/AFiv8WxGqbcpNXCSr0hBzKixZKhFtzRi889O LcyjKIzueZWcVCH0MBRKF59F4HR869/Uz0icz6cHvH2PpcW3iCNW2c8cKY5GaMkXvy0M RWnw== 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=H2YWCA6nmHzeWbutgsCu2EDSi8dt/+vcx51A+CHIItA=; b=y1lzRLV/3DGBrntW6qdRh18dcfeENeTqu01uRThGBPIT8PFN97II0Cr2bEWgP887Vz TA9xALwpk6/nYmK9vHjHud9fFWCJDD5/V8coBeNAQjQ/xqzyrh/eMplAX6kk+o2+SNGd MdpRRAJNXbShD+c7E/wxDKU0Krryc6n/jhJrrB9LrPoI0pnHkA329YXnS35k+kjZcZ3f iTfPrldwM2w5Q0yd0NQc63Y+DW4HOO6NSEcDmApnQFXPQAowN6r8ho6rE8sdoNTybEiI buAbKwJ3dQ1t89Ne85A+P3DICYLFW7lUz93MfHOmvMFnuG99MEEBoZjWSHXjqVNpJoKj m3Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O9+xuVqZ; 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 o8si13230127oti.47.2020.01.22.05.25.41; Wed, 22 Jan 2020 05:25:53 -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=O9+xuVqZ; 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 S1730507AbgAVNYq (ORCPT + 99 others); Wed, 22 Jan 2020 08:24:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:43990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730109AbgAVNYo (ORCPT ); Wed, 22 Jan 2020 08:24:44 -0500 Received: from localhost (unknown [84.241.205.26]) (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 773E0205F4; Wed, 22 Jan 2020 13:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699484; bh=Wi8eRHhKo+a2NLw+JYSoyvFpgiNBdImEdPZVPKuUjcY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O9+xuVqZgX5QNXpwwPBHBniWXNecJJZwWjPhe2o3diZojiReIvTEPawuJI9hN4hDq pmLRdWf8GQJZ0mZEcF6hA5xk+cu/Kwvlgx6Zppbc2jEjC+2Benf6ESz19LQ8le49xb nPPs0JIkoag5wdOFyYik3wYlSOfn2cpDDHGRy2b8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergei Shtylyov , "David S. Miller" Subject: [PATCH 5.4 160/222] sh_eth: check sh_eth_cpu_data::dual_port when dumping registers Date: Wed, 22 Jan 2020 10:29:06 +0100 Message-Id: <20200122092845.171712966@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@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: Sergei Shtylyov commit 3249b1e442a1be1a6b9f1026785b519d1443f807 upstream. When adding the sh_eth_cpu_data::dual_port flag I forgot to add the flag checks to __sh_eth_get_regs(), causing the non-existing TSU registers to be dumped by 'ethtool' on the single port Ether controllers having TSU... Fixes: a94cf2a614f8 ("sh_eth: fix TSU init on SH7734/R8A7740") Signed-off-by: Sergei Shtylyov Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/renesas/sh_eth.c | 38 ++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 17 deletions(-) --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -2204,24 +2204,28 @@ static size_t __sh_eth_get_regs(struct n if (cd->tsu) { add_tsu_reg(ARSTR); add_tsu_reg(TSU_CTRST); - add_tsu_reg(TSU_FWEN0); - add_tsu_reg(TSU_FWEN1); - add_tsu_reg(TSU_FCM); - add_tsu_reg(TSU_BSYSL0); - add_tsu_reg(TSU_BSYSL1); - add_tsu_reg(TSU_PRISL0); - add_tsu_reg(TSU_PRISL1); - add_tsu_reg(TSU_FWSL0); - add_tsu_reg(TSU_FWSL1); + if (cd->dual_port) { + add_tsu_reg(TSU_FWEN0); + add_tsu_reg(TSU_FWEN1); + add_tsu_reg(TSU_FCM); + add_tsu_reg(TSU_BSYSL0); + add_tsu_reg(TSU_BSYSL1); + add_tsu_reg(TSU_PRISL0); + add_tsu_reg(TSU_PRISL1); + add_tsu_reg(TSU_FWSL0); + add_tsu_reg(TSU_FWSL1); + } add_tsu_reg(TSU_FWSLC); - add_tsu_reg(TSU_QTAGM0); - add_tsu_reg(TSU_QTAGM1); - add_tsu_reg(TSU_FWSR); - add_tsu_reg(TSU_FWINMK); - add_tsu_reg(TSU_ADQT0); - add_tsu_reg(TSU_ADQT1); - add_tsu_reg(TSU_VTAG0); - add_tsu_reg(TSU_VTAG1); + if (cd->dual_port) { + add_tsu_reg(TSU_QTAGM0); + add_tsu_reg(TSU_QTAGM1); + add_tsu_reg(TSU_FWSR); + add_tsu_reg(TSU_FWINMK); + add_tsu_reg(TSU_ADQT0); + add_tsu_reg(TSU_ADQT1); + add_tsu_reg(TSU_VTAG0); + add_tsu_reg(TSU_VTAG1); + } add_tsu_reg(TSU_ADSBSY); add_tsu_reg(TSU_TEN); add_tsu_reg(TSU_POST1);