All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Rakity <prakity@marvell.com>
To: Pierre Tardy <tardyp@gmail.com>, Wolfram Sang <w.sang@pengutronix.de>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: [RFC} sdhci.c set_ios -- disable global interrupts and Question on Power Management
Date: Mon, 14 Feb 2011 10:34:01 -0800	[thread overview]
Message-ID: <E5D06E6B-BE70-4446-9F56-32982C119FC0@marvell.com> (raw)
In-Reply-To: <AANLkTikYYo4bJxQEa3+p=gE8iKNHxxbv7JPjB6vnywrs@mail.gmail.com>


On Feb 14, 2011, at 1:29 AM, Pierre Tardy wrote:

> On Mon, Feb 14, 2011 at 6:50 AM, Philip Rakity <prakity@marvell.com> wrote:
>> 
>> Pierre,
>> 
>> are you comfortable with this ?
> The mmc_delay() looks hackish at the first sight. Looks like Pierre
> Ossman was the author, he must have his reasons.
> 
> It looks like the mdelay are not in the fastpath, so why bother.
> 
> And, more important, you will do cond_resched while holding you
> spinlock, which is *bad*.
> What if the mmc stack will call you again from another thread? deadlock...


Assumptions -- Please Confirm 
-------------------------------------------

There is a one to one relationship
between the calls in the core layer into the SD driver.

Each thread is independent of the other.

Each thread maps into exactly one register instance for the SD driver

eg --> 2 threads cannot be active at the same time that use the same
registers in the SD driver.

Question
------------

If these assumptions are correct how can the deadlock happen ?
host->lock is held on a per thread basis.

======

> 
> 
>> diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
>> -static inline void mmc_delay(unsigned int ms)
> why do you want to remove it from here ?
> It is still used by the core code.

moved to include/linux/mmc so okay for sdhci driver.  Did not want to duplicate code.

> 
> 
>> @@ -1043,7 +1043,7 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
>>                        return;
>>                }
>>                timeout--;
>> -               mdelay(1);
>> +               mmc_delay(1);
> This looks like timeout code that never happen in normal condition.
> 
> 
>> @@ -1108,7 +1108,7 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
>>         * can apply clock after applying power
>>         */
>>        if (host->quirks & SDHCI_QUIRK_DELAY_AFTER_POWER)
>> -               mdelay(10);
>> +               mmc_delay(10);
> Do you need this quirk in your platform?

No

> 
> 
> Pierre


  parent reply	other threads:[~2011-02-14 18:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13  5:39 [RFC} sdhci.c set_ios -- disable global interrupts and Question on Power Management Philip Rakity
2011-02-13 10:25 ` Pierre Tardy
2011-02-13 17:57   ` Philip Rakity
2011-02-14  5:50     ` Philip Rakity
2011-02-14  9:29       ` Pierre Tardy
2011-02-14  9:55         ` Wolfram Sang
2011-02-14 17:27           ` Philip Rakity
2011-02-15  9:13             ` Wolfram Sang
2011-02-14 18:34         ` Philip Rakity [this message]
2011-02-14 18:41           ` Tardy, Pierre
2011-02-14 20:17             ` Philip Rakity
2011-02-14 20:44             ` Philip Rakity
2011-02-15  8:39             ` Wolfram Sang
2011-02-15  3:09         ` Philip Rakity

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=E5D06E6B-BE70-4446-9F56-32982C119FC0@marvell.com \
    --to=prakity@marvell.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=tardyp@gmail.com \
    --cc=w.sang@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.