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=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 805C7C43381 for ; Wed, 6 Mar 2019 10:09:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CA31206DD for ; Wed, 6 Mar 2019 10:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730090AbfCFKJO (ORCPT ); Wed, 6 Mar 2019 05:09:14 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:9044 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729882AbfCFKJN (ORCPT ); Wed, 6 Mar 2019 05:09:13 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x26A7Kx7008334; Wed, 6 Mar 2019 11:08:59 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2qyhgay5dn-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 06 Mar 2019 11:08:59 +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 814283A; Wed, 6 Mar 2019 10:08:58 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node1.st.com [10.75.127.16]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4AEE125E6; Wed, 6 Mar 2019 10:08:58 +0000 (GMT) Received: from [10.48.0.237] (10.75.127.46) by SFHDAG6NODE1.st.com (10.75.127.16) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 6 Mar 2019 11:08:57 +0100 Subject: Re: [PATCH 1/4] mmc: mmci: avoid fake busy polling To: Ulf Hansson CC: Rob Herring , Srinivas Kandagatla , Maxime Coquelin , Alexandre Torgue , Linux ARM , Linux Kernel Mailing List , DTML , "linux-mmc@vger.kernel.org" , References: <1551802205-32188-1-git-send-email-ludovic.Barre@st.com> <1551802205-32188-2-git-send-email-ludovic.Barre@st.com> <5b531f55-b8a0-5a83-4a7c-727013a66820@st.com> From: Ludovic BARRE Message-ID: <15ce68e6-136f-7e9b-553c-968a0653a9b8@st.com> Date: Wed, 6 Mar 2019 11:08:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG3NODE3.st.com (10.75.127.9) To SFHDAG6NODE1.st.com (10.75.127.16) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-06_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ulf I could have a snowball board, I don't remember if it a ux500v1 or v2? This board has been removed of u-boot mainline, do you have a specific repository for snowball or what branch do you advise? do you have a snowball wiki (up-to-date) for flashing... BR Ludo On 3/6/19 10:49 AM, Ulf Hansson wrote: > On Wed, 6 Mar 2019 at 10:04, Ludovic BARRE wrote: >> >> Hi Ulf >> >> On 3/6/19 10:00 AM, Ulf Hansson wrote: >>> On Tue, 5 Mar 2019 at 17:10, Ludovic Barre wrote: >>>> >>>> From: Ludovic Barre >>>> >>>> The busy status bit could occurred even if no busy response is >>>> expected (example cmd11). On sdmmc variant, the busy_detect_flag >>>> reflects inverted value of d0 state, it's sampled at the end of a >>>> CMD response and a second time 2 clk cycles after the CMD response. >>>> To avoid a fake busy, the busy status could be checked and polled >>>> only if the command has RSP_BUSY flag. >>>> >>>> Signed-off-by: Ludovic Barre >>> >>> Before I review this, can you tell what HW you have tested this on? >> >> I tested on stm32mp157c (stm32_sdmmc variant) > > Okay, I see. So we need to get this tested for the ux500v2 variant as > well. I try to get some time to do that, soon. > > However it seems like you could benefit from having one of those > boards yourself. It would speed up the process, as you wouldn't have > to rely on me doing the test. :-) Is there a chance of you could dig > up some of these old boards from somewhere? > > Kind regards > Uffe > >> >>> >>> Kind regards >>> Uffe >>> >>>> --- >>>> drivers/mmc/host/mmci.c | 19 +++++++++++++------ >>>> 1 file changed, 13 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c >>>> index 387ff14..4901b73 100644 >>>> --- a/drivers/mmc/host/mmci.c >>>> +++ b/drivers/mmc/host/mmci.c >>>> @@ -1220,12 +1220,13 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, >>>> unsigned int status) >>>> { >>>> void __iomem *base = host->base; >>>> - bool sbc; >>>> + bool sbc, busy_resp; >>>> >>>> if (!cmd) >>>> return; >>>> >>>> sbc = (cmd == host->mrq->sbc); >>>> + busy_resp = !!(cmd->flags & MMC_RSP_BUSY); >>>> >>>> /* >>>> * We need to be one of these interrupts to be considered worth >>>> @@ -1239,8 +1240,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, >>>> /* >>>> * ST Micro variant: handle busy detection. >>>> */ >>>> - if (host->variant->busy_detect) { >>>> - bool busy_resp = !!(cmd->flags & MMC_RSP_BUSY); >>>> + if (busy_resp && host->variant->busy_detect) { >>>> >>>> /* We are busy with a command, return */ >>>> if (host->busy_status && >>>> @@ -1253,7 +1253,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, >>>> * that the special busy status bit is still set before >>>> * proceeding. >>>> */ >>>> - if (!host->busy_status && busy_resp && >>>> + if (!host->busy_status && >>>> !(status & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT)) && >>>> (readl(base + MMCISTATUS) & host->variant->busy_detect_flag)) { >>>> >>>> @@ -1508,6 +1508,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) >>>> { >>>> struct mmci_host *host = dev_id; >>>> u32 status; >>>> + bool busy_resp; >>>> int ret = 0; >>>> >>>> spin_lock(&host->lock); >>>> @@ -1550,9 +1551,15 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) >>>> } >>>> >>>> /* >>>> - * Don't poll for busy completion in irq context. >>>> + * Don't poll for: >>>> + * -busy completion in irq context. >>>> + * -no busy response expected. >>>> */ >>>> - if (host->variant->busy_detect && host->busy_status) >>>> + busy_resp = host->cmd ? >>>> + !!(host->cmd->flags & MMC_RSP_BUSY) : false; >>>> + >>>> + if (host->variant->busy_detect && >>>> + (!busy_resp || host->busy_status)) >>>> status &= ~host->variant->busy_detect_flag; >>>> >>>> ret = 1; >>>> -- >>>> 2.7.4 >>>> From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic BARRE Subject: Re: [PATCH 1/4] mmc: mmci: avoid fake busy polling Date: Wed, 6 Mar 2019 11:08:57 +0100 Message-ID: <15ce68e6-136f-7e9b-553c-968a0653a9b8@st.com> References: <1551802205-32188-1-git-send-email-ludovic.Barre@st.com> <1551802205-32188-2-git-send-email-ludovic.Barre@st.com> <5b531f55-b8a0-5a83-4a7c-727013a66820@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Ulf Hansson Cc: Rob Herring , Srinivas Kandagatla , Maxime Coquelin , Alexandre Torgue , Linux ARM , Linux Kernel Mailing List , DTML , "linux-mmc@vger.kernel.org" , linux-stm32@st-md-mailman.stormreply.com List-Id: devicetree@vger.kernel.org Hi Ulf I could have a snowball board, I don't remember if it a ux500v1 or v2? This board has been removed of u-boot mainline, do you have a specific repository for snowball or what branch do you advise? do you have a snowball wiki (up-to-date) for flashing... BR Ludo On 3/6/19 10:49 AM, Ulf Hansson wrote: > On Wed, 6 Mar 2019 at 10:04, Ludovic BARRE wrote: >> >> Hi Ulf >> >> On 3/6/19 10:00 AM, Ulf Hansson wrote: >>> On Tue, 5 Mar 2019 at 17:10, Ludovic Barre wrote: >>>> >>>> From: Ludovic Barre >>>> >>>> The busy status bit could occurred even if no busy response is >>>> expected (example cmd11). On sdmmc variant, the busy_detect_flag >>>> reflects inverted value of d0 state, it's sampled at the end of a >>>> CMD response and a second time 2 clk cycles after the CMD response. >>>> To avoid a fake busy, the busy status could be checked and polled >>>> only if the command has RSP_BUSY flag. >>>> >>>> Signed-off-by: Ludovic Barre >>> >>> Before I review this, can you tell what HW you have tested this on? >> >> I tested on stm32mp157c (stm32_sdmmc variant) > > Okay, I see. So we need to get this tested for the ux500v2 variant as > well. I try to get some time to do that, soon. > > However it seems like you could benefit from having one of those > boards yourself. It would speed up the process, as you wouldn't have > to rely on me doing the test. :-) Is there a chance of you could dig > up some of these old boards from somewhere? > > Kind regards > Uffe > >> >>> >>> Kind regards >>> Uffe >>> >>>> --- >>>> drivers/mmc/host/mmci.c | 19 +++++++++++++------ >>>> 1 file changed, 13 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c >>>> index 387ff14..4901b73 100644 >>>> --- a/drivers/mmc/host/mmci.c >>>> +++ b/drivers/mmc/host/mmci.c >>>> @@ -1220,12 +1220,13 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, >>>> unsigned int status) >>>> { >>>> void __iomem *base = host->base; >>>> - bool sbc; >>>> + bool sbc, busy_resp; >>>> >>>> if (!cmd) >>>> return; >>>> >>>> sbc = (cmd == host->mrq->sbc); >>>> + busy_resp = !!(cmd->flags & MMC_RSP_BUSY); >>>> >>>> /* >>>> * We need to be one of these interrupts to be considered worth >>>> @@ -1239,8 +1240,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, >>>> /* >>>> * ST Micro variant: handle busy detection. >>>> */ >>>> - if (host->variant->busy_detect) { >>>> - bool busy_resp = !!(cmd->flags & MMC_RSP_BUSY); >>>> + if (busy_resp && host->variant->busy_detect) { >>>> >>>> /* We are busy with a command, return */ >>>> if (host->busy_status && >>>> @@ -1253,7 +1253,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, >>>> * that the special busy status bit is still set before >>>> * proceeding. >>>> */ >>>> - if (!host->busy_status && busy_resp && >>>> + if (!host->busy_status && >>>> !(status & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT)) && >>>> (readl(base + MMCISTATUS) & host->variant->busy_detect_flag)) { >>>> >>>> @@ -1508,6 +1508,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) >>>> { >>>> struct mmci_host *host = dev_id; >>>> u32 status; >>>> + bool busy_resp; >>>> int ret = 0; >>>> >>>> spin_lock(&host->lock); >>>> @@ -1550,9 +1551,15 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) >>>> } >>>> >>>> /* >>>> - * Don't poll for busy completion in irq context. >>>> + * Don't poll for: >>>> + * -busy completion in irq context. >>>> + * -no busy response expected. >>>> */ >>>> - if (host->variant->busy_detect && host->busy_status) >>>> + busy_resp = host->cmd ? >>>> + !!(host->cmd->flags & MMC_RSP_BUSY) : false; >>>> + >>>> + if (host->variant->busy_detect && >>>> + (!busy_resp || host->busy_status)) >>>> status &= ~host->variant->busy_detect_flag; >>>> >>>> ret = 1; >>>> -- >>>> 2.7.4 >>>> 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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=unavailable 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 EA408C10F00 for ; Wed, 6 Mar 2019 10:09:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B47A9213A2 for ; Wed, 6 Mar 2019 10:09:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GyCOTOqJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B47A9213A2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+rkjZ2bO9l2sTwt5BKj0tYVWu5vxFYIhQohhGmADqIE=; b=GyCOTOqJumMi+HIzKUZZWDPnb 27F6u7jAgC0n04cHKVmXAgTHBQjBoctBTE3dl5oChC7viDBWcrJsuLRtazUuZy3GGbflUPCVEKgi9 CzYNwLu7reqyO0M40bGbDoxKuLa/R7wZnGZFQq1um7xShpa2uRA3U8YbTYXEo4J38inJH08FGJUKs Oku6Vr2EHHerOR3yVy/mBwuaNDQV1rilETQJApIWqfmDbO9wMzIGf81/OWV56Dv2VWkerUnw+vPgL GWToi/+ehx1CIjxLV5tKcflrRkBcaHkVtUf3qP5m19ZQGvWWL6mqz2/Yfy9GkTFXPx2VwuE+zzVhe uh5lOHcRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1TU7-0004eX-E5; Wed, 06 Mar 2019 10:09:11 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1TU3-0004dE-K1 for linux-arm-kernel@lists.infradead.org; Wed, 06 Mar 2019 10:09:09 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x26A7Kx7008334; Wed, 6 Mar 2019 11:08:59 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2qyhgay5dn-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 06 Mar 2019 11:08:59 +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 814283A; Wed, 6 Mar 2019 10:08:58 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node1.st.com [10.75.127.16]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4AEE125E6; Wed, 6 Mar 2019 10:08:58 +0000 (GMT) Received: from [10.48.0.237] (10.75.127.46) by SFHDAG6NODE1.st.com (10.75.127.16) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 6 Mar 2019 11:08:57 +0100 Subject: Re: [PATCH 1/4] mmc: mmci: avoid fake busy polling To: Ulf Hansson References: <1551802205-32188-1-git-send-email-ludovic.Barre@st.com> <1551802205-32188-2-git-send-email-ludovic.Barre@st.com> <5b531f55-b8a0-5a83-4a7c-727013a66820@st.com> From: Ludovic BARRE Message-ID: <15ce68e6-136f-7e9b-553c-968a0653a9b8@st.com> Date: Wed, 6 Mar 2019 11:08:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG3NODE3.st.com (10.75.127.9) To SFHDAG6NODE1.st.com (10.75.127.16) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-06_07:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190306_020907_938158_8BAC379C X-CRM114-Status: GOOD ( 23.94 ) 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: DTML , Alexandre Torgue , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , Rob Herring , Srinivas Kandagatla , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, Linux ARM Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ulf I could have a snowball board, I don't remember if it a ux500v1 or v2? This board has been removed of u-boot mainline, do you have a specific repository for snowball or what branch do you advise? do you have a snowball wiki (up-to-date) for flashing... BR Ludo On 3/6/19 10:49 AM, Ulf Hansson wrote: > On Wed, 6 Mar 2019 at 10:04, Ludovic BARRE wrote: >> >> Hi Ulf >> >> On 3/6/19 10:00 AM, Ulf Hansson wrote: >>> On Tue, 5 Mar 2019 at 17:10, Ludovic Barre wrote: >>>> >>>> From: Ludovic Barre >>>> >>>> The busy status bit could occurred even if no busy response is >>>> expected (example cmd11). On sdmmc variant, the busy_detect_flag >>>> reflects inverted value of d0 state, it's sampled at the end of a >>>> CMD response and a second time 2 clk cycles after the CMD response. >>>> To avoid a fake busy, the busy status could be checked and polled >>>> only if the command has RSP_BUSY flag. >>>> >>>> Signed-off-by: Ludovic Barre >>> >>> Before I review this, can you tell what HW you have tested this on? >> >> I tested on stm32mp157c (stm32_sdmmc variant) > > Okay, I see. So we need to get this tested for the ux500v2 variant as > well. I try to get some time to do that, soon. > > However it seems like you could benefit from having one of those > boards yourself. It would speed up the process, as you wouldn't have > to rely on me doing the test. :-) Is there a chance of you could dig > up some of these old boards from somewhere? > > Kind regards > Uffe > >> >>> >>> Kind regards >>> Uffe >>> >>>> --- >>>> drivers/mmc/host/mmci.c | 19 +++++++++++++------ >>>> 1 file changed, 13 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c >>>> index 387ff14..4901b73 100644 >>>> --- a/drivers/mmc/host/mmci.c >>>> +++ b/drivers/mmc/host/mmci.c >>>> @@ -1220,12 +1220,13 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, >>>> unsigned int status) >>>> { >>>> void __iomem *base = host->base; >>>> - bool sbc; >>>> + bool sbc, busy_resp; >>>> >>>> if (!cmd) >>>> return; >>>> >>>> sbc = (cmd == host->mrq->sbc); >>>> + busy_resp = !!(cmd->flags & MMC_RSP_BUSY); >>>> >>>> /* >>>> * We need to be one of these interrupts to be considered worth >>>> @@ -1239,8 +1240,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, >>>> /* >>>> * ST Micro variant: handle busy detection. >>>> */ >>>> - if (host->variant->busy_detect) { >>>> - bool busy_resp = !!(cmd->flags & MMC_RSP_BUSY); >>>> + if (busy_resp && host->variant->busy_detect) { >>>> >>>> /* We are busy with a command, return */ >>>> if (host->busy_status && >>>> @@ -1253,7 +1253,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, >>>> * that the special busy status bit is still set before >>>> * proceeding. >>>> */ >>>> - if (!host->busy_status && busy_resp && >>>> + if (!host->busy_status && >>>> !(status & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT)) && >>>> (readl(base + MMCISTATUS) & host->variant->busy_detect_flag)) { >>>> >>>> @@ -1508,6 +1508,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) >>>> { >>>> struct mmci_host *host = dev_id; >>>> u32 status; >>>> + bool busy_resp; >>>> int ret = 0; >>>> >>>> spin_lock(&host->lock); >>>> @@ -1550,9 +1551,15 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) >>>> } >>>> >>>> /* >>>> - * Don't poll for busy completion in irq context. >>>> + * Don't poll for: >>>> + * -busy completion in irq context. >>>> + * -no busy response expected. >>>> */ >>>> - if (host->variant->busy_detect && host->busy_status) >>>> + busy_resp = host->cmd ? >>>> + !!(host->cmd->flags & MMC_RSP_BUSY) : false; >>>> + >>>> + if (host->variant->busy_detect && >>>> + (!busy_resp || host->busy_status)) >>>> status &= ~host->variant->busy_detect_flag; >>>> >>>> ret = 1; >>>> -- >>>> 2.7.4 >>>> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel