On Tue, Jul 05, 2011 at 10:15:08AM +0330, Hamid Nassiby wrote: > > and preferably to : > > /* Critical PSEUDO code */ > /* distinct locks for write_to_device and read_from_device */ > spin_lock_irqsave(&lock1, flag1); > write_to_device(op, 0, my_req_id); > spin_unlock_irqrestore(&lock1, flag1); > > spin_lock_irqsave(&lock2, flag2); > ret = read_from_device(op, 0, my_req_id); > spin_unlock_irqrestore(&lock2, flag2); > /* End of Critical PSEUDO*/ > > > Here, it seems we must have no problem, but as soon as one TCP flow starts > the system hangs. Do you know why it hangs? It sounds like the problem isn't with the synchronisation itself, which at worst will produce bogus packets, but something else in your code that is leading to the dead-lock. Please enable lockdep and related debugging features to track down the problem. Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html