From patchwork Sun Jan 17 12:27:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1427727 X-Patchwork-Delegate: van.freenix@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=GKL75Jo8; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DJZ291Y3Mz9sVr for ; Sun, 17 Jan 2021 23:28:00 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4FA6D82AAA; Sun, 17 Jan 2021 13:27:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="GKL75Jo8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 26CDD82AAB; Sun, 17 Jan 2021 13:27:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2CF4E82A3E for ; Sun, 17 Jan 2021 13:27:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pj1-x102d.google.com with SMTP id md11so7703637pjb.0 for ; Sun, 17 Jan 2021 04:27:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0A8X+d3jYeeau/Rz5x7jiJG5Kj4P2w5r2BPfUpb8kMo=; b=GKL75Jo8Wbp3HipG5p8RKD72PBsRNdpJ7ci14zCEjJQB4LmWd6XHL6Ivvs6/Aie5jx jaxBNnwnjvDDC73i/QF+dTD9dKSRq3nbl7FGP2hI1wM2QxsVR776CU5QcSG0B6uaU6et xlOv/v2yOkJjDbl/cxFLBw4QQ6o3xaF9kHPgGLcN1koxtr9sThtV3WvMyfmbg3VM6Wzf uPkifOvcq8eUs247bmvTlf22nDzycHOt9AQOWs1bVGaTKbKK0zlmnGWRgoBCTqZVuEIs d3qIZWM99B6V+PU5rbYSdz3m7zNuXjTUjGbaKDoAcwBBiCp+qUeeDOXgUy+I6eZF1919 Il7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0A8X+d3jYeeau/Rz5x7jiJG5Kj4P2w5r2BPfUpb8kMo=; b=t3hLZZB4M/SrQsOFxROw/R+4UIcTc2Qr2sdg4T+ZMd7178ZPbkCtl0NqfGeb1dilio FpdJy+m8KXeyQwONTxwqHiCU1CsrLRt1TJnU3VmMYniuFMyzHQeSjylJNGmHIUF2wZKP KsZVVWfHdz+d0YMfFGOt3vUWS3/o/ept7lGcuN0dn1R4GsMcBZpwB1X1sLipsaXk1eAM pzyZslAWLXov8vf/NnjLmQh691VwtDgqXfWMlmwcNuLAItmVVWKCkxoBtXuMRvU4Qn1p +/VyON8BhaBzd3PSYwdPvUeSG1Dqp9f9Ma+OCnKb9z9BsIdKYk5ip5pkkUSNlNUfhSyu u+rw== X-Gm-Message-State: AOAM533dpeonYDME9mJb88IJLh2/JFG5zvxA3PUBRLS45NGqtHqGTnKO WbOSrGlatiiQsJM8rZi1CLo= X-Google-Smtp-Source: ABdhPJzF6ssq6AiUhnSIAnJXduZwzIWZNrpda2ArVtpz9A4ZePwMba9o/+YBT6/r18KK+AUMlobdCg== X-Received: by 2002:a17:90b:298:: with SMTP id az24mr20931671pjb.128.1610886457523; Sun, 17 Jan 2021 04:27:37 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id w27sm13330905pfq.104.2021.01.17.04.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 04:27:37 -0800 (PST) From: Bin Meng To: Peng Fan , U-Boot Mailing List Cc: Jaehoon Chung , Bin Meng Subject: [PATCH v2] mmc: mmc_spi: Print verbose debug output when crc16 check fails Date: Sun, 17 Jan 2021 20:27:24 +0800 Message-Id: <20210117122724.5321-1-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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.102.3 at phobos.denx.de X-Virus-Status: Clean Add some verbose debug output when crc16 check fails. Signed-off-by: Bin Meng Reviewed-by: Jaehoon Chung --- Changes in v2: - do the crc_ok assignment at the the same line where it's defined drivers/mmc/mmc_spi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c index 46800bbed2..b1edb6ad7c 100644 --- a/drivers/mmc/mmc_spi.c +++ b/drivers/mmc/mmc_spi.c @@ -181,8 +181,10 @@ static int mmc_spi_readdata(struct udevice *dev, if (ret) return ret; #ifdef CONFIG_MMC_SPI_CRC_ON - if (be16_to_cpu(crc16_ccitt(0, buf, bsize)) != crc) { - debug("%s: data crc error\n", __func__); + u16 crc_ok = be16_to_cpu(crc16_ccitt(0, buf, bsize)); + if (crc_ok != crc) { + debug("%s: data crc error, expect %04x get %04x\n", + __func__, crc_ok, crc); r1 = R1_SPI_COM_CRC; break; }