[PATCH][MTD] mtdpart.c: allow other drivers to get physical address of partition

Jörn Engel joern at logfs.org
Fri Aug 3 08:47:45 EDT 2007


On Thu, 2 August 2007 23:42:06 -0700, Jared Hulbert wrote:
> 
> > point() doesn't have to be replaced.  My completely untested and
> > uncompiled patch below adds another parameter to point() to return the
> > physical address in.  Parameter is optional and only cfi_cmdset_0001.c
> > currently allows it.
> 
> Hey I just thought of a different approach.  What about something like:
> 
> int mtd_insert_mem(struct mtd_info *mtd, struct vm_area_struct *vma,
> unsigned long addr, unsigned long offset)
> {
>      struct map_info *map = mtd->priv;
>      unsigned long pfn;
> 
>      pfn = (map->phys + offset) >> PAGE_SHIFT;
>      return vm_insert_pfn(vma, addr, pfn);
> }
> 
> This way we don't need to export the physical address and we keep the
> vm calls in the driver world.

Hard to tell without looking at the AXFS code as well.  And it might
trigger some janitor to remove this "completely unused function" shortly
after introducing it.

How impolite would it be to ask for AXFS again? :)

Jörn

-- 
"Security vulnerabilities are here to stay."
-- Scott Culp, Manager of the Microsoft Security Response Center, 2001



More information about the linux-mtd mailing list