Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp547493pxj; Thu, 20 May 2021 15:55:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFuSmr1rNkw1Lq6yzIV04eCddgwGlihxb1OJjCkYRbP6Flt6b0ChIGadgIzKfccbCXbqcc X-Received: by 2002:aa7:d94f:: with SMTP id l15mr7742174eds.235.1621551353381; Thu, 20 May 2021 15:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621551353; cv=none; d=google.com; s=arc-20160816; b=WMmcNffA2/c15cEExo+e4qtPeVn6A28hhZO+5cQLf3zSv0hCHUpI+NzPR/RDHTJwZv W2NvogPTw20Jf+Pu3LEyBrdzVn4vFvOTeVQ3JwMCiZcdKGvV34qux7mPXqbnPbeZQPBx 57oreU1ZNrXsThB6VBtJwkE/OHKpDR2MSZoxDEnYLlHTeknq7NO5KKpaEnNgHYbTpnmp xhRq8Vl30T0YDzhVdCco8UHfiaU3O0zrdlTnpri93QvUasQB6A2ANLKYCJurZKk9zvwv wiRaxEsCQcu+J1lvWaG48P05BvNxKowYpZvUGf+5vOx1PEB5FQyB/rt27OvqshIksbuH u9Rw== 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=iJ3NtSJN+Mgx2ODkdwdPe59+W+hJ/M8zovTVaJKKBqA=; b=pTzkJXAV55vWgEmwtuF8fw+GzAxin+9JaoKGMUAFtr1BxqdqKYBFktNAMzq5Ocl75e 5pgutsX6I7GKKv97S4QYlE80VWLkhqEM1oWp20utNPB1Zovj46jN5UkYGbNnXiga2E5X czokUc52KrkObiqsjhXcYODDOtiEb2U3e11R/xRX0uJtg/KSeuJreS3DvGF+Oa9p+swj WHCl+TGe7Oq+OUWLHcVwkaRMcpR6Y0RWSx+VV8M4S7MJzKT/E2mkRJ0u2nyqBMSGPhDe lCt9TEO7mOqe9FDqR2u/KnYleXowCdZabyhzMkzJvFHe0l73JzKvLV5i5stRKLOyG2Q3 pzuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FZvDIx2v; 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 o6si4044149edi.504.2021.05.20.15.55.29; Thu, 20 May 2021 15:55:53 -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=FZvDIx2v; 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 S240718AbhETLTL (ORCPT + 99 others); Thu, 20 May 2021 07:19:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:57506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239317AbhETK6w (ORCPT ); Thu, 20 May 2021 06:58:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 912D161919; Thu, 20 May 2021 10:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504961; bh=nr0zYTv8LM9PUJavyoKcbBHyCg6isjtmGM8GDhkFACk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FZvDIx2v1mpb5QwYRDW7saaRLNWIRnRDndeB5/ViBfpMpB72z950wos/2sl7XxLJN nnqCKrTzaUla1zJ+W+7fUZ45x72xc6+cG0f/ZFceKQpQS6HIgVb+8c1EmuvzrfcEmT PGAYHIc2ZXqdD6DpLNezeIzdBIUXJ9sEGdXg6wpI= 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.9 160/240] net: davinci_emac: Fix incorrect masking of tx and rx error channel Date: Thu, 20 May 2021 11:22:32 +0200 Message-Id: <20210520092114.023559146@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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 413cf14dbacd..8b7596fef42a 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