mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
drm/amdgpu: Extend full access wait time in guest
- Extend wait time and add retry, currently 6s * 2times - Change timing algorithm Signed-off-by: Victor Zhao <Victor.Zhao@amd.com> Signed-off-by: Peng Ju Zhou <PengJu.Zhou@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
a43e2a0e11
commit
124e8b1990
1 changed files with 12 additions and 4 deletions
|
@ -96,7 +96,11 @@ static int xgpu_nv_poll_ack(struct amdgpu_device *adev)
|
||||||
|
|
||||||
static int xgpu_nv_poll_msg(struct amdgpu_device *adev, enum idh_event event)
|
static int xgpu_nv_poll_msg(struct amdgpu_device *adev, enum idh_event event)
|
||||||
{
|
{
|
||||||
int r, timeout = NV_MAILBOX_POLL_MSG_TIMEDOUT;
|
int r;
|
||||||
|
uint64_t timeout, now;
|
||||||
|
|
||||||
|
now = (uint64_t)ktime_to_ms(ktime_get());
|
||||||
|
timeout = now + NV_MAILBOX_POLL_MSG_TIMEDOUT;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
r = xgpu_nv_mailbox_rcv_msg(adev, event);
|
r = xgpu_nv_mailbox_rcv_msg(adev, event);
|
||||||
|
@ -104,8 +108,8 @@ static int xgpu_nv_poll_msg(struct amdgpu_device *adev, enum idh_event event)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
msleep(10);
|
msleep(10);
|
||||||
timeout -= 10;
|
now = (uint64_t)ktime_to_ms(ktime_get());
|
||||||
} while (timeout > 1);
|
} while (timeout > now);
|
||||||
|
|
||||||
|
|
||||||
return -ETIME;
|
return -ETIME;
|
||||||
|
@ -149,9 +153,10 @@ static void xgpu_nv_mailbox_trans_msg (struct amdgpu_device *adev,
|
||||||
static int xgpu_nv_send_access_requests(struct amdgpu_device *adev,
|
static int xgpu_nv_send_access_requests(struct amdgpu_device *adev,
|
||||||
enum idh_request req)
|
enum idh_request req)
|
||||||
{
|
{
|
||||||
int r;
|
int r, retry = 1;
|
||||||
enum idh_event event = -1;
|
enum idh_event event = -1;
|
||||||
|
|
||||||
|
send_request:
|
||||||
xgpu_nv_mailbox_trans_msg(adev, req, 0, 0, 0);
|
xgpu_nv_mailbox_trans_msg(adev, req, 0, 0, 0);
|
||||||
|
|
||||||
switch (req) {
|
switch (req) {
|
||||||
|
@ -170,6 +175,9 @@ static int xgpu_nv_send_access_requests(struct amdgpu_device *adev,
|
||||||
if (event != -1) {
|
if (event != -1) {
|
||||||
r = xgpu_nv_poll_msg(adev, event);
|
r = xgpu_nv_poll_msg(adev, event);
|
||||||
if (r) {
|
if (r) {
|
||||||
|
if (retry++ < 2)
|
||||||
|
goto send_request;
|
||||||
|
|
||||||
if (req != IDH_REQ_GPU_INIT_DATA) {
|
if (req != IDH_REQ_GPU_INIT_DATA) {
|
||||||
pr_err("Doesn't get msg:%d from pf, error=%d\n", event, r);
|
pr_err("Doesn't get msg:%d from pf, error=%d\n", event, r);
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Add table
Reference in a new issue