On thermodynamics of crystal plasticity