In every STM32, the vast majority of peripherals have a reset bit in one of the RCC reset registers (RCC_AHBxRSTR or RCC_APBxRSTR). Such reset bit resets all registers in given peripheral to its reset defaults given in the respective RM.
This reset is asynchronous, i.e. it does not depend on whether given peripheral is clocked or not, and any duration of this reset is sufficient. In other words, it is always enough to toggle the given reset bit by two consecutive writes to the respective reset register.
However, as pointed out by ST, such reset must not be performed, while there is an ongoing communication with the given peripheral - e.g. from a different bus-master (e.g. DMA) - as that may result in violation of the bus protocol and subsequently in system lockup.