Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25015
b: refs/heads/master
c: 758a613
h: refs/heads/master
i:
  25013: f6d6916
  25011: b5e5c7c
  25007: 7e3ee42
v: v3
  • Loading branch information
David S. Miller committed Apr 1, 2006
1 parent 93fad5c commit fb28648
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 56 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 29e350944fdc2dfca102500790d8ad6d6ff4f69d
refs/heads/master: 758a613936223699f99081fc75eff7cf67b208f6
1 change: 0 additions & 1 deletion trunk/arch/powerpc/kernel/systbl.S
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,3 @@ SYSCALL(spu_create)
COMPAT_SYS(pselect6)
COMPAT_SYS(ppoll)
SYSCALL(unshare)
SYSCALL(splice)
53 changes: 23 additions & 30 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,40 +497,33 @@ static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val)
unsigned long flags;

spin_lock_irqsave(&tp->indirect_lock, flags);
if (tp->write32 != tg3_write_indirect_reg32) {
tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, off);
tw32_f(TG3PCI_MEM_WIN_DATA, val);
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);

/* Always leave this as zero. */
tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, 0);
} else {
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);

/* Always leave this as zero. */
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
}
/* Always leave this as zero. */
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
spin_unlock_irqrestore(&tp->indirect_lock, flags);
}

static void tg3_write_mem_fast(struct tg3 *tp, u32 off, u32 val)
{
/* If no workaround is needed, write to mem space directly */
if (tp->write32 != tg3_write_indirect_reg32)
tw32(NIC_SRAM_WIN_BASE + off, val);
else
tg3_write_mem(tp, off, val);
}

static void tg3_read_mem(struct tg3 *tp, u32 off, u32 *val)
{
unsigned long flags;

spin_lock_irqsave(&tp->indirect_lock, flags);
if (tp->write32 != tg3_write_indirect_reg32) {
tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, off);
*val = tr32(TG3PCI_MEM_WIN_DATA);
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
pci_read_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);

/* Always leave this as zero. */
tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, 0);
} else {
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
pci_read_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);

/* Always leave this as zero. */
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
}
/* Always leave this as zero. */
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
spin_unlock_irqrestore(&tp->indirect_lock, flags);
}

Expand Down Expand Up @@ -1374,12 +1367,12 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
}
}

tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);

/* Finally, set the new power state. */
pci_write_config_word(tp->pdev, pm + PCI_PM_CTRL, power_control);
udelay(100); /* Delay after power state change */

tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);

return 0;
}

Expand Down Expand Up @@ -6547,11 +6540,11 @@ static void tg3_timer(unsigned long __opaque)
if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) {
u32 val;

tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX,
FWCMD_NICDRV_ALIVE2);
tg3_write_mem(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4);
tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_MBOX,
FWCMD_NICDRV_ALIVE2);
tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4);
/* 5 seconds timeout */
tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5);
tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5);
val = tr32(GRC_RX_CPU_EVENT);
val |= (1 << 14);
tw32(GRC_RX_CPU_EVENT, val);
Expand Down
25 changes: 4 additions & 21 deletions trunk/fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static struct pipe_buf_operations page_cache_pipe_buf_ops = {

static ssize_t move_to_pipe(struct inode *inode, struct page **pages,
int nr_pages, unsigned long offset,
unsigned long len, unsigned int flags)
unsigned long len)
{
struct pipe_inode_info *info;
int ret, do_wakeup, i;
Expand Down Expand Up @@ -159,12 +159,6 @@ static ssize_t move_to_pipe(struct inode *inode, struct page **pages,
break;
}

if (flags & SPLICE_F_NONBLOCK) {
if (!ret)
ret = -EAGAIN;
break;
}

if (signal_pending(current)) {
if (!ret)
ret = -ERESTARTSYS;
Expand Down Expand Up @@ -197,7 +191,7 @@ static ssize_t move_to_pipe(struct inode *inode, struct page **pages,
}

static int __generic_file_splice_read(struct file *in, struct inode *pipe,
size_t len, unsigned int flags)
size_t len)
{
struct address_space *mapping = in->f_mapping;
unsigned int offset, nr_pages;
Expand Down Expand Up @@ -285,7 +279,7 @@ static int __generic_file_splice_read(struct file *in, struct inode *pipe,
* Now we splice them into the pipe..
*/
splice_them:
return move_to_pipe(pipe, pages, i, offset, len, flags);
return move_to_pipe(pipe, pages, i, offset, len);
}

ssize_t generic_file_splice_read(struct file *in, struct inode *pipe,
Expand All @@ -297,19 +291,14 @@ ssize_t generic_file_splice_read(struct file *in, struct inode *pipe,
ret = 0;
spliced = 0;
while (len) {
ret = __generic_file_splice_read(in, pipe, len, flags);
ret = __generic_file_splice_read(in, pipe, len);

if (ret <= 0)
break;

in->f_pos += ret;
len -= ret;
spliced += ret;

if (!(flags & SPLICE_F_NONBLOCK))
continue;
ret = -EAGAIN;
break;
}

if (spliced)
Expand Down Expand Up @@ -538,12 +527,6 @@ static ssize_t move_from_pipe(struct inode *inode, struct file *out,
break;
}

if (flags & SPLICE_F_NONBLOCK) {
if (!ret)
ret = -EAGAIN;
break;
}

if (signal_pending(current)) {
if (!ret)
ret = -ERESTARTSYS;
Expand Down
3 changes: 0 additions & 3 deletions trunk/include/linux/pipe_fs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,5 @@ void free_pipe_info(struct inode* inode);
* add the splice flags here.
*/
#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */
#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */
/* we may still block on the fd we splice */
/* from/to, of course */

#endif

0 comments on commit fb28648

Please sign in to comment.