From patchwork Wed Oct 14 20:53:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 7398441 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 975519F302 for ; Wed, 14 Oct 2015 20:53:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CAC6A207A5 for ; Wed, 14 Oct 2015 20:53:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF68320772 for ; Wed, 14 Oct 2015 20:53:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754201AbbJNUxK (ORCPT ); Wed, 14 Oct 2015 16:53:10 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:35626 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753432AbbJNUxG (ORCPT ); Wed, 14 Oct 2015 16:53:06 -0400 Received: by lbwr8 with SMTP id r8so55113010lbw.2 for ; Wed, 14 Oct 2015 13:53:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:mime-version:content-transfer-encoding:content-type; bh=JS4KNurhoG5/70U+TGlHV6Ijlc+yKZkmh1Xs4uLLxIE=; b=OJcd7kJxdJS9jil60HByNx0fWep7bqHqXWGHfDX3xh7U4ko58kbZzKSlcSxLvg6Vh4 sGo9rN41tUICnfC7OksgqLwU9Y86YZYkUF+8GSzd1blw45GEn9BIOEbzLNeq2aNaeMlH NjtrGn6rOVc2u+eHBMP+4p10tiSJjoFMEKI5XbNpqnWAGDjgnI/1Tbpg/s573tW4+tQF JUe6EpoZn0VYBgBtOiTb+5m/3Jn/sgMSTNAiuLodf8p31WzysjL/OolatJkm7AQT8yap 80FK9q3qO1nB/aL/VP84SLo2o70dko5YYi0yiJOQ5XaMeUk6CwkBTKJLk99K5Cvzxhv3 lcdA== X-Gm-Message-State: ALoCoQnfeEfW8IbVxrDOnEMKjN7/Xgoee6+X72Z3FIQ4LCVOzUzLTFWDTq1XkA1f+5d6MoHMtQh2 X-Received: by 10.112.36.229 with SMTP id t5mr2648564lbj.61.1444855985408; Wed, 14 Oct 2015 13:53:05 -0700 (PDT) Received: from wasted.cogentembedded.com (ppp83-237-254-79.pppoe.mtu-net.ru. [83.237.254.79]) by smtp.gmail.com with ESMTPSA id s73sm1589293lfs.32.2015.10.14.13.53.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 13:53:04 -0700 (PDT) From: Sergei Shtylyov To: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mmc: skip reclaiming host on mmc_add_card() error Date: Wed, 14 Oct 2015 23:53:03 +0300 Message-ID: <4835546.qgzOJFlmY8@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.9 (Linux/4.1.8-100.fc21.x86_64; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 There's little sense in releasing the host on mmc_add_card() error immediately after reclaiming it, so reclaim the host only in case of success. Signed-off-by: Sergei Shtylyov --- The patch is against Ulf Hansson's 'mmc.git' repo's 'next' branch. drivers/mmc/core/mmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 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/core/mmc.c =================================================================== --- mmc.orig/drivers/mmc/core/mmc.c +++ mmc/drivers/mmc/core/mmc.c @@ -2009,14 +2009,13 @@ int mmc_attach_mmc(struct mmc_host *host mmc_release_host(host); err = mmc_add_card(host->card); - mmc_claim_host(host); if (err) goto remove_card; + mmc_claim_host(host); return 0; remove_card: - mmc_release_host(host); mmc_remove_card(host->card); mmc_claim_host(host); host->card = NULL;