[PATCH 2/2] talitos: Freescale integrated security engine (SEC) driver

Kim Phillips kim.phillips at freescale.com
Tue Jun 3 05:06:03 EST 2008


On Mon, 2 Jun 2008 21:57:51 +0400
Evgeniy Polyakov <johnpol at 2ka.mipt.ru> wrote:

> On Mon, Jun 02, 2008 at 11:50:21AM -0500, Kim Phillips (kim.phillips at freescale.com) wrote:
> > > But can it be changed? You write to it without lock, but read under the
> > > one (different for each channel though), so it attracted attention.
> > 
> > can you point where in the code your concern is?
> 
> talitos_submit() writes to hdr (initially I think?) without locks.

ok, the desc whose hdr is being written was allocated by
talitos_submit's caller, and it hasn't been made part of the circular
buffer at that point.  It becomes a part of the buffer (eligible for
contention with the consumer side) when desc is assigned.

> It is read in flush_channel() under tail lock, but then it is dropped,
> so I rised a question, if it can be modified during that time, since if
> it can, status value, calculated from it, can be different and thus
> error check result can be false. Or this is not an issue?

it would be an issue if flush_cannel didn't save off the data required
to call the callback with in saved_req.  flush_channel does this on
purpose to be able to call the callback outside of lock (as is
commented).  Note desc gets assigned NULL prior to releasing the lock,
after copying its contents to saved_req.

Kim



More information about the Linuxppc-dev mailing list