ia64/xen-unstable

changeset 367:e03616768593

bitkeeper revision 1.173 (3e9d845cg2MJfwRaBzAjIko6HkW-Dw)

ide-cd.c:
verbose errors
ide.c:
robustify
author smh22@boulderdash.cl.cam.ac.uk
date Wed Apr 16 16:27:08 2003 +0000 (2003-04-16)
parents 87768b015863
children 95c43a4b6685
files xen/drivers/ide/ide-cd.c xen/drivers/ide/ide.c
line diff
     1.1 --- a/xen/drivers/ide/ide-cd.c	Wed Apr 16 12:44:16 2003 +0000
     1.2 +++ b/xen/drivers/ide/ide-cd.c	Wed Apr 16 16:27:08 2003 +0000
     1.3 @@ -623,6 +623,8 @@ static int cdrom_decode_status (ide_star
     1.4  		   command request to the request sense request. */
     1.5  
     1.6  		if ((stat & ERR_STAT) != 0) {
     1.7 +			// XXX SMH: if we get here we should retry ... hmmm
     1.8 +			printk("ide-cd: error (stat = 0x%x): will retry\n", stat); 
     1.9  			wait = rq->waiting;
    1.10  			rq->waiting = NULL;
    1.11  		}
     2.1 --- a/xen/drivers/ide/ide.c	Wed Apr 16 12:44:16 2003 +0000
     2.2 +++ b/xen/drivers/ide/ide.c	Wed Apr 16 16:27:08 2003 +0000
     2.3 @@ -2060,14 +2060,22 @@ int ide_do_drive_cmd (ide_drive_t *drive
     2.4  
     2.5      /* XXX SMH: spin waiting for response */
     2.6      if (action == ide_wait) { 
     2.7 -	while(*(int *)rq->waiting) {
     2.8 -	    udelay(500); 
     2.9 -	    usecs += 500; 
    2.10 -	    if(usecs > 1000000) { 
    2.11 -		printk("ide_do_drive_cmd [ide_wait]: giving up after 1s\n"); 
    2.12 -		*(int *)rq->waiting = 0; 
    2.13 -	    }
    2.14 +
    2.15 +	/* if we get an error, ide-cd.c requeues (and kills our 'waitq') */
    2.16 +	if((rq->waiting != NULL) && *(int *)(rq->waiting)) {
    2.17 +	    do { 
    2.18 +		udelay(500); 
    2.19 +		usecs += 500; 
    2.20 +		if(usecs > 1000000) { 
    2.21 +		    printk("ide_do_drive_cmd [ide_wait]: giving "
    2.22 +			   "up after 1s\n"); 
    2.23 +		    *(int *)rq->waiting = 0; 
    2.24 +		}
    2.25 +	    } while((rq->waiting != NULL) && *(int *)(rq->waiting)); 
    2.26  	}
    2.27 +
    2.28 +	if(rq->waiting == NULL)
    2.29 +	    return 1; 
    2.30      }
    2.31  
    2.32      return 0;