Bug 110421 - Reading debugfs file /sys/kernel/debug/dri/0/amdgpu_regs hangs the machine
Summary: Reading debugfs file /sys/kernel/debug/dri/0/amdgpu_regs hangs the machine
Status: RESOLVED WILL_NOT_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - non Intel) (show other bugs)
Hardware: All Linux
: P1 high
Assignee: drivers_video-dri
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-06 12:46 UTC by Vedran Miletić
Modified: 2016-11-22 00:38 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.4.0-0.rc8.git0.1.fc24.x86_64
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Vedran Miletić 2016-01-06 12:46:41 UTC
I am using amdgpu driver on

01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Amethyst XT [Radeon R9 M295X Mac Edition / R9 380X] [1002:6938] (rev f1)

Running the following script

for i in $(seq 0 65535); do echo -n "$i: "; dd if=amdgpu_regs bs=4 skip=$i count=1 2>/dev/null | hexdump -e '"%08x"'; echo; done

hangs the machine at register 14829 and the data from the register is not printed. I tried reading the registers twice just to be sure it hangs in the same place repeatedly, and it was 14829 in both cases.

I have reports this is reproducible using vanilla kernel.
Comment 1 Christian König 2016-01-06 14:21:40 UTC
That's perfectly normal behavior. Register 14829 probably don't exists on your hardware generation and so accessing it causes an unresolvable BUS stall.
Comment 2 Vedran Miletić 2016-01-06 14:35:32 UTC
Can't anything be done to avoid the hang? Running cat on that file will hang the machine as well.
Comment 3 Christian König 2016-01-06 14:49:54 UTC
Not really.

You could do large lists of which registers are save for accessing, but we have 256KB register space and need an individual list for pretty much every hardware generation.

Sorry but just accessing random registers through the debugfs interface is simply not expected to work.

Note You need to log in before you can comment on or make changes to this bug.