From patchwork Thu Apr 23 11:15:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 6261801 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 495C79F1BE for ; Thu, 23 Apr 2015 11:15:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70AF720303 for ; Thu, 23 Apr 2015 11:15:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 834CA2026C for ; Thu, 23 Apr 2015 11:15:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933549AbbDWLPw (ORCPT ); Thu, 23 Apr 2015 07:15:52 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:33016 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933774AbbDWLPu (ORCPT ); Thu, 23 Apr 2015 07:15:50 -0400 Received: by wiax7 with SMTP id x7so10138750wia.0 for ; Thu, 23 Apr 2015 04:15:49 -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=xQAHBl+qVJ7Bxi4nYQiIhVnqmLcCODZ/YY9Z1lpCk+IInhSJONDFyV9e5aUlb0vBls lhLpsGX8jPNMhb9H799gtDyJHTsvvOMGPOZBmA3F6GcWxWx1BC12QcUCKJ4PRms351Ij f68eDQ/LzhFhUz47acAmMAwfiEKGI7yfKEk7lbZew2+bELJXvjhUvNWvOkEh4OPwLITz qkkPY99AFHrOiHKdw3xMzyL8q/e7suFbOhC57a7i7yW474MErrhkHecfqnJwFP0l6v4W I8/Gey2H+HYNkO1/s62w6yIF4nGbAQMVKlNYwyKnTpejqRMD3Vqi6Vmli0F5FUZ2R39s loMQ== X-Received: by 10.180.208.84 with SMTP id mc20mr4975547wic.38.1429787749115; Thu, 23 Apr 2015 04:15:49 -0700 (PDT) Received: from localhost (ip-94-112-1-170.net.upcbroadband.cz. [94.112.1.170]) by mx.google.com with ESMTPSA id go4sm28717576wib.1.2015.04.23.04.15.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Apr 2015 04:15:48 -0700 (PDT) From: Andreas Fenkart To: linux-mmc@vger.kernel.org Cc: Ulf Hansson , Jaehoon Chung , NeilBrown , Andreas Fenkart Subject: [PATCH v2] mmc: sdio: add reset callback to bus operations Date: Thu, 23 Apr 2015 13:15:42 +0200 Message-Id: <1429787742-4876-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, };