Subject: mmap problem another :)

From: Dmitriy Tochansky <[email-masked]>
Date: Wed, 8 Dec 2004 19:40:14 +0300

Ok. I did as you say and got that mmap func:

static int
mdrv_mmap (struct file *file, struct vm_area_struct *vma)
{
  unsigned long offset = 0;
  int ret;
  struct inode *inode;
  inode = file->f_dentry->d_inode;

  struct pci_dev *curdev = NULL;

  int minor = MINOR (inode->i_rdev);
  
  printk("minor = 0x%X\n",minor);

  curdev = (devs[minor]);

  unsigned long start = vma->vm_start;
  unsigned long size = (vma->vm_end - vma->vm_start);
  offset = pci_resource_start (curdev, IOMEM0);
  
  printk("offset = 0x%X\n",(unsigned int)offset);

  ret = remap_page_range_high (start, offset, size, vma->vm_page_prot);
  
  return ret;
}

And it works fine but... but when I try to do mmap not /dev/mboard0 but /dev/mboard1 Im again
have the "bad" result. :( Is there something specific to mmap several devices?

---

From: Dan Malek <[email-masked]>
Date: Wed, 8 Dec 2004 12:27:02 -0500

>   ret = remap_page_range_high (start, offset, size, vma->vm_page_prot);

Hmmm....this is in 2.4?  Did you apply all of the 36-bit IO
patch as Pete Popov has mentioned in past e-mail messages?
Did you make sure you enabled CONFIG_64BIT_PHYS_ADDR?

I know this does work.  In fact, you should just use
io_remap_page_range().  If that doesn't work, something
is wrong with the kernel configuration.

	-- Dan

---

From: Pete Popov <[email-masked]>
Date: Wed, 08 Dec 2004 10:20:38 -0800

> patch as Pete Popov has mentioned in past e-mail messages?

The 36 bit patch is integrated in 2.4, and now in 2.6. The above 
code looks like 2.4.

Pete

---

From: Dmitriy Tochansky <[email-masked]>
Date: Thu, 9 Dec 2004 09:56:59 +0300

On Wed, 8 Dec 2004 12:27:02 -0500

> patch as Pete Popov has mentioned in past e-mail messages?
  Could you please direct me where it is exectly? In this maillist? May be on the web?

> Did you make sure you enabled CONFIG_64BIT_PHYS_ADDR?
  Yes. I'm sure.