Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2248435ybd; Mon, 24 Jun 2019 03:16:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMQdU04nsEuzQZg93YQjkamEz56CmW8wWzip8xhzVcqwDy035T7g0mEAcTwAgndyYJCn4h X-Received: by 2002:a63:5d61:: with SMTP id o33mr32328557pgm.114.1561371378339; Mon, 24 Jun 2019 03:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371378; cv=none; d=google.com; s=arc-20160816; b=xe7VxB0h+CwlMs8eJK19G0elaU1HqhGa1WMC1dcw9qI7xzz9srauOYSkc9JVqKz1pS 6PHhypHu9GdujlW3W0b9wYWl1g+o3AZ3SlIhe9gyDXMFEqCp2aCR1lY/bszWKs84tsz4 hiS45Iw/wAVSd5F3GkijFwSt5qim0F1YOAbsGG5ZlhW6CYUkVuYQaLpFMuvMknskqZU2 wSb8pY36u23i8xHp190qtIr73CbKYxiN+hXkWmFXLONlHAlZp9Tp1qAcvq92fq5h9jBO g3qcG/jSdPCLQMg3dUTa6sh5r4p0F5XOM8Rdil9QR3slY8/k0YpeKhE4uNfNexjhp8Qz 7VDA== 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=6d7gFNO7awRNb9WUX0x1/7UG8u0j4kjdhP96HxCo7Pg=; b=ROh7TmunCl3Qgvo3AZRFtwaVOX0e/vvh54WFwH8lRqt8WxQFu+D//7AeQwVGhTeEuT 7YLfmIE+5zhtFIID/CoNkDsLlUhrOU/dHzsi3lnuioP+fxmtOiVrCy/rvn2DoJNwbUlk FhHfRfzz+d+PxlO/GRXhlW1+vtTDbPbuZwuRIRwA9gvr1nkv71Nx4KXUAL+oGQmakGGq K0yvhr1FuKqdWSsHUX4CDVhn57hOwzkjhqUNBC0p7WydKv7QCKBtOi7cGWoG+YNgy+kB IpWWVK98A/8k+gA/mCaOgCP+Zp3S2junryxVkKt9HcINdFsXzgHfzUOBoEeHyTSZBfzW ptQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZdAZHrwj; 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 62si10507437pgc.47.2019.06.24.03.16.03; Mon, 24 Jun 2019 03:16:18 -0700 (PDT) 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=ZdAZHrwj; 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 S1730264AbfFXKPt (ORCPT + 99 others); Mon, 24 Jun 2019 06:15:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:53164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730217AbfFXKPs (ORCPT ); Mon, 24 Jun 2019 06:15:48 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (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 B71662089F; Mon, 24 Jun 2019 10:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371347; bh=OV+leDYPYsoAFltb+eKy+j49AqrEWx8bF/5aw0VA0Xk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZdAZHrwjg5mL1JHiG2VO4vAYjAhiON877F5CnhFAHAupOOgiBLjZVDyv8pZHcmNJb /XMHwjGbYj/L+rc0qAIcMYOwnH93Dc+NlVlc8CSzv/ePK02N7aWbI8P3u15AbO3YPN nVbtph72srzJMoVjs1hvtAbFGJPONbP7/q1L7bJg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Lee , Sean Wang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.1 068/121] net: ethernet: mediatek: Use NET_IP_ALIGN to judge if HW RX_2BYTE_OFFSET is enabled Date: Mon, 24 Jun 2019 17:56:40 +0800 Message-Id: <20190624092324.327735639@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092320.652599624@linuxfoundation.org> References: <20190624092320.652599624@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 [ Upstream commit 880c2d4b2fdfd580ebcd6bb7240a8027a1d34751 ] Should only enable HW RX_2BYTE_OFFSET function in the case NET_IP_ALIGN equals to 2. Signed-off-by: Mark Lee Signed-off-by: Sean Wang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 59601cb5aeee..f3f7551162a9 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1777,6 +1777,7 @@ static void mtk_poll_controller(struct net_device *dev) static int mtk_start_dma(struct mtk_eth *eth) { + u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0; int err; err = mtk_dma_init(eth); @@ -1793,7 +1794,7 @@ static int mtk_start_dma(struct mtk_eth *eth) MTK_QDMA_GLO_CFG); mtk_w32(eth, - MTK_RX_DMA_EN | MTK_RX_2B_OFFSET | + MTK_RX_DMA_EN | rx_2b_offset | MTK_RX_BT_32DWORDS | MTK_MULTI_EN, MTK_PDMA_GLO_CFG); -- 2.20.1