All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] kexec fixes
@ 2019-01-08 22:11 Alex Deucher
       [not found] ` <20190108221156.24388-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Alex Deucher @ 2019-01-08 22:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

Fixes for kexec.  The GPU needs to be reset before the driver
can be loaded again reliably.  Needed for kexec for booting some
ppc platforms.  See:
https://bugs.freedesktop.org/show_bug.cgi?id=108585

Alex Deucher (6):
  drm/amdgpu: add need_reset_on_init asic callback (v2)
  drm/amdgpu/si: add need_reset_on_init asic callback for SI (v2)
  drm/amdgpu/cik: add need_reset_on_init asic callback for CIK (v2)
  drm/amdgpu/vi: add need_reset_on_init asic callback for VI (v2)
  drm/amdgpu/soc15: add need_reset_on_init asic callback for SOC15 (v2)
  drm/amdgpu: check if we need to reset at init time (v2)

 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  3 +++
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 +++++++++++
 drivers/gpu/drm/amd/amdgpu/cik.c           | 18 ++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/si.c            |  6 ++++++
 drivers/gpu/drm/amd/amdgpu/soc15.c         | 20 ++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/vi.c            | 18 ++++++++++++++++++
 6 files changed, 76 insertions(+)

-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/6] drm/amdgpu: add need_reset_on_init asic callback (v2)
       [not found] ` <20190108221156.24388-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2019-01-08 22:11   ` Alex Deucher
  2019-01-08 22:11   ` [PATCH 2/6] drm/amdgpu/si: add need_reset_on_init asic callback for SI (v2) Alex Deucher
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2019-01-08 22:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

Used to determine if we need to reset the asic on init due
to the driver having been previously loaded or not shutdown
cleanly.  E.g., kexec or VM passthrough.

v2: rebase

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index bcef6ea4bcf9..d27fa2ffb2f0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -542,6 +542,8 @@ struct amdgpu_asic_funcs {
 	bool (*need_full_reset)(struct amdgpu_device *adev);
 	/* initialize doorbell layout for specific asic*/
 	void (*init_doorbell_index)(struct amdgpu_device *adev);
+	/* do we need to reset the asic at init time (e.g., kexec) */
+	bool (*need_reset_on_init)(struct amdgpu_device *adev);
 };
 
 /*
@@ -1042,6 +1044,7 @@ int emu_soc_asic_init(struct amdgpu_device *adev);
 #define amdgpu_asic_invalidate_hdp(adev, r) (adev)->asic_funcs->invalidate_hdp((adev), (r))
 #define amdgpu_asic_need_full_reset(adev) (adev)->asic_funcs->need_full_reset((adev))
 #define amdgpu_asic_init_doorbell_index(adev) (adev)->asic_funcs->init_doorbell_index((adev))
+#define amdgpu_asic_need_reset_on_init(adev) (adev)->asic_funcs->need_reset_on_init((adev))
 
 /* Common functions */
 bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev);
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/6] drm/amdgpu/si: add need_reset_on_init asic callback for SI (v2)
       [not found] ` <20190108221156.24388-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2019-01-08 22:11   ` [PATCH 1/6] drm/amdgpu: add need_reset_on_init asic callback (v2) Alex Deucher
@ 2019-01-08 22:11   ` Alex Deucher
  2019-01-08 22:11   ` [PATCH 3/6] drm/amdgpu/cik: add need_reset_on_init asic callback for CIK (v2) Alex Deucher
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2019-01-08 22:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

SI chips don't require a reset on reload due to the nature of
the SMU on them.

v2: rebase

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/si.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index f8408f88cd37..51adfe986da3 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -1258,6 +1258,11 @@ static bool si_need_full_reset(struct amdgpu_device *adev)
 	return true;
 }
 
