Re: [PATCH 5/5] drm/i915: Kick out vga console

Started by Ed Tomlinson on Jun 29, 2014 · 10 messages from 4 authors · Last reply Jul 8, 2014

open the first message on its own page

Message details and related content
On Saturday 28 June 2014 15:28:22 Ed Tomlinson wrote:

Resend without html krud which causes list to bounce the message.
Hi

This commit ( a4de05268e674e8ed31df6348269e22d6c6a1803 ) hangs my boot with 3.16-git.  Reverting it lets the boot proceed. 

I have an i7 with a built-in i915 and an pcie r7 260x.  The R7 is the primary console.  The i915 is initialized
but does not have a physical display attached.

With the patch applied the boot stops at the messages:

[drm] Memory usable by graphics device = 2048M
[drm] Replacing VGA console driver

and I need to interrupt or power off the box to get it back.

(I did not notice messages about the R7 but they could have easily been missed - this box does not have a serial console)

Without the patch I get:

Jun 28 14:53:54 localhost kernel: [    2.075351] e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
Jun 28 14:53:54 localhost kernel: [    2.075796] [drm] Initialized drm 1.1.0 20060810
Jun 28 14:53:54 localhost kernel: [    2.075958] microcode: CPU0 sig=0x306c3, pf=0x2, revision=0x17
Jun 28 14:53:54 localhost kernel: [    2.077289] microcode: CPU1 sig=0x306c3, pf=0x2, revision=0x17
Jun 28 14:53:54 localhost kernel: [    2.077299] microcode: CPU2 sig=0x306c3, pf=0x2, revision=0x17
Jun 28 14:53:54 localhost kernel: [    2.077307] microcode: CPU3 sig=0x306c3, pf=0x2, revision=0x17
Jun 28 14:53:54 localhost kernel: [    2.077315] microcode: CPU4 sig=0x306c3, pf=0x2, revision=0x17
Jun 28 14:53:54 localhost kernel: [    2.077325] microcode: CPU5 sig=0x306c3, pf=0x2, revision=0x17
Jun 28 14:53:54 localhost kernel: [    2.077335] microcode: CPU6 sig=0x306c3, pf=0x2, revision=0x17
Jun 28 14:53:54 localhost kernel: [    2.077342] microcode: CPU7 sig=0x306c3, pf=0x2, revision=0x17
Jun 28 14:53:54 localhost kernel: [    2.077378] microcode: Microcode Update Driver: v2.00 [off-list ref], Peter Oruba
Jun 28 14:53:54 localhost kernel: [    2.079726] input: PC Speaker as /devices/platform/pcspkr/input/input4
Jun 28 14:53:54 localhost kernel: [    2.083930] e1000e: Copyright(c) 1999 - 2014 Intel Corporation.
Jun 28 14:53:54 localhost kernel: [    2.084787] ACPI Warning: SystemIO range 0x000000000000f040-0x000000000000f05f conflicts with OpRegion 0x000000000000f040-0x000000000000f04f (\_SB_.PCI0.SBUS.SMBI) (20140424/utaddress-258)
Jun 28 14:53:54 localhost kernel: [    2.084788] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
Jun 28 14:53:54 localhost kernel: [    2.084894] e1000e 0000:00:19.0: Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode
Jun 28 14:53:54 localhost kernel: [    2.084905] e1000e 0000:00:19.0: irq 44 for MSI/MSI-X
Jun 28 14:53:54 localhost kernel: [    2.096721] iTCO_vendor_support: vendor-support=0
Jun 28 14:53:54 localhost kernel: [    2.096780] AVX2 version of gcm_enc/dec engaged.
Jun 28 14:53:54 localhost kernel: [    2.098512] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.11
Jun 28 14:53:54 localhost kernel: [    2.099042] iTCO_wdt: Found a Lynx Point TCO device (Version=2, TCOBASE=0x1860)
Jun 28 14:53:54 localhost kernel: [    2.099561] iTCO_wdt: initialized. heartbeat0 sec (nowayout=0)

