Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4630790pxj; Wed, 12 May 2021 09:37:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvcUz1ogSRqYkmvqN2KP/2KcYVFpoTRszrhIDCZYbcD0TihUtZLO1MSlkqeKyOlQ87kmc7 X-Received: by 2002:aa7:c34b:: with SMTP id j11mr45835804edr.188.1620837433415; Wed, 12 May 2021 09:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837433; cv=none; d=google.com; s=arc-20160816; b=dLEI1WlKyTuPRKh+YuedHAUncf86rxfpP2LQfz41IZMyLkF+GP2VitwWFZHwXHxSGM TVe//zDKE5JQG7PYH88z5lVoJy4JQZyV4wDZUxDcut+9H+kLfWNI3NK20XyrkjOcMoH4 t06AaWJI0TopBPKgt4WBPjhMyqCuIR04P9vL703Xf18qhaJDqiH7I03Lz5mAQg0xgFNU GZV8QAVKMBJkbcTO8uZGoEzZLrKQETHD9gAg4ChVKvgk5S/xffyfj4QTKcwD0HGlOPbT TnX4dkmyyqu9N8MH8HcKskMBjHOEOFfCFSLIdTLQtGOUVPCBU1sKIyDVkYrrz9FCWeO9 kU6g== 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=uQJSDysVGP+7cUnAYScFaCAa+v5oPe51ps4DAOCE9QA=; b=Do2MDdseIFzC45dsVrJ6MrL3iMIJHqAj6OW3UG9XYkbVVDlhhM4w0TRPEOq6QgH/Jj 2yv+XZSJ1veYuf3/bHzX35/7I59sj/Z/RdaSi6n+Si35gp8PQ/3NM+n5ghB+rs+MS8uw DcdOLXNtVMScYVKB0AoHxcixip8Gzj/K14I311oV8S+9pGpYSjX7J+zbiprMTiFtyclw BqvfTfyU8hZU1KIWe953Rvnrs7b996BaRT2hihBLh7hWMjUR1RjOk7bH16QtZupYkb/y mSzcgOf1Z4M+F6YTYiR1NBFpdsssrcpzoI15+hEOsRZNh8EtfvZNQKVxAqHdkFaIPMoi 13NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n5tiEn7T; 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 cq3si168147edb.257.2021.05.12.09.36.47; Wed, 12 May 2021 09:37:13 -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=n5tiEn7T; 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 S241424AbhELQeZ (ORCPT + 99 others); Wed, 12 May 2021 12:34:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:40250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235113AbhELPm1 (ORCPT ); Wed, 12 May 2021 11:42:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 68FDA61480; Wed, 12 May 2021 15:22:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832922; bh=0mvuS6A5KBQSa4AckEgc5G1V/9ZhHey/tSU60/VdNLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n5tiEn7TEgDogAVyxHZWA0D+qXJGQr7eQMz+piP7f7n6h199Oa5WExdp0ggokPCQn 9MyNSCwPY+q6IC+eKz2Tsw8NKV7/7H0orsyZ9DAlyyjzdFbyvv/HYPATao/YClywUM vt2LvCzLIwgOl+Mhq3K9IbGjksYrTLR35P3tuzZg= 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 5.10 476/530] net: davinci_emac: Fix incorrect masking of tx and rx error channel Date: Wed, 12 May 2021 16:49:46 +0200 Message-Id: <20210512144835.404069626@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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 c7031e1960d4..03055c96f076 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -169,11 +169,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