Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp65602pxj; Thu, 20 May 2021 04:42:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyceEkS4xnUFgRR3eCZf0ECVhKGM0CEjIKFlkRq70sAiKPRVp7uL/UBLaFHU/S3uR4TM/mV X-Received: by 2002:a17:906:5291:: with SMTP id c17mr4129466ejm.527.1621510931603; Thu, 20 May 2021 04:42:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510931; cv=none; d=google.com; s=arc-20160816; b=yZggZtHSCtMYZqZdieC91jXPCnGT6gRCJzsYvDNHc2kt0XNMulwFbdWWcX7xm6AZgZ QeENoYI77JR5clHkNqAKHJBkZiSMlRlvyc/298eQBd7AJjgfd0VNDwajvfiJHW/UORNP h3Px2pqRDDWaxZxTt9xsxuB38nkEqizchScV8uFrVVQkC/LscD2dmwsJ/xF4GMPuVN/f qTDgtTAKuyBchzmo66aUw1G5Vg4wT0mOCfgTrPZGagvSaNX5I8AHbE1pOC+G7VfpmnWr 6w+RRCrbyYtc2XVQh/8ZybASVoFuLvSLaCfn4EpgQw7cRv5OlZD5jCJV7BTwMtDEhLmI mveg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Q6AOFYlZfVOACUiiwdgqWA6T/1YIvlsV5esztuaR30g=; b=kpJhJDfRCIh8wbH4liyEqo0I/OWpPfl4XePQG6//+feLx2cDCM3ehsMyeSiPEKyNFa gCZYLL4xPte+S25Y1bU9A0E1v95kiSS6x+smpaJoJRYscNgYvpPb/HsCD5yzSgQNDCib 4NxevtHkg8qmsByk/zDjBslUB1nFvjVieNj2YTn6eWVmTw8JVCZPgDfG3iZVks0JPqRB +M+Z9yuiA/yeIDgf/AFU2p9FBpurNj172vnmiqnUnKnyFUpCj22JQ653RSUeI5Q0MLWn Mr4lUcY16BuTL9UYWydwXXgo3glO2yOVAtPF94Pd+lLjP4uhAUE4+Ly/spoWv+AYcfkM x80A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=opULxu4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si2989046ejk.38.2021.05.20.04.41.48; Thu, 20 May 2021 04:42:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=opULxu4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242267AbhETLj2 (ORCPT + 99 others); Thu, 20 May 2021 07:39:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:37946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240709AbhETLTK (ORCPT ); Thu, 20 May 2021 07:19:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E77A61D7C; Thu, 20 May 2021 10:10:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505421; bh=juhazvrhykIvwdvDqTpUC/7jj7cp0wM7mF0y57nMvqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=opULxu4j07u1pPDLSX4pAGkHkTq8nijFE3LS8LEFIzXJAMLinF3QrvEKxctOYO6t9 iv6gE9jy3RV4M4YKoKOsZXScX4TeVID9fYc3NHhTDZSXifQSxns6zhHmM79I1yfNy+ AmY5EdF8+GPAN5sMl33wLfmdo9uZDGhFD2W6bA7g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 128/190] net: davinci_emac: Fix incorrect masking of tx and rx error channel Date: Thu, 20 May 2021 11:23:12 +0200 Message-Id: <20210520092106.431825378@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit d83b8aa5207d81f9f6daec9888390f079cc5db3f ] The bit-masks used for the TXERRCH and RXERRCH (tx and rx error channels) are incorrect and always lead to a zero result. The mask values are currently the incorrect post-right shifted values, fix this by setting them to the currect values. (I double checked these against the TMS320TCI6482 data sheet, section 5.30, page 127 to ensure I had the correct mask values for the TXERRCH and RXERRCH fields in the MACSTATUS register). Addresses-Coverity: ("Operands don't affect result") Fixes: a6286ee630f6 ("net: Add TI DaVinci EMAC driver") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ti/davinci_emac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index e4c4747bdf32..e11f436b0726 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -183,11 +183,11 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1"; /* EMAC mac_status register */ #define EMAC_MACSTATUS_TXERRCODE_MASK (0xF00000) #define EMAC_MACSTATUS_TXERRCODE_SHIFT (20) -#define EMAC_MACSTATUS_TXERRCH_MASK (0x7) +#define EMAC_MACSTATUS_TXERRCH_MASK (0x70000) #define EMAC_MACSTATUS_TXERRCH_SHIFT (16) #define EMAC_MACSTATUS_RXERRCODE_MASK (0xF000) #define EMAC_MACSTATUS_RXERRCODE_SHIFT (12) -#define EMAC_MACSTATUS_RXERRCH_MASK (0x7) +#define EMAC_MACSTATUS_RXERRCH_MASK (0x700) #define EMAC_MACSTATUS_RXERRCH_SHIFT (8) /* EMAC RX register masks */ -- 2.30.2