[PATCH] radeon: Call pci_clear_master() instead of open-coding it.

Alex Deucher alexdeucher at gmail.com
Thu Jan 12 08:10:16 PST 2012


2012/1/12 Michel Dänzer <michel at daenzer.net>:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Reported-by: Ben Hutchings <ben at decadent.org.uk>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>
> Only compile-tested, but should be no functional change.

Looks good to me.

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

>
>  drivers/gpu/drm/radeon/r100.c  |    4 +---
>  drivers/gpu/drm/radeon/rs600.c |   13 ++-----------
>  2 files changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
> index 7e94ea5..7e3f704 100644
> --- a/drivers/gpu/drm/radeon/r100.c
> +++ b/drivers/gpu/drm/radeon/r100.c
> @@ -2186,7 +2186,6 @@ bool r100_gpu_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring)
>  void r100_bm_disable(struct radeon_device *rdev)
>  {
>        u32 tmp;
> -       u16 tmp16;
>
>        /* disable bus mastering */
>        tmp = RREG32(R_000030_BUS_CNTL);
> @@ -2197,8 +2196,7 @@ void r100_bm_disable(struct radeon_device *rdev)
>        WREG32(R_000030_BUS_CNTL, (tmp & 0xFFFFFFFF) | 0x00000040);
>        tmp = RREG32(RADEON_BUS_CNTL);
>        mdelay(1);
> -       pci_read_config_word(rdev->pdev, 0x4, &tmp16);
> -       pci_write_config_word(rdev->pdev, 0x4, tmp16 & 0xFFFB);
> +       pci_clear_master(rdev->pdev);
>        mdelay(1);
>  }
>
> diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
> index 803e0d3..ec46eb4 100644
> --- a/drivers/gpu/drm/radeon/rs600.c
> +++ b/drivers/gpu/drm/radeon/rs600.c
> @@ -322,16 +322,6 @@ void rs600_hpd_fini(struct radeon_device *rdev)
>        }
>  }
>
> -void rs600_bm_disable(struct radeon_device *rdev)
> -{
> -       u16 tmp;
> -
> -       /* disable bus mastering */
> -       pci_read_config_word(rdev->pdev, 0x4, &tmp);
> -       pci_write_config_word(rdev->pdev, 0x4, tmp & 0xFFFB);
> -       mdelay(1);
> -}
> -
>  int rs600_asic_reset(struct radeon_device *rdev)
>  {
>        struct rv515_mc_save save;
> @@ -355,7 +345,8 @@ int rs600_asic_reset(struct radeon_device *rdev)
>        WREG32(RADEON_CP_RB_CNTL, tmp);
>        pci_save_state(rdev->pdev);
>        /* disable bus mastering */
> -       rs600_bm_disable(rdev);
> +       pci_clear_master(rdev->pdev);
> +       mdelay(1);
>        /* reset GA+VAP */
>        WREG32(R_0000F0_RBBM_SOFT_RESET, S_0000F0_SOFT_RESET_VAP(1) |
>                                        S_0000F0_SOFT_RESET_GA(1));
> --
> 1.7.8.3
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list