]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/radeon/cik: Fix printing of client name on VM protection fault
authorMichel Dänzer <michel.daenzer@amd.com>
Wed, 18 Sep 2013 13:39:40 +0000 (15:39 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 20 Sep 2013 18:28:16 +0000 (14:28 -0400)
The string is encoded from the MSB to the LSB of the register.

Cc: stable@vger.kernel.org
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/cik.c

index adbdb6503b0564b98867d67ac513b0d02f602054..c0714d72610bf7ef5a2927569251948fe2056e53 100644 (file)
@@ -4735,12 +4735,13 @@ static void cik_vm_decode_fault(struct radeon_device *rdev,
        u32 mc_id = (status & MEMORY_CLIENT_ID_MASK) >> MEMORY_CLIENT_ID_SHIFT;
        u32 vmid = (status & FAULT_VMID_MASK) >> FAULT_VMID_SHIFT;
        u32 protections = (status & PROTECTIONS_MASK) >> PROTECTIONS_SHIFT;
-       char *block = (char *)&mc_client;
+       char block[5] = { mc_client >> 24, (mc_client >> 16) & 0xff,
+               (mc_client >> 8) & 0xff, mc_client & 0xff, 0 };
 
-       printk("VM fault (0x%02x, vmid %d) at page %u, %s from %s (%d)\n",
+       printk("VM fault (0x%02x, vmid %d) at page %u, %s from '%s' (0x%08x) (%d)\n",
               protections, vmid, addr,
               (status & MEMORY_CLIENT_RW_MASK) ? "write" : "read",
-              block, mc_id);
+              block, mc_client, mc_id);
 }
 
 /**