Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4428537pxb; Mon, 21 Feb 2022 21:19:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzX3cC0LmFawUc/OgMgsdDlsjQyNEf3VZ5C/7OJiaMP2CSb70Kpt01LXoMaxkXwRMntliVH X-Received: by 2002:a63:a80c:0:b0:374:2526:2d68 with SMTP id o12-20020a63a80c000000b0037425262d68mr8855002pgf.572.1645507156424; Mon, 21 Feb 2022 21:19:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645507156; cv=none; d=google.com; s=arc-20160816; b=fPtl4eGS9pwK8a+/FkDS3WML2eMXBzXJ4+TnvfRJ5+eTzSClMWDq0JY7Zk6cbv1niK 9sxGuTa0Sq4gI27JCr4istw6UysJV6BsAMGPnnfsvtMGKlhi5/VV/bg3zReXMjxkf0IU o4Q3C0ur3zyddQWHxnpCUSQ5JNlZl+jViVaZ9eFt/DkVegG8fgLxjRBI0djZNtqnX51P O0MksqnOQrW8IGX+rMHZIFVxhlpY2erg5I0u0U38jmZAKjFP3T/J+vMvN/FsYoxQ1Gi+ GSTwK8EfBE6W/L1Jw3H7DS7qzEyXlHWCoybnzVOSBjh3nW13RyMta07ziL9mV2/M5xOL /5ZQ== 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=+SMTOr4SsY3HMvB56vmlh0mdcmGJFQaqQIHsjNDZRm8=; b=Xo4I0ebzlyunpmHMVRNESC0ZuhLuocIZ7j0TH6n3j1I2wlKaI3vZdQ8EUAFoMThmfD WPnzUEqa2fw2bdUf5yyw66miRyQCzQukDcz0V+R/yrwPcd/fA8ha2DtWgouq6tDufyRi XIxd9sOpAR0aKsF2eVXe+/Tu0cuVJDUKL7scdy8DeRzf+8Gx1iFyy4ifw8wSvR80yArj ALv45HaygfjA0ibk+6OaSdpAaVEDPhzNIHCbvtcerynDwWvXeyLV4d+v4sv8HLsXMCWJ QSGzvs2f9wx4mr/odcfazQ2/W54laCT/N+qXFoJgDJcwC5aXqSSLH3dZO3FiqgUoAMI4 uBNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DKKnD83B; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q195si19380044pgq.607.2022.02.21.21.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:19:16 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DKKnD83B; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 469E15F7B; Mon, 21 Feb 2022 20:51:04 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347776AbiBUJNY (ORCPT + 99 others); Mon, 21 Feb 2022 04:13:24 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347077AbiBUJI7 (ORCPT ); Mon, 21 Feb 2022 04:08:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 854A025CE; Mon, 21 Feb 2022 01:01:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3ABB4B80EAC; Mon, 21 Feb 2022 09:01:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52101C340F3; Mon, 21 Feb 2022 09:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434063; bh=Psmy4Is+87qpkFidA53J/KsbNElqLG7g1/V2Pwj9mlw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DKKnD83BgV3tHWjkVGz4LR5tnGkSlnz1L42iFoqRez0unGYNpWHd7sK72GoMfWJmA B2l8RD1tnxf9Y8KnvbTp0XVIEZ4UMoa7ETJBzwlXe/sA2MKxmdg5aRP78IFyr/UQF1 ZNAoDlrZtl0mjTY1b1NoA0fkrYsu51SprgQ3tprM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc St-Amand , Harini Katakam , Nicolas Ferre , Conor Dooley , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 79/80] net: macb: Align the dma and coherent dma masks Date: Mon, 21 Feb 2022 09:49:59 +0100 Message-Id: <20220221084918.181367079@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc St-Amand [ Upstream commit 37f7860602b5b2d99fc7465f6407f403f5941988 ] Single page and coherent memory blocks can use different DMA masks when the macb accesses physical memory directly. The kernel is clever enough to allocate pages that fit into the requested address width. When using the ARM SMMU, the DMA mask must be the same for single pages and big coherent memory blocks. Otherwise the translation tables turn into one big mess. [ 74.959909] macb ff0e0000.ethernet eth0: DMA bus error: HRESP not OK [ 74.959989] arm-smmu fd800000.smmu: Unhandled context fault: fsr=0x402, iova=0x3165687460, fsynr=0x20001, cbfrsynra=0x877, cb=1 [ 75.173939] macb ff0e0000.ethernet eth0: DMA bus error: HRESP not OK [ 75.173955] arm-smmu fd800000.smmu: Unhandled context fault: fsr=0x402, iova=0x3165687460, fsynr=0x20001, cbfrsynra=0x877, cb=1 Since using the same DMA mask does not hurt direct 1:1 physical memory mappings, this commit always aligns DMA and coherent masks. Signed-off-by: Marc St-Amand Signed-off-by: Harini Katakam Acked-by: Nicolas Ferre Tested-by: Conor Dooley Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/cadence/macb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index ebd0853a6f313..0dc52cf5367e7 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4284,7 +4284,7 @@ static int macb_probe(struct platform_device *pdev) #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT if (GEM_BFEXT(DAW64, gem_readl(bp, DCFG6))) { - dma_set_mask(&pdev->dev, DMA_BIT_MASK(44)); + dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(44)); bp->hw_dma_cap |= HW_DMA_CAP_64B; } #endif -- 2.34.1