Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8717261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:15:52+00:00 2026-06-13T06:15:52+00:00

I have a PCI device, its Linux driver, and a user-space application. The application

  • 0

I have a PCI device, its Linux driver, and a user-space application. The application mmap’s the first BAR of the PCI device through the driver. All the access are done through 32-bits integers, and this is important since reading/writing to a register may have side effects (starting an operation etc.).

On x86 platforms, this works very well. However, I just moved to an ARM platform, and I have a strange behaviour :

  • Reads/Writes from the driver behave correctly
  • Reads from the user-space triggers a 64 bytes PCI read request, which cannot be fulfilled by my device since it accepts only 32-bits accesses (+ I don’t want that because of side effects).

I think the problem is that the mmap wants to prefetch some data and issues this 64 bytes read.
Am I missing a flag or something that could disable some sort of mmap prefetching ?

My current mmap implementation on the driver’s side is simply

vma->vm_flags |= VM_RESERVED;
remap_pfn_range(vma,vma->vm_start,  pfn, Size_UL, vma->vm_page_prot)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:15:53+00:00Added an answer on June 13, 2026 at 6:15 am

    I found the solution !

    As a colleague suggested, 64 bytes is a cache line, this might be a caching mechanism ignoring my “non-prefetchable” information, because it is lost during the mmap() (although is was preserved on x86 …), so I had to add those flags to the vma to prevent caching :

    vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot) | L_PTE_PRESENT |
                             L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY;
    

    Not actually sure that all flags are needed but, hey, it works !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to map a VME address space through a PCI bus into user
This is only a half-way programming question. First of all I have a PCI-Express
We have a Windows application that can use multiple PCI adapters. These adapters all
I currently have an embedded device connected to a PC through a serial port.
I have a PCI device that needs to read and write from userspace. I'm
I'm programming a PCI driver for Linux 2.6.36. Here is my code. My question
What if I have a PCI bus (w/o PCI-PCI bridges) with 3 devices: spy-device,
I have a Linux driver that I would like to use it Mac OS
Possible Duplicate: iPhone development on PC I have developed an iOS native application. My
how to get font name used by special application in my pc i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.