Commit cd534a05 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.0.6

parent 4aad5d63
VERSION = 1 VERSION = 1
PATCHLEVEL = 0 PATCHLEVEL = 0
SUBLEVEL = 5 SUBLEVEL = 6
all: Version zImage all: Version zImage
......
...@@ -42,9 +42,12 @@ struct request { ...@@ -42,9 +42,12 @@ struct request {
* This is used in the elevator algorithm: Note that * This is used in the elevator algorithm: Note that
* reads always go before writes. This is natural: reads * reads always go before writes. This is natural: reads
* are much more time-critical than writes. * are much more time-critical than writes.
*
* Update: trying with writes being preferred due to test
* by Alessandro Rubini..
*/ */
#define IN_ORDER(s1,s2) \ #define IN_ORDER(s1,s2) \
((s1)->cmd < (s2)->cmd || ((s1)->cmd == (s2)->cmd && \ ((s1)->cmd > (s2)->cmd || ((s1)->cmd == (s2)->cmd && \
((s1)->dev < (s2)->dev || (((s1)->dev == (s2)->dev && \ ((s1)->dev < (s2)->dev || (((s1)->dev == (s2)->dev && \
(s1)->sector < (s2)->sector))))) (s1)->sector < (s2)->sector)))))
......
...@@ -95,17 +95,20 @@ int el3_probe(struct device *dev) ...@@ -95,17 +95,20 @@ int el3_probe(struct device *dev)
/* First check for a board on the EISA bus. */ /* First check for a board on the EISA bus. */
if (EISA_bus) { if (EISA_bus) {
for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) { for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
if (inw(ioaddr) != 0x6d50) /* Check the standard EISA ID register for an encoded '3Com'. */
if (inw(ioaddr + 0xC80) != 0x6d50)
continue; continue;
/* Change the register set to the configuration window 0. */
outw(0x0800, ioaddr + 0xC80 + EL3_CMD);
irq = inw(ioaddr + 8) >> 12; irq = inw(ioaddr + 8) >> 12;
if_port = inw(ioaddr + 6)>>14; if_port = inw(ioaddr + 6)>>14;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
phys_addr[i] = htons(read_eeprom(ioaddr, i)); phys_addr[i] = htons(read_eeprom(ioaddr, i));
/* Restore the "Manufacturer ID" to the EEPROM read register. */ /* Restore the "Product ID" to the EEPROM read register. */
/* The manual says to restore "Product ID" (reg. 3). !???! */ read_eeprom(ioaddr, 3);
read_eeprom(ioaddr, 7);
/* Was the EISA code an add-on hack? Nahhhhh... */ /* Was the EISA code an add-on hack? Nahhhhh... */
goto found; goto found;
......
...@@ -120,13 +120,27 @@ static inline void delay( unsigned how_long ) ...@@ -120,13 +120,27 @@ static inline void delay( unsigned how_long )
static inline int command_out(unchar *cmdp, int len) static inline int command_out(unchar *cmdp, int len)
{ {
if(len == 1) {
while(1==1){
WAIT(ASC_STAT, STATMASK, CMD_RDY, 0);
cli();
if(!(inb(ASC_STAT) & CMD_RDY)) {sti(); continue;}
outb(*cmdp, COMMAND);
sti();
return 1;
}
} else {
cli();
while (len--) { while (len--) {
WAIT(ASC_STAT, STATMASK, CMD_RDY, 0); WAIT(ASC_STAT, STATMASK, CMD_RDY, 0);
outb(*cmdp++, COMMAND); outb(*cmdp++, COMMAND);
} }
sti();
}
return 1; return 1;
fail: fail:
sti();
printk("wd7000_out WAIT failed(%d): ", len+1); printk("wd7000_out WAIT failed(%d): ", len+1);
return 0; return 0;
} }
...@@ -189,6 +203,7 @@ static int mail_out( Scb *scbptr ) ...@@ -189,6 +203,7 @@ static int mail_out( Scb *scbptr )
*/ */
{ {
int i, ogmb; int i, ogmb;
unsigned char start_cmd;
unsigned long flags; unsigned long flags;
DEB(printk("wd7000_scb_out: %06x");) DEB(printk("wd7000_scb_out: %06x");)
...@@ -217,10 +232,11 @@ static int mail_out( Scb *scbptr ) ...@@ -217,10 +232,11 @@ static int mail_out( Scb *scbptr )
return 0; return 0;
} }
start_cmd = START_OGMB | ogmb;
wd7000_enable_intr(); wd7000_enable_intr();
do { do {
WAIT(ASC_STAT,STATMASK,CMD_RDY,0); command_out(&start_cmd, 1);
outb(START_OGMB|ogmb, COMMAND);
WAIT(ASC_STAT,STATMASK,CMD_RDY,0); WAIT(ASC_STAT,STATMASK,CMD_RDY,0);
} while (inb(ASC_STAT) & CMD_REJ); } while (inb(ASC_STAT) & CMD_REJ);
......
...@@ -241,10 +241,7 @@ static int ext2_file_write (struct inode * inode, struct file * filp, ...@@ -241,10 +241,7 @@ static int ext2_file_write (struct inode * inode, struct file * filp,
inode->i_mode); inode->i_mode);
return -EINVAL; return -EINVAL;
} }
/* down(&inode->i_sem);
* ok, append may not work when many processes are writing at the same time
* but so what. That way leads to madness anyway.
*/
if (filp->f_flags & O_APPEND) if (filp->f_flags & O_APPEND)
pos = inode->i_size; pos = inode->i_size;
else else
...@@ -283,6 +280,7 @@ static int ext2_file_write (struct inode * inode, struct file * filp, ...@@ -283,6 +280,7 @@ static int ext2_file_write (struct inode * inode, struct file * filp,
bh->b_dirt = 1; bh->b_dirt = 1;
brelse (bh); brelse (bh);
} }
up(&inode->i_sem);
inode->i_ctime = inode->i_mtime = CURRENT_TIME; inode->i_ctime = inode->i_mtime = CURRENT_TIME;
filp->f_pos = pos; filp->f_pos = pos;
inode->i_dirt = 1; inode->i_dirt = 1;
......
...@@ -335,6 +335,7 @@ void ext2_truncate (struct inode * inode) ...@@ -335,6 +335,7 @@ void ext2_truncate (struct inode * inode)
return; return;
ext2_discard_prealloc(inode); ext2_discard_prealloc(inode);
while (1) { while (1) {
down(&inode->i_sem);
retry = trunc_direct(inode); retry = trunc_direct(inode);
retry |= trunc_indirect (inode, EXT2_IND_BLOCK, retry |= trunc_indirect (inode, EXT2_IND_BLOCK,
(unsigned long *) &inode->u.ext2_i.i_data[EXT2_IND_BLOCK]); (unsigned long *) &inode->u.ext2_i.i_data[EXT2_IND_BLOCK]);
...@@ -342,6 +343,7 @@ void ext2_truncate (struct inode * inode) ...@@ -342,6 +343,7 @@ void ext2_truncate (struct inode * inode)
EXT2_ADDR_PER_BLOCK(inode->i_sb), EXT2_ADDR_PER_BLOCK(inode->i_sb),
(unsigned long *) &inode->u.ext2_i.i_data[EXT2_DIND_BLOCK]); (unsigned long *) &inode->u.ext2_i.i_data[EXT2_DIND_BLOCK]);
retry |= trunc_tindirect (inode); retry |= trunc_tindirect (inode);
up(&inode->i_sem);
if (!retry) if (!retry)
break; break;
if (IS_SYNC(inode) && inode->i_dirt) if (IS_SYNC(inode) && inode->i_dirt)
......
...@@ -4,7 +4,15 @@ ...@@ -4,7 +4,15 @@
* Copyright (C) 1992 by Linus Torvalds * Copyright (C) 1992 by Linus Torvalds
* based on ideas by Darren Senn * based on ideas by Darren Senn
* *
* stat,statm extensions by Michael K. Johnson, johnsonm@stolaf.edu * Fixes:
* Michael. K. Johnson: stat,statm extensions.
* <johnsonm@stolaf.edu>
*
* Pauline Middelink : Made cmdline,envline only break at '\0's, to
* make sure SET_PROCTITLE works. Also removed
* bad '!' which forced addres recalculation for
* EVERY character on the current page.
* <middelin@calvin.iaf.nl>
*/ */
#include <linux/types.h> #include <linux/types.h>
...@@ -98,7 +106,7 @@ static int get_kstat(char * buffer) ...@@ -98,7 +106,7 @@ static int get_kstat(char * buffer)
"disk %u %u %u %u\n" "disk %u %u %u %u\n"
"page %u %u\n" "page %u %u\n"
"swap %u %u\n" "swap %u %u\n"
"%u", "intr %u",
kstat.cpu_user, kstat.cpu_user,
kstat.cpu_nice, kstat.cpu_nice,
kstat.cpu_system, kstat.cpu_system,
...@@ -177,12 +185,12 @@ static unsigned long get_phys_addr(struct task_struct ** p, unsigned long ptr) ...@@ -177,12 +185,12 @@ static unsigned long get_phys_addr(struct task_struct ** p, unsigned long ptr)
if (!p || !*p || ptr >= TASK_SIZE) if (!p || !*p || ptr >= TASK_SIZE)
return 0; return 0;
page = *PAGE_DIR_OFFSET((*p)->tss.cr3,ptr); page = *PAGE_DIR_OFFSET((*p)->tss.cr3,ptr);
if (!(page & 1)) if (!(page & PAGE_PRESENT))
return 0; return 0;
page &= PAGE_MASK; page &= PAGE_MASK;
page += PAGE_PTR(ptr); page += PAGE_PTR(ptr);
page = *(unsigned long *) page; page = *(unsigned long *) page;
if (!(page & 1)) if (!(page & PAGE_PRESENT))
return 0; return 0;
page &= PAGE_MASK; page &= PAGE_MASK;
page += ptr & ~PAGE_MASK; page += ptr & ~PAGE_MASK;
...@@ -200,7 +208,7 @@ static int get_array(struct task_struct ** p, unsigned long start, unsigned long ...@@ -200,7 +208,7 @@ static int get_array(struct task_struct ** p, unsigned long start, unsigned long
for (;;) { for (;;) {
addr = get_phys_addr(p, start); addr = get_phys_addr(p, start);
if (!addr) if (!addr)
return result; goto ready;
do { do {
c = *(char *) addr; c = *(char *) addr;
if (!c) if (!c)
...@@ -208,13 +216,18 @@ static int get_array(struct task_struct ** p, unsigned long start, unsigned long ...@@ -208,13 +216,18 @@ static int get_array(struct task_struct ** p, unsigned long start, unsigned long
if (size < PAGE_SIZE) if (size < PAGE_SIZE)
buffer[size++] = c; buffer[size++] = c;
else else
return result; goto ready;
addr++; addr++;
start++; start++;
if (start >= end) if (!c && start >= end)
return result; goto ready;
} while (!(addr & ~PAGE_MASK)); } while (addr & ~PAGE_MASK);
} }
ready:
/* remove the trailing blanks, used to fillout argv,envp space */
while (result>0 && buffer[result-1]==' ')
result--;
return result;
} }
static int get_env(int pid, char * buffer) static int get_env(int pid, char * buffer)
......
...@@ -21,6 +21,8 @@ extern int x86; ...@@ -21,6 +21,8 @@ extern int x86;
extern int ignore_irq13; extern int ignore_irq13;
extern int wp_works_ok; extern int wp_works_ok;
extern unsigned long intr_count;
/* /*
* Bus types (default is ISA, but people can check others with these..) * Bus types (default is ISA, but people can check others with these..)
* MCA_bus hardcoded to 0 for now. * MCA_bus hardcoded to 0 for now.
......
...@@ -28,7 +28,7 @@ struct ip_config { ...@@ -28,7 +28,7 @@ struct ip_config {
unsigned long paddr; unsigned long paddr;
unsigned long router; unsigned long router;
unsigned long net; unsigned long net;
unsigned long up:1,destroy:1; unsigned up:1,destroy:1;
}; };
#endif /* FIXME: */ #endif /* FIXME: */
......
...@@ -355,6 +355,10 @@ NORET_TYPE void do_exit(long code) ...@@ -355,6 +355,10 @@ NORET_TYPE void do_exit(long code)
struct task_struct *p; struct task_struct *p;
int i; int i;
if (intr_count) {
printk("Aiee, killing interrupt handler\n");
intr_count = 0;
}
fake_volatile: fake_volatile:
if (current->semun) if (current->semun)
sem_exit(); sem_exit();
......
...@@ -217,6 +217,10 @@ asmlinkage void schedule(void) ...@@ -217,6 +217,10 @@ asmlinkage void schedule(void)
/* check alarm, wake up any interruptible tasks that have got a signal */ /* check alarm, wake up any interruptible tasks that have got a signal */
if (intr_count) {
printk("Aiee: scheduling in interrupt\n");
intr_count = 0;
}
cli(); cli();
ticks = itimer_ticks; ticks = itimer_ticks;
itimer_ticks = 0; itimer_ticks = 0;
......
...@@ -151,7 +151,6 @@ void * kmalloc (size_t size, int priority) ...@@ -151,7 +151,6 @@ void * kmalloc (size_t size, int priority)
int order,tries,i,sz; int order,tries,i,sz;
struct block_header *p; struct block_header *p;
struct page_descriptor *page; struct page_descriptor *page;
extern unsigned long intr_count;
/* Sanity check... */ /* Sanity check... */
if (intr_count && priority != GFP_ATOMIC) { if (intr_count && priority != GFP_ATOMIC) {
......
...@@ -585,7 +585,6 @@ last_free_pages[index = (index + 1) & (NR_LAST_FREE_PAGES - 1)] = result; \ ...@@ -585,7 +585,6 @@ last_free_pages[index = (index + 1) & (NR_LAST_FREE_PAGES - 1)] = result; \
*/ */
unsigned long __get_free_page(int priority) unsigned long __get_free_page(int priority)
{ {
extern unsigned long intr_count;
unsigned long result, flag; unsigned long result, flag;
static unsigned long index = 0; static unsigned long index = 0;
......
...@@ -426,7 +426,6 @@ void kfree_skb(struct sk_buff *skb, int rw) ...@@ -426,7 +426,6 @@ void kfree_skb(struct sk_buff *skb, int rw)
struct sk_buff *alloc_skb(unsigned int size,int priority) struct sk_buff *alloc_skb(unsigned int size,int priority)
{ {
struct sk_buff *skb; struct sk_buff *skb;
extern unsigned long intr_count;
if (intr_count && priority != GFP_ATOMIC) { if (intr_count && priority != GFP_ATOMIC) {
static int count = 0; static int count = 0;
......
...@@ -1197,6 +1197,7 @@ inet_accept(struct socket *sock, struct socket *newsock, int flags) ...@@ -1197,6 +1197,7 @@ inet_accept(struct socket *sock, struct socket *newsock, int flags)
if (newsock->data) { if (newsock->data) {
struct sock * sk = (struct sock *) newsock->data; struct sock * sk = (struct sock *) newsock->data;
newsock->data = NULL; newsock->data = NULL;
sk->dead = 1;
destroy_sock(sk); destroy_sock(sk);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment