Skip to content

Commit 984d7a9

Browse files
jwrdegoedealexdeucher
authored andcommitted
drm/amdgpu: Bail earlier when amdgpu.cik_/si_support is not set to 1
Bail from the pci_driver probe function instead of from the drm_driver load function. This avoid /dev/dri/card0 temporarily getting registered and then unregistered again, sending unwanted add / remove udev events to userspace. Specifically this avoids triggering the (userspace) bug fixed by this plymouth merge-request: https://gitlab.freedesktop.org/plymouth/plymouth/merge_requests/59 Note that despite that being a userspace bug, not sending unnecessary udev events is a good idea in general. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1490490 Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent 8d13c18 commit 984d7a9

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,41 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
10481048
return -ENODEV;
10491049
}
10501050

1051+
#ifdef CONFIG_DRM_AMDGPU_SI
1052+
if (!amdgpu_si_support) {
1053+
switch (flags & AMD_ASIC_MASK) {
1054+
case CHIP_TAHITI:
1055+
case CHIP_PITCAIRN:
1056+
case CHIP_VERDE:
1057+
case CHIP_OLAND:
1058+
case CHIP_HAINAN:
1059+
dev_info(&pdev->dev,
1060+
"SI support provided by radeon.\n");
1061+
dev_info(&pdev->dev,
1062+
"Use radeon.si_support=0 amdgpu.si_support=1 to override.\n"
1063+
);
1064+
return -ENODEV;
1065+
}
1066+
}
1067+
#endif
1068+
#ifdef CONFIG_DRM_AMDGPU_CIK
1069+
if (!amdgpu_cik_support) {
1070+
switch (flags & AMD_ASIC_MASK) {
1071+
case CHIP_KAVERI:
1072+
case CHIP_BONAIRE:
1073+
case CHIP_HAWAII:
1074+
case CHIP_KABINI:
1075+
case CHIP_MULLINS:
1076+
dev_info(&pdev->dev,
1077+
"CIK support provided by radeon.\n");
1078+
dev_info(&pdev->dev,
1079+
"Use radeon.cik_support=0 amdgpu.cik_support=1 to override.\n"
1080+
);
1081+
return -ENODEV;
1082+
}
1083+
}
1084+
#endif
1085+
10511086
/* Get rid of things like offb */
10521087
ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
10531088
if (ret)

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -144,41 +144,6 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
144144
struct amdgpu_device *adev;
145145
int r, acpi_status;
146146

147-
#ifdef CONFIG_DRM_AMDGPU_SI
148-
if (!amdgpu_si_support) {
149-
switch (flags & AMD_ASIC_MASK) {
150-
case CHIP_TAHITI:
151-
case CHIP_PITCAIRN:
152-
case CHIP_VERDE:
153-
case CHIP_OLAND:
154-
case CHIP_HAINAN:
155-
dev_info(dev->dev,
156-
"SI support provided by radeon.\n");
157-
dev_info(dev->dev,
158-
"Use radeon.si_support=0 amdgpu.si_support=1 to override.\n"
159-
);
160-
return -ENODEV;
161-
}
162-
}
163-
#endif
164-
#ifdef CONFIG_DRM_AMDGPU_CIK
165-
if (!amdgpu_cik_support) {
166-
switch (flags & AMD_ASIC_MASK) {
167-
case CHIP_KAVERI:
168-
case CHIP_BONAIRE:
169-
case CHIP_HAWAII:
170-
case CHIP_KABINI:
171-
case CHIP_MULLINS:
172-
dev_info(dev->dev,
173-
"CIK support provided by radeon.\n");
174-
dev_info(dev->dev,
175-
"Use radeon.cik_support=0 amdgpu.cik_support=1 to override.\n"
176-
);
177-
return -ENODEV;
178-
}
179-
}
180-
#endif
181-
182147
adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);
183148
if (adev == NULL) {
184149
return -ENOMEM;

0 commit comments

Comments
 (0)