Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752799AbbGaG4s (ORCPT ); Fri, 31 Jul 2015 02:56:48 -0400 Received: from mail-bn1on0118.outbound.protection.outlook.com ([157.56.110.118]:7657 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751535AbbGaG4q convert rfc822-to-8bit (ORCPT ); Fri, 31 Jul 2015 02:56:46 -0400 From: Chen Bough To: Jiri Slaby CC: Ulf Hansson , "linux-mmc@vger.kernel.org" , Linux kernel mailing list Subject: RE: [SHDCI] Heavy (thousands) DMA leaks Thread-Topic: [SHDCI] Heavy (thousands) DMA leaks Thread-Index: AQHQyqqR5WQwDKgF90uqPM+msnFdIp31Jk/A Date: Fri, 31 Jul 2015 06:56:42 +0000 Message-ID: References: <55B9EF02.7040404@suse.cz> In-Reply-To: <55B9EF02.7040404@suse.cz> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: suse.cz; dkim=none (message not signed) header.d=none; x-originating-ip: [192.158.241.86] x-microsoft-exchange-diagnostics: 1;BY1PR03MB1386;5:kDX7DoveGOZmzNJFPQJfimqfuYWkaNpk/uzsNAc3KOqffN3E0iiFkrbpPq+Cwb9X0jVS+f0+qZtK8VwW/bj0juDYjhftCCZ7f7RLmjwkZoxznVPFVwydo3dK9wFxQJhWJiOU4v9SRTUaOi1WWExIJw==;24:yvY//APumQ5hllMdrJpGBdsEmeDk4+++kiFgItMqzKyta8FkwCi1JiyiQNylzglGcSV7nPFnzPT2Ub0PjYA/KyFe4u6296ADRyy7ozIb89A=;20:fH9FpLMJFvzcLNeBDVPuyU6XyPkPl2rTqafFxV5/2l2DQ+446y6MDSPvT7Z2kkmmQY4EzvzOuWAlDbgclogbNg== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1386;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1468; by1pr03mb1386: X-MS-Exchange-Organization-RulesExecuted x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BY1PR03MB1386;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1386; x-forefront-prvs: 0654257CF5 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(479174004)(13464003)(77156002)(62966003)(19580395003)(54356999)(46102003)(50986999)(87936001)(5003600100002)(76576001)(99286002)(110136002)(33656002)(122556002)(74316001)(92566002)(5001960100002)(76176999)(102836002)(2656002)(2950100001)(86362001)(19580405001)(66066001)(40100003)(106116001)(189998001)(77096005)(5002640100001)(2900100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1386;H:BY1PR03MB1388.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2015 06:56:42.7171 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1386 X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1468;2:BDE++1akEehfyUwSWOgxuV3M1TRViHH1uwDnBDZptAe2UnnK5TarDcXsgyaUF7UDI1nE8IquaIXIdvUCqOagoxGOXsGXfl4Tw6svokF53UOm9q40zsBLEE5vav4/Nf9zLzvbjKSVgyl+OvbJGCNwcsugSLHdRRwNSKLH6FeQLzM=;3:KhvtKdAgCxpgpggSx7A+AtLnyx4X+PXmqLFEgKWtxbtCOY5XCijr2hx7wgy9CBboudn3Q47Ytm8M7SHC+XVkV7PMVrttgQ6+LJ5GCinyOsbwp4cJ3TgBeQcnjwIGN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vIYDFIqyu BY1PR03MB1468: X-MS-Exchange-Organization-RulesExecuted X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3621 Lines: 86 Hi Jiri, I will check this issue ASAP, thanks for report this! Best Regards Haibo Chen > -----Original Message----- > From: Jiri Slaby [mailto:jslaby@suse.cz] > Sent: Thursday, July 30, 2015 5:32 PM > To: Chen Haibo-B51421 > Cc: Ulf Hansson; linux-mmc@vger.kernel.org; Linux kernel mailing list > Subject: [SHDCI] Heavy (thousands) DMA leaks > > 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/