ABSTRACT 4U 1954$+$31 is a high-mass X-ray binary (HMXB) that contains a neutron star (NS) and an M supergiant companion. The NS has a spin period of $\sim 5.4$ h. The traditional wind-accreting model requires an ultra-strong magnetic field for the NS to explain its extremely long spin period, which seems problematic for the NS with age of a few $10^7$ yr. In this work, we take into account the unsteady feature of wind accretion, which results in alternation of the direction of the wind matter’s angular momentum. Accordingly, the torque exerted by the accreted wind matter varies between positive and negative from time to time, and largely cancels out over long time. In such a scenario, NSs can naturally attain long spin periods without the requirement of a very strong magnetic field. This may also provide a reasonable explanation for the spin period distribution of long-period NSs in HMXBs.