All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Shaoyun.Liu-5C7GfCeVMHo@public.gmane.org
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [bug report] drm/amdgpu : Generate XGMI topology info from driver level
Date: Fri, 4 Jan 2019 14:53:07 +0300	[thread overview]
Message-ID: <20190104115307.GA25342@kadam> (raw)

Hello Shaoyun Liu,

The patch fb30fc59a245: "drm/amdgpu : Generate XGMI topology info
from driver level" from Jun 27, 2018, leads to the following static
checker warning:

	drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:117 amdgpu_xgmi_add_device()
	warn: missing error code here? 'amdgpu_get_xgmi_hive()' failed. 'ret' = '0'

drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
    88 int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
    89 {
    90 	struct psp_xgmi_topology_info *hive_topology;
    91 	struct amdgpu_hive_info *hive;
    92 	struct amdgpu_xgmi	*entry;
    93 	struct amdgpu_device *tmp_adev = NULL;
    94 
    95 	int count = 0, ret = -EINVAL;
    96 
    97 	if (!adev->gmc.xgmi.supported)
    98 		return 0;
    99 
    100 	ret = psp_xgmi_get_node_id(&adev->psp, &adev->gmc.xgmi.node_id);
    101 	if (ret) {
    102 		dev_err(adev->dev,
    103 			"XGMI: Failed to get node id\n");
    104 		return ret;
    105 	}
    106 
    107 	ret = psp_xgmi_get_hive_id(&adev->psp, &adev->gmc.xgmi.hive_id);
    108 	if (ret) {
    109 		dev_err(adev->dev,
    110 			"XGMI: Failed to get hive id\n");
    111 		return ret;
    112 	}
    113 
    114 	mutex_lock(&xgmi_mutex);
    115 	hive = amdgpu_get_xgmi_hive(adev);
    116 	if (!hive)
--> 117 		goto exit;

It does look like we should set "ret = -ESOMETHING;"...  Not sure what.

    118 
    119 	hive_topology = &hive->topology_info;
    120 
    121 	list_add_tail(&adev->gmc.xgmi.head, &hive->device_list);
    122 	list_for_each_entry(entry, &hive->device_list, head)
    123 		hive_topology->nodes[count++].node_id = entry->node_id;
    124 	hive->number_devices = count;
    125 
    126 	/* Each psp need to get the latest topology */
    127 	list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
    128 		ret = psp_xgmi_get_topology_info(&tmp_adev->psp, count, hive_topology);
    129 		if (ret) {
    130 			dev_err(tmp_adev->dev,
    131 				"XGMI: Get topology failure on device %llx, hive %llx, ret %d",
    132 				tmp_adev->gmc.xgmi.node_id,
    133 				tmp_adev->gmc.xgmi.hive_id, ret);
    134 			/* To do : continue with some node failed or disable the whole hive */
    135 			break;
    136 		}
    137 	}
    138 
    139 	list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
    140 		ret = amdgpu_xgmi_update_topology(hive, tmp_adev);
    141 		if (ret)
    142 			break;
    143 	}
    144 
    145 exit:
    146          mutex_unlock(&xgmi_mutex);
    147          return ret;
    148  }

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

             reply	other threads:[~2019-01-04 11:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-04 11:53 Dan Carpenter [this message]
2019-01-04 16:52 ` [bug report] drm/amdgpu : Generate XGMI topology info from driver level Liu, Shaoyun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190104115307.GA25342@kadam \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=Shaoyun.Liu-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.