Skip to contentSkip to conversation

device: return error for unknown chipsets

PATCH In review Karol Herbst 3 participants 5 messages Oct 5, 2020 – Oct 6, 2020 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 device: return error for unknown chipsets

Previously the code relied on device->pri to be NULL and to fail probing later. We really should just return an error inside nvkm_device_ctor for unsupported GPUs.

Fixes 24d5ff40a732 ("drm/nouveau/device: rework mmio mapping code to get rid of second map")
---
 drm/nouveau/nvkm/engine/device/base.c | 1 +
 1 file changed, 1 insertion(+)
drm/nouveau/nvkm/engine/device/base.c +1 -0
index 9f4ac2672..68d665414 100644
@@ -3149,6 +3149,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
 		case 0x168: device->chip = &nv168_chipset; break;
 		default:
 			nvdev_error(device, "unknown chipset (%08x)\n", boot0);
+			ret = -ENOSYS;
 			goto done;
 		}
 
Signature · 1 line
2.26.2

A message that is not in the archive (sent off-list or not yet received): 20201005135230.735914-1-kherbst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

Tested-by
#2 lore raw
Quoted 7 lines · Karol Herbst

Previously the code relied on device->pri to be NULL and to fail probing later. We really should just return an error inside nvkm_device_ctor for unsupported GPUs.

Fixes 24d5ff40a732 ("drm/nouveau/device: rework mmio mapping code to get rid of second map")
Cc dann frazier <[email protected]>

Thanks Karol! Got rid of the Oops for me.

Would it be appropriate to tag this for stable v5.8+?

-dann

Quoted 16 lines
---
 drm/nouveau/nvkm/engine/device/base.c | 1 +
 1 file changed, 1 insertion(+)
drm/nouveau/nvkm/engine/device/base.c +1 -0
index 9f4ac2672..68d665414 100644
@@ -3149,6 +3149,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
 		case 0x168: device->chip = &nv168_chipset; break;
 		default:
 			nvdev_error(device, "unknown chipset (%08x)\n", boot0);
+			ret = -ENOSYS;
 			goto done;
 		}
 

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 10 lines · dann frazier
Quoted 7 lines · Karol Herbst

Previously the code relied on device->pri to be NULL and to fail probing later. We really should just return an error inside nvkm_device_ctor for unsupported GPUs.

Fixes 24d5ff40a732 ("drm/nouveau/device: rework mmio mapping code to get rid of second map")
Cc dann frazier <[email protected]>
Quoted 6 lines

Thanks Karol! Got rid of the Oops for me.

Would it be appropriate to tag this for stable v5.8+?

Due to the Fixes: tags it will get auto selected for stable releases afaik. But I think an explicit send might speed it up? I think it's fine either way.

Quoted 19 lines

-dann

Quoted 16 lines
---
 drm/nouveau/nvkm/engine/device/base.c | 1 +
 1 file changed, 1 insertion(+)
drm/nouveau/nvkm/engine/device/base.c +1 -0
index 9f4ac2672..68d665414 100644
@@ -3149,6 +3149,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
              case 0x168: device->chip = &nv168_chipset; break;
              default:
                      nvdev_error(device, "unknown chipset (%08x)\n", boot0);
+                     ret = -ENOSYS;
                      goto done;
              }
 

A message that is not in the archive (sent off-list or not yet received): CACO55ttsBedogmWUV370vWpS49FmyQOk7spc5WkrnZKbbjyvGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

Reviewed-by
#6 lore raw
Quoted 13 lines · Karol Herbst
Quoted 12 lines · dann frazier
Quoted 7 lines · Karol Herbst

Previously the code relied on device->pri to be NULL and to fail probing later. We really should just return an error inside nvkm_device_ctor for unsupported GPUs.

Fixes 24d5ff40a732 ("drm/nouveau/device: rework mmio mapping code to get rid of second map")
Cc dann frazier <[email protected]>

Thanks Karol! Got rid of the Oops for me.

Quoted 9 lines
Quoted 4 lines

Would it be appropriate to tag this for stable v5.8+?

Due to the Fixes: tags it will get auto selected for stable releases afaik. But I think an explicit send might speed it up? I think it's fine either way.

The patch looks to only applies to the out-of-tree driver (is it normal
to send patches this way?) so it'll need adjustment if it's Cc'd to
stable, but the easiest, most reliable way to make sure it's picked up
is to add an explicit Cc: [email protected] tag to the commit.

Also:

Quoted 25 lines
Quoted 6 lines

-dann

Quoted 4 lines
---
 drm/nouveau/nvkm/engine/device/base.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 13 lines

drm/nouveau/nvkm/engine/device/base.c nvkm_device_ctor(const struct nvkm_device_func *func, · line 3155

Quoted 12 lines
drm/nouveau/nvkm/engine/device/base.c +1 -0
index 9f4ac2672..68d665414 100644
@@ -3149,6 +3149,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
              case 0x168: device->chip = &nv168_chipset; break;
              default:
                      nvdev_error(device, "unknown chipset (%08x)\n", boot0);
+                     ret = -ENOSYS;
                      goto done;
              }
 

_______________________________________________
Nouveau mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

#7 lore raw
Quoted 25 lines · Jeremy Cline
Quoted 13 lines · Karol Herbst
Quoted 12 lines · dann frazier
Quoted 7 lines · Karol Herbst

Previously the code relied on device->pri to be NULL and to fail probing later. We really should just return an error inside nvkm_device_ctor for unsupported GPUs.

Fixes 24d5ff40a732 ("drm/nouveau/device: rework mmio mapping code to get rid of second map")
Cc dann frazier <[email protected]>

Thanks Karol! Got rid of the Oops for me.

Quoted 9 lines
Quoted 4 lines

Would it be appropriate to tag this for stable v5.8+?

Due to the Fixes: tags it will get auto selected for stable releases afaik. But I think an explicit send might speed it up? I think it's fine either way.

Quoted 5 lines

The patch looks to only applies to the out-of-tree driver (is it normal
to send patches this way?) so it'll need adjustment if it's Cc'd to
stable, but the easiest, most reliable way to make sure it's picked up
is to add an explicit Cc: [email protected] tag to the commit.

Actually.. we do have a drm-fixes thing, I think it's probably better to go through that instead of the nouveau tree? Mhh.. we need a better process here anyway :p

Quoted 30 lines

Also:

Quoted 25 lines
Quoted 6 lines

-dann

Quoted 4 lines
---
 drm/nouveau/nvkm/engine/device/base.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 13 lines

drm/nouveau/nvkm/engine/device/base.c nvkm_device_ctor(const struct nvkm_device_func *func, · line 3155

Quoted 12 lines
drm/nouveau/nvkm/engine/device/base.c +1 -0
index 9f4ac2672..68d665414 100644
@@ -3149,6 +3149,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
              case 0x168: device->chip = &nv168_chipset; break;
              default:
                      nvdev_error(device, "unknown chipset (%08x)\n", boot0);
+                     ret = -ENOSYS;
                      goto done;
              }
 

_______________________________________________
Nouveau mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau