From patchwork Thu Aug 1 21:17:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2837259 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 B56FB9F479 for ; Thu, 1 Aug 2013 21:17:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B067020299 for ; Thu, 1 Aug 2013 21:17:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C69BD202F8 for ; Thu, 1 Aug 2013 21:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753257Ab3HAVRR (ORCPT ); Thu, 1 Aug 2013 17:17:17 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:63379 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753109Ab3HAVRQ (ORCPT ); Thu, 1 Aug 2013 17:17:16 -0400 Received: by mail-la0-f47.google.com with SMTP id eo20so1794438lab.20 for ; Thu, 01 Aug 2013 14:17:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:cc:from:organization:date:mime-version:content-type :content-transfer-encoding:message-id:x-gm-message-state; bh=S6XhUMDNAg2cvY8RZlb4Qu4Xbgq5zbfncMiLWjxuHtQ=; b=Pfuc6trD2lInjAr0osfsAFunHiDiJ6j/nLAAWbqZ2rURumEV4gpcDePxR9bh2OGSg0 O2n9qDyxfdDD+FzZ8FRN5Yzz0AllWSw6OBQurX67DczgYNWySMQw/PZY00hkVG/gT2MO A0gDAhDWrU/DpLuvpyevrGy77HizV09MiKdUj5LD4jreCo2wZtY0HtId1/A1Gs7mZQJy ygDTPMW1ot6oroOPfXI4tI5j4DKOCFg5XGz4Z3LZe3PZfdmFkFgVHHDY3E/MB7jOPPn9 UgpAVCalzIo4Y85WCyFdoghttMqSS02Akirh5VUr2TkhH8mGngOgCLfXBiPhdwJnrRO6 J3QA== X-Received: by 10.152.1.169 with SMTP id 9mr1532752lan.90.1375391832104; Thu, 01 Aug 2013 14:17:12 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-144-149.pppoe.mtu-net.ru. [91.76.144.149]) by mx.google.com with ESMTPSA id 8sm1988085lbq.4.2013.08.01.14.17.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 01 Aug 2013 14:17:11 -0700 (PDT) To: linux-mmc@vger.kernel.org, g.liakhovetski@gmx.de, ian@mnementh.co.uk, cjb@laptop.org Subject: [PATCH] tmio_mmc_dma: fix PIO fallback on SDHI Cc: linux-sh@vger.kernel.org, max.filippov@cogentembedded.com From: Sergei Shtylyov Organization: Cogent Embedded Date: Fri, 2 Aug 2013 01:17:17 +0400 MIME-Version: 1.0 Message-Id: <201308020117.17897.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQlFVkjdpz6CVCFmoWQRCdjv2JS1J+MEuUCaEWDyjGWB7fAzuZT8T6t12x/Fu3EW+1tZ25Wo Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 I'm testing SH-Mobile SDHI driver in DMA mode with a new DMA controller using 'bonnie++' and getting DMA error after which the tmio_mmc_dma.c code falls back to PIO but all commands time out after that. It turned out that the fallback code calls tmio_mmc_enable_dma() with RX/TX channels already freed and pointers to them cleared, so that the function bails out early instead of clearing the DMA bit in the CTL_DMA_ENABLE register. Fixing the RX/TX channel check so that it takes place only when enabling DMA helps with the PIO fallback. Signed-off-by: Sergei Shtylyov --- The patch is against Chris Ball's 'mmc.git' repo, 'master' branch. drivers/mmc/host/tmio_mmc_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: mmc/drivers/mmc/host/tmio_mmc_dma.c =================================================================== --- mmc.orig/drivers/mmc/host/tmio_mmc_dma.c +++ mmc/drivers/mmc/host/tmio_mmc_dma.c @@ -25,7 +25,7 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable) { - if (!host->chan_tx || !host->chan_rx) + if (enable && !(host->chan_tx && host->chan_rx)) return; #if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)