Commit 9030eb03 authored by François Romieu's avatar François Romieu Committed by Jeff Garzik

[PATCH] via-velocity: velocity_give_rx_desc() removal

In velocity_give_rx_desc(), there should be a wmb() between resetting the
first four bytes of rdesc0 and setting owner. As resetting the first four
bytes isn't necessary, I just removed the function and directly set owner.
Another rationale for removing the function:
The function doesn't handle synchronization. We should do wmb() before
calling the function.  So, I think using bare assignment makes the fact
more explicit.
Signed-off-by: default avatarTejun Heo <tj@home-tj.org>
parent 997a0c68
...@@ -492,12 +492,6 @@ static void velocity_init_cam_filter(struct velocity_info *vptr) ...@@ -492,12 +492,6 @@ static void velocity_init_cam_filter(struct velocity_info *vptr)
} }
} }
static inline void velocity_give_rx_desc(struct rx_desc *rd)
{
*(u32 *)&rd->rdesc0 = 0;
rd->rdesc0.owner = cpu_to_le32(OWNED_BY_NIC);
}
/** /**
* velocity_rx_reset - handle a receive reset * velocity_rx_reset - handle a receive reset
* @vptr: velocity we are resetting * @vptr: velocity we are resetting
...@@ -518,7 +512,7 @@ static void velocity_rx_reset(struct velocity_info *vptr) ...@@ -518,7 +512,7 @@ static void velocity_rx_reset(struct velocity_info *vptr)
* Init state, all RD entries belong to the NIC * Init state, all RD entries belong to the NIC
*/ */
for (i = 0; i < vptr->options.numrx; ++i) for (i = 0; i < vptr->options.numrx; ++i)
velocity_give_rx_desc(vptr->rd_ring + i); vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC;
writew(vptr->options.numrx, &regs->RBRDU); writew(vptr->options.numrx, &regs->RBRDU);
writel(vptr->rd_pool_dma, &regs->RDBaseLo); writel(vptr->rd_pool_dma, &regs->RDBaseLo);
...@@ -1028,7 +1022,7 @@ static inline void velocity_give_many_rx_descs(struct velocity_info *vptr) ...@@ -1028,7 +1022,7 @@ static inline void velocity_give_many_rx_descs(struct velocity_info *vptr)
dirty = vptr->rd_dirty - unusable + 1; dirty = vptr->rd_dirty - unusable + 1;
for (avail = vptr->rd_filled & 0xfffc; avail; avail--) { for (avail = vptr->rd_filled & 0xfffc; avail; avail--) {
dirty = (dirty > 0) ? dirty - 1 : vptr->options.numrx - 1; dirty = (dirty > 0) ? dirty - 1 : vptr->options.numrx - 1;
velocity_give_rx_desc(vptr->rd_ring + dirty); vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC;
} }
writew(vptr->rd_filled & 0xfffc, &regs->RBRDU); writew(vptr->rd_filled & 0xfffc, &regs->RBRDU);
......
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