H1-stability of an L2-type method on general nonuniform meshes for subdiffusion equation