]> git.neil.brown.name Git - history.git/commitdiff
Import 2.2.11pre4 2.2.11pre4
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:19:16 +0000 (15:19 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:19:16 +0000 (15:19 -0500)
arch/alpha/kernel/setup.c
drivers/char/keyboard.c
drivers/char/sysrq.c
drivers/net/pcnet32.c
fs/lockd/clntlock.c
fs/lockd/svclock.c
fs/locks.c
include/asm-i386/elf.h
include/asm-i386/ptrace.h [new file with mode: 0644]
mm/mmap.c

index 6c13fea3f9b7b84d602f23573ec06b6e8876e04f..483320950ecbba65a77408737364155751404585 100644 (file)
@@ -727,7 +727,8 @@ int get_cpuinfo(char *buffer)
                      "BogoMIPS\t\t: %lu.%02lu\n"
                      "kernel unaligned acc\t: %ld (pc=%lx,va=%lx)\n"
                      "user unaligned acc\t: %ld (pc=%lx,va=%lx)\n"
-                     "platform string\t\t: %s\n",
+                     "platform string\t\t: %s\n"
+                     "cpus detected\t\t: %ld\n",
                       cpu_name, cpu->variation, cpu->revision,
                       (char*)cpu->serial_no,
                       systype_name, sysvariation_name, hwrpb->sys_revision,
@@ -742,7 +743,7 @@ int get_cpuinfo(char *buffer)
                       loops_per_sec / 500000, (loops_per_sec / 5000) % 100,
                       unaligned[0].count, unaligned[0].pc, unaligned[0].va,
                       unaligned[1].count, unaligned[1].pc, unaligned[1].va,
-                      platform_string());
+                      platform_string(), hwrpb->nr_processors);
 
 #ifdef __SMP__
        len += smp_info(buffer+len);
index d188882ff188d525293fd3e224e6c56b6ff79c62..e5377cea8e8d0a38d5cc9eae2e0db27a2ac68193 100644 (file)
@@ -156,7 +156,6 @@ struct pt_regs * kbd_pt_regs;
 
 #ifdef CONFIG_MAGIC_SYSRQ
 static int sysrq_pressed;
-int sysrq_enabled = 1;
 #endif
 
 /*
index 5a4ad1c6f5c414cfc510b63f23ad738e68f084c6..b266d44505e9143ed5c35b5e510b5200615c9b36 100644 (file)
 #include <linux/apm_bios.h>
 #endif
 
+#ifdef CONFIG_MAGIC_SYSRQ
+int sysrq_enabled = 1;
+#endif
+
 extern void wakeup_bdflush(int);
 extern void reset_vc(unsigned int);
 extern int console_loglevel;
index f2ce89efa73ed700e867ac9037ba84741482d557..62be203af456a214fa08bdc909214bc8bb339faa 100644 (file)
@@ -13,7 +13,7 @@
  *     This driver is for PCnet32 and PCnetPCI based ethercards
  */
 
-static const char *version = "pcnet32.c:v1.21 31.3.99 tsbogend@alpha.franken.de\n";
+static const char *version = "pcnet32.c:v1.23 6.7.1999 tsbogend@alpha.franken.de\n";
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -149,6 +149,13 @@ static int full_duplex[MAX_UNITS] = {0, };
  *         rewritten PCI card detection
  *         added dwio mode to get driver working on some PPC machines
  * v1.21:  added mii selection and mii ioctl
+ * v1.22:  changed pci scanning code to make PPC people happy
+ *         fixed switching to 32bit mode in pcnet32_open() (thanks
+ *         to Michael Richard <mcr@solidum.com> for noticing this one)
+ *        added sub vendor/device id matching (thanks again to 
+ *        Michael Richard <mcr@solidum.com>)
+ *         added chip id for 79c973/975 (thanks to Zach Brown <zab@zabbo.net>)
+ * v1.23   fixed small bug, when manual selecting MII speed/duplex
  */
 
 
@@ -185,6 +192,16 @@ static int full_duplex[MAX_UNITS] = {0, };
 
 #define PCNET32_TOTAL_SIZE 0x20
 
