Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1662120 > unrolled thread
| Started by | Christian König <deathsimple@vodafone.de> |
|---|---|
| First post | 2017-06-09 11:10 +0200 |
| Last post | 2017-06-09 12:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v5 5/6] drm/amdgpu: move hw generation check into amdgpu_doorbell_init Christian König <deathsimple@vodafone.de> - 2017-06-09 11:10 +0200
Re: [PATCH v5 5/6] drm/amdgpu: move hw generation check into amdgpu_doorbell_init Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-09 12:20 +0200
| From | Christian König <deathsimple@vodafone.de> |
|---|---|
| Date | 2017-06-09 11:10 +0200 |
| Subject | [PATCH v5 5/6] drm/amdgpu: move hw generation check into amdgpu_doorbell_init |
| Message-ID | <tQo5z-84n-1@gated-at.bofh.it> |
From: Christian König <christian.koenig@amd.com>
This way we can savely call it on SI as well.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index a7d6804..99290af 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -419,6 +419,15 @@ void amdgpu_pci_config_reset(struct amdgpu_device *adev)
*/
static int amdgpu_doorbell_init(struct amdgpu_device *adev)
{
+ /* No doorbell on SI hardware generation */
+ if (adev->asic_type < CHIP_BONAIRE) {
+ adev->doorbell.base = 0;
+ adev->doorbell.size = 0;
+ adev->doorbell.num_doorbells = 0;
+ adev->doorbell.ptr = NULL;
+ return 0;
+ }
+
/* doorbell bar mapping */
adev->doorbell.base = pci_resource_start(adev->pdev, 2);
adev->doorbell.size = pci_resource_len(adev->pdev, 2);
@@ -2136,9 +2145,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
DRM_INFO("register mmio base: 0x%08X\n", (uint32_t)adev->rmmio_base);
DRM_INFO("register mmio size: %u\n", (unsigned)adev->rmmio_size);
- if (adev->asic_type >= CHIP_BONAIRE)
- /* doorbell bar mapping */
- amdgpu_doorbell_init(adev);
+ /* doorbell bar mapping */
+ amdgpu_doorbell_init(adev);
/* io port mapping */
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
@@ -2335,8 +2343,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
adev->rio_mem = NULL;
iounmap(adev->rmmio);
adev->rmmio = NULL;
- if (adev->asic_type >= CHIP_BONAIRE)
- amdgpu_doorbell_fini(adev);
+ amdgpu_doorbell_fini(adev);
amdgpu_debugfs_regs_cleanup(adev);
}
--
2.7.4
[toc] | [next] | [standalone]
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Date | 2017-06-09 12:20 +0200 |
| Message-ID | <tQpbk-h3-19@gated-at.bofh.it> |
| In reply to | #1662120 |
On Fri, Jun 9, 2017 at 11:59 AM, Christian König
<deathsimple@vodafone.de> wrote:
> From: Christian König <christian.koenig@amd.com>
>
> This way we can savely call it on SI as well.
s/savely/safely
FWIW,
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ++++++++++++-----
> 1 file changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index a7d6804..99290af 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -419,6 +419,15 @@ void amdgpu_pci_config_reset(struct amdgpu_device *adev)
> */
> static int amdgpu_doorbell_init(struct amdgpu_device *adev)
> {
> + /* No doorbell on SI hardware generation */
> + if (adev->asic_type < CHIP_BONAIRE) {
> + adev->doorbell.base = 0;
> + adev->doorbell.size = 0;
> + adev->doorbell.num_doorbells = 0;
> + adev->doorbell.ptr = NULL;
> + return 0;
> + }
> +
> /* doorbell bar mapping */
> adev->doorbell.base = pci_resource_start(adev->pdev, 2);
> adev->doorbell.size = pci_resource_len(adev->pdev, 2);
> @@ -2136,9 +2145,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
> DRM_INFO("register mmio base: 0x%08X\n", (uint32_t)adev->rmmio_base);
> DRM_INFO("register mmio size: %u\n", (unsigned)adev->rmmio_size);
>
> - if (adev->asic_type >= CHIP_BONAIRE)
> - /* doorbell bar mapping */
> - amdgpu_doorbell_init(adev);
> + /* doorbell bar mapping */
> + amdgpu_doorbell_init(adev);
>
> /* io port mapping */
> for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
> @@ -2335,8 +2343,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
> adev->rio_mem = NULL;
> iounmap(adev->rmmio);
> adev->rmmio = NULL;
> - if (adev->asic_type >= CHIP_BONAIRE)
> - amdgpu_doorbell_fini(adev);
> + amdgpu_doorbell_fini(adev);
> amdgpu_debugfs_regs_cleanup(adev);
> }
>
> --
> 2.7.4
>
--
With Best Regards,
Andy Shevchenko
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web