Skip to content

Commit

Permalink
drm/radeon: enable pci bus mastering after card is initialised (v2)
Browse files Browse the repository at this point in the history
This closes a race seen with kexec where we enable PCI bus mastering
but the card has been reinitialised fully yet.

This was previously fixed by a patch from Jerome, but this should
close the race completely.

v2: add SI support as suggested by Alex.

Reported-and-tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Dave Airlie committed Apr 12, 2012
1 parent 0034102 commit 2099810
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/radeon/r100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,10 @@ int r100_cp_init(struct radeon_device *rdev, unsigned ring_size)
WREG32(RADEON_CP_RB_WPTR_DELAY, 0);
WREG32(RADEON_CP_CSQ_MODE, 0x00004D4D);
WREG32(RADEON_CP_CSQ_CNTL, RADEON_CSQ_PRIBM_INDBM);

/* at this point everything should be setup correctly to enable master */
pci_set_master(rdev->pdev);

radeon_ring_start(rdev, RADEON_RING_TYPE_GFX_INDEX, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]);
r = radeon_ring_test(rdev, RADEON_RING_TYPE_GFX_INDEX, ring);
if (r) {
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/radeon/r600.c
Original file line number Diff line number Diff line change
Expand Up @@ -3047,6 +3047,9 @@ int r600_irq_init(struct radeon_device *rdev)
else
r600_disable_interrupt_state(rdev);

/* at this point everything should be setup correctly to enable master */
pci_set_master(rdev->pdev);

/* enable irqs */
r600_enable_interrupts(rdev);

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/radeon/radeon_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,6 @@ int radeon_resume_kms(struct drm_device *dev)
console_unlock();
return -1;
}
pci_set_master(dev->pdev);
/* resume AGP if in use */
radeon_agp_resume(rdev);
radeon_resume(rdev);
Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/radeon/radeon_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
}
dev->dev_private = (void *)rdev;

pci_set_master(dev->pdev);

/* update BUS flag */
if (drm_pci_device_is_agp(dev)) {
flags |= RADEON_IS_AGP;
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/radeon/si.c
Original file line number Diff line number Diff line change
Expand Up @@ -3217,6 +3217,8 @@ static int si_irq_init(struct radeon_device *rdev)
/* force the active interrupt state to all disabled */
si_disable_interrupt_state(rdev);

pci_set_master(rdev->pdev);

/* enable irqs */
si_enable_interrupts(rdev);

Expand Down

0 comments on commit 2099810

Please sign in to comment.