<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/video/console/fbcon.c, branch linux-2.6.31.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.31.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.31.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-10-05T16:31:36Z</updated>
<entry>
<title>fbcon: only unbind from console if successfully registered</title>
<updated>2009-10-05T16:31:36Z</updated>
<author>
<name>Ian Armstrong</name>
</author>
<published>2009-09-22T23:47:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1ae2307df3270ecf3fb15786aebc1d72493e960'/>
<id>urn:sha1:a1ae2307df3270ecf3fb15786aebc1d72493e960</id>
<content type='text'>
commit 2ddce3fd0acbdc1be684fb5f919ae3d2e9518aac upstream.

Attempting to unload a framebuffer module calls unregister_framebuffer()
which in turn gets fbcon to release it.  If fbcon has no framebuffers
linked to a console, it will also unbind itself from the console driver.
However, if fbcon never registered itself as a console driver, the unbind
will fail causing the framebuffer device entry to persist.  In most cases
this failure will result in an oops when attempting to access the now
non-existent device.

This patch ensures that the fbcon unbind request will succeed even if a
bind was never done.  It tracks if a successful bind ever occurred &amp; will
only attempt to unbind if needed.  If there never was a bind, it simply
returns with no error.

Signed-off-by: Ian Armstrong &lt;ian@iarmst.demon.co.uk&gt;
Cc: Krzysztof Helt &lt;krzysztof.h1@poczta.fm&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>fbcon: don't use vc_resize() on initialization</title>
<updated>2009-08-07T17:39:56Z</updated>
<author>
<name>Johannes Weiner</name>
</author>
<published>2009-08-06T22:07:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0035fe00f77d2b0a1a2d001f7442136d1ec5aefa'/>
<id>urn:sha1:0035fe00f77d2b0a1a2d001f7442136d1ec5aefa</id>
<content type='text'>
Catalin and kmemleak spotted a leak of a VC screen buffer in
vc_allocate() due to the following chain of events:

	vc_allocate()
	  visual_init(init=1)
	    vc-&gt;vc_sw-&gt;con_init(init=1)
              fbcon_init()
	        vc_resize()
	          vc-&gt;screen_buf = kmalloc()
	  vc-&gt;screen_buf = kmalloc()

The common way for the VC drivers is to set the screen dimension
parameters manually in the init case and only call vc_resize() for
!init - which allocates a screen buffer according to the new
dimensions.

fbcon instead would do vc_resize() unconditionally and afterwards set
the dimensions manually (again) for !init - i.e. completely upside
down.  The vc_resize() allocated buffer would then get lost by
vc_allocate() allocating a fresh one.

Use vc_resize() only for actual resizing to close the leak.

Set the dimensions manually only in initialization mode to remove the
redundant setting in resize mode.

The kmemleak trace from Catalin:

unreferenced object 0xde158000 (size 12288):
  comm "Xorg", pid 1439, jiffies 4294961016
  hex dump (first 32 bytes):
    20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00   . . . . . . . .
    20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00   . . . . . . . .
  backtrace:
    [&lt;c006f74b&gt;] __save_stack_trace+0x17/0x1c
    [&lt;c006f81d&gt;] create_object+0xcd/0x188
    [&lt;c01f5457&gt;] kmemleak_alloc+0x1b/0x3c
    [&lt;c006e303&gt;] __kmalloc+0xdb/0xe8
    [&lt;c012cc4b&gt;] vc_do_resize+0x73/0x1e0
    [&lt;c012cdf1&gt;] vc_resize+0x15/0x18
    [&lt;c011afc1&gt;] fbcon_init+0x1f9/0x2b8
    [&lt;c0129e87&gt;] visual_init+0x9f/0xdc
    [&lt;c012aff3&gt;] vc_allocate+0x7f/0xfc
    [&lt;c012b087&gt;] con_open+0x17/0x80
    [&lt;c0120e43&gt;] tty_open+0x1f7/0x2e4
    [&lt;c0072fa1&gt;] chrdev_open+0x101/0x118
    [&lt;c006ffad&gt;] __dentry_open+0x105/0x1cc
    [&lt;c00700fd&gt;] nameidata_to_filp+0x2d/0x38
    [&lt;c00788cd&gt;] do_filp_open+0x2c1/0x54c
    [&lt;c006fdff&gt;] do_sys_open+0x3b/0xb4

