ia64/xen-unstable

changeset 13023:c98ca86138a7

[XENFB] No need for IRQs to be disabled in critical regions.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Dec 14 11:37:14 2006 +0000 (2006-12-14)
parents 35c724302bdd
children 21609e7f5a49
files linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c	Thu Dec 14 11:09:27 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c	Thu Dec 14 11:37:14 2006 +0000
     1.3 @@ -105,7 +105,6 @@ static int xenfb_queue_full(struct xenfb
     1.4  
     1.5  static void xenfb_update_screen(struct xenfb_info *info)
     1.6  {
     1.7 -	unsigned long flags;
     1.8  	int y1, y2, x1, x2;
     1.9  	struct xenfb_mapping *map;
    1.10  
    1.11 @@ -114,7 +113,7 @@ static void xenfb_update_screen(struct x
    1.12  	if (xenfb_queue_full(info))
    1.13  		return;
    1.14  
    1.15 -	spin_lock_irqsave(&info->mm_lock, flags);
    1.16 +	spin_lock(&info->mm_lock);
    1.17  
    1.18  	y1 = info->y1;
    1.19  	y2 = info->y2;
    1.20 @@ -131,7 +130,7 @@ static void xenfb_update_screen(struct x
    1.21  		map->faults = 0;
    1.22  	}
    1.23  
    1.24 -	spin_unlock_irqrestore(&info->mm_lock, flags);
    1.25 +	spin_unlock(&info->mm_lock);
    1.26  
    1.27  	xenfb_do_update(info, x1, y1, x2 - x1, y2 - y1);
    1.28  }
    1.29 @@ -214,11 +213,9 @@ static void __xenfb_refresh(struct xenfb
    1.30  static void xenfb_refresh(struct xenfb_info *info,
    1.31  			  int x1, int y1, int w, int h)
    1.32  {
    1.33 -	unsigned long flags;
    1.34 -
    1.35 -	spin_lock_irqsave(&info->mm_lock, flags);
    1.36 +	spin_lock(&info->mm_lock);
    1.37  	__xenfb_refresh(info, x1, y1, w, h);
    1.38 -	spin_unlock_irqrestore(&info->mm_lock, flags);
    1.39 +	spin_unlock(&info->mm_lock);
    1.40  }
    1.41  
    1.42  static void xenfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
    1.43 @@ -255,14 +252,13 @@ static void xenfb_vm_close(struct vm_are
    1.44  {
    1.45  	struct xenfb_mapping *map = vma->vm_private_data;
    1.46  	struct xenfb_info *info = map->info;
    1.47 -	unsigned long flags;
    1.48  
    1.49 -	spin_lock_irqsave(&info->mm_lock, flags);
    1.50 +	spin_lock(&info->mm_lock);
    1.51  	if (atomic_dec_and_test(&map->map_refs)) {
    1.52  		list_del(&map->link);
    1.53  		kfree(map);
    1.54  	}
    1.55 -	spin_unlock_irqrestore(&info->mm_lock, flags);
    1.56 +	spin_unlock(&info->mm_lock);
    1.57  }
    1.58  
    1.59  static struct page *xenfb_vm_nopage(struct vm_area_struct *vma,
    1.60 @@ -271,14 +267,13 @@ static struct page *xenfb_vm_nopage(stru
    1.61  	struct xenfb_mapping *map = vma->vm_private_data;
    1.62  	struct xenfb_info *info = map->info;
    1.63  	int pgnr = (vaddr - vma->vm_start) >> PAGE_SHIFT;
    1.64 -	unsigned long flags;
    1.65  	struct page *page;
    1.66  	int y1, y2;
    1.67  
    1.68  	if (pgnr >= info->nr_pages)
    1.69  		return NOPAGE_SIGBUS;
    1.70  
    1.71 -	spin_lock_irqsave(&info->mm_lock, flags);
    1.72 +	spin_lock(&info->mm_lock);
    1.73  	page = info->pages[pgnr];
    1.74  	get_page(page);
    1.75  	map->faults++;
    1.76 @@ -288,7 +283,7 @@ static struct page *xenfb_vm_nopage(stru
    1.77  	if (y2 > info->fb_info->var.yres)
    1.78  		y2 = info->fb_info->var.yres;
    1.79  	__xenfb_refresh(info, 0, y1, info->fb_info->var.xres, y2 - y1);
    1.80 -	spin_unlock_irqrestore(&info->mm_lock, flags);
    1.81 +	spin_unlock(&info->mm_lock);
    1.82  
    1.83  	if (type)
    1.84  		*type = VM_FAULT_MINOR;
    1.85 @@ -305,7 +300,6 @@ static struct vm_operations_struct xenfb
    1.86  static int xenfb_mmap(struct fb_info *fb_info, struct vm_area_struct *vma)
    1.87  {
    1.88  	struct xenfb_info *info = fb_info->par;
    1.89 -	unsigned long flags;
    1.90  	struct xenfb_mapping *map;
    1.91  	int map_pages;
    1.92  
    1.93 @@ -329,9 +323,9 @@ static int xenfb_mmap(struct fb_info *fb
    1.94  	map->info = info;
    1.95  	atomic_set(&map->map_refs, 1);
    1.96  
    1.97 -	spin_lock_irqsave(&info->mm_lock, flags);
    1.98 +	spin_lock(&info->mm_lock);
    1.99  	list_add(&map->link, &info->mappings);
   1.100 -	spin_unlock_irqrestore(&info->mm_lock, flags);
   1.101 +	spin_unlock(&info->mm_lock);
   1.102  
   1.103  	vma->vm_ops = &xenfb_vm_ops;
   1.104  	vma->vm_flags |= (VM_DONTEXPAND | VM_RESERVED);