Commit 9e27f077 authored by Patrick Mochel's avatar Patrick Mochel

Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin

into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-driverfs-api
parents 137973c1 8a24c0b9
...@@ -534,6 +534,8 @@ td_fill (unsigned int info, ...@@ -534,6 +534,8 @@ td_fill (unsigned int info,
/* aim for only one interrupt per urb. mostly applies to control /* aim for only one interrupt per urb. mostly applies to control
* and iso; other urbs rarely need more than one TD per urb. * and iso; other urbs rarely need more than one TD per urb.
* this way, only final tds (or ones with an error) cause IRQs. * this way, only final tds (or ones with an error) cause IRQs.
* at least immediately; use DI=6 in case any control request is
* tempted to die part way through.
* *
* NOTE: could delay interrupts even for the last TD, and get fewer * NOTE: could delay interrupts even for the last TD, and get fewer
* interrupts ... increasing per-urb latency by sharing interrupts. * interrupts ... increasing per-urb latency by sharing interrupts.
...@@ -541,7 +543,7 @@ td_fill (unsigned int info, ...@@ -541,7 +543,7 @@ td_fill (unsigned int info,
*/ */
if (index != (urb_priv->length - 1) if (index != (urb_priv->length - 1)
|| (urb->transfer_flags & URB_NO_INTERRUPT)) || (urb->transfer_flags & URB_NO_INTERRUPT))
info |= TD_DI_SET (7); info |= TD_DI_SET (6);
/* use this td as the next dummy */ /* use this td as the next dummy */
td_pt = urb_priv->td [index]; td_pt = urb_priv->td [index];
...@@ -809,12 +811,16 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci) ...@@ -809,12 +811,16 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci)
ohci->hcca->done_head = 0; ohci->hcca->done_head = 0;
while (td_list_hc) { while (td_list_hc) {
int cc;
td_list = dma_to_td (ohci, td_list_hc); td_list = dma_to_td (ohci, td_list_hc);
td_list->hwINFO |= cpu_to_le32 (TD_DONE); td_list->hwINFO |= cpu_to_le32 (TD_DONE);
if (TD_CC_GET (le32_to_cpup (&td_list->hwINFO))) { cc = TD_CC_GET (le32_to_cpup (&td_list->hwINFO));
if (cc != TD_CC_NOERROR) {
urb_priv = (urb_priv_t *) td_list->urb->hcpriv; urb_priv = (urb_priv_t *) td_list->urb->hcpriv;
/* Non-iso endpoints can halt on error; un-halt, /* Non-iso endpoints can halt on error; un-halt,
* and dequeue any other TDs from this urb. * and dequeue any other TDs from this urb.
* No other TD could have caused the halt. * No other TD could have caused the halt.
...@@ -822,12 +828,21 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci) ...@@ -822,12 +828,21 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci)
if (td_list->ed->hwHeadP & ED_H) { if (td_list->ed->hwHeadP & ED_H) {
if (urb_priv && ((td_list->index + 1) if (urb_priv && ((td_list->index + 1)
< urb_priv->length)) { < urb_priv->length)) {
#ifdef OHCI_VERBOSE_DEBUG struct urb *urb = td_list->urb;
dbg ("urb %p TD %p (%d/%d), patch ED",
td_list->urb, td_list, /* help for troubleshooting: */
dbg ("urb %p usb-%s-%s ep-%d-%s "
"(td %d/%d), "
"cc %d --> status %d",
td_list->urb,
urb->dev->bus->bus_name,
urb->dev->devpath,
usb_pipeendpoint (urb->pipe),
usb_pipein (urb->pipe)
? "IN" : "OUT",
1 + td_list->index, 1 + td_list->index,
urb_priv->length); urb_priv->length,
#endif cc, cc_to_error [cc]);
td_list->ed->hwHeadP = td_list->ed->hwHeadP =
(urb_priv->td [urb_priv->length - 1]->hwNextTD (urb_priv->td [urb_priv->length - 1]->hwNextTD
& __constant_cpu_to_le32 (TD_MASK)) & __constant_cpu_to_le32 (TD_MASK))
......
...@@ -198,7 +198,7 @@ int find_dirent_page(nfs_readdir_descriptor_t *desc) ...@@ -198,7 +198,7 @@ int find_dirent_page(nfs_readdir_descriptor_t *desc)
dfprintk(VFS, "NFS: find_dirent_page() searching directory page %ld\n", desc->page_index); dfprintk(VFS, "NFS: find_dirent_page() searching directory page %ld\n", desc->page_index);
page = read_cache_page(&inode->i_data, desc->page_index, page = read_cache_page(inode->i_mapping, desc->page_index,
(filler_t *)nfs_readdir_filler, desc); (filler_t *)nfs_readdir_filler, desc);
if (IS_ERR(page)) { if (IS_ERR(page)) {
status = PTR_ERR(page); status = PTR_ERR(page);
...@@ -566,7 +566,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, int flags) ...@@ -566,7 +566,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, int flags)
goto out_valid; goto out_valid;
shrink_dcache_parent(dentry); shrink_dcache_parent(dentry);
} }
d_drop(dentry);
unlock_kernel(); unlock_kernel();
dput(parent); dput(parent);
return 0; return 0;
...@@ -639,7 +638,7 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry) ...@@ -639,7 +638,7 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry)
nfs_renew_times(dentry); nfs_renew_times(dentry);
error = 0; error = 0;
} }
goto out; goto out_unlock;
} }
error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, &fhandle, &fattr); error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, &fhandle, &fattr);
...@@ -655,8 +654,10 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry) ...@@ -655,8 +654,10 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry)
} }
nfs_renew_times(dentry); nfs_renew_times(dentry);
} }
out_unlock:
unlock_kernel(); unlock_kernel();
out: out:
BUG_ON(error > 0);
return ERR_PTR(error); return ERR_PTR(error);
} }
...@@ -712,7 +713,7 @@ int nfs_cached_lookup(struct inode *dir, struct dentry *dentry, ...@@ -712,7 +713,7 @@ int nfs_cached_lookup(struct inode *dir, struct dentry *dentry,
desc.page_index = 0; desc.page_index = 0;
desc.plus = 1; desc.plus = 1;
for(;(page = find_get_page(&dir->i_data, desc.page_index)); desc.page_index++) { for(;(page = find_get_page(dir->i_mapping, desc.page_index)); desc.page_index++) {
res = -EIO; res = -EIO;
if (PageUptodate(page)) { if (PageUptodate(page)) {
......
...@@ -420,9 +420,9 @@ nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy) ...@@ -420,9 +420,9 @@ nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy)
kunmap(*page); kunmap(*page);
return nr; return nr;
short_pkt: short_pkt:
kunmap(*page);
printk(KERN_NOTICE "NFS: short packet in readdir reply!\n"); printk(KERN_NOTICE "NFS: short packet in readdir reply!\n");
entry[0] = entry[1] = 0; entry[0] = entry[1] = 0;
kunmap(*page);
return nr; return nr;
err_unmap: err_unmap:
kunmap(*page); kunmap(*page);
......
...@@ -574,10 +574,10 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res) ...@@ -574,10 +574,10 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res)
kunmap(*page); kunmap(*page);
return nr; return nr;
short_pkt: short_pkt:
kunmap(*page);
printk(KERN_NOTICE "NFS: short packet in readdir reply!\n"); printk(KERN_NOTICE "NFS: short packet in readdir reply!\n");
/* truncate listing */ /* truncate listing */
entry[0] = entry[1] = 0; entry[0] = entry[1] = 0;
kunmap(*page);
return nr; return nr;
err_unmap: err_unmap:
kunmap(*page); kunmap(*page);
......
...@@ -85,7 +85,9 @@ extern volatile int logical_apicid_to_cpu[MAX_APICID]; ...@@ -85,7 +85,9 @@ extern volatile int logical_apicid_to_cpu[MAX_APICID];
*/ */
#define smp_processor_id() (current_thread_info()->cpu) #define smp_processor_id() (current_thread_info()->cpu)
#define cpu_possible(cpu) (phys_cpu_present_map & (1<<(cpu))) extern volatile unsigned long cpu_callout_map;
#define cpu_possible(cpu) (cpu_callout_map & (1<<(cpu)))
#define cpu_online(cpu) (cpu_online_map & (1<<(cpu))) #define cpu_online(cpu) (cpu_online_map & (1<<(cpu)))
extern inline unsigned int num_online_cpus(void) extern inline unsigned int num_online_cpus(void)
...@@ -113,7 +115,6 @@ static __inline int logical_smp_processor_id(void) ...@@ -113,7 +115,6 @@ static __inline int logical_smp_processor_id(void)
return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR)); return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR));
} }
extern volatile unsigned long cpu_callout_map;
/* We don't mark CPUs online until __cpu_up(), so we need another measure */ /* We don't mark CPUs online until __cpu_up(), so we need another measure */
static inline int num_booting_cpus(void) static inline int num_booting_cpus(void)
{ {
......
...@@ -208,8 +208,6 @@ void page_remove_rmap(struct page * page, pte_t * ptep) ...@@ -208,8 +208,6 @@ void page_remove_rmap(struct page * page, pte_t * ptep)
} }
printk("\n"); printk("\n");
printk(KERN_ERR "page_remove_rmap: driver cleared PG_reserved ?\n"); printk(KERN_ERR "page_remove_rmap: driver cleared PG_reserved ?\n");
#else
BUG();
#endif #endif
out: out:
......
...@@ -605,17 +605,17 @@ call_status(struct rpc_task *task) ...@@ -605,17 +605,17 @@ call_status(struct rpc_task *task)
{ {
struct rpc_clnt *clnt = task->tk_client; struct rpc_clnt *clnt = task->tk_client;
struct rpc_xprt *xprt = clnt->cl_xprt; struct rpc_xprt *xprt = clnt->cl_xprt;
struct rpc_rqst *req; struct rpc_rqst *req = task->tk_rqstp;
int status = task->tk_status; int status;
if (req->rq_received != 0)
task->tk_status = req->rq_received;
dprintk("RPC: %4d call_status (status %d)\n", dprintk("RPC: %4d call_status (status %d)\n",
task->tk_pid, task->tk_status); task->tk_pid, task->tk_status);
req = task->tk_rqstp; status = task->tk_status;
if (req->rq_received != 0)
status = req->rq_received;
if (status >= 0) { if (status >= 0) {
req->rq_received = 0;
task->tk_action = call_decode; task->tk_action = call_decode;
return; return;
} }
......
...@@ -137,17 +137,14 @@ xprt_from_sock(struct sock *sk) ...@@ -137,17 +137,14 @@ xprt_from_sock(struct sock *sk)
* Also prevents TCP socket reconnections from colliding with writes. * Also prevents TCP socket reconnections from colliding with writes.
*/ */
static int static int
xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task) __xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
{ {
int retval;
spin_lock_bh(&xprt->sock_lock);
if (!xprt->snd_task) { if (!xprt->snd_task) {
if (xprt->nocong || __xprt_get_cong(xprt, task)) if (xprt->nocong || __xprt_get_cong(xprt, task))
xprt->snd_task = task; xprt->snd_task = task;
} }
if (xprt->snd_task != task) { if (xprt->snd_task != task) {
dprintk("RPC: %4d TCP write queue full (task %d)\n", dprintk("RPC: %4d TCP write queue full\n", task->tk_pid);
task->tk_pid, xprt->snd_task->tk_pid);
task->tk_timeout = 0; task->tk_timeout = 0;
task->tk_status = -EAGAIN; task->tk_status = -EAGAIN;
if (task->tk_rqstp->rq_nresend) if (task->tk_rqstp->rq_nresend)
...@@ -155,11 +152,21 @@ xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task) ...@@ -155,11 +152,21 @@ xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
else else
rpc_sleep_on(&xprt->sending, task, NULL, NULL); rpc_sleep_on(&xprt->sending, task, NULL, NULL);
} }
retval = xprt->snd_task == task; return xprt->snd_task == task;
}
static inline int
xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
{
int retval;
spin_lock_bh(&xprt->sock_lock);
retval = __xprt_lock_write(xprt, task);
spin_unlock_bh(&xprt->sock_lock); spin_unlock_bh(&xprt->sock_lock);
return retval; return retval;
} }
static void static void
__xprt_lock_write_next(struct rpc_xprt *xprt) __xprt_lock_write_next(struct rpc_xprt *xprt)
{ {
...@@ -564,8 +571,8 @@ xprt_complete_rqst(struct rpc_xprt *xprt, struct rpc_rqst *req, int copied) ...@@ -564,8 +571,8 @@ xprt_complete_rqst(struct rpc_xprt *xprt, struct rpc_rqst *req, int copied)
#endif #endif
dprintk("RPC: %4d has input (%d bytes)\n", task->tk_pid, copied); dprintk("RPC: %4d has input (%d bytes)\n", task->tk_pid, copied);
task->tk_status = copied;
req->rq_received = copied; req->rq_received = copied;
list_del_init(&req->rq_list);
/* ... and wake up the process. */ /* ... and wake up the process. */
rpc_wake_up_task(task); rpc_wake_up_task(task);
...@@ -1057,8 +1064,16 @@ xprt_transmit(struct rpc_task *task) ...@@ -1057,8 +1064,16 @@ xprt_transmit(struct rpc_task *task)
*marker = htonl(0x80000000|(req->rq_slen-sizeof(*marker))); *marker = htonl(0x80000000|(req->rq_slen-sizeof(*marker)));
} }
if (!xprt_lock_write(xprt, task)) spin_lock_bh(&xprt->sock_lock);
if (!__xprt_lock_write(xprt, task)) {
spin_unlock_bh(&xprt->sock_lock);
return; return;
}
if (list_empty(&req->rq_list)) {
list_add_tail(&req->rq_list, &xprt->recv);
req->rq_received = 0;
}
spin_unlock_bh(&xprt->sock_lock);
do_xprt_transmit(task); do_xprt_transmit(task);
} }
...@@ -1242,9 +1257,6 @@ xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt) ...@@ -1242,9 +1257,6 @@ xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
if (!xid) if (!xid)
xid++; xid++;
INIT_LIST_HEAD(&req->rq_list); INIT_LIST_HEAD(&req->rq_list);
spin_lock_bh(&xprt->sock_lock);
list_add_tail(&req->rq_list, &xprt->recv);
spin_unlock_bh(&xprt->sock_lock);
} }
/* /*
......
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