Reported-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Tested-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Cc: Krzysztof Helt &lt;krzysztof.h1@poczta.fm&gt;
Tested-by: Dave Young &lt;hidave.darkstar@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fbdev: fix info-&gt;lock deadlock in fbcon_event_notify()</title>
<updated>2009-04-13T22:04:28Z</updated>
<author>
<name>Andrea Righi</name>
</author>
<published>2009-04-13T21:39:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=513adb58685615b0b1d47a3f0d40f5352beff189'/>
<id>urn:sha1:513adb58685615b0b1d47a3f0d40f5352beff189</id>
<content type='text'>
fb_notifier_call_chain() is called with info-&gt;lock held, i.e.  in
do_fb_ioctl() =&gt; FBIOPUT_VSCREENINFO =&gt; fb_set_var() and the some
notifier callbacks, like fbcon_event_notify(), try to re-acquire
info-&gt;lock again.

Remove the lock/unlock_fb_info() in all the framebuffer notifier
callbacks' and be sure to always call fb_notifier_call_chain() with
info-&gt;lock held.

Reported-by: Pavel Roskin &lt;proski@gnu.org&gt;
Reported-by: Eric Miao &lt;eric.y.miao@gmail.com&gt;
Signed-off-by: Andrea Righi &lt;righi.andrea@gmail.com&gt;
Cc: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Cc: Krzysztof Helt &lt;krzysztof.h1@poczta.fm&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fbmem: fix fb_info-&gt;lock and mm-&gt;mmap_sem circular locking dependency</title>
<updated>2009-04-01T15:59:29Z</updated>
<author>
<name>Andrea Righi</name>
</author>
<published>2009-03-31T22:25:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=66c1ca019078220dc1bf968f2bb18421100ef147'/>
<id>urn:sha1:66c1ca019078220dc1bf968f2bb18421100ef147</id>
<content type='text'>
Fix a circular locking dependency in the frame buffer console driver
pushing down the mutex fb_info-&gt;lock.

Circular locking dependecies occur calling the blocking
fb_notifier_call_chain() with fb_info-&gt;lock held.  Notifier callbacks can
try to acquire mm-&gt;mmap_sem, while fb_mmap() acquires the locks in the
reverse order mm-&gt;mmap_sem =&gt; fb_info-&gt;lock.

Tested-by: Andrey Borzenkov &lt;arvidjaar@mail.ru&gt;
Signed-off-by: Andrea Righi &lt;righi.andrea@gmail.com&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Krzysztof Helt &lt;krzysztof.h1@poczta.fm&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fbdev: Kill Atari vblank cursor blinking</title>
<updated>2009-01-12T19:56:43Z</updated>
<author>
<name>Geert Uytterhoeven</name>
</author>
<published>2008-12-30T13:11:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1fa0b29f3a43f9dd8080d24cd16790b15ef963f5'/>
<id>urn:sha1:1fa0b29f3a43f9dd8080d24cd16790b15ef963f5</id>
<content type='text'>
Kill the last remaining vblank cursor blinking user

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
<entry>
<title>fbcon: Protect free_irq() by MACH_IS_ATARI check</title>
<updated>2008-12-28T19:00:06Z</updated>
<author>
<name>Geert Uytterhoeven</name>
</author>
<published>2008-11-18T19:45:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7f877ebb32ac9a4b0783e825cef84c6ace87fe90'/>
<id>urn:sha1:7f877ebb32ac9a4b0783e825cef84c6ace87fe90</id>
<content type='text'>
Add missing check for Atari in free_irq() call, which could cause problems on
multi-platform m68k kernels.

