Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72E66C433EF for ; Tue, 11 Jan 2022 16:15:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C1AEA830AB; Tue, 11 Jan 2022 17:15:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=metanate.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=metanate.com header.i=@metanate.com header.b="lEQQxug4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB5B0830B3; Tue, 11 Jan 2022 17:15:36 +0100 (CET) Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 13F51830A1 for ; Tue, 11 Jan 2022 17:15:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=metanate.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=john@metanate.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Content-Type:Reply-To:Content-ID:Content-Description: In-Reply-To:References; bh=I7mezBvnXYYsaxv0FMWH4nT7/mUBMpAaEpagQkzeLAg=; b=lE QQxug4RU/fCZa32MYu3LXu58qL+rc5LE+5rWI2PYqHpleaYFYPbpQlzuZcr/NbuHshKqK2G6BfSNV a2Hk4ucKumN1ihC4YnjJjqe0MPhOHyj0c8KIeuRqI5g3OkSJNg/wVX0Q0VyHVH1cbOCt+2YFuyk7H rZl+xStTH2vqLwQ6SGMMdcknZtaGAxIkWVW1dR9aKGMk9mfxwfFxgfHnim4deGhjorzQS6GkCMpDY kEPa0IhLnRrov0Lo5YrorHCUggthJyPVRaPDzdZPMiLfKx8VaFZSD3rIIOxLgwhQdXloE1NevRLcD RysriDvHr06sOMxb9AfgFx2UhACV38Nw==; Received: from [81.174.171.191] (helo=donbot.metanate.com) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1n7Jo3-0000VC-W2; Tue, 11 Jan 2022 16:15:32 +0000 From: John Keeping To: u-boot@lists.denx.de Cc: John Keeping , Peng Fan , Jaehoon Chung Subject: [PATCH] mmc: dwmmc: return a proper error code when busy Date: Tue, 11 Jan 2022 16:15:25 +0000 Message-Id: <20220111161525.2499825-1-john@metanate.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated: YES X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean When failing to send a command because the hardware is busy, return EBUSY to indicate the cause instead of just -1. Signed-off-by: John Keeping --- drivers/mmc/dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index a949dad574..4232c5eb8c 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -301,7 +301,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, flags = dwmci_set_transfer_mode(host, data); if ((cmd->resp_type & MMC_RSP_136) && (cmd->resp_type & MMC_RSP_BUSY)) - return -1; + return -EBUSY; if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION) flags |= DWMCI_CMD_ABORT_STOP; -- 2.34.1