public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: matroxfb console oops in 2.4.2x
@ 2003-06-24 11:54 Petr Vandrovec
  0 siblings, 0 replies; 8+ messages in thread
From: Petr Vandrovec @ 2003-06-24 11:54 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linux-kernel, jsimmons

On 24 Jun 03 at 10:09, David Woodhouse wrote:
> On Thu, 2003-06-19 at 20:45, Petr Vandrovec wrote:
> > This one is culprit. If you'll comment this message out, it will not
> > crash.
> 
> As discussed, this is true but if anyone _else_ happens to call printk
> during the same period, it'll still crash. 
> 
> Matroxfb is registering a screen for which it's not yet willing to
> attempt output -- and taking out this printk only serves to fix the
> coincidence which makes it 100% reproducible -- the thing is still
> broken without that printk.

There is no way around - at least I do not know such. matroxfb cannot 
initialize hardware before call to the set_var, as otherwise you'll 
get white 80x25 square instead of vgacon text copied to the matroxfb.

If you'll replace matroxfb_set_var(..., -2, &ACCESS_FBINFO(fbcon))
with matroxfb_set_var(..., -1, &ACCESS_FBINFO(fbcon)) in matroxfb_base.c,
you'll get behavior you are asking for: hardware gets initialized before
call to register_framebuffer(). Unfortunately it breaks 
take_over_console for all vgacon users - and as there is more vgacon
users than sh users, I prefer just creating dummy putc/putcs functions
which will do nothing, over changing initialization order.

I'm still trying to find why PLL does not lock on your hardware,
but I still do not understand why it works on ia32 for secondary adapters,
but not on sh.
                                                    Petr Vandrovec
                                                    vandrove@vc.cvut.cz
                                                    


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: matroxfb console oops in 2.4.2x
@ 2003-06-19 19:45 Petr Vandrovec
  2003-06-19 21:58 ` David Woodhouse
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Petr Vandrovec @ 2003-06-19 19:45 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linux-kernel, jsimmons

On 19 Jun 03 at 14:47, David Woodhouse wrote:
> On Thu, 2003-06-19 at 13:21, Petr Vandrovec wrote:

> take_over_console() attempts to redraw the screen.

It is not take_over_console... It does init first. 
> >  It is not allowed to call fbdev's putc 
> > before mode set was issued (at least I always believed to it; before
> > first mode set hardware is in VGA state)
> 
> If I omit the fixes, I just get...
> 
> matroxfb: Matrox Mystique (PCI) detected
> matroxfb: 1280x1024x8bpp (virtual: 1280x1635)
> matroxfb: framebuffer at 0x1000000, mapped to 0xc017d000, size 2097152
> matroxfb: Pixel PLL not locked after 5 secs
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
This one is culprit. If you'll comment this message out, it will not
crash.
 
> Console: switching to colour frame buffer device 160x64
> fb0: MATROX VGA frame buffer device
> 
> If I call matrox_init_putc() earlier as you suggest, then it seems to
> end up busy-waiting in mga_fifo()...

Ok. It means that hardware is completely uninitialized when this happens.
Probably accelerator clocks are stopped (== message about pixclocks was
right...) Bad.

Does driver work with your change without problems? It looks strange
to me that PLL did not stabilized in 5 seconds. Do you get same message
when you change videomode with fbset, or happens this only once during
boot, and never again?
                                        Thanks,
                                                Petr Vandrovec


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: matroxfb console oops in 2.4.2x
@ 2003-06-19 12:21 Petr Vandrovec
  2003-06-19 13:47 ` David Woodhouse
  0 siblings, 1 reply; 8+ messages in thread
From: Petr Vandrovec @ 2003-06-19 12:21 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linux-kernel, jsimmons

On 19 Jun 03 at 11:06, David Woodhouse wrote:

> Below is a workaround which lets the machine boot. It's obviously not a
> fix.
> 
> --- drivers/video/matrox/matroxfb_accel.c~  Wed Jun 18 17:16:40 2003
> +++ drivers/video/matrox/matroxfb_accel.c   Thu Jun 19 10:57:54 2003
> @@ -487,6 +487,9 @@
>  
>     DBG_HEAVY("matroxfb_cfb8_putc");
>  
> +   if (!ACCESS_FBINFO(curr.putc))
> +       return;
> +

