public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Gavin Lambert" <gavinl@compacsort.com>
To: "'Jitendra Jain'" <jitendra.jain@einfochips.com>
Cc: linux-mtd@lists.infradead.org
Subject: RE: MEMGETREGIONCOUNT ioctl
Date: Wed, 4 Apr 2007 19:11:58 +1200	[thread overview]
Message-ID: <004501c77688$88c0b930$74fbfea9@gavinlpc> (raw)
In-Reply-To: <00b401c77683$d0be6340$fd09a8c0@jitendrajain>

I'm a bit of an MTD newbie myself, so I could be wrong about some of
this, but:

Quoth Jitendra Jain [jitendra.jain@einfochips.com]:
> As per the driver, the MEMGETREGIONCOUNT returns the
> parameter numeraseregions, which is meant to signify if the
> flash erase size is same throughout or whether it has
> variable sized sectors (which is found on NOR flash devices).
> Why does the util denote that number as number of erase regions ??

Because that's sort of what it is.  If your driver doesn't support the
ioctl at all then callers assume the erase size is constant as given in
the erasesize field of MEMGETINFO.  If it does support the ioctl, then
callers expect it to return the number of erase block size-change
thresholds (since a region can cover multiple erase blocks, provided
they're contiguous and of the same size).

> Next, the MEMGETREGIONINFO seems to copy arguments from User
> to the kernel which I dont understand. This is meant to give
> the User information so, it ought to be copy_to_user.

It's bidirectional.  It has to first copy to the kernel so that the
kernel can read the regionindex field and find out which region the user
wants to know about.  Then once it's filled in the rest of the
kernel-side structure it needs to copy that back to userspace.

  reply	other threads:[~2007-04-04  7:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-04  6:38 MEMGETREGIONCOUNT ioctl Jitendra Jain
2007-04-04  7:11 ` Gavin Lambert [this message]
2007-04-04  7:49   ` MikeW

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='004501c77688$88c0b930$74fbfea9@gavinlpc' \
    --to=gavinl@compacsort.com \
    --cc=jitendra.jain@einfochips.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