Changeset d9cf9d5f in mainline


Ignore:
Timestamp:
2006-05-13T12:38:06Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e459f12
Parents:
9f581365
Message:

Do not report possible deadlock on fb_lock.
This issue was causing troubles in connection
with slow framebuffer in simulated environment
when false positives triggered an infinite
recursion of attempts to report deadlock on
fb_lock using printf() and fb_putchar().

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/drivers/vesa.c

    r9f581365 rd9cf9d5f  
    7575        /* Map videoram */
    7676        for (a = 0; a < ((vesa_scanline * vesa_height + PAGE_SIZE - 1) >> PAGE_WIDTH); a++)
    77                 page_mapping_insert(AS_KERNEL, vram_lin_addr+a*4096, vesa_ph_addr+a*4096, PAGE_NOT_CACHEABLE);
     77                page_mapping_insert(AS_KERNEL, vram_lin_addr + a*PAGE_SIZE, vesa_ph_addr + a*FRAME_SIZE,
     78                        PAGE_NOT_CACHEABLE);
    7879
    7980        fb_init(vram_lin_addr, vesa_width, vesa_height, vesa_bpp, vesa_scanline);
  • genarch/include/fb/fb.h

    r9f581365 rd9cf9d5f  
    3333#include <arch/types.h>
    3434
     35extern spinlock_t fb_lock;
    3536void fb_init(__address addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan);
    3637
  • generic/src/synch/spinlock.c

    r9f581365 rd9cf9d5f  
    4141#include <symtab.h>
    4242
     43#ifdef CONFIG_FB
     44#include <genarch/fb/fb.h>
     45#endif
     46
    4347#ifdef CONFIG_SMP
    4448
     
    7478        preemption_disable();
    7579        while (test_and_set(&sl->val)) {
    76                 if (i++ > 300000 && sl!=&printflock) {
     80
     81                /*
     82                 * We need to be careful about printflock and fb_lock.
     83                 * Both of them are used to report deadlocks via
     84                 * printf() and fb_putchar().
     85                 *
     86                 * We trust our code that there is no possible deadlock
     87                 * caused by these two locks (except when an exception
     88                 * is triggered for instance by printf() or fb_putchar()).
     89                 * However, we encountered false positives caused by very
     90                 * slow VESA framebuffer interaction (especially when
     91                 * run in a simulator) that caused problems with both
     92                 * printflock and fb_lock.
     93                 *
     94                 * Possible deadlocks on both printflock and fb_lock
     95                 * are therefore not reported as they would cause an
     96                 * infinite recursion.
     97                 */
     98                if (sl == &printflock)
     99                        continue;
     100#ifdef CONFIG_FB
     101                if (sl == &fb_lock)
     102                        continue;
     103#endif
     104                if (i++ > 300000) {
    77105                        printf("cpu%d: looping on spinlock %.*p:%s, caller=%.*p",
    78106                               CPU->id, sizeof(__address) * 2, sl, sl->name, sizeof(__address) * 2, CALLER);
Note: See TracChangeset for help on using the changeset viewer.