[#4652] Incorrect permissions on some debug MMRs
Submitted By: Michael McTernan
Open Date
2008-11-18 16:44:56 Close Date
2009-03-03 03:17:06
Priority:
Low Assignee:
Mike Frysinger
Status:
Closed Fixed In Release:
N/A
Found In Release:
2008R1.5-RC3 Release:
2008R1.5 and trunk
Category:
Kernel Functions Board:
Custom
Processor:
BF537 Silicon Revision:
0.3
Is this bug repeatable?:
Yes Resolution:
Fixed
Uboot version or rev.:
Toolchain version or rev.:
2008R1.5
App binary format:
N/A
Summary: Incorrect permissions on some debug MMRs
Details:
On trunk and 2008R1.5, some of the debug MMRs have incorrect permissions:
debugfs_create_x32("SPORT0_RX", 0600, parent, (u32 *)0xFFC00818);
debugfs_create_x32("SPORT0_TX", 0600, parent, (u32 *)0xFFC00810);
<same for sport1>
If you 'cat' the TX register or 'echo' into the RX register you immediately get a trap:
root:/sys/kernel/debug/blackfin/SPORT> echo > SPORT0_RX
System MMR Error
- An error occurred due to an invalid access to an System MMR location
Possible reason: a 32-bit register is accessed with a 16-bit instruction
or a 16-bit register is accessed with a 32-bit instruction.
Kernel OOPS in progress
HW Error context
CURRENT PROCESS:
COMM=echo PID=440
TEXT = 0x07a80040-0x07ac5c00 DATA = 0x07ac5c04-0x07ad2704
BSS = 0x07ad2704-0x07ad87d4 USER-STACK = 0x07adff84
The permissions on these fs entrys can be trivially changed to remove this risk and reflect the true register access.
I believe this is also a bug on trunk. Please fix in both places if possible.
Follow-ups
--- Mike Frysinger 2008-11-18 16:58:29
the debug-mmrs file is automatically generated ...
that said, i wasnt paying attention to the declared register permissions as i
was unable to find any actual examples where writing to a read-only register
would trigger a bug, or reading from a write-only register.
apparently SPORT_RX/SPORT_TX registers will actually generate a PAB error
according to the HRM.
--- Mike Frysinger 2008-11-18 17:08:55
hmm, actually, the CPU definition files dont appear to even explicitly declare
read/write permission. for the SPORT TX/RX registers, they define a read and a
write address. so i'll have to report this to the tools group to get their XML
files changed.
--- Mike Frysinger 2009-02-27 15:41:41
should be fixed in latest versions of stuff
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
No Files Were Found