Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2091107ybp; Thu, 10 Oct 2019 02:02:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwy+jjM314CaQN58olmwqMzULYKHrfK5ut5j3i9ueh7HC7Bhj62FVCi4ahJ5GKBxsJQ1Ce X-Received: by 2002:a17:907:426f:: with SMTP id nx23mr7366404ejb.43.1570698141045; Thu, 10 Oct 2019 02:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570698141; cv=none; d=google.com; s=arc-20160816; b=pKvUVUSOiLWVSQFj69LUxWojj+sXg4lEX+jMF3XTTIP1N/k2iVGtHLftcqcTYb5ad7 HRhQI/gnB/pWieUdrGEvpsn/VvkRQ22g3JoKAyJrfX17IC3j1psMqcGKakotToNav7Dw s8C2i27FiVT7y02uuAiyZsaeLlr/FfkKQygHd34xC7vRv1ZUBiB2eYGVYxmZqrfAHKWD tSKXQF9pILRoKxT4KyptYMfJkp/VGB0RJSj8aVuzGC+d+T1/47frtOHe2HdtWIM9R0DP qvyXOJw6C1fq9GnW/vjqu8a8UoAa96MedfrZ/fQpd59ITN+hNFe50wcdMWVD0xeY+qqG 6Cvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vZk8i0L394Q8f7wNbhGaotWmBMFQ+tvBI/7LvH7wHj0=; b=AhOwQqzZSYzLjFIlZwdOtK4tvT+6LCbqcAbGmTKFx705gULeCJ00pqBG2eh90WgdWM 3u7gOAQ4lqBiKZlPgK+mCm/QFvLo0LchwLgTJ0pqva7loZcMo2+NoXH1wg5sPZ0qKdx5 Pj1n4IThvP6pFUgQxnKxOu+1MaiB78+lVuJKc1VrhCYmHgXuUd9Qcrn+DClZVKIEQtYR 3Zbu0f5TzA9hI5c638E63opMweVZgwiejwdXR/DrMqqzh7VBkqqDAMxrcN0A3vSJ5K+2 ksh2PPLnZLDdqGycNutgcl6mOjwwSHPuhyvn/IBICijYFKzLa2T3aBCJLIjqSo90rPou FIHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t3DFLrCw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si3133459edz.77.2019.10.10.02.01.57; Thu, 10 Oct 2019 02:02:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t3DFLrCw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388218AbfJJIk5 (ORCPT + 99 others); Thu, 10 Oct 2019 04:40:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:45100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387585AbfJJIkz (ORCPT ); Thu, 10 Oct 2019 04:40:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 44B7A218AC; Thu, 10 Oct 2019 08:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696854; bh=Ck7sX0+FXelRH0DMHdATlyjDNhesOgfQM+4Zk78puy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t3DFLrCwmWQtST2iZ3F6KldVcuFoHWVz4c2NT2fiZXq3KRwE66csr3Q5Va4PuQH/l jCsw9KB4QUIRIaarnBncPyJxzDl+gqLJM8riup7uVuWUeR3CJ48yPraUvf8U/K9rg9 ACcik8MU4DhzIEqAVax5Y2cuOZu+PZ9ZocwC9kBE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Russell King , Adrian Hunter , Ulf Hansson Subject: [PATCH 5.3 075/148] mmc: sdhci: improve ADMA error reporting Date: Thu, 10 Oct 2019 10:35:36 +0200 Message-Id: <20191010083615.913134034@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Russell King commit d1c536e3177390da43d99f20143b810c35433d1f upstream. ADMA errors are potentially data corrupting events; although we print the register state, we do not usefully print the ADMA descriptors. Worse than that, we print them by referencing their virtual address which is meaningless when the register state gives us the DMA address of the failing descriptor. Print the ADMA descriptors giving their DMA addresses rather than their virtual addresses, and print them using SDHCI_DUMP() rather than DBG(). We also do not show the correct value of the interrupt status register; the register dump shows the current value, after we have cleared the pending interrupts we are going to service. What is more useful is to print the interrupts that _were_ pending at the time the ADMA error was encountered. Fix that too. Signed-off-by: Russell King Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2857,6 +2857,7 @@ static void sdhci_cmd_irq(struct sdhci_h static void sdhci_adma_show_error(struct sdhci_host *host) { void *desc = host->adma_table; + dma_addr_t dma = host->adma_addr; sdhci_dumpregs(host); @@ -2864,18 +2865,21 @@ static void sdhci_adma_show_error(struct struct sdhci_adma2_64_desc *dma_desc = desc; if (host->flags & SDHCI_USE_64_BIT_DMA) - DBG("%p: DMA 0x%08x%08x, LEN 0x%04x, Attr=0x%02x\n", - desc, le32_to_cpu(dma_desc->addr_hi), + SDHCI_DUMP("%08llx: DMA 0x%08x%08x, LEN 0x%04x, Attr=0x%02x\n", + (unsigned long long)dma, + le32_to_cpu(dma_desc->addr_hi), le32_to_cpu(dma_desc->addr_lo), le16_to_cpu(dma_desc->len), le16_to_cpu(dma_desc->cmd)); else - DBG("%p: DMA 0x%08x, LEN 0x%04x, Attr=0x%02x\n", - desc, le32_to_cpu(dma_desc->addr_lo), + SDHCI_DUMP("%08llx: DMA 0x%08x, LEN 0x%04x, Attr=0x%02x\n", + (unsigned long long)dma, + le32_to_cpu(dma_desc->addr_lo), le16_to_cpu(dma_desc->len), le16_to_cpu(dma_desc->cmd)); desc += host->desc_sz; + dma += host->desc_sz; if (dma_desc->cmd & cpu_to_le16(ADMA2_END)) break; @@ -2951,7 +2955,8 @@ static void sdhci_data_irq(struct sdhci_ != MMC_BUS_TEST_R) host->data->error = -EILSEQ; else if (intmask & SDHCI_INT_ADMA_ERROR) { - pr_err("%s: ADMA error\n", mmc_hostname(host->mmc)); + pr_err("%s: ADMA error: 0x%08x\n", mmc_hostname(host->mmc), + intmask); sdhci_adma_show_error(host); host->data->error = -EIO; if (host->ops->adma_workaround)