public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: tglx@linutronix.de (Thomas Gleixner)
To: "Eisenhut, Daniel (MED)" <Daniel.Eisenhut@med.ge.com>,
	"'linux-mtd@lists.infradead.org'" <linux-mtd@lists.infradead.org>
Subject: Re: Accessing an MTD device from kernel space
Date: Wed, 26 May 2004 23:26:29 +0200	[thread overview]
Message-ID: <200405262326.29385.tglx@linutronix.de> (raw)
In-Reply-To: <77FE4A1FA59FF947845A42194AD6676202E30F72@uswaumsx07medge.med.ge.com>

On Wednesday 26 May 2004 23:21, Eisenhut, Daniel (MED) wrote:
> To list,
>
> I've successfully setup MTD devices for our NOR flash chips and
> everything is working great from userspace.  But I have a need to access
> the NOR flash from within kernelspace, such as in a /proc entry.
>
> What is the best way to access the flash from within the kernel?  The
> only way I've be able to so far is to just dereference a pointer
> pointing to the flash address.  But this creates two issues (that I know
> about):
>
> 1. A race condition between my proc entry that reads the flash and
> another process using the MTD device.
>
> 2. The MTD device does not always leave the flash chip in read mode.
>
> Is there anything setup in the current MTD code to allow access from
> within the kernel?

Just use the mtd API which is used from fs drivers and anything else which 
accessed the mtd devices from kernel space

mtd->read(....), mtd->erase(...) 

-- 
Thomas
________________________________________________________________________
Steve Ballmer quotes the statistic that IT pros spend 70 percent of their 
time managing existing systems. That couldn’t have anything to do with 
the fact that 99 percent of these systems run Windows, could it?
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: tglx@linutronix.de

  reply	other threads:[~2004-05-26 21:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-26 21:21 Accessing an MTD device from kernel space Eisenhut, Daniel (MED)
2004-05-26 21:26 ` Thomas Gleixner [this message]
2004-05-26 23:38   ` Dan Eisenhut

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=200405262326.29385.tglx@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=Daniel.Eisenhut@med.ge.com \
    --cc=linux-mtd@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox