libhsakmt: Distinguish EPERM and EACCES

EPERM means "operation not permitted" and is returned when CGroup
access checks fail. EACCES means "permission denied" and is returned
when the device file permission bits or access control list don't
allow access.

EPERM can fail silently, since we assume the administrator disabled
a device on purpose in the CGroup. EACCESS should produce an error
message and an info message to check the device file permissions.

Change-Id: Iee4c5584c5fdc4e113c3d760dede6661097b4341
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
このコミットが含まれているのは:
Felix Kuehling
2018-11-05 20:25:45 -05:00
コミット 5e4e19d47b
+3 -3
ファイルの表示
@@ -1733,10 +1733,10 @@ int open_drm_render_device(int minor)
sprintf(path, "/dev/dri/renderD%d", minor);
fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0) {
if (errno != ENOENT) {
if (errno == EPERM)
pr_info("Check a) User is in \"video\" group b) cgroup permissions\n");
if (errno != ENOENT && errno != EPERM) {
pr_err("Failed to open %s: %s\n", path, strerror(errno));
if (errno == EACCES)
pr_info("Check user is in \"video\" group\n");
}
return -errno;
}