From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1170AC47E48 for ; Thu, 15 Jul 2021 08:03:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5EEF6610C7 for ; Thu, 15 Jul 2021 08:03:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5EEF6610C7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2035A82859; Thu, 15 Jul 2021 10:03:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1626336236; bh=GctsFmR3h7ox1p6/vRFnR/aosqQ01mMRJWYxjgZaFCg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eHgf7kegFQnpHHiIL1wh98B/mwdPWRD4Qqo0aPdK55pvf6A4F/rosyuWC6BthqZo6 b1GBwYAetJHkEAQ/U2YBWWMYK4naxAfycaYNA4rlbIwNYsVBSkEhOPB85Hp/2R14nB acm0/AwjZfLCGX/P9igLFNKBTZ64m0FizO8yhAQG854NqIzSbBE3jgXdIlaWHklwax rXWZvX96OhtjKGjjvA72fiTHWpFbimw66fC1M4htQ+cz3kTG3g3dlJqkB/zODp4iBU KzAke+J5fWTwpo0GxXtujORLbGUT7JSVX2iRBGv38IHAsINlvH7/DBT7bLKFomVlM8 AH6rZveqdS1Og== Received: by phobos.denx.de (Postfix, from userid 109) id D7C0982903; Thu, 15 Jul 2021 10:03:53 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:1::465:204]) (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 B229281E8F for ; Thu, 15 Jul 2021 10:03:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4GQRhk3b2YzQjrd; Thu, 15 Jul 2021 10:03:50 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id ugc_chwJi7XQ; Thu, 15 Jul 2021 10:03:47 +0200 (CEST) Subject: Re: [PATCH 3/3] mmc: mmc_get_op_cond: Allow quiet detection of eMMC To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , Andre Heider , =?UTF-8?Q?G=c3=a9rald_Kerma?= , Konstantin Porotchkin , Baruch Siach , Fabio Estevam , Peng Fan Cc: u-boot@lists.denx.de References: <20210714143729.2396-1-pali@kernel.org> <20210714143729.2396-3-pali@kernel.org> From: Stefan Roese Message-ID: Date: Thu, 15 Jul 2021 10:03:46 +0200 MIME-Version: 1.0 In-Reply-To: <20210714143729.2396-3-pali@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit X-MBO-SPAM-Probability: X-Rspamd-Score: -1.41 / 15.00 / 15.00 X-Rspamd-Queue-Id: 8CDCE18B5 X-Rspamd-UID: 681982 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 On 14.07.21 16:37, Pali Rohár wrote: > Add a new 'quiet' argument to mmc_get_op_cond() function which avoids > printing error message when SD/eMMC card is not detected. > > Espressobin and mx6cuboxi boards use this function for detecting presence > of eMMC and therefore it is expected and normal that eMMC does not have to > be connected. So error message "Card did not respond to voltage select!" > should be skipped in this case as it is not an error. > > Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Thanks, Stefan > --- > board/Marvell/mvebu_armada-37xx/board.c | 2 +- > board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 +- > drivers/mmc/mmc.c | 7 ++++--- > include/mmc.h | 3 ++- > 4 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c > index 6086996b8062..fdc873b1952f 100644 > --- a/board/Marvell/mvebu_armada-37xx/board.c > +++ b/board/Marvell/mvebu_armada-37xx/board.c > @@ -124,7 +124,7 @@ int board_late_init(void) > > /* eMMC is mmc dev num 1 */ > mmc_dev = find_mmc_device(1); > - emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0); > + emmc = (mmc_dev && mmc_get_op_cond(mmc_dev, true) == 0); > > /* if eMMC is not present then remove it from DM */ > if (!emmc && mmc_dev) { > diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c > index 3eadc38f6fd4..6207bf8253ab 100644 > --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c > +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c > @@ -374,7 +374,7 @@ static bool has_emmc(void) > mmc = find_mmc_device(2); > if (!mmc) > return 0; > - return (mmc_get_op_cond(mmc) < 0) ? 0 : 1; > + return (mmc_get_op_cond(mmc, true) < 0) ? 0 : 1; > } > > int checkboard(void) > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c > index 1e83007286b2..8078a89f18cb 100644 > --- a/drivers/mmc/mmc.c > +++ b/drivers/mmc/mmc.c > @@ -2766,7 +2766,7 @@ static int mmc_power_cycle(struct mmc *mmc) > return mmc_power_on(mmc); > } > > -int mmc_get_op_cond(struct mmc *mmc) > +int mmc_get_op_cond(struct mmc *mmc, bool quiet) > { > bool uhs_en = supports_uhs(mmc->cfg->host_caps); > int err; > @@ -2842,7 +2842,8 @@ retry: > > if (err) { > #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT) > - pr_err("Card did not respond to voltage select! : %d\n", err); > + if (!quiet) > + pr_err("Card did not respond to voltage select! : %d\n", err); > #endif > return -EOPNOTSUPP; > } > @@ -2882,7 +2883,7 @@ int mmc_start_init(struct mmc *mmc) > return -ENOMEDIUM; > } > > - err = mmc_get_op_cond(mmc); > + err = mmc_get_op_cond(mmc, false); > > if (!err) > mmc->init_in_progress = 1; > diff --git a/include/mmc.h b/include/mmc.h > index 6f943e78b740..0bf19de20e52 100644 > --- a/include/mmc.h > +++ b/include/mmc.h > @@ -900,9 +900,10 @@ int mmc_set_bkops_enable(struct mmc *mmc); > * the presence of SD/eMMC when no card detect logic is available. > * > * @param mmc Pointer to a MMC device struct > + * @param quiet Be quiet, do not print error messages when card is not detected. > * @return 0 on success, <0 on error. > */ > -int mmc_get_op_cond(struct mmc *mmc); > +int mmc_get_op_cond(struct mmc *mmc, bool quiet); > > /** > * Start device initialization and return immediately; it does not block on > Viele Grüße, Stefan -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de