# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/09/13 12:55:57+09:00 tj@xxxxxxxxxxxxxxxx # 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. # # drivers/net/via-velocity.c # 2004/09/13 12:55:46+09:00 tj@xxxxxxxxxxxxxxxx +2 -8 # 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. # diff -Nru a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c --- a/drivers/net/via-velocity.c 2004-09-13 13:49:01 +09:00 +++ b/drivers/net/via-velocity.c 2004-09-13 13:49:01 +09:00 @@ -492,12 +492,6 @@ } } -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 * @vptr: velocity we are resetting @@ -518,7 +512,7 @@ * Init state, all RD entries belong to the NIC */ 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, ®s->RBRDU); writel(vptr->rd_pool_dma, ®s->RDBaseLo); @@ -1028,7 +1022,7 @@ dirty = vptr->rd_dirty - unusable + 1; for (avail = vptr->rd_filled & 0xfffc; avail; avail--) { 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, ®s->RBRDU);