Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752764AbbHGLGY (ORCPT ); Fri, 7 Aug 2015 07:06:24 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:35408 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869AbbHGLF4 (ORCPT ); Fri, 7 Aug 2015 07:05:56 -0400 Subject: Re: [PATCH] mmc: sdhci: fix dma memory leak in sdhci_pre_req() To: Haibo Chen , ulf.hansson@linaro.org References: <1438939790-28310-1-git-send-email-haibo.chen@freescale.com> Cc: adrian.hunter@intel.com, aisheng.dong@freescale.com, shawn.guo@linaro.org, stable@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org From: Jiri Slaby Message-ID: <55C49111.9080505@suse.cz> Date: Fri, 7 Aug 2015 13:05:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1438939790-28310-1-git-send-email-haibo.chen@freescale.com> 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: 1250 Lines: 33 On 08/07/2015, 11:29 AM, Haibo Chen wrote: > Currently one mrq->data maybe execute dma_map_sg() twice > when mmc subsystem prepare over one new request, and the > following log show up: > sdhci[sdhci_pre_dma_transfer] invalid cookie: 24, next-cookie 25 > > In this condition, mrq->date map a dma-memory(1) in sdhci_pre_req > for the first time, and map another dma-memory(2) in sdhci_prepare_data > for the second time. But driver only unmap the dma-memory(2), and > dma-memory(1) never unmapped, which cause the dma memory leak issue. > > This patch use another method to map the dma memory for the mrq->data > which can fix this dma memory leak issue. > > Fixes: commit 348487cb28e66b0 ("mmc: sdhci: use pipeline mmc requests to improve performance") > Cc: stable@vger.kernel.org # 4.0+ > Reported-by: Jiri Slaby Reported-and-tested-by: Jiri Slaby I also added the mentioned WARN_ON in place and it never triggerred. (As I expected...) 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/