+static bool si_need_reset_on_init(struct amdgpu_device *adev)
+{
+	return false;
+}
+
 static int si_get_pcie_lanes(struct amdgpu_device *adev)
 {
 	u32 link_width_cntl;
@@ -1339,6 +1344,7 @@ static const struct amdgpu_asic_funcs si_asic_funcs =
 	.flush_hdp = &si_flush_hdp,
 	.invalidate_hdp = &si_invalidate_hdp,
 	.need_full_reset = &si_need_full_reset,
+	.need_reset_on_init = &si_need_reset_on_init,
 };
 
 static uint32_t si_get_rev_id(struct amdgpu_device *adev)
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/6] drm/amdgpu/cik: add need_reset_on_init asic callback for CIK (v2)
       [not found] ` <20190108221156.24388-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2019-01-08 22:11   ` [PATCH 1/6] drm/amdgpu: add need_reset_on_init asic callback (v2) Alex Deucher
  2019-01-08 22:11   ` [PATCH 2/6] drm/amdgpu/si: add need_reset_on_init asic callback for SI (v2) Alex Deucher
@ 2019-01-08 22:11   ` Alex Deucher
  2019-01-08 22:11   ` [PATCH 4/6] drm/amdgpu/vi: add need_reset_on_init asic callback for VI (v2) Alex Deucher
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2019-01-08 22:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

CIK chips require a reset if the driver was previously loaded
because the SMU can only be loaded once between each reset.

v2: rebase

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/cik.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 71c50d8900e3..09dfaff63502 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -1741,6 +1741,23 @@ static bool cik_need_full_reset(struct amdgpu_device *adev)
 	return true;
 }
 
+static bool cik_need_reset_on_init(struct amdgpu_device *adev)
+{
+	u32 clock_cntl, pc;
+
+	if (adev->flags & AMD_IS_APU)
+		return false;
+
+	/* check if the SMC is already running */
+	clock_cntl = RREG32_SMC(ixSMC_SYSCON_CLOCK_CNTL_0);
+	pc = RREG32_SMC(ixSMC_PC_C);
+	if ((0 == REG_GET_FIELD(clock_cntl, SMC_SYSCON_CLOCK_CNTL_0, ck_disable)) &&
+	    (0x20100 <= pc))
+		return true;
+
+	return false;
+}
+
 static const struct amdgpu_asic_funcs cik_asic_funcs =
 {
 	.read_disabled_bios = &cik_read_disabled_bios,
@@ -1756,6 +1773,7 @@ static const struct amdgpu_asic_funcs cik_asic_funcs =
 	.invalidate_hdp = &cik_invalidate_hdp,
 	.need_full_reset = &cik_need_full_reset,
 	.init_doorbell_index = &legacy_doorbell_index_init,
+	.need_reset_on_init = &cik_need_reset_on_init,
 };
 
 static int cik_common_early_init(void *handle)
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/6] drm/amdgpu/vi: add need_reset_on_init asic callback for VI (v2)
       [not found] ` <20190108221156.24388-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
                     ` (2 preceding siblings ...)
  2019-01-08 22:11   ` [PATCH 3/6] drm/amdgpu/cik: add need_reset_on_init asic callback for CIK (v2) Alex Deucher
@ 2019-01-08 22:11   ` Alex Deucher
  2019-01-08 22:11   ` [PATCH 5/6] drm/amdgpu/soc15: add need_reset_on_init asic callback for SOC15 (v2) Alex Deucher
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2019-01-08 22:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

VI chips require a reset if the driver was previously loaded
because the SMU can only be loaded once between each reset.

v2: rebase

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/vi.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 03e7be595a0d..60ce2c1dac5c 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -941,6 +941,23 @@ static bool vi_need_full_reset(struct amdgpu_device *adev)
 	}
 }
 
