All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: "Gao, Yunpeng" <yunpeng.gao@intel.com>
Cc: "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: help! locks problem in block layer request queue?
Date: Thu, 19 Feb 2009 14:13:05 +0100	[thread overview]
Message-ID: <20090219131305.GD29783@kernel.dk> (raw)
In-Reply-To: <38D9F46DFF92C54980D2F2C1E8EE313024842389@pdsmsx503.ccr.corp.intel.com>

On Thu, Feb 19 2009, Gao, Yunpeng wrote:
> 
> Hi all,
> 
> Sorry for the too long email. But I encountered a kernle OOP problem
> when testing my standalone NAND block driver (it's almost a normal
> block device driver) and not sure why this happen.
> 
> In my development environment, the linux 2.6.27 kernel boot with
> initrd, then 'chroot' to an MMC card. After chroot, I try to mkfs.ext3
> on NAND device. but it caused the kernel OOP message.  If I mkfs.ext3
> on NAND device before chroot, then it works well (it can mount/umount,
> copy file correctly accross system reboot).
> 
> Below is the log message (/dev/mmcblk0 is the MMC card device node,
> and /dev/nda is the NAND flash device node) and part of the driver
> code.
> 
> From the OOP message, It seems there's improper usage of locks in my
> driver code, but actually, there only one spinlock used in the driver
> (spinlock_t qlock defined in struct spectra_nand_dev). And it only
> used by registered request queue. Also, I used a semaphore
> ('spectra_sem') to prevent the low layer function from being
> re-entered. As the low layer (hardware layer) now works in PIO mode
> and it's very slowly, so maybe it holds the spinlock or semaphore for
> too long time?

You call the bvec_kmap_irq() and then call a function that does a
down(). This is illegal, as you cannot block/schedule with interrupts
disabled.

-- 
Jens Axboe


  reply	other threads:[~2009-02-19 13:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-19 11:53 help! locks problem in block layer request queue? Gao, Yunpeng
2009-02-19 13:13 ` Jens Axboe [this message]
2009-02-21  9:24   ` Gao, Yunpeng
2009-02-21  9:24     ` Gao, Yunpeng
2009-02-23  7:18     ` Jens Axboe

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=20090219131305.GD29783@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yunpeng.gao@intel.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 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.