Re: [Bug 206175] Fedora >= 5.4 kernels instantly freeze on boot without producing any display output

From: Christoph Hellwig
Date: Tue Mar 10 2020 - 14:25:50 EST


FYI, Linus' latest rant shows up in bugzilla, but never made it to me,
just as the other replies from Artem and Hans. This just shows how
broken bugzilla is as a reporting tool. Please be a little more calm,
I've always taken reported regressions series and as a first priority,
but it really does not help if information is hidden away. Adding
Artem to the Cc list and drop bugzilla to make this work a bit better.

Artem, can you test the patch below? This fixes the broken dma_mask
handling in platform_device_register_full that could override a
perfectly valid mask with 0. If this doesn't work, can you throw
in a dump_stack() into the working kernel build to see where
platform_device_register_full and setup_pdev_dma_masks get called
for your system?

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 7fa654f1288b..03035661eb6b 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -662,19 +662,6 @@ struct platform_device *platform_device_register_full(
pdev->dev.of_node_reused = pdevinfo->of_node_reused;

if (pdevinfo->dma_mask) {
- /*
- * This memory isn't freed when the device is put,
- * I don't have a nice idea for that though. Conceptually
- * dma_mask in struct device should not be a pointer.
- * See http://thread.gmane.org/gmane.linux.kernel.pci/9081
- */
- pdev->dev.dma_mask =
- kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
- if (!pdev->dev.dma_mask)
- goto err;
-
- kmemleak_ignore(pdev->dev.dma_mask);
-
*pdev->dev.dma_mask = pdevinfo->dma_mask;
pdev->dev.coherent_dma_mask = pdevinfo->dma_mask;
}