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: 2837258 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D9B9DBF535 for ; Thu, 1 Aug 2013 21:17:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7C5820303 for ; Thu, 1 Aug 2013 21:17:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBF6220299 for ; Thu, 1 Aug 2013 21:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753236Ab3HAVRR (ORCPT ); Thu, 1 Aug 2013 17:17:17 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:56647 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752760Ab3HAVRQ (ORCPT ); Thu, 1 Aug 2013 17:17:16 -0400 Received: by mail-lb0-f170.google.com with SMTP id r10so1933585lbi.15 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=eH8us5QOLVwKClD8ahjO8qLcIRuGFqPh3IJEW8F9mBBHpMTO8dlLJ58z9vqXIKU87+ b4ZVst0sjUygWOHGBvEy1abru4iHXz30igoXXjbx2dMi/nj8QDoPTwGv1uV0AjLwrIEY J1+PTdVCULn/t8BAikqUzFOoOLPaFzsDiahEWPmBFAKgiS7EaMh7q5WauAsbxUksWe4W DP77edVTr6jQOkG+It8NqIq7f7B/wup6cpW3Nzcz4Kct07Wbla/kpIwDEg/4CY2X3ydf J2l3zgCMeIS+HeygsCjdGb9Wa6J6IsiJ4t9nggUEOLZHTj7Bjc4lFGueLeSMTZ1sDo10 RXrA== 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: ALoCoQkxGWuEWY4LyCktK/Ehy1Zmu4IAA68VUVnXPLDbDAfTwuIPLtD83AQ26yS7EqN//3QapwHP Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@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-sh" 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)