From patchwork Wed Jan 24 16:22:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 191642 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp1100309dyi; Wed, 24 Jan 2024 08:22:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRCMtqXz7o01LdcBxN62Dpszg5XY8wxlHxIsPb34LlV2yrUsdn416SD8SwLF+ENkifZegw X-Received: by 2002:a05:622a:1990:b0:42a:4559:a5eb with SMTP id u16-20020a05622a199000b0042a4559a5ebmr3739466qtc.83.1706113379551; Wed, 24 Jan 2024 08:22:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706113379; cv=pass; d=google.com; s=arc-20160816; b=OERmlxZ+VohVWuJDtIMLCbJKTP/ekbCXTEt2SDiBSN5P+0QbCoyXDYvXyD8xC/ZeGn hX2imWKWrZHYs7IHt0mxTJqMWLEPvW+Oqf561VBVHzOy4JVtASdNi/krw9ZszKVjJUh5 GR1aMDWZ0RATZIiHmYrkHgmQMsNn+Z2fcLDXvERsEKgs/askMu8EzkT36Pxj5H050G95 nm+2wzVWHsSgJQqEF/FX1fOnEXyKMW1CG28CkgVdYjRCSdRTBc5+qb2IDau1f6EmsYH7 Mf/hZ863QpVT64vffcRSamHnxQMDQDRws0HdkLCJL9XJY2/pS800FVSvUhhUgraM8CGU YtxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=total:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:to:from:date; bh=YF+EKIzep+/YJv3D47pegNUkbzXt45KSoZ5/BcUkQOY=; fh=jZO81m3g/p77tzse3lk9/c38RbUJpdSBYMeNyjPnlQQ=; b=K8YdR+cGwZMzFYL818RfwXX7yOTXvYHwddUvUT/QsmDaqNEFCL0bTVOfIwbJrE4Yrw L54crWDavKA8WjI2tjecV/wOcx5cb0FdMP8NxQHFSw+dtQ6lDvBO+VVN2UfNf/qsL/pd sSSVCDU58dRcOl4U48ljrb4nNa1QccUQDIotqUlNyzRgybJKRFrRrK3e5EBPBDaiNX5N YuiqnTgQQI1o9aIJE/Ymg4EXJORHNxQDzYddoHyyBDAXL99sbp/4Z2q7qGYQKAh9DDCb HFixJZwQWC3Doli6hhxAeduFh9Qb4vwaNQubw5eTfWJpL0TIM6pItu8NDwPjLtv2nrWq chxw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-37325-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37325-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v2-20020ac85782000000b0042a4540636fsi6009732qta.643.2024.01.24.08.22.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 08:22:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37325-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-37325-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37325-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1D2011C20E84 for ; Wed, 24 Jan 2024 16:22:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11E677E580; Wed, 24 Jan 2024 16:22:36 +0000 (UTC) Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82B9E7C094; Wed, 24 Jan 2024 16:22:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706113354; cv=none; b=FTB17m3VKTL11arhjN6EZ8uNeJZtvLqChNBn9j4jrITu+EnoVa2R5p4tlV9coAAvLmiCKDsAIlH3i0CcONaiwOEeXBi0P+1ZibjTl23MrtXHoXOus4frt8/pjEZP+p2RN/1ApMBZDU2pLee7r0epP5wOomGVH2InZbexqhVBFy8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706113354; c=relaxed/simple; bh=TFu4AyGknFyGV9bta9ypoZFYCdDwc0WAWdjNP2wbiQw=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=skIgQc8TfT7uxeB1GT0IMAuQ8Cr1TV0+2H+A/VWFvA10nroaQfc2rPQUDdHKascEtEY/UNw0ICF85/pou4RCx0nmwkE1zg15ReeAhUOTw4SjAhF242QV/rQVVu7ajuBXyZHyHEgpLOHWwPXUDMszjQnU3AJ2emc1xKDzuQY0c2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1rSg12-0004Wm-0B; Wed, 24 Jan 2024 16:22:17 +0000 Date: Wed, 24 Jan 2024 16:22:09 +0000 From: Daniel Golle To: Felix Fietkau , Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Daniel Golle , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net] net: ethernet: mtk_eth_soc: set DMA coherent mask to get PPE working Message-ID: <97e90925368b405f0974b9b15f1b7377c4a329ad.1706113251.git.daniel@makrotopia.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline total: 0 errors, 1 warnings, 0 checks, 11 lines checked X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788989542893370230 X-GMAIL-MSGID: 1788989542893370230 Set DMA coherent mask to 32-bit which makes PPE offloading engine start working on BPi-R4 which got 4 GiB of RAM. Fixes: 2d75891ebc09 ("net: ethernet: mtk_eth_soc: support 36-bit DMA addressing on MT7988") Suggested-by: Elad Yifee Signed-off-by: Daniel Golle --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index a6e91573f8dae..de123350bd46b 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -4761,7 +4761,10 @@ static int mtk_probe(struct platform_device *pdev) } if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA)) { - err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36)); + err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(36)); + if (!err) + err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); + if (err) { dev_err(&pdev->dev, "Wrong DMA config\n"); return -EINVAL;