303 more quoted lines

Message details and related content
On Sat, Jun 28, 2014 at 11:55:19PM -0400, Ed Tomlinson wrote:
On Saturday 28 June 2014 15:28:22 Ed Tomlinson wrote:

Resend without html krud which causes list to bounce the message.
quoted
Hi

This commit ( a4de05268e674e8ed31df6348269e22d6c6a1803 ) hangs my boot with 3.16-git.  Reverting it lets the boot proceed. 

I have an i7 with a built-in i915 and an pcie r7 260x.  The R7 is the primary console.  The i915 is initialized
but does not have a physical display attached.

With the patch applied the boot stops at the messages:

[drm] Memory usable by graphics device = 2048M
[drm] Replacing VGA console driver
The issue looks like that we are ripping out the radeon fb_con whilst it
is active and that upsets everyone. In which case, I think the
compromise is:

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 5f44581..4915f1d 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1439,18 +1439,20 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 #else
 static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 {
-       int ret;
+       int ret = 0;
 
        DRM_INFO("Replacing VGA console driver\n");
 
        console_lock();
-       ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
-       if (ret = 0) {
-               ret = do_unregister_con_driver(&vga_con);
-
-               /* Ignore "already unregistered". */
-               if (ret = -ENODEV)
-                       ret = 0;
+       if (con_is_bound(&vga_con)) {
+               ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
+               if (ret = 0) {
+                       ret = do_unregister_con_driver(&vga_con);
+
+                       /* Ignore "already unregistered". */
+                       if (ret = -ENODEV)
+                               ret = 0;
+               }
        }
        console_unlock();

-Chris
-- 
Chris Wilson, Intel Open Source Technology Centre
Message details and related content
Hi

On Mon, Jun 30, 2014 at 8:59 AM, Chris Wilson [off-list ref] wrote:
On Sat, Jun 28, 2014 at 11:55:19PM -0400, Ed Tomlinson wrote:
quoted
On Saturday 28 June 2014 15:28:22 Ed Tomlinson wrote:

Resend without html krud which causes list to bounce the message.
quoted
Hi

This commit ( a4de05268e674e8ed31df6348269e22d6c6a1803 ) hangs my boot with 3.16-git.  Reverting it lets the boot proceed.

I have an i7 with a built-in i915 and an pcie r7 260x.  The R7 is the primary console.  The i915 is initialized
but does not have a physical display attached.

With the patch applied the boot stops at the messages:

[drm] Memory usable by graphics device = 2048M
[drm] Replacing VGA console driver
The issue looks like that we are ripping out the radeon fb_con whilst it
is active and that upsets everyone. In which case, I think the
compromise is:
do_take_over_console() should only touch console-drivers like fbcon.
How does this affect the underlying fbdev device? Ripping out active
or inactive fbcon should be just fine, shouldn't it?

Given that this hard-locks at kick_out_vgacon(), this looks more like
a dead-lock to me.

Thanks
David
Message details and related content
Hi Chris,

I had to rediff to get a patch that applies...  I am not hanging with this applied - it
does look like the i915 is starting is initialization later boot the new kernel.

[    2.389796] [drm] Radeon Display Connectors
[    2.389798] [drm] Connector 0:
[    2.389799] [drm]   DP-1
[    2.389799] [drm]   HPD2
[    2.389801] [drm]   DDC: 0x6530 0x6530 0x6534 0x6534 0x6538 0x6538 0x653c 0x653c
[    2.389802] [drm]   Encoders:
[    2.389803] [drm]     DFP1: INTERNAL_UNIPHY2
[    2.389804] [drm] Connector 1:
[    2.389805] [drm]   HDMI-A-1
[    2.389805] [drm]   HPD3
[    2.389806] [drm]   DDC: 0x6550 0x6550 0x6554 0x6554 0x6558 0x6558 0x655c 0x655c
[    2.389807] [drm]   Encoders:
[    2.389808] [drm]     DFP2: INTERNAL_UNIPHY2
[    2.389809] [drm] Connector 2:
[    2.389810] [drm]   DVI-D-1
[    2.389811] [drm]   HPD1
[    2.389812] [drm]   DDC: 0x6560 0x6560 0x6564 0x6564 0x6568 0x6568 0x656c 0x656c
[    2.389813] [drm]   Encoders:
[    2.389814] [drm]     DFP3: INTERNAL_UNIPHY1
[    2.389815] [drm] Connector 3:
[    2.389815] [drm]   DVI-I-1
[    2.389816] [drm]   HPD6
[    2.389817] [drm]   DDC: 0x6580 0x6580 0x6584 0x6584 0x6588 0x6588 0x658c 0x658c
[    2.389818] [drm]   Encoders:
[    2.389819] [drm]     DFP4: INTERNAL_UNIPHY
[    2.389820] [drm]     CRT1: INTERNAL_KLDSCP_DAC1
[    2.435689] raid6: avx2x2   24564 MB/s
[    2.435691] Switched to clocksource tsc
[    2.489087] usb 1-8: new low-speed USB device number 7 using xhci_hcd
[    2.492403] raid6: avx2x4   34887 MB/s
[    2.492404] raid6: using algorithm avx2x4 (34887 MB/s)
[    2.492405] raid6: using avx2x2 recovery algorithm
[    2.492789] xor: automatically using best checksumming function:
[    2.502557] Adding 5779452k swap on /dev/sdb2.  Priority:-2 extents:1 across:5779452k FS
[    2.511532] [drm] fb mappable at 0xE098E000

26 more lines

quoted hunk
On Sat, Jun 28, 2014 at 11:55:19PM -0400, Ed Tomlinson wrote:
quoted
On Saturday 28 June 2014 15:28:22 Ed Tomlinson wrote:

Resend without html krud which causes list to bounce the message.
quoted
Hi

This commit ( a4de05268e674e8ed31df6348269e22d6c6a1803 ) hangs my boot with 3.16-git.  Reverting it lets the boot proceed. 

I have an i7 with a built-in i915 and an pcie r7 260x.  The R7 is the primary console.  The i915 is initialized
but does not have a physical display attached.

With the patch applied the boot stops at the messages:

[drm] Memory usable by graphics device = 2048M
[drm] Replacing VGA console driver
The issue looks like that we are ripping out the radeon fb_con whilst it
is active and that upsets everyone. In which case, I think the
compromise is:

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 5f44581..4915f1d 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1439,18 +1439,20 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 #else
 static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 {
-       int ret;
+       int ret = 0;
 
        DRM_INFO("Replacing VGA console driver\n");
 
        console_lock();
-       ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
-       if (ret = 0) {
-               ret = do_unregister_con_driver(&vga_con);
-

18 more quoted lines

Re: [Intel-gfx] [PATCH 5/5] drm/i915: Kick out vga console

Message details and related content
On Mon, Jun 30, 2014 at 07:59:55AM +0100, Chris Wilson wrote:
quoted hunk
On Sat, Jun 28, 2014 at 11:55:19PM -0400, Ed Tomlinson wrote:
quoted
On Saturday 28 June 2014 15:28:22 Ed Tomlinson wrote:

Resend without html krud which causes list to bounce the message.
quoted
Hi

This commit ( a4de05268e674e8ed31df6348269e22d6c6a1803 ) hangs my boot with 3.16-git.  Reverting it lets the boot proceed. 

I have an i7 with a built-in i915 and an pcie r7 260x.  The R7 is the primary console.  The i915 is initialized
but does not have a physical display attached.

With the patch applied the boot stops at the messages:

[drm] Memory usable by graphics device = 2048M
[drm] Replacing VGA console driver
The issue looks like that we are ripping out the radeon fb_con whilst it
is active and that upsets everyone. In which case, I think the
compromise is:

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 5f44581..4915f1d 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1439,18 +1439,20 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 #else
 static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 {
-       int ret;
+       int ret = 0;
 
        DRM_INFO("Replacing VGA console driver\n");
 
        console_lock();
-       ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
-       if (ret = 0) {
-               ret = do_unregister_con_driver(&vga_con);
-

7 more quoted lines

Hm, we should only conditionalize the take_over_console - unregistering
vga_con is kinda the point to make sure it's gone for real. Ed, can you
please retest with the if (con_is_bound) check just for the
do_take_over_console call?

Still puzzled wtf is going on here since as David says this should be a
no-op.

Thanks, Daniel
+
+                       /* Ignore "already unregistered". */
+                       if (ret = -ENODEV)
+                               ret = 0;
+               }
        }
        console_unlock();

-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

Re: [Intel-gfx] [PATCH 5/5] drm/i915: Kick out vga console

Message details and related content
Daniel,

I am not quite sure I understand what you want me to test?
Do you want me to try it without:
quoted
+               if (ret = 0) {
+                       ret = do_unregister_con_driver(&vga_con);
Thanks
Ed


On Monday 07 July 2014 10:48:26 Daniel Vetter wrote:
On Mon, Jun 30, 2014 at 07:59:55AM +0100, Chris Wilson wrote:
quoted
On Sat, Jun 28, 2014 at 11:55:19PM -0400, Ed Tomlinson wrote:
quoted
On Saturday 28 June 2014 15:28:22 Ed Tomlinson wrote:

Resend without html krud which causes list to bounce the message.
quoted
Hi

This commit ( a4de05268e674e8ed31df6348269e22d6c6a1803 ) hangs my boot with 3.16-git.  Reverting it lets the boot proceed. 

I have an i7 with a built-in i915 and an pcie r7 260x.  The R7 is the primary console.  The i915 is initialized
but does not have a physical display attached.

With the patch applied the boot stops at the messages:

[drm] Memory usable by graphics device = 2048M
[drm] Replacing VGA console driver
The issue looks like that we are ripping out the radeon fb_con whilst it
is active and that upsets everyone. In which case, I think the
compromise is:

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 5f44581..4915f1d 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1439,18 +1439,20 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 #else
 static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 {
-       int ret;
+       int ret = 0;
 
        DRM_INFO("Replacing VGA console driver\n");
 
        console_lock();
-       ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
-       if (ret = 0) {
-               ret = do_unregister_con_driver(&vga_con);

30 more quoted lines

Re: [Intel-gfx] [PATCH 5/5] drm/i915: Kick out vga console

Message details and related content
Daniel,

Just to be sure.  The intel card here should not be claiming the real console.  It does
not have an output device and the bios set set so the radeon is the primary device.

Ed


On Monday 07 July 2014 10:48:26 Daniel Vetter wrote:
On Mon, Jun 30, 2014 at 07:59:55AM +0100, Chris Wilson wrote:
quoted
On Sat, Jun 28, 2014 at 11:55:19PM -0400, Ed Tomlinson wrote:
quoted
On Saturday 28 June 2014 15:28:22 Ed Tomlinson wrote:

Resend without html krud which causes list to bounce the message.
quoted
Hi

This commit ( a4de05268e674e8ed31df6348269e22d6c6a1803 ) hangs my boot with 3.16-git.  Reverting it lets the boot proceed. 

I have an i7 with a built-in i915 and an pcie r7 260x.  The R7 is the primary console.  The i915 is initialized
but does not have a physical display attached.

With the patch applied the boot stops at the messages:

[drm] Memory usable by graphics device = 2048M
[drm] Replacing VGA console driver
The issue looks like that we are ripping out the radeon fb_con whilst it
is active and that upsets everyone. In which case, I think the
compromise is:

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 5f44581..4915f1d 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1439,18 +1439,20 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 #else
 static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 {
-       int ret;
+       int ret = 0;
 
        DRM_INFO("Replacing VGA console driver\n");
 
        console_lock();
-       ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
-       if (ret = 0) {
-               ret = do_unregister_con_driver(&vga_con);

30 more quoted lines

Re: [Intel-gfx] [PATCH 5/5] drm/i915: Kick out vga console

Message details and related content
On Mon, Jul 07, 2014 at 06:45:49AM -0400, Ed Tomlinson wrote:
Daniel,

I am not quite sure I understand what you want me to test?
Do you want me to try it without:
quoted
quoted
+               if (ret = 0) {
+                       ret = do_unregister_con_driver(&vga_con);
Below the diff of what I mean.
-Daniel

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 5e583a1838f8..bd8517151479 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1466,12 +1466,13 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 #else
 static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 {
-	int ret;
+	int ret = 0;
 
 	DRM_INFO("Replacing VGA console driver\n");
 
 	console_lock();
-	ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
+	if (con_is_bound(&vga_con))
+		ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
 	if (ret = 0) {
 		ret = do_unregister_con_driver(&vga_con);
 
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

Re: [Intel-gfx] [PATCH 5/5] drm/i915: Kick out vga console

Message details and related content
Hi Daniel,

The patch below also works.  You can use my Tested By for it.

Thanks
Ed Tomlinson [off-list ref]

PS. I _really_ need to get a serial console working on my i7 box.

On Monday 07 July 2014 14:26:54 Daniel Vetter wrote:
quoted hunk
On Mon, Jul 07, 2014 at 06:45:49AM -0400, Ed Tomlinson wrote:
quoted
Daniel,

I am not quite sure I understand what you want me to test?
Do you want me to try it without:
quoted
quoted
+               if (ret = 0) {
+                       ret = do_unregister_con_driver(&vga_con);
Below the diff of what I mean.
-Daniel

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 5e583a1838f8..bd8517151479 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1466,12 +1466,13 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 #else
 static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 {
-	int ret;
+	int ret = 0;
 
 	DRM_INFO("Replacing VGA console driver\n");
 
 	console_lock();
-	ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
+	if (con_is_bound(&vga_con))
+		ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
 	if (ret = 0) {
 		ret = do_unregister_con_driver(&vga_con);
 

Re: [Intel-gfx] [PATCH 5/5] drm/i915: Kick out vga console

Message details and related content
On Mon, Jul 07, 2014 at 10:53:16PM -0400, Ed Tomlinson wrote:
Hi Daniel,

The patch below also works.  You can use my Tested By for it.
Thanks a lot for testing, patch submitted and should get forwarded asap.
Thanks
Ed Tomlinson [off-list ref]

PS. I _really_ need to get a serial console working on my i7 box.
Usually this doesn't help a lot with gfx initialization issues since we do
an awful lot of setup while holding the console_lock. Which prevents any
dmesg output on any console :(

Cheers, Daniel
On Monday 07 July 2014 14:26:54 Daniel Vetter wrote:
quoted
On Mon, Jul 07, 2014 at 06:45:49AM -0400, Ed Tomlinson wrote:
quoted
Daniel,

I am not quite sure I understand what you want me to test?
Do you want me to try it without:
quoted
quoted
+               if (ret = 0) {
+                       ret = do_unregister_con_driver(&vga_con);
Below the diff of what I mean.
-Daniel

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 5e583a1838f8..bd8517151479 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1466,12 +1466,13 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 #else
 static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
 {
-	int ret;
+	int ret = 0;
 
 	DRM_INFO("Replacing VGA console driver\n");
 
 	console_lock();
-	ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
+	if (con_is_bound(&vga_con))
+		ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
 	if (ret = 0) {
 		ret = do_unregister_con_driver(&vga_con);
 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org

1 more quoted lines

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help