Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: msk(4) require to sync status buffer



Hi! tsutsui-san,


From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
Date: Sun, 24 Feb 2008 14:57:31 +0900

> kiyohara%kk.iij4u.or.jp@localhost wrote:

> > @@ -1841,8 +1841,7 @@
> >             msk_intr_yukon(sc_if1);
> >     }
> >  
> > -   MSK_CDSTSYNC(sc, sc->sk_status_idx,
> > -       BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
> > +   MSK_CDSTSYNC(sc, sc->sk_status_idx, BUS_DMASYNC_POSTREAD);
> >     cur_st = &sc->sk_status_ring[sc->sk_status_idx];
> >  
> >     while (cur_st->sk_opcode & SK_Y2_STOPC_OWN) {
> 
> Hmm, if msk_status_desc has only data transfered from device
> to memory, we don't have to have POSTWRITE (or PREWRITE).

I should have understood that msk read opcode of msk_status_desc.  X-<


> > @@ -1872,12 +1871,17 @@
> >                     aprint_error("opcode=0x%x\n", cur_st->sk_opcode);
> >                     break;
> >             }
> > +           /* Write back after clearing SK_Y2_STOPC_OWN of opcode */
> > +           MSK_CDSTSYNC(sc, sc->sk_status_idx,
> > +               BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
> > +
> 
> Why do you say "write back" here?
> 
> If there is no date transfered from memory to the device,
> no writeback is needed.

"write back" comment no necessary.


> >             SK_INC(sc->sk_status_idx, MSK_STATUS_RING_CNT);
> >  
> > -           MSK_CDSTSYNC(sc, sc->sk_status_idx,
> > -               BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
> > +           MSK_CDSTSYNC(sc, sc->sk_status_idx, BUS_DMASYNC_POSTREAD);
> 
> This seems okay as the first one in this function.

This change no need.


> >             cur_st = &sc->sk_status_ring[sc->sk_status_idx];
> >     }
> > +   /* Invalidate the status buffer that has already been cached */
> > +   MSK_CDSTSYNC(sc, sc->sk_status_idx, BUS_DMASYNC_PREREAD);
> 
> In your patch, only the last descriptor gets PREREAD op,
> i.e. the rest DMA descriptors are not flushed from cache.
> (then you had to add extra PREREAD op in the above?)
> You have to call PREREAD op after sk_status_ring is fetched
> in while loop.

Why?
I have MSK_CDSTSYNCed with the comment for "write back" on the previous
state.

However, I can't feel after neither this machine and msk from tomorrow
for a while. (about 1 or 2 week?  ;-<
--
kiyohara


Home | Main Index | Thread Index | Old Index