+static bool vi_need_reset_on_init(struct amdgpu_device *adev)
+{
+	u32 clock_cntl, pc;
+
+	if (adev->flags & AMD_IS_APU)
+		return false;
+
+	/* check if the SMC is already running */
+	clock_cntl = RREG32_SMC(ixSMC_SYSCON_CLOCK_CNTL_0);
+	pc = RREG32_SMC(ixSMC_PC_C);
+	if ((0 == REG_GET_FIELD(clock_cntl, SMC_SYSCON_CLOCK_CNTL_0, ck_disable)) &&
+	    (0x20100 <= pc))
+		return true;
+
+	return false;
+}
+
 static const struct amdgpu_asic_funcs vi_asic_funcs =
 {
 	.read_disabled_bios = &vi_read_disabled_bios,
@@ -956,6 +973,7 @@ static const struct amdgpu_asic_funcs vi_asic_funcs =
 	.invalidate_hdp = &vi_invalidate_hdp,
 	.need_full_reset = &vi_need_full_reset,
 	.init_doorbell_index = &legacy_doorbell_index_init,
+	.need_reset_on_init = &vi_need_reset_on_init,
 };
 
 #define CZ_REV_BRISTOL(rev)	 \
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/6] drm/amdgpu/soc15: add need_reset_on_init asic callback for SOC15 (v2)
       [not found] ` <20190108221156.24388-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
                     ` (3 preceding siblings ...)
  2019-01-08 22:11   ` [PATCH 4/6] drm/amdgpu/vi: add need_reset_on_init asic callback for VI (v2) Alex Deucher
@ 2019-01-08 22:11   ` Alex Deucher
  2019-01-08 22:11   ` [PATCH 6/6] drm/amdgpu: check if we need to reset at init time (v2) Alex Deucher
  2019-01-08 23:22   ` [PATCH 0/6] kexec fixes Kuehling, Felix
  6 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2019-01-08 22:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

SOC15 chips require a reset if the driver was previously loaded
because the PSP can only be loaded once between each reset.

v2: rebase, handle multiple asic funcs

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 8849b74078d6..fb01a6cda262 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -43,6 +43,7 @@
 #include "hdp/hdp_4_0_sh_mask.h"
 #include "smuio/smuio_9_0_offset.h"
 #include "smuio/smuio_9_0_sh_mask.h"
+#include "mp/mp_9_0_offset.h"
 
 #include "soc15.h"
 #include "soc15_common.h"
@@ -602,6 +603,23 @@ static bool soc15_need_full_reset(struct amdgpu_device *adev)
 	return true;
 }
 
+static bool soc15_need_reset_on_init(struct amdgpu_device *adev)
+{
+	u32 sol_reg;
+
+	if (adev->flags & AMD_IS_APU)
+		return false;
+
+	/* Check sOS sign of life register to confirm sys driver and sOS
+	 * are already been loaded.
+	 */
+	sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
+	if (sol_reg)
+		return true;
+
+	return false;
+}
+
 static const struct amdgpu_asic_funcs soc15_asic_funcs =
 {
 	.read_disabled_bios = &soc15_read_disabled_bios,
@@ -617,6 +635,7 @@ static const struct amdgpu_asic_funcs soc15_asic_funcs =
 	.invalidate_hdp = &soc15_invalidate_hdp,
 	.need_full_reset = &soc15_need_full_reset,
 	.init_doorbell_index = &vega10_doorbell_index_init,
+	.need_reset_on_init = &soc15_need_reset_on_init,
 };
 
 static const struct amdgpu_asic_funcs vega20_asic_funcs =
@@ -634,6 +653,7 @@ static const struct amdgpu_asic_funcs vega20_asic_funcs =
 	.invalidate_hdp = &soc15_invalidate_hdp,
 	.need_full_reset = &soc15_need_full_reset,
 	.init_doorbell_index = &vega20_doorbell_index_init,
+	.need_reset_on_init = &soc15_need_reset_on_init,
 };
 
 static int soc15_common_early_init(void *handle)
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/6] drm/amdgpu: check if we need to reset at init time (v2)
       [not found] ` <20190108221156.24388-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
                     ` (4 preceding siblings ...)
  2019-01-08 22:11   ` [PATCH 5/6] drm/amdgpu/soc15: add need_reset_on_init asic callback for SOC15 (v2) Alex Deucher
@ 2019-01-08 22:11   ` Alex Deucher
       [not found]     ` <20190108221156.24388-7-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2019-01-08 23:22   ` [PATCH 0/6] kexec fixes Kuehling, Felix
  6 siblings, 1 reply; 10+ messages in thread
From: Alex Deucher @ 2019-01-08 22:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

To deal with situations like kexec or GPU VM passthrough
where the device may have been used previously without a
proper GPU reset between.

v2: rebase

