I did some research in various repair sites and concluded that it was the water valve. The other possibility was the control panel, but the washer was doing other action like the spin cycle.
I changed the water valve, and the problem was solved. There are various sites showing how to do the job. It is easy.