Commit 73c07955 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.4.0-test6pre7

parent 1973baab
...@@ -130,8 +130,8 @@ ENOSYS = 38 ...@@ -130,8 +130,8 @@ ENOSYS = 38
.previous .previous
#define GET_CURRENT(reg) \ #define GET_CURRENT(reg) \
movl %esp, reg; \ movl $-8192, reg; \
andl $-8192, reg; andl %esp, reg
ENTRY(lcall7) ENTRY(lcall7)
pushfl # We get a different stack layout with call gates, pushfl # We get a different stack layout with call gates,
......
...@@ -1712,12 +1712,15 @@ static void tx_dle_intr(struct atm_dev *dev) ...@@ -1712,12 +1712,15 @@ static void tx_dle_intr(struct atm_dev *dev)
vcc = ATM_SKB(skb)->vcc; vcc = ATM_SKB(skb)->vcc;
if (!vcc) { if (!vcc) {
printk("tx_dle_intr: vcc is null\n"); printk("tx_dle_intr: vcc is null\n");
spin_unlock_irqrestore(&iadev->tx_lock, flags);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return; return;
} }
iavcc = INPH_IA_VCC(vcc); iavcc = INPH_IA_VCC(vcc);
if (!iavcc) { if (!iavcc) {
printk("tx_dle_intr: iavcc is null\n"); printk("tx_dle_intr: iavcc is null\n");
spin_unlock_irqrestore(&iadev->tx_lock, flags);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return; return;
} }
......
...@@ -3429,9 +3429,6 @@ static int get_floppy_geometry(int drive, int type, struct floppy_struct **g) ...@@ -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, static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long param) 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 OUT(c,x) case c: outparam = (const char *) (x); break
#define IN(c,x,tag) case c: *(x) = inparam. tag ; return 0 #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, ...@@ -3499,7 +3496,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
return -EINVAL; return -EINVAL;
/* permission checks */ /* permission checks */
if (((cmd & 0x40) && !IOCTL_ALLOWED) || if (((cmd & 0x40) && !(filp->f_mode & 2)) ||
((cmd & 0x80) && !suser())) ((cmd & 0x80) && !suser()))
return -EPERM; return -EPERM;
...@@ -3620,7 +3617,6 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, ...@@ -3620,7 +3617,6 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
return fd_copyout((void *)param, outparam, size); return fd_copyout((void *)param, outparam, size);
else else
return 0; return 0;
#undef IOCTL_ALLOWED
#undef OUT #undef OUT
#undef IN #undef IN
} }
...@@ -3773,12 +3769,6 @@ static int floppy_open(struct inode * inode, struct file * filp) ...@@ -3773,12 +3769,6 @@ static int floppy_open(struct inode * inode, struct file * filp)
invalidate_buffers(MKDEV(FLOPPY_MAJOR,old_dev)); 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) if (UFDCS->rawcmd == 1)
UFDCS->rawcmd = 2; UFDCS->rawcmd = 2;
......
...@@ -772,6 +772,7 @@ static void cops_rx(struct net_device *dev) ...@@ -772,6 +772,7 @@ static void cops_rx(struct net_device *dev)
if(boguscount==1000000) if(boguscount==1000000)
{ {
printk(KERN_WARNING "%s: DMA timed out.\n",dev->name); printk(KERN_WARNING "%s: DMA timed out.\n",dev->name);
restore_flags(flags);
return; return;
} }
} }
......
...@@ -2252,8 +2252,10 @@ static struct pci_driver eepro100_driver = { ...@@ -2252,8 +2252,10 @@ static struct pci_driver eepro100_driver = {
id_table: eepro100_pci_tbl, id_table: eepro100_pci_tbl,
probe: eepro100_init_one, probe: eepro100_init_one,
remove: eepro100_remove_one, remove: eepro100_remove_one,
#if 0 /* These seem to be broken.. */
suspend: eepro100_suspend, suspend: eepro100_suspend,
resume: eepro100_resume, resume: eepro100_resume,
#endif
}; };
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,48) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,48)
......
...@@ -2406,8 +2406,7 @@ SK_EVPARA EvPara; ...@@ -2406,8 +2406,7 @@ SK_EVPARA EvPara;
SkEventDispatcher(pAC, pAC->IoBase); SkEventDispatcher(pAC, pAC->IoBase);
for (i=0; i<pAC->GIni.GIMacsFound; i++) { for (i=0; i<pAC->GIni.GIMacsFound; i++) {
spin_lock_irqsave( spin_lock(&pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock);
&pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock, Flags);
} }
netif_stop_queue(pAC->dev); netif_stop_queue(pAC->dev);
...@@ -2500,8 +2499,7 @@ SK_EVPARA EvPara; ...@@ -2500,8 +2499,7 @@ SK_EVPARA EvPara;
netif_start_queue(pAC->dev); netif_start_queue(pAC->dev);
for (i=pAC->GIni.GIMacsFound-1; i>=0; i--) { for (i=pAC->GIni.GIMacsFound-1; i>=0; i--) {
spin_unlock_irqrestore( spin_unlock(&pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock);
&pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock, Flags);
} }
/* enable Interrupts */ /* enable Interrupts */
......
...@@ -1260,8 +1260,10 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd) ...@@ -1260,8 +1260,10 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd)
switch(cmd){ switch(cmd){
case SIOCSKEEPALIVE: case SIOCSKEEPALIVE:
/* max for unchar */ /* 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; return -EINVAL;
}
sl->keepalive = (unchar) ((unsigned long)rq->ifr_data); sl->keepalive = (unchar) ((unsigned long)rq->ifr_data);
if (sl->keepalive != 0) { if (sl->keepalive != 0) {
sl->keepalive_timer.expires=jiffies+sl->keepalive*HZ; 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) ...@@ -1270,7 +1272,6 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd)
} else { } else {
del_timer(&sl->keepalive_timer); del_timer(&sl->keepalive_timer);
} }
spin_unlock_bh(&sl->lock);
break; break;
case SIOCGKEEPALIVE: case SIOCGKEEPALIVE:
...@@ -1278,8 +1279,10 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd) ...@@ -1278,8 +1279,10 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd)
break; break;
case SIOCSOUTFILL: 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; return -EINVAL;
}
if ((sl->outfill = (unchar)((unsigned long) rq->ifr_data)) != 0){ if ((sl->outfill = (unchar)((unsigned long) rq->ifr_data)) != 0){
mod_timer(&sl->outfill_timer, jiffies+sl->outfill*HZ); mod_timer(&sl->outfill_timer, jiffies+sl->outfill*HZ);
set_bit(SLF_OUTWAIT, &sl->flags); set_bit(SLF_OUTWAIT, &sl->flags);
......
...@@ -76,10 +76,12 @@ endif ...@@ -76,10 +76,12 @@ endif
ifeq ($(CONFIG_COMX_HW_LOCOMX),y) ifeq ($(CONFIG_COMX_HW_LOCOMX),y)
L_OBJS += comx-hw-locomx.o L_OBJS += comx-hw-locomx.o
CONFIG_85230_BUILTIN=y CONFIG_85230_BUILTIN=y
CONFIG_SYNCPPP_BUILTIN = y
else else
ifeq ($(CONFIG_COMX_HW_LOCOMX),m) ifeq ($(CONFIG_COMX_HW_LOCOMX),m)
M_OBJS += comx-hw-locomx.o M_OBJS += comx-hw-locomx.o
CONFIG_85230_MODULE=y CONFIG_85230_MODULE=y
CONFIG_SYNCPPP_MODULE = y
endif endif
endif endif
......
...@@ -50,45 +50,70 @@ pci_claim_resource(struct pci_dev *dev, int resource) ...@@ -50,45 +50,70 @@ pci_claim_resource(struct pci_dev *dev, int resource)
return err; 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; int i;
unsigned long size, min;
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. */ /* type_mask must match */
res->end -= res->start; if ((res->flags ^ r->flags) & type_mask)
res->start = 0; continue;
root = pci_find_parent_resource(dev, res);
if (root == NULL) { /* We cannot allocate a non-prefetching resource from a pre-fetching area */
printk(KERN_ERR "PCI: Cannot find parent resource for " if ((r->flags & IORESOURCE_PREFETCH) && !(res->flags & IORESOURCE_PREFETCH))
"device %s\n", dev->slot_name); continue;
return -EINVAL;
}
min = (res->flags & IORESOURCE_IO ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM); /* Ok, try it out.. */
size = res->end + 1; if (allocate_resource(r, res, size, min, -1, size, pcibios_align_resource, dev) < 0)
DBGC((" for root[%lx:%lx] min[%lx] size[%lx]\n", continue;
root->start, root->end, min, size));
/* Update PCI config space. */
if (allocate_resource(root, res, size, min, -1, size, pcibios_update_resource(dev, r, res, i);
pcibios_align_resource, dev) < 0) { return 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;
} }
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", size = res->end - res->start + 1;
res->start, res->end, i)); 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. */ DBGC((" got res[%lx:%lx] for resource %d\n", res->start, res->end, i));
pcibios_update_resource(dev, root, res, i);
return 0; return 0;
} }
......
...@@ -582,6 +582,8 @@ int blkdev_get(struct block_device *bdev, mode_t mode, unsigned flags, int kind) ...@@ -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. * This crockload is due to bad choice of ->open() type.
* It will go away. * 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 file fake_file = {};
struct dentry fake_dentry = {}; struct dentry fake_dentry = {};
......
...@@ -263,11 +263,13 @@ static int ipq_receive_peer(ipq_queue_t *q, ipq_peer_msg_t *m, ...@@ -263,11 +263,13 @@ static int ipq_receive_peer(ipq_queue_t *q, ipq_peer_msg_t *m,
{ {
int status = 0; int status = 0;
int busy;
spin_lock_bh(&q->lock); spin_lock_bh(&q->lock);
if (q->terminate || q->flushing) busy = (q->terminate || q->flushing);
return -EBUSY;
spin_unlock_bh(&q->lock); spin_unlock_bh(&q->lock);
if (busy)
return -EBUSY;
if (len < sizeof(ipq_peer_msg_t)) if (len < sizeof(ipq_peer_msg_t))
return -EINVAL; return -EINVAL;
switch (type) { switch (type) {
......
...@@ -436,8 +436,11 @@ int ipv6_flowlabel_opt(struct sock *sk, char *optval, int optlen) ...@@ -436,8 +436,11 @@ int ipv6_flowlabel_opt(struct sock *sk, char *optval, int optlen)
case IPV6_FL_A_RENEW: case IPV6_FL_A_RENEW:
read_lock_bh(&ip6_sk_fl_lock); read_lock_bh(&ip6_sk_fl_lock);
for (sfl = np->ipv6_fl_list; sfl; sfl = sfl->next) { for (sfl = np->ipv6_fl_list; sfl; sfl = sfl->next) {
if (sfl->fl->label == freq.flr_label) if (sfl->fl->label == freq.flr_label) {
return fl6_renew(sfl->fl, freq.flr_linger, freq.flr_expires); 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); read_unlock_bh(&ip6_sk_fl_lock);
......
...@@ -441,8 +441,10 @@ static int spx_transmit(struct sock *sk, struct sk_buff *skb, int type, int len) ...@@ -441,8 +441,10 @@ static int spx_transmit(struct sock *sk, struct sk_buff *skb, int type, int len)
save_flags(flags); save_flags(flags);
cli(); cli();
skb = sock_alloc_send_skb(sk, size, 1, 0, &err); skb = sock_alloc_send_skb(sk, size, 1, 0, &err);
if(skb == NULL) if(skb == NULL) {
restore_flags(flags);
return (-ENOMEM); return (-ENOMEM);
}
skb_reserve(skb, offset); skb_reserve(skb, offset);
skb->h.raw = skb->nh.raw = skb_put(skb,sizeof(struct ipxspxhdr)); skb->h.raw = skb->nh.raw = skb_put(skb,sizeof(struct ipxspxhdr));
restore_flags(flags); restore_flags(flags);
...@@ -741,9 +743,9 @@ static int spx_sendmsg(struct socket *sock, struct msghdr *msg, int len, ...@@ -741,9 +743,9 @@ static int spx_sendmsg(struct socket *sock, struct msghdr *msg, int len,
cli(); cli();
skb = sock_alloc_send_skb(sk, size, 0, flags&MSG_DONTWAIT, &err); skb = sock_alloc_send_skb(sk, size, 0, flags&MSG_DONTWAIT, &err);
sti();
if(skb == NULL) if(skb == NULL)
return (err); return (err);
sti();
skb->sk = sk; skb->sk = sk;
skb_reserve(skb, offset); skb_reserve(skb, offset);
......
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