diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-08-08 19:48:21 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-08-08 19:48:21 +0000 |
commit | a7ce7d5e94c98ef5b867f61b2ebecd563f4b6ec9 (patch) | |
tree | f3dc5381e660de7685258f75d16c381c4c47694a | |
parent | 57445428488a2862840c4d7c96d7746c11031aaf (diff) |
Merge with Linux 2.4.0-test6-pre7.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | arch/i386/kernel/entry.S | 4 | ||||
-rw-r--r-- | drivers/atm/iphase.c | 3 | ||||
-rw-r--r-- | drivers/block/floppy.c | 12 | ||||
-rw-r--r-- | drivers/net/appletalk/cops.c | 1 | ||||
-rw-r--r-- | drivers/net/eepro100.c | 2 | ||||
-rw-r--r-- | drivers/net/sk98lin/skge.c | 6 | ||||
-rw-r--r-- | drivers/net/slip.c | 9 | ||||
-rw-r--r-- | drivers/net/wan/Makefile | 2 | ||||
-rw-r--r-- | drivers/pci/setup-res.c | 89 | ||||
-rw-r--r-- | fs/block_dev.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_queue.c | 6 | ||||
-rw-r--r-- | net/ipv6/ip6_flowlabel.c | 7 | ||||
-rw-r--r-- | net/ipx/af_spx.c | 6 |
14 files changed, 92 insertions, 59 deletions
@@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 0 -EXTRAVERSION = -test6-pre6 +EXTRAVERSION = -test6-pre7 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index c36d01cce..337879b63 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S @@ -130,8 +130,8 @@ ENOSYS = 38 .previous #define GET_CURRENT(reg) \ - movl %esp, reg; \ - andl $-8192, reg; + movl $-8192, reg; \ + andl %esp, reg ENTRY(lcall7) pushfl # We get a different stack layout with call gates, diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index fb224a891..2187039d4 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -1712,12 +1712,15 @@ static void tx_dle_intr(struct atm_dev *dev) vcc = ATM_SKB(skb)->vcc; if (!vcc) { printk("tx_dle_intr: vcc is null\n"); + spin_unlock_irqrestore(&iadev->tx_lock, flags); dev_kfree_skb_any(skb); + return; } iavcc = INPH_IA_VCC(vcc); if (!iavcc) { printk("tx_dle_intr: iavcc is null\n"); + spin_unlock_irqrestore(&iadev->tx_lock, flags); dev_kfree_skb_any(skb); return; } diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index e83509c8e..dcd9d1036 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -3429,9 +3429,6 @@ static int get_floppy_geometry(int drive, int type, struct floppy_struct **g) static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long param) { -#define IOCTL_MODE_BIT 8 -#define OPEN_WRITE_BIT 16 -#define IOCTL_ALLOWED (filp && (filp->f_mode & IOCTL_MODE_BIT)) #define OUT(c,x) case c: outparam = (const char *) (x); break #define IN(c,x,tag) case c: *(x) = inparam. tag ; return 0 @@ -3499,7 +3496,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, return -EINVAL; /* permission checks */ - if (((cmd & 0x40) && !IOCTL_ALLOWED) || + if (((cmd & 0x40) && !(filp->f_mode & 2)) || ((cmd & 0x80) && !suser())) return -EPERM; @@ -3620,7 +3617,6 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, return fd_copyout((void *)param, outparam, size); else return 0; -#undef IOCTL_ALLOWED #undef OUT #undef IN } @@ -3773,12 +3769,6 @@ static int floppy_open(struct inode * inode, struct file * filp) invalidate_buffers(MKDEV(FLOPPY_MAJOR,old_dev)); } - /* Allow ioctls if we have write-permissions even if read-only open */ - if ((filp->f_mode & 2) || (permission(inode,2) == 0)) - filp->f_mode |= IOCTL_MODE_BIT; - if (filp->f_mode & 2) - filp->f_mode |= OPEN_WRITE_BIT; - if (UFDCS->rawcmd == 1) UFDCS->rawcmd = 2; diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c index 950bd016c..255d845fd 100644 --- a/drivers/net/appletalk/cops.c +++ b/drivers/net/appletalk/cops.c @@ -772,6 +772,7 @@ static void cops_rx(struct net_device *dev) if(boguscount==1000000) { printk(KERN_WARNING "%s: DMA timed out.\n",dev->name); + restore_flags(flags); return; } } diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index db89a18f6..233b1e4d3 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -2252,8 +2252,10 @@ static struct pci_driver eepro100_driver = { id_table: eepro100_pci_tbl, probe: eepro100_init_one, remove: eepro100_remove_one, +#if 0 /* These seem to be broken.. */ suspend: eepro100_suspend, resume: eepro100_resume, +#endif }; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,48) diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c index 8e95f0a05..637b02460 100644 --- a/drivers/net/sk98lin/skge.c +++ b/drivers/net/sk98lin/skge.c @@ -2406,8 +2406,7 @@ SK_EVPARA EvPara; SkEventDispatcher(pAC, pAC->IoBase); for (i=0; i<pAC->GIni.GIMacsFound; i++) { - spin_lock_irqsave( - &pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock, Flags); + spin_lock(&pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock); } netif_stop_queue(pAC->dev); @@ -2500,8 +2499,7 @@ SK_EVPARA EvPara; netif_start_queue(pAC->dev); for (i=pAC->GIni.GIMacsFound-1; i>=0; i--) { - spin_unlock_irqrestore( - &pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock, Flags); + spin_unlock(&pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock); } /* enable Interrupts */ diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 51e2d6494..7420e5691 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -1260,8 +1260,10 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd) switch(cmd){ case SIOCSKEEPALIVE: /* max for unchar */ - if (((unsigned int)((unsigned long)rq->ifr_data)) > 255) + if (((unsigned int)((unsigned long)rq->ifr_data)) > 255) { + spin_unlock_bh(&sl->lock); return -EINVAL; + } sl->keepalive = (unchar) ((unsigned long)rq->ifr_data); if (sl->keepalive != 0) { sl->keepalive_timer.expires=jiffies+sl->keepalive*HZ; @@ -1270,7 +1272,6 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd) } else { del_timer(&sl->keepalive_timer); } - spin_unlock_bh(&sl->lock); break; case SIOCGKEEPALIVE: @@ -1278,8 +1279,10 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd) break; case SIOCSOUTFILL: - if (((unsigned)((unsigned long)rq->ifr_data)) > 255) /* max for unchar */ + if (((unsigned)((unsigned long)rq->ifr_data)) > 255) { /* max for unchar */ + spin_unlock_bh(&sl->lock); return -EINVAL; + } if ((sl->outfill = (unchar)((unsigned long) rq->ifr_data)) != 0){ mod_timer(&sl->outfill_timer, jiffies+sl->outfill*HZ); set_bit(SLF_OUTWAIT, &sl->flags); diff --git a/drivers/net/wan/Makefile b/drivers/net/wan/Makefile index 371153a47..f7f3fe58a 100644 --- a/drivers/net/wan/Makefile +++ b/drivers/net/wan/Makefile @@ -76,10 +76,12 @@ endif ifeq ($(CONFIG_COMX_HW_LOCOMX),y) L_OBJS += comx-hw-locomx.o CONFIG_85230_BUILTIN=y +CONFIG_SYNCPPP_BUILTIN = y else ifeq ($(CONFIG_COMX_HW_LOCOMX),m) M_OBJS += comx-hw-locomx.o CONFIG_85230_MODULE=y + CONFIG_SYNCPPP_MODULE = y endif endif diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 6b4654d7b..9fac0e1ce 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -50,45 +50,70 @@ pci_claim_resource(struct pci_dev *dev, int resource) return err; } -int -pci_assign_resource(struct pci_dev *dev, int i) +/* + * Given the PCI bus a device resides on, try to + * find an acceptable resource allocation for a + * specific device resource.. + */ +static int pci_assign_bus_resource(const struct pci_bus *bus, + struct pci_dev *dev, + struct resource *res, + unsigned long size, + unsigned long min, + unsigned int type_mask) { - struct resource *root, *res; - unsigned long size, min; + int i; - res = &dev->resource[i]; + type_mask |= IORESOURCE_IO | IORESOURCE_MEM; + for (i = 0 ; i < 4; i++) { + struct resource *r = bus->resource[i]; + if (!r) + continue; - /* Determine the root we allocate from. */ - res->end -= res->start; - res->start = 0; - root = pci_find_parent_resource(dev, res); - if (root == NULL) { - printk(KERN_ERR "PCI: Cannot find parent resource for " - "device %s\n", dev->slot_name); - return -EINVAL; - } + /* type_mask must match */ + if ((res->flags ^ r->flags) & type_mask) + continue; + + /* We cannot allocate a non-prefetching resource from a pre-fetching area */ + if ((r->flags & IORESOURCE_PREFETCH) && !(res->flags & IORESOURCE_PREFETCH)) + continue; - min = (res->flags & IORESOURCE_IO ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM); - size = res->end + 1; - DBGC((" for root[%lx:%lx] min[%lx] size[%lx]\n", - root->start, root->end, min, size)); - - if (allocate_resource(root, res, size, min, -1, size, - pcibios_align_resource, dev) < 0) { - printk(KERN_ERR "PCI: Failed to allocate resource %d for %s\n", - i, dev->name); - printk(KERN_ERR " failed root[%lx:%lx] min[%lx] size[%lx]\n", - root->start, root->end, min, size); - printk(KERN_ERR " failed res[%lx:%lx]\n", - res->start, res->end); - return -EBUSY; + /* Ok, try it out.. */ + if (allocate_resource(r, res, size, min, -1, size, pcibios_align_resource, dev) < 0) + continue; + + /* Update PCI config space. */ + pcibios_update_resource(dev, r, res, i); + return 0; } + return -EBUSY; +} + +int +pci_assign_resource(struct pci_dev *dev, int i) +{ + const struct pci_bus *bus = dev->bus; + struct resource *res = dev->resource + i; + unsigned long size, min; - DBGC((" got res[%lx:%lx] for resource %d\n", - res->start, res->end, i)); + size = res->end - res->start + 1; + min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM; + + /* First, try exact prefetching match.. */ + if (pci_assign_bus_resource(bus, dev, res, size, min, IORESOURCE_PREFETCH) < 0) { + /* + * That failed. + * + * But a prefetching area can handle a non-prefetching + * window (it will just not perform as well). + */ + if (!(res->flags & IORESOURCE_PREFETCH) || pci_assign_bus_resource(bus, dev, res, size, min, 0) < 0) { + printk(KERN_ERR "PCI: Failed to allocate resource %d for %s\n", i, dev->name); + return -EBUSY; + } + } - /* Update PCI config space. */ - pcibios_update_resource(dev, root, res, i); + DBGC((" got res[%lx:%lx] for resource %d\n", res->start, res->end, i)); return 0; } diff --git a/fs/block_dev.c b/fs/block_dev.c index 02a2b2758..7546705fa 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -582,6 +582,8 @@ int blkdev_get(struct block_device *bdev, mode_t mode, unsigned flags, int kind) /* * This crockload is due to bad choice of ->open() type. * It will go away. + * For now, block device ->open() routine must _not_ + * examine anything in 'inode' argument except ->i_rdev. */ struct file fake_file = {}; struct dentry fake_dentry = {}; diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index 2ac8b22e2..4f8a8de07 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c @@ -263,11 +263,13 @@ static int ipq_receive_peer(ipq_queue_t *q, ipq_peer_msg_t *m, { int status = 0; + int busy; spin_lock_bh(&q->lock); - if (q->terminate || q->flushing) - return -EBUSY; + busy = (q->terminate || q->flushing); spin_unlock_bh(&q->lock); + if (busy) + return -EBUSY; if (len < sizeof(ipq_peer_msg_t)) return -EINVAL; switch (type) { diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 4dd29b60e..c87c1d447 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c @@ -436,8 +436,11 @@ int ipv6_flowlabel_opt(struct sock *sk, char *optval, int optlen) case IPV6_FL_A_RENEW: read_lock_bh(&ip6_sk_fl_lock); for (sfl = np->ipv6_fl_list; sfl; sfl = sfl->next) { - if (sfl->fl->label == freq.flr_label) - return fl6_renew(sfl->fl, freq.flr_linger, freq.flr_expires); + if (sfl->fl->label == freq.flr_label) { + err = fl6_renew(sfl->fl, freq.flr_linger, freq.flr_expires); + read_unlock_bh(&ip6_sk_fl_lock); + return err; + } } read_unlock_bh(&ip6_sk_fl_lock); diff --git a/net/ipx/af_spx.c b/net/ipx/af_spx.c index dc8623aad..fa90429f9 100644 --- a/net/ipx/af_spx.c +++ b/net/ipx/af_spx.c @@ -441,8 +441,10 @@ static int spx_transmit(struct sock *sk, struct sk_buff *skb, int type, int len) save_flags(flags); cli(); skb = sock_alloc_send_skb(sk, size, 1, 0, &err); - if(skb == NULL) + if(skb == NULL) { + restore_flags(flags); return (-ENOMEM); + } skb_reserve(skb, offset); skb->h.raw = skb->nh.raw = skb_put(skb,sizeof(struct ipxspxhdr)); restore_flags(flags); @@ -741,9 +743,9 @@ static int spx_sendmsg(struct socket *sock, struct msghdr *msg, int len, cli(); skb = sock_alloc_send_skb(sk, size, 0, flags&MSG_DONTWAIT, &err); + sti(); if(skb == NULL) return (err); - sti(); skb->sk = sk; skb_reserve(skb, offset); |