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
This commit is contained in:
parent
8d13c187c4
commit
984d7a929a
|
@ -1048,6 +1048,41 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_DRM_AMDGPU_SI
|
||||||
|
if (!amdgpu_si_support) {
|
||||||
|
switch (flags & AMD_ASIC_MASK) {
|
||||||
|
case CHIP_TAHITI:
|
||||||
|
case CHIP_PITCAIRN:
|
||||||
|
case CHIP_VERDE:
|
||||||
|
case CHIP_OLAND:
|
||||||
|
case CHIP_HAINAN:
|
||||||
|
dev_info(&pdev->dev,
|
||||||
|
"SI support provided by radeon.\n");
|
||||||
|
dev_info(&pdev->dev,
|
||||||
|
"Use radeon.si_support=0 amdgpu.si_support=1 to override.\n"
|
||||||
|
);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_DRM_AMDGPU_CIK
|
||||||
|
if (!amdgpu_cik_support) {
|
||||||
|
switch (flags & AMD_ASIC_MASK) {
|
||||||
|
case CHIP_KAVERI:
|
||||||
|
case CHIP_BONAIRE:
|
||||||
|
case CHIP_HAWAII:
|
||||||
|
case CHIP_KABINI:
|
||||||
|
case CHIP_MULLINS:
|
||||||
|
dev_info(&pdev->dev,
|
||||||
|
"CIK support provided by radeon.\n");
|
||||||
|
dev_info(&pdev->dev,
|
||||||
|
"Use radeon.cik_support=0 amdgpu.cik_support=1 to override.\n"
|
||||||
|
);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Get rid of things like offb */
|
/* Get rid of things like offb */
|
||||||
ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
|
ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -144,41 +144,6 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
|
||||||
struct amdgpu_device *adev;
|
struct amdgpu_device *adev;
|
||||||
int r, acpi_status;
|
int r, acpi_status;
|
||||||
|
|
||||||
#ifdef CONFIG_DRM_AMDGPU_SI
|
|
||||||
if (!amdgpu_si_support) {
|
|
||||||
switch (flags & AMD_ASIC_MASK) {
|
|
||||||
case CHIP_TAHITI:
|
|
||||||
case CHIP_PITCAIRN:
|
|
||||||
case CHIP_VERDE:
|
|
||||||
case CHIP_OLAND:
|
|
||||||
case CHIP_HAINAN:
|
|
||||||
dev_info(dev->dev,
|
|
||||||
"SI support provided by radeon.\n");
|
|
||||||
dev_info(dev->dev,
|
|
||||||
"Use radeon.si_support=0 amdgpu.si_support=1 to override.\n"
|
|
||||||
);
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_DRM_AMDGPU_CIK
|
|
||||||
if (!amdgpu_cik_support) {
|
|
||||||
switch (flags & AMD_ASIC_MASK) {
|
|
||||||
case CHIP_KAVERI:
|
|
||||||
case CHIP_BONAIRE:
|
|
||||||
case CHIP_HAWAII:
|
|
||||||
case CHIP_KABINI:
|
|
||||||
case CHIP_MULLINS:
|
|
||||||
dev_info(dev->dev,
|
|
||||||
"CIK support provided by radeon.\n");
|
|
||||||
dev_info(dev->dev,
|
|
||||||
"Use radeon.cik_support=0 amdgpu.cik_support=1 to override.\n"
|
|
||||||
);
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);
|
adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);
|
||||||
if (adev == NULL) {
|
if (adev == NULL) {
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in New Issue