From patchwork Thu Jun 6 14:35:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2681261 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 754A3DF23A for ; Thu, 6 Jun 2013 14:36:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752318Ab3FFOgE (ORCPT ); Thu, 6 Jun 2013 10:36:04 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:65229 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752221Ab3FFOgD (ORCPT ); Thu, 6 Jun 2013 10:36:03 -0400 Received: from axis700.grange (dslb-088-077-167-013.pools.arcor-ip.net [88.77.167.13]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0LsJrw-1UMMLk253g-012VZ4; Thu, 06 Jun 2013 16:35:48 +0200 Received: by axis700.grange (Postfix, from userid 1000) id 2EE0C40BB4; Thu, 6 Jun 2013 16:35:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 2C0CD40BB3; Thu, 6 Jun 2013 16:35:48 +0200 (CEST) Date: Thu, 6 Jun 2013 16:35:48 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: Chris Ball cc: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org Subject: [PATCH v3 2/2] mmc: tmio: reset the controller after power-up In-Reply-To: Message-ID: References: <871u8f8nxb.fsf@octavius.laptop.org> MIME-Version: 1.0 X-Provags-ID: V02:K0:Q2thsOkOkkeVM8Du5JJuVUDzYrh1duZSm2oj86TgdVO rTycCutv2WU4ehHtAKwTg13KNmlHGbs6/e2HgO5mkRWjTikcqQ 7iwsTET9LhungwvO1+Jl+pjNQbSD6f7TwpLCiN9H4evcr1FgMc fXTJzxb0FMQkGMzk8cQ9l4deO4E9SNhJyXoIB98lnH6mVk86XD xsO/0/pj60uvbolOoqpYt6uEY97oNanvfKo3+EufYhIdpmNFWm P/FekSSK5qA8IpzUJbZh26ppKPyWN8Yy/orY472BQpHmdixNze HPc2IoAjFrgYwRr7eCf2G0QiqAC9kSKwQEtbzi+SyCKyRqT3xX v6anLmPSuJ8qtriy+e3sN6C9kk4MKVtfr4SAW6vLFUyc02EslR vlfchK+6BvWXg== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org This fixes two reported problems: 1. after a system resume the controller isn't functioning until a command runs on a timeout and a controller reset is performed. 2. if a card is ejected during a running write operation, its re-insertion isn't detected. Reported-by: Nguyen Viet Dung Reported-by: Nguyen Hong Ky Signed-off-by: Guennadi Liakhovetski Tested-by: Nguyen Viet Dung Tested-by: Nguyen Hong Ky --- v3: rebased on top of current mmc-next / 3.10-rc drivers/mmc/host/tmio_mmc_pio.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index 67d9642..f294708 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -867,6 +867,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) host->resuming = false; } } + if (host->power == TMIO_MMC_OFF_STOP) + tmio_mmc_reset(host); tmio_mmc_set_clock(host, ios->clock); if (host->power == TMIO_MMC_OFF_STOP) /* power up SD card and the bus */ @@ -1186,7 +1188,6 @@ int tmio_mmc_host_runtime_resume(struct device *dev) struct mmc_host *mmc = dev_get_drvdata(dev); struct tmio_mmc_host *host = mmc_priv(mmc); - tmio_mmc_reset(host); tmio_mmc_enable_dma(host, true); return 0;