Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4431257pxb; Mon, 21 Feb 2022 21:24:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVQ6PgFU4jPH63ENbOOQL97hbRd5Baw65YpsTlsjI1ChVb53g+Xf0vn9K1Vi61moEh9QJ7 X-Received: by 2002:a17:90a:1d0:b0:1bc:73ac:6e3c with SMTP id 16-20020a17090a01d000b001bc73ac6e3cmr1195842pjd.204.1645507469820; Mon, 21 Feb 2022 21:24:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645507469; cv=none; d=google.com; s=arc-20160816; b=lhgL9mzyWbg5UQi8IFwM5iIDHDtC7v24uUqQQq3MtS4SVw6RaCCYQrC4vMJ1Ay8h5P ohNhjs845QISfdnM/PLyXcBJJ+mGNANm6JILy7a9TDK7K2MECj6GKdmEL67yMS7+B73a NDyxJgM79NMKu9ncZQ2bco7ODto1/3o7po+XobnGWSjlOYu87NsAGCAS0HwgZvpLPnqh qi5P0eTPCy85ATCtcCJ/oQDQfckh6jXED7JHonPJmACYZC4ofKXkZhOVuJPyu6n+t23o iTb6i8HkEuHy7pdseyCkmY9tCYWQwnx4eqp+Gjk/gOS4pWTZvDZYG/cBAB30P4u0SiC+ s17A== 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=0Q1O4S+wp87V/LxeVKP3tHlhUnC3jlMGt3SExgT5tMk=; b=lam7lI8E6JLcPRLTXUQIEgVL+sTNcwhCIzg8r0XtcizOerLXABhklwpzVctOAnGZe5 w6GVdUOIpdAMmVU0QYx8GMVIj3oR6oz2G1U3M/q7Kv/1EmY+BluSlfwVRRfeSZiXSi/e cWpBxbQnb6Vsm2+T0x9k0ofyyfsnpj2XoCtvWTuO7LccYiAVOQ1eE0bEWYvx40Z1o78D wLX3leSP8twQKjd7myD86ogCFimeQy8O7z0lUn6lvN2+azdUd5Qo5zRcMk/ql9d8iESm hLZ/nY5MLHnL+6tPIFH96mzT6SnYRXIbKzXlELxPjXYhLo12vRO8dlH+o9mjRsHJmk0Q YG2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YOtjTu0G; 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 74si13043913pgg.749.2022.02.21.21.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:24:29 -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=YOtjTu0G; 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 AA3AD1029C3; Mon, 21 Feb 2022 20:55:04 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351703AbiBUJq0 (ORCPT + 99 others); Mon, 21 Feb 2022 04:46:26 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:48576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351325AbiBUJg7 (ORCPT ); Mon, 21 Feb 2022 04:36:59 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F22D2DD6F; Mon, 21 Feb 2022 01:15:38 -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 sin.source.kernel.org (Postfix) with ESMTPS id 3BE91CE0E76; Mon, 21 Feb 2022 09:15:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 219D3C340E9; Mon, 21 Feb 2022 09:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434910; bh=QX9P9b6jKNwVb+IFyUDJF/Xx6Le72wsrSkqWivmyQJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YOtjTu0GBqz8E6z3CMPIxagdVAZYkY7kdkFcCePrqllwy0RPiGNNfygpwWhC3H+yu AgGeRPaFGVGFaizm46t2alCJbHGciG5QbVLofNky7qCBjh0qQPHsGVped96pepLnq5 QcwtUcnGfzKFXMvrmiyMaCd7azn3pmzLNBmGxaEc= 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.15 174/196] net: macb: Align the dma and coherent dma masks Date: Mon, 21 Feb 2022 09:50:06 +0100 Message-Id: <20220221084936.779910220@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084930.872957717@linuxfoundation.org> References: <20220221084930.872957717@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 d13fb1d318215..d71c11a6282ec 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4739,7 +4739,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