From patchwork Mon Apr 13 09:30:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 6206901 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CCB4BBF4A6 for ; Mon, 13 Apr 2015 09:30:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 08C10201CE for ; Mon, 13 Apr 2015 09:30:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23448201D3 for ; Mon, 13 Apr 2015 09:30:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752688AbbDMJac (ORCPT ); Mon, 13 Apr 2015 05:30:32 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:37718 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753243AbbDMJab (ORCPT ); Mon, 13 Apr 2015 05:30:31 -0400 Received: by widdi4 with SMTP id di4so44412952wid.0 for ; Mon, 13 Apr 2015 02:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=8uXmEJa5B3q2qGOflKquA7/whXZR71qR9LKMn50CYEg=; b=E2F8QYQNFwnWQQZF80SERdmm2RRzje9lKwQt2qLWRQuO9/2DXUaBFJjlamljs/+wrZ MezGM6PJ2hV9FXFmKPRHnqejMou3nZZA8XdelCZVzEZDE6svKFRRRrFv6D0d4AdHXWa9 MRfeP8BdG0R7wGmmDutryW02zANGtTbYozYf5I3ytm0YS09iqF+Wg8vYxYIVpTVRaivB Enxp91biB3OHIk8mS3XCwIf5dmLM0WVfJRtGEJi++celtyp5+rbjLhjtErkRgAPoBkC2 V/ltiLvJsTr7p9xqDIYwhFu2xO19LOb1PWzYcwVTIQdTrFGG2VOPYnvBhe3kvdUoMLEc M6vw== X-Received: by 10.194.222.197 with SMTP id qo5mr25835858wjc.142.1428917430658; Mon, 13 Apr 2015 02:30:30 -0700 (PDT) Received: from localhost (ip-94-112-1-170.net.upcbroadband.cz. [94.112.1.170]) by mx.google.com with ESMTPSA id f8sm10626208wiy.7.2015.04.13.02.30.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2015 02:30:29 -0700 (PDT) From: Andreas Fenkart To: linux-mmc@vger.kernel.org Cc: Chris Ball , Ulf Hansson , Andreas Fenkart Subject: [PATCH] mmc: sdio: add reset callback to bus operations Date: Mon, 13 Apr 2015 11:30:21 +0200 Message-Id: <1428917421-10467-1-git-send-email-afenkart@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_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 Some drivers schedule automatic hw resets. An example is mwifiex, which schedules a card reset if the command handler between driver and card firmware becomes out of sync Signed-off-by: Andreas Fenkart --- drivers/mmc/core/sdio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index ce6cc47..01255ef 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -1064,6 +1064,12 @@ static int mmc_sdio_runtime_resume(struct mmc_host *host) return mmc_sdio_power_restore(host); } +static int mmc_sdio_reset(struct mmc_host *host) +{ + mmc_power_cycle(host, host->card->ocr); + return mmc_sdio_power_restore(host); +} + static const struct mmc_bus_ops mmc_sdio_ops = { .remove = mmc_sdio_remove, .detect = mmc_sdio_detect, @@ -1074,6 +1080,7 @@ static const struct mmc_bus_ops mmc_sdio_ops = { .runtime_resume = mmc_sdio_runtime_resume, .power_restore = mmc_sdio_power_restore, .alive = mmc_sdio_alive, + .reset = mmc_sdio_reset, };