Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754685AbbG3Jbw (ORCPT ); Thu, 30 Jul 2015 05:31:52 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:36349 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752024AbbG3Jbu (ORCPT ); Thu, 30 Jul 2015 05:31:50 -0400 To: haibo.chen@freescale.com Cc: Ulf Hansson , linux-mmc@vger.kernel.org, Linux kernel mailing list From: Jiri Slaby Subject: [SHDCI] Heavy (thousands) DMA leaks X-Enigmail-Draft-Status: N1110 Message-ID: <55B9EF02.7040404@suse.cz> Date: Thu, 30 Jul 2015 11:31:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3146 Lines: 74 Hi, after commit 348487cb28e66b032bae1b38424d81bf5b444408 Author: Haibo Chen Date: Tue Dec 9 17:04:05 2014 +0800 mmc: sdhci: use pipeline mmc requests to improve performance I see heavy DMA leaks which result in warnings of the dma api debug code: WARNING: CPU: 0 PID: 0 at lib/dma-debug.c:509 add_dma_entry+0x138/0x150() DMA-API: exceeded 7 overlapping mappings of cacheline 0x000000000b20ec00 And mainly this one upon sdhci module removal. It is over 4000 leaked mappings during one card transfer. mmc0: card e624 removed ------------[ cut here ]------------ WARNING: CPU: 2 PID: 1263 at lib/dma-debug.c:974 dma_debug_device_change+0x158/0x1c0() pci 0000:02:00.0: DMA-API: device driver has pending DMA allocations while released from device [count=4041] One of leaked entries details: [device address=0x00000000ddff0000] [size=65536 bytes] [mapped with DMA_FROM_DEVICE] [mapped as scather-gather] Modules linked in: CPU: 2 PID: 1263 Comm: bash Tainted: G W 4.2.0-rc4 #12 Hardware name: LENOVO 23252SG/23252SG, BIOS G2ET33WW (1.13 ) 07/24/2012 ffffffff81cc5e32 ffff8800d03c3b68 ffffffff81820938 0000000000000000 ffff8800d03c3bb8 ffff8800d03c3ba8 ffffffff810b827a 0000000100260021 ffff88030e500000 0000000000000fc9 ffff88030d95aeb8 ffff88030e4ddd68 Call Trace: [] dump_stack+0x4c/0x6e [] warn_slowpath_common+0x8a/0xc0 [] warn_slowpath_fmt+0x46/0x50 [] dma_debug_device_change+0x158/0x1c0 [] notifier_call_chain+0x4d/0x80 [] __blocking_notifier_call_chain+0x4d/0x70 [] blocking_notifier_call_chain+0x16/0x20 [] __device_release_driver+0x105/0x130 [] device_release_driver+0x23/0x30 [] unbind_store+0xba/0xe0 [] ? kernfs_fop_write+0xe8/0x170 [] drv_attr_store+0x24/0x30 [] sysfs_kf_write+0x3a/0x50 [] kernfs_fop_write+0x120/0x170 [] __vfs_write+0x28/0xe0 [] ? __sb_start_write+0x49/0xe0 [] ? local_clock+0x25/0x30 [] vfs_write+0xa1/0x170 [] ? vtime_account_user+0x54/0x60 [] SyS_write+0x46/0xa0 [] ? context_tracking_user_exit+0x13/0x20 [] entry_SYSCALL_64_fastpath+0x12/0x6a ---[ end trace 398181ad32332b33 ]--- Mapped at: [] debug_dma_map_sg+0x122/0x140 [] sdhci_pre_dma_transfer+0xc3/0x1b0 [] sdhci_pre_req+0x42/0x70 [] mmc_pre_req+0x42/0x60 [] mmc_start_req+0x3e/0x400 I already fixed one symptom -- memory corruption. Could you revisit the commit once again, as there is surely at least one more bug? thanks, -- js suse labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/