+/* some PCI ids */
+#ifndef PCI_DEVICE_ID_AMD_LANCE
+#define PCI_VENDOR_ID_AMD            0x1022
+#define PCI_DEVICE_ID_AMD_LANCE              0x2000
+#endif
+#ifndef PCI_DEVICE_ID_AMD_PCNETHOME
+#define PCI_DEVICE_ID_AMD_PCNETHOME   0x2001
+#endif
+
+
 #define CRC_POLYNOMIAL_LE 0xedb88320UL  /* Ethernet CRC, little endian */
 
 /* The PCNET32 Rx and Tx ring descriptors. */
@@ -272,14 +289,19 @@ enum pci_flags_bit {
 
 struct pcnet32_pci_id_info {
     const char *name;
-    u16 vendor_id, device_id, device_id_mask, flags;
+    u16 vendor_id, device_id, svid, sdid, flags;
     int io_size;
     int (*probe1) (struct device *, unsigned long, unsigned char, int, int);
 };
 
 static struct pcnet32_pci_id_info pcnet32_tbl[] = {
     { "AMD PCnetPCI series",
-       0x1022, 0x2000, 0xfffe, PCI_USES_IO|PCI_USES_MASTER, PCNET32_TOTAL_SIZE,
+       PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE, 0, 0,
+       PCI_USES_IO|PCI_USES_MASTER, PCNET32_TOTAL_SIZE,
+       pcnet32_probe1},
+    { "AMD PCnetHome series",
+       PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_PCNETHOME, 0, 0,
+       PCI_USES_IO|PCI_USES_MASTER, PCNET32_TOTAL_SIZE,
        pcnet32_probe1},
     {0,}
 };
@@ -418,30 +440,27 @@ int __init pcnet32_probe (struct device *dev)
     
 #if defined(CONFIG_PCI)
     if (pci_present()) {
-       struct pci_dev *pdev;
-       unsigned char pci_bus, pci_device_fn;
-       int pci_index;
+       struct pci_dev *pdev = NULL;
        
        printk("pcnet32.c: PCI bios is present, checking for devices...\n");
-       for (pci_index = 0; pci_index < 0xff; pci_index++) {
-           u16 vendor, device, pci_command;
+       while ((pdev = pci_find_class (PCI_CLASS_NETWORK_ETHERNET<<8, pdev))) {
+           u16 pci_command;
            int chip_idx;
+           u16 sdid,svid;
 
-           if (pcibios_find_class (PCI_CLASS_NETWORK_ETHERNET << 8,
-                                   pci_index, &pci_bus, &pci_device_fn) != PCIBIOS_SUCCESSFUL)
-               break;
-           
-           pcibios_read_config_word(pci_bus, pci_device_fn, PCI_VENDOR_ID, &vendor);
-           pcibios_read_config_word(pci_bus, pci_device_fn, PCI_DEVICE_ID, &device);
-
+           pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &sdid);
+           pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &svid);
            for (chip_idx = 0; pcnet32_tbl[chip_idx].vendor_id; chip_idx++)
-               if (vendor == pcnet32_tbl[chip_idx].vendor_id &&
-                   (device & pcnet32_tbl[chip_idx].device_id_mask) == pcnet32_tbl[chip_idx].device_id)
+               if ((pdev->vendor == pcnet32_tbl[chip_idx].vendor_id) &&
+                   (pdev->device == pcnet32_tbl[chip_idx].device_id) &&
+                   (pcnet32_tbl[chip_idx].svid == 0 || 
+                    (svid == pcnet32_tbl[chip_idx].svid)) &&
+                   (pcnet32_tbl[chip_idx].sdid == 0 || 
+                    (sdid == pcnet32_tbl[chip_idx].sdid)))
                    break;
            if (pcnet32_tbl[chip_idx].vendor_id == 0)
                continue;
            
-           pdev = pci_find_slot(pci_bus, pci_device_fn);
            ioaddr = pdev->base_address[0] & PCI_BASE_ADDRESS_IO_MASK;
 #if defined(ADDR_64BITS) && defined(__alpha__)
            ioaddr |= ((long)pdev->base_address[1]) << 32;
@@ -541,6 +560,10 @@ pcnet32_probe1(struct device *dev, unsigned long ioaddr, unsigned char irq_line,
        chipname = "PCnet/FAST+ 79C972";
        fdx = 1; mii = 1;
        break;
+     case 0x2625:
+       chipname = "PCnet/FAST III 79C973";
+       fdx = 1; mii = 1;
+       break;
      case 0x2626:
        chipname = "PCnet/Home 79C978";
        fdx = 1;
@@ -561,6 +584,9 @@ pcnet32_probe1(struct device *dev, unsigned long ioaddr, unsigned char irq_line,
            printk("pcnet32: pcnet32 media reset to %#x.\n",  media);
        a->write_bcr (ioaddr, 49, media);
        break;
+     case 0x2627:
+       chipname = "PCnet/FAST III 79C975";
+       fdx = 1; mii = 1;
      default:
        printk("pcnet32: PCnet version %#x, no PCnet32 chip.\n",chip_version);
        return ENODEV;
@@ -693,7 +719,7 @@ pcnet32_open(struct device *dev)
     lp->a.reset (ioaddr);
 
     /* switch pcnet32 to 32bit mode */
-    lp->a.write_csr (ioaddr, 20, 2);
+    lp->a.write_bcr (ioaddr, 20, 2);
 
     if (pcnet32_debug > 1)
        printk("%s: pcnet32_open() irq %d tx/rx rings %#x/%#x init %#x.\n",
@@ -725,7 +751,7 @@ pcnet32_open(struct device *dev)
        val |= 0x10;
     lp->a.write_csr (ioaddr, 124, val);
     
-    if (lp->mii & (lp->options & PORT_ASEL)) {
+    if (lp->mii & !(lp->options & PORT_ASEL)) {
        val = lp->a.read_bcr (ioaddr, 32) & ~0x38; /* disable Auto Negotiation, set 10Mpbs, HD */
        if (lp->options & PORT_FD)
            val |= 0x10;
@@ -952,7 +978,7 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
     struct device *dev = (struct device *)dev_id;
     struct pcnet32_private *lp;
     unsigned long ioaddr;
-    u16 csr0;
+    u16 csr0,rap;
     int boguscnt =  max_interrupt_work;
     int must_restart;
 
@@ -968,6 +994,7 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 
     dev->interrupt = 1;
 
+    rap = lp->a.read_rap(ioaddr);
     while ((csr0 = lp->a.read_csr (ioaddr, 0)) & 0x8600 && --boguscnt >= 0) {
        /* Acknowledge all of the current interrupt sources ASAP. */
        lp->a.write_csr (ioaddr, 0, csr0 & ~0x004f);
@@ -1069,6 +1096,7 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 
     /* Clear any other interrupt, and set interrupt enable. */
     lp->a.write_csr (ioaddr, 0, 0x7940);
+    lp->a.write_rap(ioaddr,rap);
 
     if (pcnet32_debug > 4)
        printk("%s: exiting interrupt, csr0=%#4.4x.\n",
index a9be4b80267f91ddead83fc26ff93bfd4f4f6b04..4b68882bee64ef47d6a869712d3b8f388d4d3856 100644 (file)
@@ -172,7 +172,7 @@ reclaimer(void *ptr)
 
        /* First, reclaim all locks that have been granted previously. */
        do {
-               for (fl = file_lock_table; fl; fl = fl->fl_next) {
+               for (fl = file_lock_table; fl; fl = fl->fl_nextlink) {
                        inode = fl->fl_file->f_dentry->d_inode;
                        if (inode->i_sb->s_magic == NFS_SUPER_MAGIC
                         && nlm_cmp_addr(NFS_ADDR(inode), &host->h_addr)
index 10c66ed4d7ae0a639c89514166a0048f3809aa17..73caf63492f6a19271d4718caf952209dca5c274 100644 (file)
@@ -335,9 +335,12 @@ again:
        /* Append to list of blocked */
        nlmsvc_insert_block(block, NLM_NEVER);
 
-       /* Now add block to block list of the conflicting lock */
-       dprintk("lockd: blocking on this lock.\n");
-       posix_block_lock(conflock, &block->b_call.a_args.lock.fl);
+       if (!block->b_call.a_args.lock.fl.fl_prevblock) {
+               /* Now add block to block list of the conflicting lock
+                  if we haven't done so. */
+               dprintk("lockd: blocking on this lock.\n");
+               posix_block_lock(conflock, &block->b_call.a_args.lock.fl);
+       }
 
        up(&file->f_sema);
        return nlm_lck_blocked;
@@ -440,7 +443,7 @@ nlmsvc_notify_blocked(struct file_lock *fl)
        dprintk("lockd: VFS unblock notification for block %p\n", fl);
        posix_unblock_lock(fl);
        for (bp = &nlm_blocked; (block = *bp); bp = &block->b_next) {
-               if (&block->b_call.a_args.lock.fl == fl) {
+               if (nlm_compare_locks(&block->b_call.a_args.lock.fl, fl)) {
                        svc_wake_up(block->b_daemon);
                        nlmsvc_insert_block(block, 0);
                        return;
index ea8be5d5663a7176fd613c4f5e62d8bddd6f5cf8..87926addb5eec1a74c5166afccb60b03f979d541 100644 (file)
@@ -193,6 +193,14 @@ static void locks_insert_block(struct file_lock *blocker,
 {
        struct file_lock *prevblock;
 
+       if (waiter->fl_prevblock) {
+               printk(KERN_ERR "locks_insert_block: remove duplicated lock "
+                       "(pid=%d %ld-%ld type=%d)\n",
+                       waiter->fl_pid, waiter->fl_start,
+                       waiter->fl_end, waiter->fl_type);
+               locks_delete_block(waiter->fl_prevblock, waiter);
+       }
+
        if (blocker->fl_prevblock == NULL)
                /* No previous waiters - list is empty */
                prevblock = blocker;
index dacd01b99eb9d944995f5a2374708cf4b6c53291..e3916575b591982716e71390687371f15317b4d4 100644 (file)
@@ -51,7 +51,9 @@ typedef struct user_i387_struct elf_fpregset_t;
    the loader.  We need to make sure that it is out of the way of the program
    that it will "exec", and that there is sufficient room for the brk.  */
 
-#define ELF_ET_DYN_BASE         (2 * TASK_SIZE / 3)
+#define ELF_ET_DYN_BASE         ((TASK_SIZE & 0x80000000) \
+                                ? TASK_SIZE / 3 * 2 \
+                                : 2 * TASK_SIZE / 3)
 
 /* Wow, the "main" arch needs arch dependent functions too.. :) */
 
diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h
new file mode 100644 (file)
index 0000000..985d288
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef _I386_PTRACE_H
+#define _I386_PTRACE_H
+
+#define EBX 0
+#define ECX 1
+#define EDX 2
+#define ESI 3
+#define EDI 4
+#define EBP 5
+#define EAX 6
+#define DS 7
+#define ES 8
+#define FS 9
+#define GS 10
+#define ORIG_EAX 11
+#define EIP 12
+#define CS  13
+#define EFL 14
+#define UESP 15
+#define SS   16
+
+
+/* this struct defines the way the registers are stored on the 
+   stack during a system call. */
+
+struct pt_regs {
+       long ebx;
+       long ecx;
+       long edx;
+       long esi;
+       long edi;
+       long ebp;
+       long eax;
+       int  xds;
+       int  xes;
+       long orig_eax;
+       long eip;
+       int  xcs;
+       long eflags;
+       long esp;
+       int  xss;
+};
+
+/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
+#define PTRACE_GETREGS            12
+#define PTRACE_SETREGS            13
+#define PTRACE_GETFPREGS          14
+#define PTRACE_SETFPREGS          15
+
+#ifdef __KERNEL__
+#define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs))
+#define instruction_pointer(regs) ((regs)->eip)
+extern void show_regs(struct pt_regs *);
+#endif
+
+#endif
index 9f7d3285183c5dfcb43e4a150a52f276477c6ec5..55e773bf26ef0d57a4d33bd5679c7c5abf43ef14 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -359,8 +359,11 @@ unsigned long get_unmapped_area(unsigned long addr, unsigned long len)
 
        if (len > TASK_SIZE)
                return 0;
-       if (!addr)
-               addr = TASK_UNMAPPED_BASE;
+       if (!addr) {
+               addr = current->rlim[RLIMIT_DATA].rlim_cur;
+               if (addr >= RLIM_INFINITY)
+                       addr = TASK_UNMAPPED_BASE;
+       }
        addr = PAGE_ALIGN(addr);
 
        for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {