Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3230589imc; Wed, 13 Mar 2019 12:12:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyu/lh3PoOofD0feFByYeamoY+Utj7uIccHQ+MGvph5eyMhPswlMeZaakVE3DhO5pdDf3zf X-Received: by 2002:a63:d854:: with SMTP id k20mr916138pgj.107.1552504358756; Wed, 13 Mar 2019 12:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552504358; cv=none; d=google.com; s=arc-20160816; b=HteZIgiaP1Jbs+TKb76wCA/B7Hfy6uLo3yatKXbr2TzcwYMj82/MIrQbFUGFq7UnIn x/WWg740ax5iUU+pL50P8GJ99cC++Q8ANYn9mLXqWmWQ8ulTwoUOHl29dJelBQQrSCTj Z0wl1YycZsCZihRXmUnlYkUqQpGJI35BPrRF/2YVbc8Aju86bEmFOXu/0US7qX+eWdxe p6/jWPANlsUir1J7YYf3pWPcDxryyAoG4npsmD/qi02pvEVKAdsd5Wti15zBiCJf+QTF q8kmSw+D8BPgKLz2ALDmvfcfV7d9jnNn7+BGDiILo3dlRW83ZL2Gjh6YmyzFN/aGu5tp PMqg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xegvmFKi6zIg7UvwZux54RwnVKkQnMokix9oDnmD8rA=; b=PQafvBQxOU6lGmSv3ck+2RfG5W6QrWjQ9MC6xyxd7RZP4zAxaOhGhlmoCgd6I6c2o7 +39JvdxMqH4ZB85r2gDb0DiJEnBQLIWLoPf1kSVPGheZ9mzhgJqyi9/wOFD2Zfx8owyX cr1AyCfMsvsrwbiyqtonmf72LSpynpST75y7G71aNbFbaladhnnGUeSGgLS5L0TbXKtC e1ptFQsXDvqJx2DiZZ5H5W8feXg3AnjZ2UDsHNsHtffmbeaUFnVzL5nSddNN4KWJmvNO KVoLZ3M1Hm0dgJJZy1PuUKL+w4XlaXpSjYRuYbVk5cj3YSXhpuv2+YMJI0yMF3eREstf d88w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=witSWkmG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q14si11401516pls.204.2019.03.13.12.12.23; Wed, 13 Mar 2019 12:12:38 -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=witSWkmG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727518AbfCMTLg (ORCPT + 99 others); Wed, 13 Mar 2019 15:11:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:42098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbfCMTLc (ORCPT ); Wed, 13 Mar 2019 15:11:32 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D7E3721855; Wed, 13 Mar 2019 19:11:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552504291; bh=zj0IyhfXSFQ4GA6SIDlaRCo1ldpq3ns5AjhM8nul7mU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=witSWkmG8CibGexarurRlg4NpdbWt4Gp8ocu5xASm6wdSTrIWA6O2KYj/G5gtD88E X6YYtV4ltIE8aEVDDE3DqbZWcuSWm3rQpiVxAL7yKYU21IOZNotaG4+ZxBdGtxwpEK UF2IcJ8k12cvXKR2Il8YrOPZfEK9A7GISkLWcIq0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Russell King , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.20 33/60] net: marvell: mvneta: fix DMA debug warning Date: Wed, 13 Mar 2019 15:09:54 -0400 Message-Id: <20190313191021.158171-33-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190313191021.158171-1-sashal@kernel.org> References: <20190313191021.158171-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Russell King [ 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 61b23497f836..b7218dd7b4b6 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -2146,7 +2146,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