All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kirill Tkhai <tkhai@yandex.ru>
To: Georg Gast <georg@schorsch-tech.de>,
	"linux-rt-users@vger.kernel.org" <linux-rt-users@vger.kernel.org>
Subject: Re: Searching a Bug on Raspberry Pi
Date: Thu, 04 Jul 2013 16:14:07 +0400	[thread overview]
Message-ID: <393651372940047@web30e.yandex.ru> (raw)
In-Reply-To: <51CF2756.5080509@schorsch-tech.de>

Hi, Georg!

29.06.2013, 22:39, "Georg Gast" <georg@schorsch-tech.de>:
> Hi there!
>
> Currently i try to locate a bug in sdhci.c on RaspberryPi. I know it is
> not the mainline kernel...
>
> Currently i use Kernel 3.8.13 and RT Patch 3.8.13-rt12 on the kernel
> found at git://github.com/raspberrypi/linux.git on branch rpi-3.8.y.
>
> The bug shows up as booting and after 3 seconds of booting as it wants
> to mount the rootfs in a deadlock. as i compiled sdhci_bcm2708 as a
> module i can boot the kernel and system as i pushed the system to a usb
> stick. As far as good.
>
> Now i try to find the bug, if the rootfs is on the sdcard. I narrowd the
> deadlock down to the following lines:
>
> void sdhci_spin_lock_irqsave(struct sdhci_host *host,unsigned long *flags)
> {
>      return;
> #ifdef CONFIG_PREEMPT
>      if(enable_llm)
>      {
>          while(sdhci_locked)
>          {
>              preempt_schedule();
>          }
>          spin_lock_irqsave(&host->lock,*flags);
>          disable_irq(host->irq);
>          if(host->second_irq)
>              disable_irq(host->second_irq);
>          local_irq_enable();
>      }
>      else
> #endif
>          spin_lock_irqsave(&host->lock,*flags);
> }
>
> void sdhci_spin_unlock_irqrestore(struct sdhci_host *host,unsigned long
> flags)
> {
>      return;
> #ifdef CONFIG_PREEMPT
>      if(enable_llm)
>      {
>          local_irq_disable();
>          if(host->second_irq)
>              enable_irq(host->second_irq);
>          enable_irq(host->irq);
>      }
> #endif
>      spin_unlock_irqrestore(&host->lock,flags);
> }
>
> in drivers/mmc/host/sdhci.c . The both return statements are added by
> me. Now i can boot the RT Preempt kernel but it is for sure not the
> right fix.
>
> My problem is, that i dont know how those both functions should work
> with the rt preempt patch.

Spinlocks transform to mutexes on RT kernel and really functions like
spin_lock_irqsave() do not disable interrupts. Your problem can be connected
with that.

If you code works on !RT kernel you should convert the type of host->lock
from spinlock_t to raw_spinlock_t and all of spin_lock_irqsave()
to raw_spin_lock_irqsave() etc.

I think this will help you. Sadly, I don't have enough time to look at whole of your
driver.

Kirill
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-07-04 12:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-29 18:28 Searching a Bug on Raspberry Pi Georg Gast
2013-07-04 12:14 ` Kirill Tkhai [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-06-29 20:14 Georg Gast
     [not found] ` <CAFSh4Uz7B8L5Y0nsp1bW4pgPkyqHtXDSM0R-PiRLZQfd+URFYw@mail.gmail.com>
2013-06-30  4:42   ` Georg Gast
2013-07-04 10:45     ` Jeremy Jongepier

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=393651372940047@web30e.yandex.ru \
    --to=tkhai@yandex.ru \
    --cc=georg@schorsch-tech.de \
    --cc=linux-rt-users@vger.kernel.org \
    /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.