From patchwork Wed Oct 14 20:54:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 7398461 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 F157EBEEA4 for ; Wed, 14 Oct 2015 20:54:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2643120772 for ; Wed, 14 Oct 2015 20:54:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 498CD207E9 for ; Wed, 14 Oct 2015 20:54:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754615AbbJNUyJ (ORCPT ); Wed, 14 Oct 2015 16:54:09 -0400 Received: from mail-lf0-f53.google.com ([209.85.215.53]:36373 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754606AbbJNUyI (ORCPT ); Wed, 14 Oct 2015 16:54:08 -0400 Received: by lfeh64 with SMTP id h64so18490811lfe.3 for ; Wed, 14 Oct 2015 13:54:06 -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=Pt0/5btCWo9G1mej5ywdP60sf6LfLX0H9DNgwYWv3UA=; b=E3gqxVxtifi4p2xLFR8xHbEYlV1lp2nu8c0Ti8gKh/yC5wLYCSBLf++ujMlNxTT2s0 yWzLZ7cq8rJV+G5vffPmPgLu/pZUGlmegeChjnwiSvkc7gBGQNzNM0zcMPEHsVJ2uvc8 n/cEulKVjFtEIwNR+ThirbikSdL+N3mSoL+CsYHOEHwrbEH5BiRGrBRMuHz4KGuXu3Lu gBxmbM2iEnR/s5EVXEeqCN21HwSDGhGnEy2Bs3LE5UzxdZzIU+p0tFoCPE70Rj/zgz8s IwkoL63PR0ZJGFJY860EXrIEQIHAcmnBNgRZWq6MlRnI8NneEtxfHjwHieKAvPWmzzwI oJWQ== X-Gm-Message-State: ALoCoQnM7aNjrYgEzdZVQe6wEJ6EDtm/krjawgOk2YDYo5pmYsPJL3d14b+Ip/bPMCCd+RvgJKpO X-Received: by 10.25.22.38 with SMTP id m38mr1784857lfi.10.1444856046427; Wed, 14 Oct 2015 13:54:06 -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 o4sm1573313lbc.7.2015.10.14.13.54.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 13:54:05 -0700 (PDT) From: Sergei Shtylyov To: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] sd: skip reclaiming host on mmc_add_card() error Date: Wed, 14 Oct 2015 23:54:05 +0300 Message-ID: <1596257.vaoCtQJA8a@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/sd.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/sd.c =================================================================== --- mmc.orig/drivers/mmc/core/sd.c +++ mmc/drivers/mmc/core/sd.c @@ -1243,14 +1243,13 @@ int mmc_attach_sd(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); host->card = NULL; mmc_claim_host(host);