It looks like that someone tried to print something on the console
during fbcon initialization. It is not allowed to call fbdev's putc 
before mode set was issued (at least I always believed to it; before
first mode set hardware is in VGA state). Do not you see some error 
message in dmesg with these fixes?

> @@ -504,6 +507,9 @@
>  
>     DBG_HEAVY("matroxfb_cfb16_putc");
>  
> +   if (!ACCESS_FBINFO(curr.putc))
> +       return;
> +

Instead of plugging these tests into fast path please call
"matrox_init_putc(PMINFO NULL, NULL)" somewhere in the initMatrox2(),
before call to the register_framebuffer. At worst some part of video
memory gets smashed by painted characters, but no damage should
occur.
                                                Petr Vandrovec
                                                


^ permalink raw reply	[flat|nested] 8+ messages in thread
* matroxfb console oops in 2.4.2x
@ 2003-06-19 10:06 David Woodhouse
  0 siblings, 0 replies; 8+ messages in thread
From: David Woodhouse @ 2003-06-19 10:06 UTC (permalink / raw)
  To: Petr Vandrovec; +Cc: linux-kernel, jsimmons

If you have matroxfb with acceleration enabled but no other console, and
set console=tty0 on the command line, it dies because its putcs
functions are called before matroxfb_init_putc() is called.

Below is a workaround which lets the machine boot. It's obviously not a
fix.

--- drivers/video/matrox/matroxfb_accel.c~	Wed Jun 18 17:16:40 2003
+++ drivers/video/matrox/matroxfb_accel.c	Thu Jun 19 10:57:54 2003
@@ -487,6 +487,9 @@
 
 	DBG_HEAVY("matroxfb_cfb8_putc");
 
+	if (!ACCESS_FBINFO(curr.putc))
+		return;
+
 	fgx = attr_fgcol(p, c);
 	bgx = attr_bgcol(p, c);
 	fgx |= (fgx << 8);
@@ -504,6 +507,9 @@
 
 	DBG_HEAVY("matroxfb_cfb16_putc");
 
+	if (!ACCESS_FBINFO(curr.putc))
+		return;
+
 	fgx = ((u_int16_t*)p->dispsw_data)[attr_fgcol(p, c)];
 	bgx = ((u_int16_t*)p->dispsw_data)[attr_bgcol(p, c)];
 	fgx |= (fgx << 16);
@@ -519,6 +525,9 @@
 
 	DBG_HEAVY("matroxfb_cfb32_putc");
 
+	if (!ACCESS_FBINFO(curr.putc))
+		return;
+
 	fgx = ((u_int32_t*)p->dispsw_data)[attr_fgcol(p, c)];
 	bgx = ((u_int32_t*)p->dispsw_data)[attr_bgcol(p, c)];
 	ACCESS_FBINFO(curr.putc)(fgx, bgx, p, c, yy, xx);
@@ -662,6 +671,9 @@
 
 	DBG_HEAVY("matroxfb_cfb8_putcs");
 
+	if (!ACCESS_FBINFO(curr.putcs))
+		return;
+
 	c = scr_readw(s);
 	fgx = attr_fgcol(p, c);
 	bgx = attr_bgcol(p, c);
@@ -681,6 +693,9 @@
 
 	DBG_HEAVY("matroxfb_cfb16_putcs");
 
+	if (!ACCESS_FBINFO(curr.putcs))
+		return;
+
 	c = scr_readw(s);
 	fgx = ((u_int16_t*)p->dispsw_data)[attr_fgcol(p, c)];
 	bgx = ((u_int16_t*)p->dispsw_data)[attr_bgcol(p, c)];
@@ -697,6 +712,9 @@
 	MINFO_FROM_DISP(p);
 
 	DBG_HEAVY("matroxfb_cfb32_putcs");
+
+	if (!ACCESS_FBINFO(curr.putcs))
+		return;
 
 	c = scr_readw(s);
 	fgx = ((u_int32_t*)p->dispsw_data)[attr_fgcol(p, c)];





-- 
dwmw2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-06-24 11:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-24 11:54 matroxfb console oops in 2.4.2x Petr Vandrovec
  -- strict thread matches above, loose matches on Subject: below --
2003-06-19 19:45 Petr Vandrovec
2003-06-19 21:58 ` David Woodhouse
2003-06-20 10:52 ` David Woodhouse
2003-06-24  9:09 ` David Woodhouse
2003-06-19 12:21 Petr Vandrovec
2003-06-19 13:47 ` David Woodhouse
2003-06-19 10:06 David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox