From patchwork Wed Oct 8 11:25:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 38470 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D546E20447 for ; Wed, 8 Oct 2014 11:25:36 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id b15sf3320485eek.8 for ; Wed, 08 Oct 2014 04:25:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=5sVYdoXx5C25qlN3EkwMJqJriNrTzgKvYxbPyy15TyM=; b=hVmqKGLSj6oz5/D8+/6qtLqSj7BpAqmejNEMJUs4rUcDAb44Pr5pNaBtXE1pIISOiE qFF24xT3WNqZcyXDJ21x9f2CbitYM9q032cpIcbJwVWjkNs4+f5ZiSqYwEkBLYGHK6M0 emFV/pYmz4pA6d80Z11l60GQngKvuLUDXPjJpd0l74fhAqlwPz176Mx5iiTAS3BA9rin 7CFw0UK5rDPrCayWTuhBkxezingYnPaarRab+L5gZmq+K/mrJqqnEj1BsFUVNBZhocy/ RPn5/f6Eabwau/XzITc40iQ2mGu3Pr2I2lpL2VaKn+UpIGm9XRgD0VaEreDr85aFC94r uLPA== X-Gm-Message-State: ALoCoQlUPAuRzXEZasiqmTS4ZEDh9oYyio3ex85XgsOOdiCqj8D3tTJh7el2Xw6nNQkh1F9hfBjC X-Received: by 10.112.168.225 with SMTP id zz1mr404106lbb.8.1412767535995; Wed, 08 Oct 2014 04:25:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.230 with SMTP id m6ls4097laa.89.gmail; Wed, 08 Oct 2014 04:25:35 -0700 (PDT) X-Received: by 10.152.44.165 with SMTP id f5mr10767905lam.89.1412767535680; Wed, 08 Oct 2014 04:25:35 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx.google.com with ESMTPS id t8si32565297laa.112.2014.10.08.04.25.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Oct 2014 04:25:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id z12so7897970lbi.2 for ; Wed, 08 Oct 2014 04:25:35 -0700 (PDT) X-Received: by 10.152.19.195 with SMTP id h3mr10790309lae.71.1412767535553; Wed, 08 Oct 2014 04:25:35 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp43738lbz; Wed, 8 Oct 2014 04:25:34 -0700 (PDT) X-Received: by 10.66.100.130 with SMTP id ey2mr2253046pab.35.1412767534023; Wed, 08 Oct 2014 04:25:34 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mr2si601948pdb.73.2014.10.08.04.25.32 for ; Wed, 08 Oct 2014 04:25:34 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756154AbaJHLZ3 (ORCPT + 27 others); Wed, 8 Oct 2014 07:25:29 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:64088 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754749AbaJHLZY (ORCPT ); Wed, 8 Oct 2014 07:25:24 -0400 Received: by mail-wi0-f169.google.com with SMTP id cc10so11982834wib.0 for ; Wed, 08 Oct 2014 04:25:23 -0700 (PDT) X-Received: by 10.194.110.104 with SMTP id hz8mr11432819wjb.12.1412767523476; Wed, 08 Oct 2014 04:25:23 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-78-149-2-97.as13285.net. [78.149.2.97]) by mx.google.com with ESMTPSA id v9sm24238690wjy.14.2014.10.08.04.25.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Oct 2014 04:25:22 -0700 (PDT) From: Srinivas Kandagatla To: linux-mmc@vger.kernel.org Cc: Chris Ball , Ulf Hansson , Russell King , linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [RFC PATCH 2/2] mmc: mmci: fix mmci_post_request Date: Wed, 8 Oct 2014 12:25:17 +0100 Message-Id: <1412767517-6784-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412767415-6624-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1412767415-6624-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If the post request is cancelling the channel and descriptor and which are equal to host->dma_current and host->dma_desc_current respectively, then it makes sense to reset these pointers to NULL, so that the driver does not reference it. Also the host_cookie can be reset to 0 in cases of error, so that the core could reissue the same mmc_request. This patch was tested with 'mmc: core: fix prepared requests while doing bkops' to fix the below issue. mmci-pl18x 12400000.sdcc: error during DMA transfer! Unable to handle kernel paging request at virtual address 40000000 pgd = c0204000 [40000000] *pgd=00000000 Internal error: Oops: 805 [#1] SMP ARM Modules linked in: ipv6 ath6kl_sdio ath6kl_core CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 3.17.0-rc7-linaro-multi-v7 #1 task: c0c9d7e0 ti: c0c92000 task.ti: c0c92000 PC is at v7_dma_inv_range+0x34/0x4c LR is at __dma_page_dev_to_cpu+0x80/0x100 pc : [] lr : [] psr: 400f0193 sp : c0c93e20 ip : c0c9a478 fp : c08ea538 r10: c0c9f548 r9 : 00000002 r8 : e97d9000 r7 : 00000200 r6 : c0c9d504 r5 : c0db0880 r4 : 00000000 r3 : 0000003f r2 : 00000040 r1 : 40000200 r0 : 40000000 Flags: nZcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c5787d Table: a9ef406a DAC: 00000015 Process swapper/0 (pid: 0, stack limit = 0xc0c92250) Stack: (0xc0c93e20 to 0xc0c94000) 3e20: c021f058 e9a17178 e9a171bc e99dfd6c 00000001 00000001 e995de10 00000002 3e40: 00000000 c021b574 00000000 c04bc4a4 00000000 e9b49ac0 c0ce6e6c e99dfda4 3e60: 00000088 e9810780 c0d8291c c072ea58 00000000 c072d3fc 00000000 c072f534 3e80: 00000000 e9b49ac0 00000100 c0c9a444 00000088 c072f6b4 c072f5d4 e9d40080 3ea0: e98107dc 00000000 00000000 c0280a60 00000000 7d55bf61 e9810780 e98107dc 3ec0: 00000000 f0002000 c0d460e8 c0d460e8 c0c92000 c0280b60 e9810780 c0ce7190 3ee0: 00000000 c028369c c02835f4 00000088 00000088 c0280278 c0c8ec70 c020f080 3f00: f000200c c0c9a958 c0c93f28 c02088e4 c04bd630 c04bd5bc 200f0013 ffffffff 3f20: c0c93f5c c0212800 00000001 a987c000 c0c93f3c c04bd574 00000000 0000015b 3f40: ea7a0e40 00000000 c0d460e8 c0d460e8 c0c92000 c08ea538 29b12000 c0c93f70 3f60: c04bd630 c04bd5bc 200f0013 ffffffff c04bd574 c071bd24 7d50c9b4 c0719a44 3f80: 7d50c9b4 0000015b c0c9a498 c0c92028 c0c9a498 c0c9a4fc ea7a0e40 c0c8ee38 3fa0: c0d460e8 c0276198 00000000 c0d8291a 00000000 c0c9a400 00000000 c0be0bc4 3fc0: ffffffff ffffffff c0be05f8 00000000 00000000 c0c533d8 c0d82ed4 c0c9a47c 3fe0: c0c533d4 c0c9e870 8020406a 511f06f0 00000000 80208074 00000000 00000000 [] (v7_dma_inv_range) from [] (__dma_page_dev_to_cpu+0x80/0x100) [] (__dma_page_dev_to_cpu) from [] (arm_dma_unmap_sg+0x5c/0x84) [] (arm_dma_unmap_sg) from [] (mmci_dma_unmap.isra.16+0x60/0x74) [] (mmci_dma_unmap.isra.16) from [] (mmci_data_irq+0x1fc/0x29c) [] (mmci_data_irq) from [] (mmci_irq+0xe0/0x114) [] (mmci_irq) from [] (handle_irq_event_percpu+0x78/0x134) [] (handle_irq_event_percpu) from [] (handle_irq_event+0x44/0x64) [] (handle_irq_event) from [] (handle_fasteoi_irq+0xa8/0x1a8) [] (handle_fasteoi_irq) from [] (generic_handle_irq+0x2c/0x3c) [] (generic_handle_irq) from [] (handle_IRQ+0x40/0x90) [] (handle_IRQ) from [] (gic_handle_irq+0x38/0x68) [] (gic_handle_irq) from [] (__irq_svc+0x40/0x54) Exception stack(0xc0c93f28 to 0xc0c93f70) 3f20: 00000001 a987c000 c0c93f3c c04bd574 00000000 0000015b 3f40: ea7a0e40 00000000 c0d460e8 c0d460e8 c0c92000 c08ea538 29b12000 c0c93f70 3f60: c04bd630 c04bd5bc 200f0013 ffffffff [] (__irq_svc) from [] (msm_cpu_pm_enter_sleep+0x48/0x4c) [] (msm_cpu_pm_enter_sleep) from [] (qcom_lpm_enter_spc+0x20/0x2c) [] (qcom_lpm_enter_spc) from [] (cpuidle_enter_state+0x44/0xf0) [] (cpuidle_enter_state) from [] (cpu_startup_entry+0x1f4/0x238) [] (cpu_startup_entry) from [] (start_kernel+0x384/0x390) Code: 1e070f3e e1110003 e1c11003 1e071f3e (ee070f36) ---[ end trace cf6cb3f6432c9834 ]--- Kernel panic - not syncing: Fatal exception in interrup Signed-off-by: Srinivas Kandagatla --- drivers/mmc/host/mmci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 264c947..84f4a91 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -741,8 +741,15 @@ static void mmci_post_request(struct mmc_host *mmc, struct mmc_request *mrq, chan = host->dma_tx_channel; dmaengine_terminate_all(chan); + if (host->dma_desc_current == next->dma_desc) + host->dma_desc_current = NULL; + + if (host->dma_current == next->dma_chan) + host->dma_current = NULL; + next->dma_desc = NULL; next->dma_chan = NULL; + data->host_cookie = 0; } }