From: Linus Torvalds Date: Fri, 23 Nov 2007 20:17:09 +0000 (-0500) Subject: Import 2.1.127pre7 X-Git-Tag: 2.1.127pre7 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=852a91e86e1aeceb6dc5c2db99e8de6180e3d482;p=history.git Import 2.1.127pre7 --- diff --git a/drivers/char/serial.c b/drivers/char/serial.c index 141a0c697412..497496e00f48 100644 --- a/drivers/char/serial.c +++ b/drivers/char/serial.c @@ -1653,6 +1653,8 @@ static int set_serial_info(struct async_struct * info, return -EPERM; state->flags = ((state->flags & ~ASYNC_USR_MASK) | (new_serial.flags & ASYNC_USR_MASK)); + info->flags = ((state->flags & ~ASYNC_USR_MASK) | + (info->flags & ASYNC_USR_MASK)); state->custom_divisor = new_serial.custom_divisor; goto check_and_exit; } @@ -1660,8 +1662,9 @@ static int set_serial_info(struct async_struct * info, new_serial.irq = irq_cannonicalize(new_serial.irq); if ((new_serial.irq >= NR_IRQS) || (new_serial.port > 0xffff) || - (new_serial.type < PORT_UNKNOWN) || - (new_serial.type > PORT_MAX)) { + (new_serial.baud_base == 0) || (new_serial.type < PORT_UNKNOWN) || + (new_serial.type > PORT_MAX) || (new_serial.type == PORT_CIRRUS) || + (new_serial.type == PORT_STARTECH)) { return -EINVAL; } diff --git a/drivers/pnp/parport_probe.c b/drivers/pnp/parport_probe.c index 6118eb6435bf..97a824fd32ca 100644 --- a/drivers/pnp/parport_probe.c +++ b/drivers/pnp/parport_probe.c @@ -105,9 +105,8 @@ int parport_probe(struct parport *port, char *buffer, int len) switch (parport_ieee1284_nibble_mode_ok(port, 4)) { case 1: current->state=TASK_INTERRUPTIBLE; - current->timeout=jiffies+1; - schedule(); /* HACK: wait 10ms because printer seems to - * ack wrong */ + schedule_timeout(1); /* HACK: wait 10ms because printer seems to + * ack wrong */ result = read_polled(port, buffer, len); break; case 0: diff --git a/drivers/sound/sscape.c b/drivers/sound/sscape.c index 1b823692c0aa..48017eeed7bb 100644 --- a/drivers/sound/sscape.c +++ b/drivers/sound/sscape.c @@ -124,10 +124,8 @@ static char old_hardware = 0; static void sleep(unsigned howlong) { - current->timeout = jiffies + 1; current->state = TASK_INTERRUPTIBLE; - schedule(); - current->timeout = 0; + schedule_timeout(1); } static unsigned char sscape_read(struct sscape_info *devc, int reg) diff --git a/fs/smbfs/proc.c b/fs/smbfs/proc.c index b61bb3277983..42981d4836f7 100644 --- a/fs/smbfs/proc.c +++ b/fs/smbfs/proc.c @@ -520,9 +520,7 @@ server->conn_pid); /* * Wait for the new connection. */ - current->timeout = jiffies + 5*HZ; - interruptible_sleep_on(&server->wait); - current->timeout = 0; + interruptible_sleep_on_timeout(&server->wait, 5*HZ); if (signal_pending(current)) printk("smb_retry: caught signal\n"); @@ -1602,10 +1600,8 @@ ff_dir_handle, ff_resume_key, ff_lastname, mask); /* Windows 95 is not able to deliver answers * to FIND_NEXT fast enough, so sleep 0.2 sec */ - current->timeout = jiffies + HZ / 5; current->state = TASK_INTERRUPTIBLE; - schedule(); - current->timeout = 0; + schedule_timeout(HZ/5); } } diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h index 9d3fec928a42..00e238407f6a 100644 --- a/include/asm-i386/spinlock.h +++ b/include/asm-i386/spinlock.h @@ -88,9 +88,16 @@ typedef struct { * can "mix" irq-safe locks - any writer needs to get a * irq-safe write-lock, but readers can get non-irqsafe * read-locks. + * + * Gcc-2.7.x has a nasty bug with empty initializers. */ -typedef struct { } rwlock_t; -#define RW_LOCK_UNLOCKED (rwlock_t) { } +#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8) + typedef struct { } rwlock_t; + #define RW_LOCK_UNLOCKED (rwlock_t) { } +#else + typedef struct { int gcc_is_buggy; } rwlock_t; + #define RW_LOCK_UNLOCKED (rwlock_t) { 0 } +#endif #define read_lock(lock) do { } while(0) #define read_unlock(lock) do { } while(0) diff --git a/include/linux/sched.h b/include/linux/sched.h index 6afb955e69aa..4e41d457058b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -23,8 +23,6 @@ extern unsigned long event; #include #include -#define JIFFIES_OFFSET (-3600*HZ) - /* * cloning flags: */ diff --git a/include/linux/serial.h b/include/linux/serial.h index cee1fc11f149..929618dd563b 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h @@ -42,11 +42,11 @@ struct serial_struct { #define PORT_16450 2 #define PORT_16550 3 #define PORT_16550A 4 -#define PORT_CIRRUS 5 +#define PORT_CIRRUS 5 /* usurped by cyclades.c */ #define PORT_16650 6 #define PORT_16650V2 7 #define PORT_16750 8 -#define PORT_STARTECH 9 +#define PORT_STARTECH 9 /* usurped by cyclades.c */ #define PORT_MAX 9 struct serial_uart_config { @@ -87,7 +87,7 @@ struct serial_uart_config { #define ASYNC_LOW_LATENCY 0x2000 /* Request low latency behaviour */ -#define ASYNC_FLAGS 0x2FFF /* Possible legal async flags */ +#define ASYNC_FLAGS 0x3FFF /* Possible legal async flags */ #define ASYNC_USR_MASK 0x3430 /* Legal flags that non-privileged * users can set or reset */