Received: by 10.223.148.5 with SMTP id 5csp7533251wrq; Thu, 18 Jan 2018 06:37:21 -0800 (PST) X-Google-Smtp-Source: ACJfBov9GMLcPCLUBBmh+JcXeEcq9acHuh+4MimPxt1iz60eOduvicjR9z2hcm24F1qIwfFq+c17 X-Received: by 10.98.51.130 with SMTP id z124mr41630635pfz.21.1516286241756; Thu, 18 Jan 2018 06:37:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516286241; cv=none; d=google.com; s=arc-20160816; b=FCod4EFqQeQCarILwhwLdRs1vMhs79Re14Q733W7765DI91e7Yq9ZJcN3hzLkKFU3W CXjTjJrr0hzu6tOhPU9amDC15pBQ4Ac7CWj+Y8sRRJjX+u29651cU25I5xD9fK8A9MJz mgb+a3SupNchdSijFjjQptk39KUDB3RnZagVtUn29j8yEImh0L1HkF/EN/nqvtAT6Fs3 f6BVmd9Wzp3XwJ38haFykaM+V2DrARFyI/Qdja0tUyYNPkXJyrUbl55/e3nbgpIiJoh/ OH8bK1/YANZ7hjw0Rs2T1YeFAon5q88z6rmvp4+d4NpxtKWy+4TowFq5mXBQ9ckdRJnS kkcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=hYrW5T6U5lqdMHxiSLElmq0kjg9QPt2lnNfjBfPrxzM=; b=RxAk5+phUfc0hSKVBM2kvGmPxbEXTRkLsYtgvRy1l03FBH/t9JzXlMUTc4Lu0PSssY 8Ke4EFYyTycscp+bTZYpss86s963UjJ8h3RR977E3a2Dtgf7d/xcOkpJUaOoacI3md1A TG+tCLrtO/Qtc8vMlXzVEK/g6EoOfmDYOBhwYpW4uGCTHWNIMHv9bGJ55VonJhJg7jzp Rj+ALoMoU4KE12nTf1VGjshUNgJaoFNJFiMrL24cEshO7W68wCiiFMYAUiQyKZdilzro QwRwHe7k3h8a73ZLEZJJWaAM1WnzaXe7OA1MBf+VuDmO+DinkPABE506dF9GKLYMuPOE xPRQ== ARC-Authentication-Results: i=1; mx.google.com; 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 v4si6168372pgf.103.2018.01.18.06.37.07; Thu, 18 Jan 2018 06:37:21 -0800 (PST) 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; 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 S1756691AbeAROgc (ORCPT + 99 others); Thu, 18 Jan 2018 09:36:32 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:18838 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756661AbeAROgR (ORCPT ); Thu, 18 Jan 2018 09:36:17 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0IEY960021771; Thu, 18 Jan 2018 15:34:53 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2fgygdmw98-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 18 Jan 2018 15:34:53 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 71D7E38; Thu, 18 Jan 2018 14:34:52 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4EE9A2646; Thu, 18 Jan 2018 14:34:52 +0000 (GMT) Received: from localhost (10.75.127.49) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 18 Jan 2018 15:34:51 +0100 From: To: Russell King , Ulf Hansson , Michael Turquette , Stephen Boyd , Linus Walleij , Rob Herring , Mark Rutland , Alexandre Torgue CC: , , , , , , Patrice Chotard , Andrea Merello Subject: [PATCH v3 02/14] mmc: mmci: Don't pretend all variants to have MCI_STARBITERR flag Date: Thu, 18 Jan 2018 15:34:18 +0100 Message-ID: <1516286070-24927-3-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516286070-24927-1-git-send-email-patrice.chotard@st.com> References: <1516286070-24927-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG3NODE2.st.com (10.75.127.8) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-18_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Patrice Chotard This patch prepares for supporting the STM32 variant that has no such bit in the status register. Signed-off-by: Andrea Merello Signed-off-by: Patrice Chotard --- v3: _ none v2: _ replace start_err bool type by u32 drivers/mmc/host/mmci.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 3125dc0..8a4fbc2 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -83,6 +83,8 @@ * @qcom_dml: enables qcom specific dma glue for dma transfers. * @reversed_irq_handling: handle data irq before cmd irq. * @mmcimask1: true if variant have a MMCIMASK1 register. + * @start_err: bitmask identifying the STARTBITERR bit inside MMCISTATUS + * register. */ struct variant_data { unsigned int clkreg; @@ -113,6 +115,7 @@ struct variant_data { bool qcom_dml; bool reversed_irq_handling; bool mmcimask1; + u32 start_err; }; static struct variant_data variant_arm = { @@ -123,6 +126,7 @@ struct variant_data { .f_max = 100000000, .reversed_irq_handling = true, .mmcimask1 = true, + .start_err = MCI_STARTBITERR, }; static struct variant_data variant_arm_extended_fifo = { @@ -132,6 +136,7 @@ struct variant_data { .pwrreg_powerup = MCI_PWR_UP, .f_max = 100000000, .mmcimask1 = true, + .start_err = MCI_STARTBITERR, }; static struct variant_data variant_arm_extended_fifo_hwfc = { @@ -142,6 +147,7 @@ struct variant_data { .pwrreg_powerup = MCI_PWR_UP, .f_max = 100000000, .mmcimask1 = true, + .start_err = MCI_STARTBITERR, }; static struct variant_data variant_u300 = { @@ -158,6 +164,7 @@ struct variant_data { .pwrreg_clkgate = true, .pwrreg_nopower = true, .mmcimask1 = true, + .start_err = MCI_STARTBITERR, }; static struct variant_data variant_nomadik = { @@ -175,6 +182,7 @@ struct variant_data { .pwrreg_clkgate = true, .pwrreg_nopower = true, .mmcimask1 = true, + .start_err = MCI_STARTBITERR, }; static struct variant_data variant_ux500 = { @@ -198,6 +206,7 @@ struct variant_data { .busy_detect_mask = MCI_ST_BUSYENDMASK, .pwrreg_nopower = true, .mmcimask1 = true, + .start_err = MCI_STARTBITERR, }; static struct variant_data variant_ux500v2 = { @@ -223,6 +232,7 @@ struct variant_data { .busy_detect_mask = MCI_ST_BUSYENDMASK, .pwrreg_nopower = true, .mmcimask1 = true, + .start_err = MCI_STARTBITERR, }; static struct variant_data variant_qcom = { @@ -242,6 +252,7 @@ struct variant_data { .qcom_fifo = true, .qcom_dml = true, .mmcimask1 = true, + .start_err = MCI_STARTBITERR, }; /* Busy detection for the ST Micro variant */ @@ -935,8 +946,9 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) return; /* First check for errors */ - if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR| - MCI_TXUNDERRUN|MCI_RXOVERRUN)) { + if (status & (MCI_DATACRCFAIL | MCI_DATATIMEOUT | + host->variant->start_err | + MCI_TXUNDERRUN | MCI_RXOVERRUN)) { u32 remain, success; /* Terminate the DMA transfer */ -- 1.9.1