From patchwork Thu Jul 18 16:30:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balaji T K X-Patchwork-Id: 2829702 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6D1429F9CA for ; Thu, 18 Jul 2013 16:31:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B48C20174 for ; Thu, 18 Jul 2013 16:31:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1391D200E5 for ; Thu, 18 Jul 2013 16:31:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932929Ab3GRQbP (ORCPT ); Thu, 18 Jul 2013 12:31:15 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:33231 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932315Ab3GRQbP (ORCPT ); Thu, 18 Jul 2013 12:31:15 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r6IGUtBU010708; Thu, 18 Jul 2013 11:30:55 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r6IGUsZj026262; Thu, 18 Jul 2013 11:30:54 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Thu, 18 Jul 2013 11:30:54 -0500 Received: from [172.24.147.109] (ulaa0393241.apr.dhcp.ti.com [172.24.147.109]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r6IGUqDT014387; Thu, 18 Jul 2013 11:30:53 -0500 Message-ID: <51E8183B.5060100@ti.com> Date: Thu, 18 Jul 2013 22:00:51 +0530 From: Balaji T K User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: Daniel Mack CC: Linux MMC List , "linux-omap@vger.kernel.org" , Adrian Hunter , Mark Jackson , Joel Fernandes Subject: Re: omap_hsmmc: race between omap_hsmmc_start_command() and DMA callback References: <51E8127B.9090903@gmail.com> In-Reply-To: <51E8127B.9090903@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thursday 18 July 2013 09:36 PM, Daniel Mack wrote: > Hi, > > I'm facing a NULL pointer dereference in omap_hsmmc_start_command() on > an AM33xx board running 3.11-rc1 (DMA enabled). > > A quick debug session showed that DMA engine timing leads to a very > reproducable race condition. In omap_hsmmc_request(), we have: > > host->mrq = req; > omap_hsmmc_prepare_data() > omap_hsmmc_start_dma_transfer() > tx->callback = omap_hsmmc_dma_callback; > > [*] > > omap_hsmmc_start_command() > if (cmd == host->mrq->stop) [<-- oops] > ... > > It turns out that omap_hsmmc_dma_callback() (which sets host->mrq = > NULL) is entered just after the DMA submission, and *before* > omap_hsmmc_start_command() is called, consequently leading to an Oops. > > I can debug this in more depth, but maybe someone has an idea already? > Can you check with this hack patch in addition to other dependent patch for adding edma nodes to dt[1] and slave sg limit [2] diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index a432e6c..5a19164 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c @@ -1262,8 +1262,8 @@ int edma_start(unsigned channel) if (test_bit(channel, edma_cc[ctlr]->edma_unused)) { pr_debug("EDMA: ESR%d %08x\n", j, edma_shadow0_read_array(ctlr, SH_ESR, j)); - edma_shadow0_write_array(ctlr, SH_ESR, j, mask); - return 0; +// edma_shadow0_write_array(ctlr, SH_ESR, j, mask); +// return 0; } /* EDMA channel with event association */