#121 closed enhancement (fixed)
Failure to mmap /dev/mem needs a better error message
| Reported by: | lymanrb@… | Owned by: | stuge |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | flashrom (please use trac on flashrom.org) | Keywords: | |
| Cc: | Dependencies: | ||
| Patch Status: | there is no patch |
Description
I got such errors when running flashrom.
Calibrating delay loop... OK. Can't mmap memory using /dev/mem: Invalid argument
My env
Linux xxx 2.6.28-ARCH #1 SMP PREEMPT Sun Jan 18 19:41:52 UTC 2009 x86_64 Intel(R) Core(TM)2 Duo CPU T7250 @ 2.00GHz GenuineIntel GNU/Linux
core/pciutils 3.0.3-1 [installed] (base)
PCI bus configuration space access library and tools
core/zlib 1.2.3.3-3 [installed] (base)
A compression/decompression Library
$ ./flashrom -R
flashrom r3869
Attachments (0)
Change History (6)
comment:1 Changed 4 years ago by stuge
- Owner changed from somebody to stuge
- Priority changed from major to minor
- Status changed from new to assigned
- Summary changed from flashrom runtime error to Failure to mmap /dev/mem needs a better error message
- Type changed from defect to enhancement
comment:2 Changed 4 years ago by stuge
- Resolution set to fixed
- Status changed from assigned to closed
More info in error message added in r3889.
comment:3 Changed 4 years ago by lymanrb@…
I've seen the info you added in source code. However, I didn't get it printed when I recompile and run.
I debugged a little and found that the error occurred at line 193 of cbtable.c, the errno is 22. I'm not sure whether this helps.
comment:4 Changed 4 years ago by stuge
Helps a lot! Sloppy me didn't catch all occurences of mmap().
Fixed in r3890. Thanks!
comment:5 Changed 4 years ago by stuge
http://bugzilla.kernel.org/show_bug.cgi?id=12372 is possibly related to CONFIG_X86_PAT being problematic here, but no testing has been made to verify if that is the case. All test results most welcome. Thanks to Niels Ole Salscheider for pointing this out.
comment:6 Changed 4 years ago by dahuletam
interesting stuff hope it works.

This happens because CONFIG_NONPROMISC_DEVMEM (pre 2008-07), CONFIG_STRICT_DEVMEM or CONFIG_X86_PAT are set in your kernel.
Although flashrom can do nothing about any of these, I will add this information to the error message, so I'm not closing the ticket just yet.