Avast has nothing to do with the mode of your storage ports; not in the BIOS nor in your OS. At most, avast was indirectly (and unintentionally) showing you the problem, but was not the source of it.

JFYI, before reinstalling avast (whenever you do), uninstall any other security tool and run the respective removal utility (http://singularlabs.com/uninstallers/security-software/) under Windows Safe Mode. This will reduce conflicts between security tools.