Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2199937iof; Tue, 7 Jun 2022 23:01:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdZ7Pfij3A/HFAyrWZt+pwIRVYmIBZmWIfCHWIaO0rP06pale2yU22t7JCsPmmOUNyhZzZ X-Received: by 2002:a17:902:d48e:b0:167:5752:3b43 with SMTP id c14-20020a170902d48e00b0016757523b43mr22377180plg.52.1654668073348; Tue, 07 Jun 2022 23:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668073; cv=none; d=google.com; s=arc-20160816; b=A0FFziIynoKWKDhKedIYRUjkdCbPBO1LVhFxB3ACSFQGZszik3/M6KxlaNqBwtlNvN Guka3GCd9aVYQ8e2JyP0QuQ4l1RJI/COghZjAkl9HQPz/sfWB2n3Hbc8XiMnQTTe36KA VXDr84kytQ0wyXUPHaVP0p3Ijn4pghEn4M+cKbm2gBVYxKZ6vWk7DkNP6bz+ZEPFPZjz pOTcH9MI3LaWziff6hswYnLyFkd6uNs02g1sEfUA4+VZsvNBItBvCRO4xyw/I5TvKYxF Q/tc0N9Vqy455doOmVTOtKURAN1VKbDoUDYEFlLJ997+JTjpJ9vhciHt91GWUzsBpPK3 QrYg== 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=3yXD77LJpg+WUBUsZmnzItlFSoOXcCZO6PXCk3+Gmk0=; b=QajmQUAG5QRpXSKqNO+ZS/sIH7T+PgWPtxzcBG8seQhG+f2ybQ/pxyJ6X9hE0KRF4I 3VAZvW392V8nj4dnRMNvi4qcc5Vla02WBCyfuvqGascjsyT3oHJ/Vk58san6yC09u3k5 fQv4YehRIfY7ze7Hq/uyY3LfP18hrAPQ4Elk52klobADjQ3DfrwW8hi2USGEyGWuFiei Eas0g0Vr4eocFwOWHyKL3I2lJLN+DDL6kk0rw6n4yW2SxAhFhJXPRY1NZ2pHP/s9V+MR 2TZiP5dGnsYU0usLoCZCcpqpYUWd+1sGNovoRHtPzt6pccThGEDR0X/4plZMLyVMMbZH JcHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LqRb2mY8; 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 b13-20020a170902b60d00b0016373d14547si23252005pls.219.2022.06.07.23.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:01:13 -0700 (PDT) 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=LqRb2mY8; 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 BA379136C37; Tue, 7 Jun 2022 22:25:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238607AbiFHBLB (ORCPT + 99 others); Tue, 7 Jun 2022 21:11:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382810AbiFGVv5 (ORCPT ); Tue, 7 Jun 2022 17:51:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E11323E820; Tue, 7 Jun 2022 12:09:38 -0700 (PDT) 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 0B49FB823AF; Tue, 7 Jun 2022 19:09:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A37AC385A5; Tue, 7 Jun 2022 19:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628975; bh=VT+orIzbW0yg3j05zWzFaQ7qL2FfDI5uldUGWuWUFPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LqRb2mY85dbcEQiM6L3b+GfefJb4QfmRsdjWtAMUzCkGGmGTnofosu2PM+4xafP5O UGKp+9bUYlECplpAWi6jKJZt9MMQAie7Sv7QAOoOIEFpVJ3b0O/09jMljvZrbYX0K2 Wup+bONnV8zUF3AuHlQ1z26L/YaAD5DE14yA7aJw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ioana Ciornei , "David S. Miller" , Sasha Levin Subject: [PATCH 5.18 524/879] dpaa2-eth: use the correct software annotation field Date: Tue, 7 Jun 2022 19:00:42 +0200 Message-Id: <20220607165018.085635379@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 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=unavailable 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: Ioana Ciornei [ Upstream commit d5f4e19a85670b4e5697654f4a4e086e064f8a47 ] The incorrect software annotation field was being used, swa->sg.sgt_size instead of swa->tso.sgt_size, which meant that the SGT buffer was unmapped with a wrong size. This is also confirmed by the DMA API debug prints which showed the following: [ 38.962434] DMA-API: fsl_dpaa2_eth dpni.2: device driver frees DMA memory with different size [device address=0x0000fffffafba740] [map size=224 bytes] [unmap size=0 bytes] [ 38.980496] WARNING: CPU: 11 PID: 1131 at kernel/dma/debug.c:973 check_unmap+0x58c/0x9b0 [ 38.988586] Modules linked in: [ 38.991631] CPU: 11 PID: 1131 Comm: iperf3 Not tainted 5.18.0-rc7-00117-g59130eeb2b8f #1972 [ 38.999970] Hardware name: NXP Layerscape LX2160ARDB (DT) Fixes: 3dc709e0cd47 ("dpaa2-eth: add support for software TSO") Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index 766391310d1b..f1f140277184 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -1148,7 +1148,7 @@ static void dpaa2_eth_free_tx_fd(struct dpaa2_eth_priv *priv, dpaa2_sg_get_len(&sgt[i]), DMA_TO_DEVICE); /* Unmap the SGT buffer */ - dma_unmap_single(dev, fd_addr, swa->sg.sgt_size, + dma_unmap_single(dev, fd_addr, swa->tso.sgt_size, DMA_BIDIRECTIONAL); if (!swa->tso.is_last_fd) -- 2.35.1