Reported-by: Brad Boyer &lt;flar@allandria.com&gt;
Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
<entry>
<title>fbcon: remove broken mac vbl handler</title>
<updated>2008-12-28T19:00:06Z</updated>
<author>
<name>Finn Thain</name>
</author>
<published>2008-11-18T19:45:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=79f0c9a0479060e3a8607d93bc8d81ff962acc87'/>
<id>urn:sha1:79f0c9a0479060e3a8607d93bc8d81ff962acc87</id>
<content type='text'>
Remove the Mac VBL interrupt code as it doesn't work properly and
doesn't bring any benefit when fixed. Also remove unused
DEFAULT_CURSOR_BLINK_RATE macro and irqres variable.

Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
<entry>
<title>fbcon: fix workqueue shutdown</title>
<updated>2008-12-10T16:01:53Z</updated>
<author>
<name>Geoff Levand</name>
</author>
<published>2008-12-09T21:14:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=beaa4867eec02e6eb78e9e9ef503d7eff612b068'/>
<id>urn:sha1:beaa4867eec02e6eb78e9e9ef503d7eff612b068</id>
<content type='text'>
Add a call to cancel_work_sync() in fbcon_exit() to cancel any pending
work in the fbcon workqueue.

The current implementation of fbcon_exit() sets the fbcon workqueue
function info-&gt;queue.func to NULL, but does not assure that there is no
work pending when it does so.  On occasion, depending on system timing,
there will still be pending work in the queue when fbcon_exit() is
called.  This results in a null pointer deference when run_workqueue()
tries to call the queue's work function.

Fixes errors on shutdown similar to these:

  Console: switching to colour dummy device 80x25
  Unable to handle kernel paging request for data at address 0x00000000

Signed-off-by: Geoff Levand &lt;geoffrey.levand@am.sony.com&gt;
Cc: Krzysztof Helt &lt;krzysztof.h1@poczta.fm&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fbdev: fix FB console blanking</title>
<updated>2008-12-02T03:55:25Z</updated>
<author>
<name>Dmitry Baryshkov</name>
</author>
<published>2008-12-01T21:14:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bca404afdc5206c3bb30168315ee8a98a579ec65'/>
<id>urn:sha1:bca404afdc5206c3bb30168315ee8a98a579ec65</id>
<content type='text'>
The commit aef7db4bd5a3b6068dfa05919a3d685199eed116 fixed the problem with
recursive locking in fb blanking code if blank is caused by user setting
the /sys/class/graphics/fb*/blank.  However this broke the fbcon timeout
blanking.

If you use a driver that defines -&gt;fb_blank operation and at the same time
that driver relies on other driver (e.g.  backlight or lcd class) to blank
the screen, when the fbcon times out and tries to blank the fb, it will
call only fb driver blanker and won't notify the other driver.  Thus FB
output is disabled, but the screen isn't blanked.

Restore fbcon blanking and at the same time apply the proper fix for the
above problem: if fbcon_blank is called with FBINFO_FLAG_USEREVENT, we are
already called through notification from fb_blank, thus we don't have to
blank the fb again.

Signed-off-by: Dmitry Baryshkov &lt;dbaryshkov@gmail.com&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fbcon: don't inline updatescrollmode</title>
<updated>2008-10-30T18:38:46Z</updated>
<author>
<name>Marcin Slusarz</name>
</author>
<published>2008-10-29T21:01:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=def1be2d727a1764205479b3e3e3ba16ffbad028'/>
<id>urn:sha1:def1be2d727a1764205479b3e3e3ba16ffbad028</id>
<content type='text'>
Updatescrollmode is marked inline, but it's big and is called only from
non-critical codepaths (fbcon_resize, fbcon_switch, fbcon_modechanged).
Dropping it saves almost 800 bytes of text size.

   text    data     bss     dec     hex filename
  23859     287    8448   32594    7f52 drivers/video/console/fbcon.o.before
  23065     287    8448   31800    7c38 drivers/video/console/fbcon.o.after

Signed-off-by: Marcin Slusarz &lt;marcin.slusarz@gmail.com&gt;
Cc: Antonino Daplas &lt;adaplas@gmail.com&gt;
Cc: Krzysztof Helt &lt;krzysztof.h1@wp.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
