Bug 91749 - Tonga IH ring misaligned
Summary: Tonga IH ring misaligned
Status: RESOLVED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/AMDgpu (show other bugs)
Version: DRI git
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-25 01:18 UTC by Jay Cornwall
Modified: 2019-10-02 17:03 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
possible fix (2.32 KB, patch)
2015-08-25 02:53 UTC, Alex Deucher
no flags Details | Splinter Review

Description Jay Cornwall 2015-08-25 01:18:08 UTC
From amdgpu_ih.c:

      adev->irq.ih.ring = kzalloc(adev->irq.ih.ring_size + 8, GFP_KERNEL);
      if (adev->irq.ih.ring == NULL)
        return -ENOMEM;
      adev->irq.ih.rb_dma_addr = pci_map_single(adev->pdev,
                  (void *)adev->irq.ih.ring,
                  adev->irq.ih.ring_size,
                  PCI_DMA_BIDIRECTIONAL);

The Tonga IH_RB_BASE register requires 256B alignment. kzalloc does not guarantee this, e.g.:

adev->irq.ih.ring: 0xFFFF880835B22148
adev->irq.ih.rb_dma_addr: 0x835B22148
IH_RB_BASE: 0835b221

This causes amdgpu_ih_decode_iv to read ahead of the last written IV, missing it, when this misalignment occurs.
Comment 1 Alex Deucher 2015-08-25 02:53:32 UTC
Created attachment 117903 [details] [review]
possible fix

This should fix it.
Comment 2 Jay Cornwall 2015-08-25 03:18:09 UTC
Works good, thanks.
Comment 3 Alex Deucher 2019-10-02 17:03:08 UTC
Fixed long ago.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.