Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp591604img; Fri, 22 Mar 2019 04:43:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzX9rZnP1aZxYHE3F/sy90OJ0LNNehLjkOqzwuTYyJ8FPm9zbiQY7CrX7+ncQpruKujhQTQ X-Received: by 2002:a63:5366:: with SMTP id t38mr500012pgl.425.1553255002346; Fri, 22 Mar 2019 04:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553255002; cv=none; d=google.com; s=arc-20160816; b=aMUBWr1bd35K7DemPID9RF7tS1urKb++64F1+0iv65xXJWmTkZFc4jr1Sefy8oiMq3 YkTCvlPYZFigB5qQV+Wncw7si9LGMF+NxQKium2ost25CYosBcRmc/dR75onqZXpDhYl 3zvSpWtAwrXrsofulwXFRQi1ONysbdkbLeirwuYwhs3vX2ihmKmCXzSdxX7bjDYh6Ubm iyDlnJggaYkBnprllZEqugSrM9zZ6SAmdwaqQMlQ0D0PnCtux+9QLkj0+D3h7VveZSke eo4qgSrKG3WuoPNGdlBE3v/Pu7wNdrw2Q0B5ymwLiwObZhDGRAg7WTn5IkgS/pwh7YiL +yhQ== 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=2AkzPsdmq1DRZzpO9OUbUn8klfx0WADADvetcskP62E=; b=EihotiQ5ZJYNFaYSvP54P8WPX27LYWPAfAtaO89I3vH4YCh4R+d0cuKakW1ih0yGKH CIWArEzV/rm+YJ09H2yoC80LbgGlaz7SwCIcA5JiFUUSRIKmIPWvHPea+baZU1QNc7zF /CEf8rJ9PNYQchXdBCysoAHJPssk//D3i/Yt2XX6jHg6502r/OMdzNg+fV9jSrOOQgft z6TBYGMzgZns4WcSU3m8+Q1WfVidBymk1laUfqNxkS7G/HvsRJ1+356+Y1KRjlXwkQlf hC/gZnd/EDI2h9ksP1civADCY3irXnJGin+ovgjVVgiBXHSH3zgydvso3RI08qIWn0ho Rv5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uHnixVWh; 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 w3si6455870pfw.94.2019.03.22.04.43.04; Fri, 22 Mar 2019 04:43:22 -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=uHnixVWh; 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 S1731334AbfCVLkz (ORCPT + 99 others); Fri, 22 Mar 2019 07:40:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:42906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731310AbfCVLkx (ORCPT ); Fri, 22 Mar 2019 07:40:53 -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 3FD48218B0; Fri, 22 Mar 2019 11:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553254852; bh=aFwyE6zYs3MjTSvV82IWx/OfdMXCThBxW4g1JUkOF1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uHnixVWhGaaxZl66QxHGT0bvzaqgxyQbUFnHu90gqHDdE+EVIKBLL+hKlDuUZ7TWe dk1wZ/GhIAPNgTYkxuAAHhn7gBvEGPgUj2MBJEgfXpMXuyEsp0jovms/K350EkWGJ4 QfavVne5MULyQuJ3B84cWJRLoILDTgVvPjZcxtqA= 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.9 031/118] net: marvell: mvneta: fix DMA debug warning Date: Fri, 22 Mar 2019 12:15:03 +0100 Message-Id: <20190322111218.357409513@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111215.873964544@linuxfoundation.org> References: <20190322111215.873964544@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.9-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 c92ffdf91065..d98b874a7238 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -2050,7 +2050,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