linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Balaji T K <balajitk@ti.com>
To: Tony Lindgren <tony@atomide.com>
Cc: Andreas Fenkart <afenkart@gmail.com>, Chris Ball <cjb@laptop.org>,
	linux-omap@vger.kernel.org, linux-mmc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] mmc: omap_hsmmc: Enable SDIO interrupt
Date: Thu, 26 Sep 2013 20:01:34 +0530	[thread overview]
Message-ID: <52444546.4060303@ti.com> (raw)
In-Reply-To: <20130926141936.GE8949@atomide.com>

On Thursday 26 September 2013 07:49 PM, Tony Lindgren wrote:
> Hi,
>
> * Andreas Fenkart <afenkart@gmail.com> [130926 01:34]:
>> 2013/9/26 Tony Lindgren <tony@atomide.com>:
>>> @@ -463,27 +469,34 @@ static void omap_hsmmc_stop_clock(struct omap_hsmmc_host *host)
>>>   static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host,
>>>                                    struct mmc_command *cmd)
>>>   {
>>> -       unsigned int irq_mask;
>>> +       u32 irq_mask = INT_EN_MASK;
>>> +       unsigned long flags;
>>>
>>>          if (host->use_dma)
>>> -               irq_mask = INT_EN_MASK & ~(BRR_EN | BWR_EN);
>>> -       else
>>> -               irq_mask = INT_EN_MASK;
>>> +               irq_mask &= ~(BRR_EN | BWR_EN);
>>>
>>>          /* Disable timeout for erases */
>>>          if (cmd->opcode == MMC_ERASE)
>>>                  irq_mask &= ~DTO_EN;
>>>
>>> +       spin_lock_irqsave(&host->irq_lock, flags);
>>>          OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
>>>          OMAP_HSMMC_WRITE(host->base, ISE, irq_mask);
>>> +       if (host->flags & HSMMC_SDIO_IRQ_ENABLED)
>>> +               irq_mask |= CIRQ_EN;
>>>          OMAP_HSMMC_WRITE(host->base, IE, irq_mask);
>>> +       spin_unlock_irqrestore(&host->irq_lock, flags);
>>>   }
>>>
>>>   static void omap_hsmmc_disable_irq(struct omap_hsmmc_host *host)
>>>   {
>>> +       unsigned long flags;
>>> +
>>> +       spin_lock_irqsave(&host->irq_lock, flags);
>>>          OMAP_HSMMC_WRITE(host->base, ISE, 0);
>>>          OMAP_HSMMC_WRITE(host->base, IE, 0);
>>>          OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
>>
>> This is wrong. SDIO IRQ must not be disabled upon host initiated transfer.
>> see omap_hsmmc_request_done
>
> Hmm I don't quite follow you here, are you saying that
> omap_hsmmc_request_done() should call this conditionally?
>
> Or maybe even do a patch on top of this based on what you discovered
> with your earlier patches?
Hi Tony,

Resetting CIRQ_ENABLE in ISE and IE, clears the (latched) pending CIRQ_EN
if set in STAT register and also disables SDIO interrupt during interrupt
period (outside of command/data transaction).

+	u32 irq_mask = 0;
+	unsigned long flags;
+
+	spin_lock_irqsave(&host->irq_lock, flags);
+
+	/* no transfer running, need to signal cirq if */
+	if (host->sdio_irq_en)
+		irq_mask |= CIRQ_EN;
+
+	OMAP_HSMMC_WRITE(host->base, ISE, irq_mask);
+	OMAP_HSMMC_WRITE(host->base, IE, irq_mask);

I will try testing these patches with above code change and let you know


  reply	other threads:[~2013-09-26 14:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-25 23:47 [PATCH 0/2] patches to enable SDIO interrupt support for omap_hsmmc for v3.13 Tony Lindgren
2013-09-25 23:47 ` [PATCH 1/2] mmc: omap_hsmmc: Fix context save and restore for DT Tony Lindgren
2013-09-25 23:47 ` [PATCH 2/2] mmc: omap_hsmmc: Enable SDIO interrupt Tony Lindgren
2013-09-26  8:26   ` Andreas Fenkart
2013-09-26 14:19     ` Tony Lindgren
2013-09-26 14:31       ` Balaji T K [this message]
2013-09-27  6:38       ` Andreas Fenkart
2013-09-27 21:10         ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52444546.4060303@ti.com \
    --to=balajitk@ti.com \
    --cc=afenkart@gmail.com \
    --cc=cjb@laptop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).