ia64/linux-2.6.18-xen.hg

changeset 786:b790b287bf47

merge with linux-2.6.18-xen.hg
author Isaku Yamahata <yamahata@valinux.co.jp>
date Fri Jan 30 10:53:27 2009 +0900 (2009-01-30)
parents 9ab1c319531f 8197c86e6729
children 98897f04b338
files
line diff
     1.1 --- a/drivers/xen/fbfront/xenfb.c	Wed Jan 28 13:07:23 2009 +0900
     1.2 +++ b/drivers/xen/fbfront/xenfb.c	Fri Jan 30 10:53:27 2009 +0900
     1.3 @@ -61,7 +61,6 @@ struct xenfb_info
     1.4  	int			irq;
     1.5  	struct xenfb_page	*page;
     1.6  	unsigned long 		*mfns;
     1.7 -	int			update_wanted; /* XENFB_TYPE_UPDATE wanted */
     1.8  	int			feature_resize; /* Backend has resize feature */
     1.9  	struct xenfb_resize	resize;
    1.10  	int			resize_dpy;
    1.11 @@ -208,22 +207,26 @@ static void xenfb_update_screen(struct x
    1.12  	int y1, y2, x1, x2;
    1.13  	struct xenfb_mapping *map;
    1.14  
    1.15 -	if (!info->update_wanted)
    1.16 -		return;
    1.17  	if (xenfb_queue_full(info))
    1.18  		return;
    1.19  
    1.20 -	mutex_lock(&info->mm_lock);
    1.21 -
    1.22  	spin_lock_irqsave(&info->dirty_lock, flags);
    1.23 -	y1 = info->y1;
    1.24 -	y2 = info->y2;
    1.25 -	x1 = info->x1;
    1.26 -	x2 = info->x2;
    1.27 -	info->x1 = info->y1 = INT_MAX;
    1.28 -	info->x2 = info->y2 = 0;
    1.29 +	if (info->dirty){
    1.30 +		info->dirty = 0;
    1.31 +		y1 = info->y1;
    1.32 +		y2 = info->y2;
    1.33 +		x1 = info->x1;
    1.34 +		x2 = info->x2;
    1.35 +		info->x1 = info->y1 = INT_MAX;
    1.36 +		info->x2 = info->y2 = 0;
    1.37 +	} else {
    1.38 +		spin_unlock_irqrestore(&info->dirty_lock, flags);
    1.39 +		return;
    1.40 +	}
    1.41  	spin_unlock_irqrestore(&info->dirty_lock, flags);
    1.42  
    1.43 +	mutex_lock(&info->mm_lock);
    1.44 +	
    1.45  	list_for_each_entry(map, &info->mappings, link) {
    1.46  		if (!map->faults)
    1.47  			continue;
    1.48 @@ -262,10 +265,7 @@ static int xenfb_thread(void *data)
    1.49  
    1.50  	while (!kthread_should_stop()) {
    1.51  		xenfb_handle_resize_dpy(info);
    1.52 -		if (info->dirty) {
    1.53 -			info->dirty = 0;
    1.54 -			xenfb_update_screen(info);
    1.55 -		}
    1.56 +		xenfb_update_screen(info);
    1.57  		wait_event_interruptible(info->wq,
    1.58  			kthread_should_stop() || info->dirty);
    1.59  		try_to_freeze();
    1.60 @@ -666,15 +666,6 @@ static int __devinit xenfb_probe(struct 
    1.61  	if (ret < 0)
    1.62  		goto error;
    1.63  
    1.64 -	/* FIXME should this be delayed until backend XenbusStateConnected? */
    1.65 -	info->kthread = kthread_run(xenfb_thread, info, "xenfb thread");
    1.66 -	if (IS_ERR(info->kthread)) {
    1.67 -		ret = PTR_ERR(info->kthread);
    1.68 -		info->kthread = NULL;
    1.69 -		xenbus_dev_fatal(dev, ret, "register_framebuffer");
    1.70 -		goto error;
    1.71 -	}
    1.72 -
    1.73  	return 0;
    1.74  
    1.75   error_nomem:
    1.76 @@ -829,16 +820,25 @@ static void xenfb_backend_changed(struct
    1.77  		if (dev->state != XenbusStateConnected)
    1.78  			goto InitWait; /* no InitWait seen yet, fudge it */
    1.79  
    1.80 -		if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,
    1.81 -				 "request-update", "%d", &val) < 0)
    1.82 -			val = 0;
    1.83 -		if (val)
    1.84 -			info->update_wanted = 1;
    1.85  
    1.86  		if (xenbus_scanf(XBT_NIL, dev->otherend,
    1.87  					"feature-resize", "%d", &val) < 0)
    1.88  			val = 0;
    1.89  		info->feature_resize = val;
    1.90 +
    1.91 +		if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,
    1.92 +				 "request-update", "%d", &val) < 0)
    1.93 +			val = 0;
    1.94 +
    1.95 +		if (val){
    1.96 +			info->kthread = kthread_run(xenfb_thread, info,
    1.97 +						    "xenfb thread");
    1.98 +			if (IS_ERR(info->kthread)) {
    1.99 +				info->kthread = NULL;
   1.100 +				xenbus_dev_fatal(dev, PTR_ERR(info->kthread),
   1.101 +						"register_framebuffer");
   1.102 +			}
   1.103 +		}
   1.104  		break;
   1.105  
   1.106  	case XenbusStateClosing:
     2.1 --- a/drivers/xen/netback/interface.c	Wed Jan 28 13:07:23 2009 +0900
     2.2 +++ b/drivers/xen/netback/interface.c	Fri Jan 30 10:53:27 2009 +0900
     2.3 @@ -219,6 +219,13 @@ static int map_frontend_pages(
     2.4  		BUG();
     2.5  
     2.6  	if (op.status) {
     2.7 +		struct gnttab_unmap_grant_ref unop;
     2.8 +
     2.9 +		gnttab_set_unmap_op(&unop,
    2.10 +				    (unsigned long)netif->tx_comms_area->addr,
    2.11 +				    GNTMAP_host_map, netif->tx_shmem_handle);
    2.12 +		VOID(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref,
    2.13 +					       &unop, 1));
    2.14  		DPRINTK(" Gnttab failure mapping rx_ring_ref!\n");
    2.15  		return op.status;
    2.16  	}