Linear charger is ok.
Both voltage feedback loop and current feedback loop are needed.
The maximum output current of USB is 500mA, the current feedback loop must limit the charge current within 500mA.
The linear charger is heater than DCDC charger. When VDD=5V, VBAT=3V and charge current 400mA, the power of charger chip is 800mW.