bug: https://bugs.freedesktop.org/show_bug.cgi?id=108585
bug: https://bugs.freedesktop.org/show_bug.cgi?id=108754
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 1a558dc41ba6..8a61764e64cf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2550,6 +2550,17 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	/* detect if we are with an SRIOV vbios */
 	amdgpu_device_detect_sriov_bios(adev);
 
+	/* check if we need to reset the asic
+	 *  E.g., driver was not cleanly unloaded previously, etc.
+	 */
+	if (amdgpu_asic_need_reset_on_init(adev)) {
+		r = amdgpu_asic_reset(adev);
+		if (r) {
+			dev_err(adev->dev, "asic reset on init failed\n");
+			goto failed;
+		}
+	}
+
 	/* Post card if necessary */
 	if (amdgpu_device_need_post(adev)) {
 		if (!adev->bios) {
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] kexec fixes
       [not found] ` <20190108221156.24388-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
                     ` (5 preceding siblings ...)
  2019-01-08 22:11   ` [PATCH 6/6] drm/amdgpu: check if we need to reset at init time (v2) Alex Deucher
@ 2019-01-08 23:22   ` Kuehling, Felix
       [not found]     ` <139d62ef-e36c-23ba-785d-914d5383f8d7-5C7GfCeVMHo@public.gmane.org>
  6 siblings, 1 reply; 10+ messages in thread
From: Kuehling, Felix @ 2019-01-08 23:22 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Deucher, Alexander

Thanks for this. I trust that your method for detecting that SMU or PSP
are running is correct. With that caveat the series is Reviewed-by:
Felix Kuehling <Felix.Kuehling@amd.com>

Regards,
  Felix

On 2019-01-08 5:11 p.m., Alex Deucher wrote:
> Fixes for kexec.  The GPU needs to be reset before the driver
> can be loaded again reliably.  Needed for kexec for booting some
> ppc platforms.  See:
> https://bugs.freedesktop.org/show_bug.cgi?id=108585
>
> Alex Deucher (6):
>   drm/amdgpu: add need_reset_on_init asic callback (v2)
>   drm/amdgpu/si: add need_reset_on_init asic callback for SI (v2)
>   drm/amdgpu/cik: add need_reset_on_init asic callback for CIK (v2)
>   drm/amdgpu/vi: add need_reset_on_init asic callback for VI (v2)
>   drm/amdgpu/soc15: add need_reset_on_init asic callback for SOC15 (v2)
>   drm/amdgpu: check if we need to reset at init time (v2)
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  3 +++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 +++++++++++
>  drivers/gpu/drm/amd/amdgpu/cik.c           | 18 ++++++++++++++++++
>  drivers/gpu/drm/amd/amdgpu/si.c            |  6 ++++++
>  drivers/gpu/drm/amd/amdgpu/soc15.c         | 20 ++++++++++++++++++++
>  drivers/gpu/drm/amd/amdgpu/vi.c            | 18 ++++++++++++++++++
>  6 files changed, 76 insertions(+)
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] kexec fixes
       [not found]     ` <139d62ef-e36c-23ba-785d-914d5383f8d7-5C7GfCeVMHo@public.gmane.org>
@ 2019-01-09  1:19       ` Deucher, Alexander
  0 siblings, 0 replies; 10+ messages in thread
From: Deucher, Alexander @ 2019-01-09  1:19 UTC (permalink / raw)
  To: Kuehling, Felix, Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 1667 bytes --]

Yes, the checks are taken from the existing SMU and PSP code.


Alex

________________________________
From: Kuehling, Felix
Sent: Tuesday, January 8, 2019 6:22:48 PM
To: Alex Deucher; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Deucher, Alexander
Subject: Re: [PATCH 0/6] kexec fixes

Thanks for this. I trust that your method for detecting that SMU or PSP
are running is correct. With that caveat the series is Reviewed-by:
Felix Kuehling <Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>

Regards,
  Felix

On 2019-01-08 5:11 p.m., Alex Deucher wrote:
> Fixes for kexec.  The GPU needs to be reset before the driver
> can be loaded again reliably.  Needed for kexec for booting some
> ppc platforms.  See:
> https://bugs.freedesktop.org/show_bug.cgi?id=108585
>
> Alex Deucher (6):
>   drm/amdgpu: add need_reset_on_init asic callback (v2)
>   drm/amdgpu/si: add need_reset_on_init asic callback for SI (v2)
>   drm/amdgpu/cik: add need_reset_on_init asic callback for CIK (v2)
>   drm/amdgpu/vi: add need_reset_on_init asic callback for VI (v2)
>   drm/amdgpu/soc15: add need_reset_on_init asic callback for SOC15 (v2)
>   drm/amdgpu: check if we need to reset at init time (v2)
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  3 +++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 +++++++++++
>  drivers/gpu/drm/amd/amdgpu/cik.c           | 18 ++++++++++++++++++
>  drivers/gpu/drm/amd/amdgpu/si.c            |  6 ++++++
>  drivers/gpu/drm/amd/amdgpu/soc15.c         | 20 ++++++++++++++++++++
>  drivers/gpu/drm/amd/amdgpu/vi.c            | 18 ++++++++++++++++++
>  6 files changed, 76 insertions(+)
>

[-- Attachment #1.2: Type: text/html, Size: 3426 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH 6/6] drm/amdgpu: check if we need to reset at init time (v2)
       [not found]     ` <20190108221156.24388-7-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2019-01-09  3:50       ` Quan, Evan
  0 siblings, 0 replies; 10+ messages in thread
From: Quan, Evan @ 2019-01-09  3:50 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Deucher, Alexander

Series is Reviewed-by: Evan Quan <evan.quan@amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: 2019年1月9日 6:12
> To: amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
> Subject: [PATCH 6/6] drm/amdgpu: check if we need to reset at init time (v2)
> 
> To deal with situations like kexec or GPU VM passthrough where the device
> may have been used previously without a proper GPU reset between.
> 
> v2: rebase
> 
> bug: https://bugs.freedesktop.org/show_bug.cgi?id=108585
> bug: https://bugs.freedesktop.org/show_bug.cgi?id=108754
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 1a558dc41ba6..8a61764e64cf 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2550,6 +2550,17 @@ int amdgpu_device_init(struct amdgpu_device
> *adev,
>  	/* detect if we are with an SRIOV vbios */
>  	amdgpu_device_detect_sriov_bios(adev);
> 
> +	/* check if we need to reset the asic
> +	 *  E.g., driver was not cleanly unloaded previously, etc.
> +	 */
> +	if (amdgpu_asic_need_reset_on_init(adev)) {
> +		r = amdgpu_asic_reset(adev);
> +		if (r) {
> +			dev_err(adev->dev, "asic reset on init failed\n");
> +			goto failed;
> +		}
> +	}
> +
>  	/* Post card if necessary */
>  	if (amdgpu_device_need_post(adev)) {
>  		if (!adev->bios) {
> --
> 2.20.1
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-01-09  3:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 22:11 [PATCH 0/6] kexec fixes Alex Deucher
     [not found] ` <20190108221156.24388-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-01-08 22:11   ` [PATCH 1/6] drm/amdgpu: add need_reset_on_init asic callback (v2) Alex Deucher
2019-01-08 22:11   ` [PATCH 2/6] drm/amdgpu/si: add need_reset_on_init asic callback for SI (v2) Alex Deucher
2019-01-08 22:11   ` [PATCH 3/6] drm/amdgpu/cik: add need_reset_on_init asic callback for CIK (v2) Alex Deucher
2019-01-08 22:11   ` [PATCH 4/6] drm/amdgpu/vi: add need_reset_on_init asic callback for VI (v2) Alex Deucher
2019-01-08 22:11   ` [PATCH 5/6] drm/amdgpu/soc15: add need_reset_on_init asic callback for SOC15 (v2) Alex Deucher
2019-01-08 22:11   ` [PATCH 6/6] drm/amdgpu: check if we need to reset at init time (v2) Alex Deucher
     [not found]     ` <20190108221156.24388-7-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-01-09  3:50       ` Quan, Evan
2019-01-08 23:22   ` [PATCH 0/6] kexec fixes Kuehling, Felix
     [not found]     ` <139d62ef-e36c-23ba-785d-914d5383f8d7-5C7GfCeVMHo@public.gmane.org>
2019-01-09  1:19       ` Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.