Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp347666pxj; Thu, 20 May 2021 10:40:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrzPC9oUDLH6wxDsI87nQujJqSb6Nd9Lcq05ZEl2RnlEp6KZqfUYf6TvTRjjdVS83MDdl3 X-Received: by 2002:a05:6402:5211:: with SMTP id s17mr6375393edd.352.1621532419951; Thu, 20 May 2021 10:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621532419; cv=none; d=google.com; s=arc-20160816; b=quVSV2gyrXgZeq9V3WNSkAL9+VZI/nMsvSo+EsBpCsU/GWNkzfcNdUrCk11JLfnM1V l9LNLUWapBiaazJ0H1iB0fUAcGw8ZZ7FOj36FmlbRVmJbO275uPY+JUPI0q6Y600g4+3 RLwnv8qIyeAwNzbc282/k7pl2Wq8hnlcm1+4BTlXKwb1gYDfjO9i2GIZH3otoUaoCaGY pUOYYMCQXKf/xWJYkbMKFn2aYxjwMwaRtb7bu4IKbgKSc1SG+39FBsdSVN35pnPoDKTt TeB1IelaFPdax2+j5x5470feqmxJrjV5G/i7wKav+GrHgYYjypjbBZd+IN128GrpKe6r bkAA== 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=crDciS0dwPXEYbtHhEJTTA96c8HlpiZM/cN0cuPvAds=; b=VNyVkNUK2kKVDiJ/l6MJ7bVA+5FxbsIdvWZnnCI9EXkHTpifSo7f7SnXMRlZ69QNav S1A6yOt6G9SsV5HilRgsOTQbWVET5DV21gEIazF6yOEQ5Kar61eXezCPBEf2/T9Pue16 xra0D5k2VInF+alsEJf4vOOFh4OLo+QqIkw2ea+pG9ySehr8ZmobHnrmaIjZf9B+mDC/ mU7RhVMuuhnjEjZSUCh4h7F8Uq7Iuwdn8VrdW6xMiL66IrVYZQNc2LEB9d69UfBFiwcr fQCxP0a0TBkbdTX8PhTQdPCIp0JQSHXvzTeXWLW4HV38ncUZIpfgAeYYARcs5irHTq3N Vx2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1vThR1N7; 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 bl4si244401ejb.17.2021.05.20.10.39.56; Thu, 20 May 2021 10:40:19 -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=1vThR1N7; 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 S235025AbhETKHf (ORCPT + 99 others); Thu, 20 May 2021 06:07:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:37158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235040AbhETKBv (ORCPT ); Thu, 20 May 2021 06:01:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 538806141F; Thu, 20 May 2021 09:39:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503570; bh=FBSJL/XyQp6/6xaOx6WynsWLHByWX1K8k9Dxi6yvriY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1vThR1N7lpg0NZ9ptw6AOcmB5knoUWkJhHz16HXnVNi4P89JGJ8zV51uUnxyInXDI jh3TfcEBwY3tDVi6l3rRwhcYNi2fANHXNocewZxngdhzm7Cs51O+/e6b82LxArIByd G4t4cavAWygcawSYIBJ8urw2tBbi5+VluDO35+6M= 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.19 281/425] net: davinci_emac: Fix incorrect masking of tx and rx error channel Date: Thu, 20 May 2021 11:20:50 +0200 Message-Id: <20210520092140.681346288@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 f270beebb428..9bb84d83afc1 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