From patchwork Fri Jan 12 12:15:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 10160649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3970260327 for ; Fri, 12 Jan 2018 12:26:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2142E289D2 for ; Fri, 12 Jan 2018 12:26:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 161EC289D7; Fri, 12 Jan 2018 12:26:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9AE05289D2 for ; Fri, 12 Jan 2018 12:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b8HEz/jP60v66H6PSMidExmvTk22YXuKp6EvJW4M3Rw=; b=t0f6nz8S0jCT4C 5gc6Oi90EVmHTPulgPTA4WpMAWH1NRiKzFFJ6SRBrxNIDfc+/xppi6PKbBhNraMCYrOhl1TqO76wG GGiq8pRN0CWYq9oq0jriQGSKLVM9+RJ1PSLTpTVJh90s9oGZ1iQA7zdFNJ1F6vTkYnxuv8midq9zx ajKvxuDwLfNtN9CUpI554iPSMTshFMh4V4TqgPcGZh+s2SDqsJyMlCD8bc12nEqW2M77g3BfUTEHR i6n7ahw09SPn317b7upPjAnM5pQ+pHtZk4ktU7m24BGGNNl7atXntWK5QzJPwaXWmrlmJeKkyxSgn BLSOpX+7fbHgmT2qZmwQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eZyPt-0003dU-Ex; Fri, 12 Jan 2018 12:26:37 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eZyNc-00080k-2O for linux-arm-kernel@bombadil.infradead.org; Fri, 12 Jan 2018 12:24:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Bqc3V3F9YxUlYsOnv6w72qnMv4RodstngRKEvgCYXiM=; b=VGpW6DNW1xCz7ZtNZoIs5GCZ/ Hh2sSp8Z5Kw/HfBl2NrGQVaJ0Ot65Zbk2K/xLjteRLSo8d2STOOImHKaEngwoFGb1wndgSTYSYIKD serG5iT1h1sVZJsIp0OVJgA4dhMtUG5QKEgCOyXEjFrvuUQ0JIvJUfjB0hW0rj0NnvEl3Y43cGkpg HzOnLsYRgI+sXG8QgthnFMZnQvAzAloTUK1YDuhhxXo+rVbhBcKRD+5xfwcrJAlL0xbGWXT9dj9Th orwl4vXayNbWW2Za8gIK6xr7orfH952uh7omsp8TqkpflXLruHHJm1wGXhW5nhEOpq4+1e9iwN1R2 yKwTcynZA==; Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eZyGl-0003gi-HE for linux-arm-kernel@lists.infradead.org; Fri, 12 Jan 2018 12:17:13 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0CCDdPr015412; Fri, 12 Jan 2018 13:16:19 +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 2fe739e73n-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 12 Jan 2018 13:16:19 +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 1686734; Fri, 12 Jan 2018 12:16:19 +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 D95D424C1; Fri, 12 Jan 2018 12:16:18 +0000 (GMT) Received: from localhost (10.75.127.44) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 12 Jan 2018 13:16:18 +0100 From: To: Russell King , Ulf Hansson , Michael Turquette , Stephen Boyd , Linus Walleij , Rob Herring , Mark Rutland , Alexandre Torgue Subject: [PATCH 02/14] mmc: mmci: Don't pretend all variants to have MCI_STARBITERR flag Date: Fri, 12 Jan 2018 13:15:56 +0100 Message-ID: <1515759368-16946-3-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515759368-16946-1-git-send-email-patrice.chotard@st.com> References: <1515759368-16946-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-12_06:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180112_121711_821988_C5C0C6F2 X-CRM114-Status: GOOD ( 19.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Andrea Merello , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Patrice Chotard , linux-gpio@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Linus Walleij --- 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..7e56f85 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: true is the variant has 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; + bool 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 = true, }; 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 = true, }; 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 = true, }; static struct variant_data variant_u300 = { @@ -158,6 +164,7 @@ struct variant_data { .pwrreg_clkgate = true, .pwrreg_nopower = true, .mmcimask1 = true, + .start_err = true, }; static struct variant_data variant_nomadik = { @@ -175,6 +182,7 @@ struct variant_data { .pwrreg_clkgate = true, .pwrreg_nopower = true, .mmcimask1 = true, + .start_err = true, }; 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 = true, }; 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 = true, }; static struct variant_data variant_qcom = { @@ -242,6 +252,7 @@ struct variant_data { .qcom_fifo = true, .qcom_dml = true, .mmcimask1 = true, + .start_err = true, }; /* 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_STARTBITERR : 0) | + MCI_TXUNDERRUN | MCI_RXOVERRUN)) { u32 remain, success; /* Terminate the DMA transfer */