Resource map sanity check fails after GRUB "keeps" the gfx mode
Hello!
I'm getting this backtrace every time I boot:
resource map sanity check conflict: 0xf0000000 0xf1ffffff 0xf1000000 0xf112bfff BOOTFB ------------[ cut here ]------------
WARNING: CPU: 6 PID: 1 at /home/proskin/src/linux/arch/x86/mm/ioremap.c:171 __ioremap_caller+0x372/0x380() Info: mapping multiple BARs. Your kernel
is fine. Modules linked in: CPU: 6 PID: 1 Comm: swapper/0 Not tainted 3.12.0-rc1-00021-g8f98ef7 #28 Hardware name: LENOVO 2441AA2/2441AA2, BIOS G5ET30WW (1.08 ) 06/01/2012 00000000000000ab ffff88040bca3818 ffffffff816a61ef 0000000000000072 ffff88040bca3868 ffff88040bca3858 ffffffff81083d1c ffff88040bca3878 ffffc90005300000 00000000f0000000 00000000f0000000 0000000002000000 Call Trace:
[<ffffffff816a61ef>] dump_stack+0x46/0x58 [<ffffffff81083d1c>] warn_slowpath_common+0x8c/0xc0 [<ffffffff81083e06>] warn_slowpath_fmt+0x46/0x50 [<ffffffff81079512>] __ioremap_caller+0x372/0x380 [<ffffffff813a8de0>] ? nouveau_bar_create_+0x80/0xb0 [<ffffffff81079577>] ioremap_nocache+0x17/0x20 [<ffffffff813a8de0>] nouveau_bar_create_+0x80/0xb0 [<ffffffff813a984b>] nvc0_bar_ctor+0x4b/0x440 [<ffffffff813a733e>] nouveau_object_ctor+0x3e/0xf0 [<ffffffff813cdfd5>] nouveau_devobj_ctor+0x195/0x700 [<ffffffff813a733e>] nouveau_object_ctor+0x3e/0xf0 [<ffffffff813a7cf7>] nouveau_object_new+0x197/0x250 [<ffffffff81404a6d>] nouveau_drm_load+0x1cd/0x7a0 [<ffffffff8144203e>] ? device_register+0x1e/0x30 [<ffffffff81389206>] ? drm_sysfs_device_add+0x86/0xb0 [<ffffffff81387bed>] drm_get_pci_dev+0x13d/0x310 [<ffffffff812dd81b>] ? __pci_set_master+0x2b/0x90 [<ffffffff814041ca>] nouveau_drm_probe+0x25a/0x290 [<ffffffff812e3b89>] pci_device_probe+0x99/0xe0 [<ffffffff81444c9b>] driver_probe_device+0x7b/0x240 [<ffffffff81444f0b>] __driver_attach+0xab/0xb0 [<ffffffff81444e60>] ? driver_probe_device+0x240/0x240 [<ffffffff81442ede>] bus_for_each_dev+0x5e/0x90 [<ffffffff8144479e>] driver_attach+0x1e/0x20 [<ffffffff81444244>] bus_add_driver+0x104/0x2a0 [<ffffffff814455e4>] driver_register+0x64/0xf0 [<ffffffff81d0ee34>] ? ttm_init+0x62/0x62 [<ffffffff812e2b3b>] __pci_register_driver+0x4b/0x50 [<ffffffff81387ed5>] drm_pci_init+0x115/0x130 [<ffffffff81d0ee34>] ? ttm_init+0x62/0x62 [<ffffffff81d0ee77>] nouveau_drm_init+0x43/0x45 [<ffffffff8100023f>] do_one_initcall+0x3f/0x150 [<ffffffff81cd7f47>] kernel_init_freeable+0x138/0x1c7 [<ffffffff81cd7837>] ? do_early_param+0x86/0x86 [<ffffffff8169e590>] ? rest_init+0x80/0x80 [<ffffffff8169e59e>] kernel_init+0xe/0xf0 [<ffffffff816ad9ac>] ret_from_fork+0x7c/0xb0 [<ffffffff8169e590>] ? rest_init+0x80/0x80 ---[ end trace 0bc6b5945c0022a8 ]---
It is not showing if I enable GRUB_GFXPAYLOAD_LINUX=text in /etc/default/grub
I'm attaching the kernel configuration and the kernel log for the good and the bad cases (with the timestamps stripped).
There is one interesting part of the diff:
dmesg.bad 2013-09-25 09:41:01.972012919 -0400 renamed from dmesg.good 2013-09-25 08:41:35.814705791 -0400 +1 -1
@@ -174,12 +174,12 @@ CONFIG_RCU_FANOUT set to non-default value of 32 RCU dyntick-idle grace-period acceleration is enabled. NR_IRQS:4352 nr_irqs:744 16 -Console: colour VGA+ 80x25 +Console: colour dummy device 80x25
I believe GRUB does something to the videocard so that drivers/video/console/vgacon.c passes control to drivers/video/console/dummycon.c and that somehow confuses nouveau and makes it map multiple BARs in one call.
Ironically, GRUB uses text mode on that system. Perhaps it cannot enable the GFX mode. Yet it must be doing something bad when passing control to the kernel.
I'm using 32-bit Lubuntu 12.04 with a 64-bit kernel. The GRUB version is 1.99-21ubuntu3.10. The hardware is Lenovo ThinkPad W530, model 2441AA2. The BIOS is set to always use the discreet graphics.
I can reproduce the problem on the current master branch of the nouveau repository, git://anongit.freedesktop.org/nouveau/linux-2.6
Signature · 2 lines
Regards, Pavel Roskin
_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
Hello!
I have spent some time on the issue. I'm not sure it's a nouveau bug. I have a fix that changes arch/x86/kernel/sysfb_simplefb.c only.
GRUB actually uses graphic mode on my card. That mode is supported by simplefb. However, the resource conflict happens regardless of whether simplefb is enabled. It's sysfb_simplefb that causes it, a completely different driver.
If GRUB keeps the graphic mode, I have this entry in /proc/iomem:
f1000000-f112bfff : BOOTFB
It is reserved by sysfb_simplefb. Nouveau tries to map an area at 0xf0000000-0xf1ffffff, so it includes the existing resource without being equivalent to it.
Nouveau correctly calls remove_conflicting_framebuffers() before trying to map that resource. However, sysfb_simplefb is not a real framebuffer, so it doesn't free its resources.
iomem_map_sanity_check() doesn't check regions with IORESOURCE_BUSY set. That's the comment from the code:
/*
* if a resource is "BUSY", it's not a hardware resource
* but a driver mapping of such a resource; we don't want
* to warn for those; some drivers legitimately map only
* partial hardware resources. (example: vesafb) */
So I added IORESOURCE_BUSY to sysfb_simplefb.c and the problem is fixed now. Actually, it prevents nvidiafb from claiming the device:
nvidiafb 0000:01:00.0: BAR 3: can't reserve [mem 0xf0000000-0xf1ffffff 64bit pref]
But maybe that's the point of sysfb_simplefb? Anyway, here's the patch/hack, signed off in case it's correct :)
sysfb_simplefb: mark BOOTFB resource as busy
From: Pavel Roskin <proski-mXXj517/[email protected]>
This fixes a warning when nouveau tries to allocate a larger iomem area:
resource map sanity check conflict: 0xf0000000 0xf1ffffff 0xf1000000 0xf112bfff BOOTFB
iomem_map_sanity_check() specifically excludes busy regions from checking.
--- arch/x86/kernel/sysfb_simplefb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/sysfb_simplefb.c +1 -1
@@ -79,7 +79,7 @@ __init int create_simplefb(const struct screen_info *si,/* setup IORESOURCE_MEM as framebuffer memory */ memset (&res,0 ,sizeof (res)); - res.flags =IORESOURCE_MEM ; + res.flags =IORESOURCE_MEM |IORESOURCE_BUSY ; res.name = simplefb_resname; res.start = si->lfb_base; res.end = si->lfb_base + len -1 ;
Signature · 2 lines
Regards, Pavel Roskin
Quoted 32 lines · Pavel Roskin
Hello!
I have spent some time on the issue. I'm not sure it's a nouveau bug. I have a fix that changes
arch/x86/kernel/sysfb_simplefb.conly.GRUB actually uses graphic mode on my card. That mode is supported by simplefb. However, the resource conflict happens regardless of whether simplefb is enabled. It's
sysfb_simplefbthat causes it, a completely different driver.If GRUB keeps the graphic mode, I have this entry in
/proc/iomem:f1000000-f112bfff : BOOTFBIt is reserved by
sysfb_simplefb. Nouveau tries to map an area at 0xf0000000-0xf1ffffff, so it includes the existing resource without being equivalent to it.Nouveau correctly calls
remove_conflicting_framebuffers()before trying to map that resource. However,sysfb_simplefbis not a real framebuffer, so it doesn't free its resources.
iomem_map_sanity_check()doesn't check regions withIORESOURCE_BUSYset. That's the comment from the code:/*
* if a resource is "BUSY", it's not a hardware resource
* but a driver mapping of such a resource; we don't want
* to warn for those; some drivers legitimately map only
* partial hardware resources. (example: vesafb) */
Quoted 10 lines
So I added
IORESOURCE_BUSYtosysfb_simplefb.cand the problem is fixed now. Actually, it prevents nvidiafb from claiming the device:nvidiafb 0000:01:00.0: BAR 3: can't reserve [mem 0xf0000000-0xf1ffffff 64bit pref]
But maybe that's the point of
sysfb_simplefb? Anyway, here's the patch/hack, signed off in case it's correct :)
FWIW another nvc0 user is experiencing the same/similar issue and the patch seems to resolve the problem in his case.
https://bugs.freedesktop.org/show_bug.cgi?id=69488
Thanks Pavel :)
Cheers
Emil
Quoted 4 lines · On Fri, 27 Sep 2013 10:33:26 +0100 Emil Velikov…
FWIW another nvc0 user is experiencing the same/similar issue and the patch seems to resolve the problem in his case.
Good to hear that my patch actually makes more than cosmetic difference for somebody. My system doesn't hang even with the stack trace.
I posted another patch on the bug page. It widens the BOOTFB resource to match the PCI BAR instead of making it busy. With the new patch, nvidiafb doesn't report that the resource is busy, it reports unsupported hardware, which is true.
Old patch:
nvidiafb 0000:01:00.0: BAR 3: can't reserve [mem 0xf0000000-0xf1ffffff 64bit pref]
nvidiafb: cannot request PCI regions
New patch:
nvidiafb: Device ID: 10de0ffc
nvidiafb: unknown NV_ARCH
I'll send the patch to [email protected], it's clearly not an nvidia issue.
Signature · 2 lines
Regards, Pavel Roskin
Hi
Quoted 10 lines · Pavel Roskin
Quoted 4 lines · On Fri, 27 Sep 2013 10:33:26 +0100 Emil Velikov…
FWIW another nvc0 user is experiencing the same/similar issue and the patch seems to resolve the problem in his case.
Good to hear that my patch actually makes more than cosmetic difference for somebody. My system doesn't hang even with the stack trace.
I am aware of this and there is already a fix pending from 2 weeks ago. Unfortunately, I have been in the US for the last 2 weeks and haven't really been able to push on that. Anyhow, it should really be just a cosmetic issue. We need to mark the sysfb FB as busy to avoid the nasty warnings. Other than that, this shouldn't cause any issues.
Thanks
David
Quoted 19 lines
I posted another patch on the bug page. It widens the BOOTFB resource to match the PCI BAR instead of making it busy. With the new patch, nvidiafb doesn't report that the resource is busy, it reports unsupported hardware, which is true.
Old patch:
nvidiafb 0000:01:00.0: BAR 3: can't reserve [mem 0xf0000000-0xf1ffffff 64bit pref]
nvidiafb: cannot request PCI regionsNew patch:
nvidiafb: Device ID:10de0ffc
nvidiafb: unknownNV_ARCHI'll send the patch to [email protected], it's clearly not an nvidia issue.
--
Regards,
Pavel Roskin
Quoting David Herrmann <[email protected]>:
Quoted 5 lines
I am aware of this and there is already a fix pending from 2 weeks ago. Unfortunately, I have been in the US for the last 2 weeks and haven't really been able to push on that. Anyhow, it should really be just a cosmetic issue. We need to mark the sysfb FB as busy to avoid the nasty warnings. Other than that, this shouldn't cause any issues.
OK, you are the one who must be better aware of the whole picture, so if the intention is to make the resource busy, that's my first patch and whatever you are trying to push.
You still may want to have a look at my second patch that widens the resource to match an appropriate PCI BAR.
I'm too puzzled why the resource conflict warning causes a GPU lockup for another user. Maybe it's an unrelated issue. Also, I don't use UEFI. I plan to test it eventually if I figure out how to migrate to it without reinstalling everything.
Signature · 2 lines
Regards, Pavel Roskin
Hi Pavel
Quoted 13 lines · Pavel Roskin
Quoting David Herrmann <[email protected]>:
Quoted 5 lines
I am aware of this and there is already a fix pending from 2 weeks ago. Unfortunately, I have been in the US for the last 2 weeks and haven't really been able to push on that. Anyhow, it should really be just a cosmetic issue. We need to mark the sysfb FB as busy to avoid the nasty warnings. Other than that, this shouldn't cause any issues.
OK, you are the one who must be better aware of the whole picture, so if the intention is to make the resource busy, that's my first patch and whatever you are trying to push.
Quoted 7 lines
You still may want to have a look at my second patch that widens the resource to match an appropriate PCI BAR.
I'm too puzzled why the resource conflict warning causes a GPU lockup for another user. Maybe it's an unrelated issue. Also, I don't use UEFI. I plan to test it eventually if I figure out how to migrate to it without reinstalling everything.
Thanks for your investigations. I finally sent my patch and put you on CC. Sorry for the delay, but I have mostly catched up with all emails now.
This really just suppresses the warning and nothing else. It does not fix any lockup/crash/... And your PCI-BAR adjustment doesn't change anything either, sorry. There is no reason to size the resource according to PCI tables as it is totally fine to remap partial segments. resource management is only used for sanity checks and bookkeeping. If there are real bugs (other than just "Your kernel is fine." warnings) then we need to bisect them.
Let me know if there are still related issues. I will gladly try to resolve them.
Thanks!
David
Quoted 5 lines · On Wed, 2 Oct 2013 16:47:29 +0200 David Herrmann…
Thanks for your investigations. I finally sent my patch and put you on CC. Sorry for the delay, but I have mostly catched up with all emails now.
This really just suppresses the warning and nothing else.
Thank you for your detailed explanation in the patch.
Quoted 2 lines
It does not
fix any lockup/crash/...
I know. I was surprised that my patch fixed something else, but now we know that it didn't. It's better when patches don't have unexpected effects even if the effects are positive :)
Quoted 2 lines
And your PCI-BAR adjustment doesn't change
anything either, sorry.
I simply tried another approach to pacify the resource checker.
However, there is some difference. nvidiafb cannot access the resources if IORESOURCE_BUSY is used.
It's not that it matters for me. nvidiafb fails on my hardware anyway and I don't need it when I already have simplefb and nouveau. But I think we should have a closer look why it fails and what other drivers may fail.
Signature · 2 lines
Regards, Pavel Roskin
Hi Pavel
Quoted 9 lines · Pavel Roskin
Quoted 5 lines · On Wed, 2 Oct 2013 16:47:29 +0200 David Herrmann…
Thanks for your investigations. I finally sent my patch and put you on CC. Sorry for the delay, but I have mostly catched up with all emails now.
This really just suppresses the warning and nothing else.
Quoted 8 lines
Thank you for your detailed explanation in the patch.
Quoted 2 lines
It does not
fix any lockup/crash/...I know. I was surprised that my patch fixed something else, but now we know that it didn't. It's better when patches don't have unexpected effects even if the effects are positive :)
Indeed. And I appreciate your help a lot.
Quoted 7 lines
Quoted 2 lines
And your PCI-BAR adjustment doesn't change
anything either, sorry.I simply tried another approach to pacify the resource checker.
However, there is some difference. nvidiafb cannot access the resources if
IORESOURCE_BUSYis used.
Are you sure this is related to IORESOURCE_BUSY? Or is it related to CONFIG_X86_SYSFB?
Thanks
David
Quoted 8 lines
It's not that it matters for me. nvidiafb fails on my hardware anyway and I don't need it when I already have simplefb and nouveau. But I think we should have a closer look why it fails and what other drivers may fail.
--
Regards,
Pavel Roskin
Hi David,
Quoted 10 lines · On Thu, 3 Oct 2013 00:19:56 +0200 David Herrmann…
Quoted 7 lines
Quoted 2 lines
And your PCI-BAR adjustment doesn't change
anything either, sorry.I simply tried another approach to pacify the resource checker.
However, there is some difference. nvidiafb cannot access the resources if
IORESOURCE_BUSYis used.Are you sure this is related to
IORESOURCE_BUSY? Or is it related toCONFIG_X86_SYSFB?
CONFIG_X86_SYSFB is always defined. I doubt an x86 kernel would compile without it. create_simplefb() is used in arch/x86/kernel/sysfb.c that is compiled unconditionally and that function is defined in arch/x86/kernel/sysfb_simplefb.c that is only compiled if CONFIG_X86_SYSFB is defined.
I tried four combinations: with and without IORESOURCE_BUSY and with and without the PCI resource adjustment. The only combination when nvidiafb probes the hardware is when IORESOURCE_BUSY is not used and the BOOTFP resource is adjusted to match the PCI BAR.
It means that your patch by itself won't prevent nvidiafb from getting the resource on my hardware (ThinkPad W530). However, if the BOOTFP resource matches the PCI BAR for the video card, adding IORESOURCE_BUSY might prevent some framebuffer drivers from accessing the resource.
This complexity doesn't seem right. I think specific drivers should trump generic once and DRI drivers should trump non-DRI. It shouldn't matter whether the BOOTFP area from screen_info coincides with the PCI BAR or occupies a part of it.
Signature · 2 lines
Regards, Pavel Roskin
Hi Pavel
Quoted 13 lines · Pavel Roskin
Hi David,
Quoted 8 lines · On Thu, 3 Oct 2013 00:19:56 +0200 David Herrmann…
Quoted 7 lines
Quoted 2 lines
And your PCI-BAR adjustment doesn't change
anything either, sorry.I simply tried another approach to pacify the resource checker.
However, there is some difference. nvidiafb cannot access the resources if
IORESOURCE_BUSYis used.
Quoted 8 lines
Quoted 2 lines
Are you sure this is related to
IORESOURCE_BUSY? Or is it related toCONFIG_X86_SYSFB?
CONFIG_X86_SYSFBis always defined. I doubt an x86 kernel would compile without it.create_simplefb()is used inarch/x86/kernel/sysfb.cthat is compiled unconditionally and that function is defined inarch/x86/kernel/sysfb_simplefb.cthat is only compiled ifCONFIG_X86_SYSFBis defined.
You can set CONFIG_X86_SYSFB=n and everything works fine. It's the default and is what pre-3.12 kernels always did.
Quoted 4 lines
I tried four combinations: with and without
IORESOURCE_BUSYand with and without the PCI resource adjustment. The only combination when nvidiafb probes the hardware is whenIORESOURCE_BUSYis not used and the BOOTFP resource is adjusted to match the PCI BAR.
A dmesg log would be nice, but I assume nvidiafb fails because it cannot map its BAR regions?
Quoted 4 lines
It means that your patch by itself won't prevent nvidiafb from getting the resource on my hardware (ThinkPad W530). However, if the BOOTFP resource matches the PCI BAR for the video card, adding
IORESOURCE_BUSYmight prevent some framebuffer drivers from accessing the resource.
Meh! I now understand the problem:
The resource.c resource-management allows creating sub-regions of existing regions. However, a sub-region must always be a real child of its parent, it cannot span multiple parents. Therefore, if we create the simplefb region before the pci BAR is mapped, we need your patches to bump the simplefb region to at least the size of the respective PCI region. Otherwise, nvidia tries allocating a sub-region that spans wider than the simplefb region and thus failing.
On the other hand, sub-mappings of BUSY regions are _never_ allowed. A BUSY region gives exclusive access to the holder of the region. But dropping BUSY from the simplefb region is wrong. We have to mark the system-framebuffer as BUSY, otherwise we might end up with a corrupted framebuffer after loading other real hw drivers.
In other words: The fact that we used to not reserve platform-framebuffer regions before 3.12 trips us now because it is actually _wrong_ to load real hw drivers like nvidiafb while the platform-framebuffer is still available. So the failure we get now just tells us that nvidiafb and friends do horrible things.
TL;DR
To fix this, we want real hardware drivers to remove platform-framebuffer devices and release their resources before acquiring them again. I recommend CONFIG_X86_SYSFB=n for anyone seeing these issues. For 3.13 I will try to fix the framebuffer-handover. Fortunately, no real DRM drivers actually request pci regions (why would they? pci-probing already guarantees exclusive access) and the platform-FB drivers have already been converted. So this bug can only be triggered with legacy hw-fbdev drivers (a simple search for pci_request_regions in ./drivers/video/ shows them).
Quoted 4 lines
This complexity doesn't seem right. I think specific drivers should trump generic once and DRI drivers should trump non-DRI. It shouldn't matter whether the BOOTFP area from
screen_infocoincides with the PCI BAR or occupies a part of it.
I will try to write a patch as part of the SimpleDRM series which allows removing platform-framebuffer devices. We simply do this during framebuffer probing and we should be fine.
Thanks
David
Quoted 8 lines · On Fri, 4 Oct 2013 01:08:34 +0200 David Herrmann…
Quoted 5 lines
CONFIG_X86_SYSFBis always defined. I doubt an x86 kernel would compile without it.create_simplefb()is used inarch/x86/kernel/sysfb.cthat is compiled unconditionally and that function is defined inarch/x86/kernel/sysfb_simplefb.cthat is only compiled ifCONFIG_X86_SYSFBis defined.You can set
CONFIG_X86_SYSFB=nand everything works fine. It's the default and is what pre-3.12 kernels always did.
Of course, you are right, I missed sysfb.h.
Quoted 7 lines
Quoted 4 lines
I tried four combinations: with and without
IORESOURCE_BUSYand with and without the PCI resource adjustment. The only combination when nvidiafb probes the hardware is whenIORESOURCE_BUSYis not used and the BOOTFP resource is adjusted to match the PCI BAR.A dmesg log would be nice, but I assume nvidiafb fails because it cannot map its BAR regions?
The logs are adjusted and so it the kernel config file.
$ grep nvidiafb * dm-busy-adjust:nvidiafb_setup START dm-busy-adjust:nvidiafb_probe START dm-busy-adjust:nvidiafb 0000:01:00.0: BAR 3: can't reserve [mem 0xf0000000-0xf1ffffff 64bit pref] dm-busy-adjust:nvidiafb: cannot request PCI regions dm-busy-noadjust:nvidiafb_setup START dm-busy-noadjust:nvidiafb_probe START dm-busy-noadjust:nvidiafb 0000:01:00.0: BAR 3: can't reserve [mem 0xf0000000-0xf1ffffff 64bit pref] dm-busy-noadjust:nvidiafb: cannot request PCI regions dm-nobusy-adjust:nvidiafb_setup START dm-nobusy-adjust:nvidiafb_probe START dm-nobusy-adjust:nvidiafb: Device ID: 10de0ffc dm-nobusy-adjust:nvidiafb: unknown NV_ARCH dm-nobusy-noadjust:nvidiafb_setup START dm-nobusy-noadjust:nvidiafb_probe START dm-nobusy-noadjust:nvidiafb 0000:01:00.0: BAR 3: can't reserve [mem 0xf0000000-0xf1ffffff 64bit pref] dm-nobusy-noadjust:nvidiafb: cannot request PCI regions
The error comes from pci_request_regions() called in drivers/video/nvidia/nvidia.c
Quoted 7 lines
Quoted 5 lines
It means that your patch by itself won't prevent nvidiafb from getting the resource on my hardware (ThinkPad W530). However, if the BOOTFP resource matches the PCI BAR for the video card, adding
IORESOURCE_BUSYmight prevent some framebuffer drivers from accessing the resource.Meh! I now understand the problem:
Great!
Quoted 5 lines
In other words: The fact that we used to not reserve platform-framebuffer regions before 3.12 trips us now because it is actually _wrong_ to load real hw drivers like nvidiafb while the platform-framebuffer is still available. So the failure we get now just tells us that nvidiafb and friends do horrible things.
I actually hoped to hear from you something like that. It's good to have limitations if they are well understood and not arbitrary.
Quoted 5 lines
Fortunately, no real DRM drivers actually request pci regions (why would they? pci-probing already guarantees exclusive access) and the platform-FB drivers have already been converted. So this bug can only be triggered with legacy hw-fbdev drivers (a simple search for
pci_request_regionsin./drivers/video/shows them).
It's very reassuring. Your work is greatly appreciated!
Signature · 2 lines
Regards, Pavel Roskin
_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
Hi Pavel
Quoted 65 lines · Pavel Roskin
Quoted 8 lines · On Fri, 4 Oct 2013 01:08:34 +0200 David Herrmann…
Quoted 5 lines
CONFIG_X86_SYSFBis always defined. I doubt an x86 kernel would compile without it.create_simplefb()is used inarch/x86/kernel/sysfb.cthat is compiled unconditionally and that function is defined inarch/x86/kernel/sysfb_simplefb.cthat is only compiled ifCONFIG_X86_SYSFBis defined.You can set
CONFIG_X86_SYSFB=nand everything works fine. It's the default and is what pre-3.12 kernels always did.Of course, you are right, I missed
sysfb.h.Quoted 7 lines
Quoted 4 lines
I tried four combinations: with and without
IORESOURCE_BUSYand with and without the PCI resource adjustment. The only combination when nvidiafb probes the hardware is whenIORESOURCE_BUSYis not used and the BOOTFP resource is adjusted to match the PCI BAR.A dmesg log would be nice, but I assume nvidiafb fails because it cannot map its BAR regions?
The logs are adjusted and so it the kernel config file.
$ grep nvidiafb * dm-busy-adjust:nvidiafb_setup START dm-busy-adjust:nvidiafb_probe START dm-busy-adjust:nvidiafb 0000:01:00.0: BAR 3: can't reserve [mem 0xf0000000-0xf1ffffff 64bit pref] dm-busy-adjust:nvidiafb: cannot request PCI regions dm-busy-noadjust:nvidiafb_setup START dm-busy-noadjust:nvidiafb_probe START dm-busy-noadjust:nvidiafb 0000:01:00.0: BAR 3: can't reserve [mem 0xf0000000-0xf1ffffff 64bit pref] dm-busy-noadjust:nvidiafb: cannot request PCI regions dm-nobusy-adjust:nvidiafb_setup START dm-nobusy-adjust:nvidiafb_probe START dm-nobusy-adjust:nvidiafb: Device ID: 10de0ffc dm-nobusy-adjust:nvidiafb: unknown NV_ARCH dm-nobusy-noadjust:nvidiafb_setup START dm-nobusy-noadjust:nvidiafb_probe START dm-nobusy-noadjust:nvidiafb 0000:01:00.0: BAR 3: can't reserve [mem 0xf0000000-0xf1ffffff 64bit pref] dm-nobusy-noadjust:nvidiafb: cannot request PCI regionsThe error comes from
pci_request_regions()called indrivers/video/nvidia/nvidia.cQuoted 7 lines
Quoted 5 lines
It means that your patch by itself won't prevent nvidiafb from getting the resource on my hardware (ThinkPad W530). However, if the BOOTFP resource matches the PCI BAR for the video card, adding
IORESOURCE_BUSYmight prevent some framebuffer drivers from accessing the resource.Meh! I now understand the problem:
Great!
Quoted 5 lines
In other words: The fact that we used to not reserve platform-framebuffer regions before 3.12 trips us now because it is actually _wrong_ to load real hw drivers like nvidiafb while the platform-framebuffer is still available. So the failure we get now just tells us that nvidiafb and friends do horrible things.
I actually hoped to hear from you something like that. It's good to have limitations if they are well understood and not arbitrary.
Quoted 7 lines
Quoted 5 lines
Fortunately, no real DRM drivers actually request pci regions (why would they? pci-probing already guarantees exclusive access) and the platform-FB drivers have already been converted. So this bug can only be triggered with legacy hw-fbdev drivers (a simple search for
pci_request_regionsin./drivers/video/shows them).It's very reassuring. Your work is greatly appreciated!
2 months late, but there's a patch pending on LKML:
http://thread.gmane.org/gmane.linux.kernel/1616367/focus=1616583
This should fix your issues as it removes simple-framebuffer devices on remove_conflicting_framebuffers() now.
Thanks
David