Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp596830img; Fri, 22 Mar 2019 04:51:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzd2yT+2piBm4+htoSHLxcqXJpsrXOTJw0WI7G4dAjnek5Ot7Z0/6Yop9Z6N9Of4qzYQakb X-Received: by 2002:a63:e850:: with SMTP id a16mr8449558pgk.195.1553255465067; Fri, 22 Mar 2019 04:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553255465; cv=none; d=google.com; s=arc-20160816; b=szuKX8+CWeyvhXdGylmOKeYlffVtDX+h8EqkH/KpeKO1l38qA4Sh+LEgEPsO9UpxR/ XBbqVvLvxv0YU72QFhH/6i7hbtGyOuNivYRe1fdOHDBHtKBkqCgNO5d/UUCcvhRXI6be KuWIZLfxTtTgZv8WWLz0GCKXjcLT2yJU9XTGS+RIDHRFloSVYLZwPT1DXwbZRC/uFDCk /sgFrQF3gUfrNh2SPXjbvBqXZNocFRAzZ3e8eAPSzmJ1NldszqX5m8Kea6unNHnMfGEC Vy0hGKYcZcwJov2yjPvq/PUZHYYOGF/Mib7Ysxzk7WxFlJ82svTa5nQYjkiwo2LQm26l Z5uQ== 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=PqFaLYJIesv5O7jrdN9zVY4NDMJBJeXpJ+DYlsk4BHw=; b=khi14OzwpqLTES4RvkaGljyjf99Ny58/q86DZhbznuUghnU8HbbUna747d1SW3oFCe k/8GEjJBUKAW6VmFjUPCZg8GuWcANWgUnn7RvHjXo2Qgh16QoS4+XNr6WRHYcitEUJDZ tekfq9EIhQcJDjM1SuLFfJFgCj0UIZP7fbrPXuCf+Vu8oroSbCsJw9k85NOBn2UXYceW QVa4BDpTFzNJh6pTC8c5qMuuvZDB18DGpGZ7LtXiWt3nKPKIjQjzEGy4icHSs5trmpib uReOcOqxopEJaOc7PvsZuWyCZdpxonJYGn6Fu+Cthyf5TeoCyeIL/5l2cvX29pZYj0fL hwvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yxWAr8jO; 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 n1si7072940pld.251.2019.03.22.04.50.50; Fri, 22 Mar 2019 04:51:05 -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=yxWAr8jO; 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 S1732577AbfCVLuH (ORCPT + 99 others); Fri, 22 Mar 2019 07:50:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:53852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728700AbfCVLuG (ORCPT ); Fri, 22 Mar 2019 07:50:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0FD542082C; Fri, 22 Mar 2019 11:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553255405; bh=B+kr4jyJp5rpShGJ1Een3ExMRP6XvOOwtqzeOqstL/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yxWAr8jOMEo6FJ7lX35HmtDREro+GpXmLvonC3NIvzyU6yA+BXlZ8bzDQCCuObjms CWkSKcF+jbnMRp4zULNhd3Bz02I8pOWH8fM8nhPh7rKk7Tw62htn2VClfKSIVH/xAg t3ytK/3VB8Z/kZdE2p5RNyDgHKyf8oWmRdtEkssU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Russell King , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 053/183] net: marvell: mvneta: fix DMA debug warning Date: Fri, 22 Mar 2019 12:14:41 +0100 Message-Id: <20190322111245.544536109@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111241.819468003@linuxfoundation.org> References: <20190322111241.819468003@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit a8fef9ba58c9966ddb1fec916d8d8137c9d8bc89 ] Booting 4.20 on SolidRun Clearfog issues this warning with DMA API debug enabled: WARNING: CPU: 0 PID: 555 at kernel/dma/debug.c:1230 check_sync+0x514/0x5bc mvneta f1070000.ethernet: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x000000002dd7dc00] [size=240 bytes] Modules linked in: ahci mv88e6xxx dsa_core xhci_plat_hcd xhci_hcd devlink armada_thermal marvell_cesa des_generic ehci_orion phy_armada38x_comphy mcp3021 spi_orion evbug sfp mdio_i2c ip_tables x_tables CPU: 0 PID: 555 Comm: bridge-network- Not tainted 4.20.0+ #291 Hardware name: Marvell Armada 380/385 (Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x9c/0xd4) [] (dump_stack) from [] (__warn+0xf8/0x124) [] (__warn) from [] (warn_slowpath_fmt+0x38/0x48) [] (warn_slowpath_fmt) from [] (check_sync+0x514/0x5bc) [] (check_sync) from [] (debug_dma_sync_single_range_for_cpu+0x6c/0x74) [] (debug_dma_sync_single_range_for_cpu) from [] (mvneta_poll+0x298/0xf58) [] (mvneta_poll) from [] (net_rx_action+0x128/0x424) [] (net_rx_action) from [] (__do_softirq+0xf0/0x540) [] (__do_softirq) from [] (irq_exit+0x124/0x144) [] (irq_exit) from [] (__handle_domain_irq+0x58/0xb0) [] (__handle_domain_irq) from [] (gic_handle_irq+0x48/0x98) [] (gic_handle_irq) from [] (__irq_svc+0x70/0x98) ... This appears to be caused by mvneta_rx_hwbm() calling dma_sync_single_range_for_cpu() with the wrong struct device pointer, as the buffer manager device pointer is used to map and unmap the buffer. Fix this. Signed-off-by: Russell King Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/mvneta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 074a5b79d691..f76cbefeb3c7 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -2102,7 +2102,7 @@ err_drop_frame: if (unlikely(!skb)) goto err_drop_frame_ret_pool; - dma_sync_single_range_for_cpu(dev->dev.parent, + dma_sync_single_range_for_cpu(&pp->bm_priv->pdev->dev, rx_desc->buf_phys_addr, MVNETA_MH_SIZE + NET_SKB_PAD, rx_bytes, -- 2.19.1