Ata_link corrupted after changing ports (fixed)

I’m working on a project that tests what SATA connection your hard drive has, and so far I have used /sys/class/ata_link and the file sata_spd_limit to find the Maximum speed imposed by libata. During testing, I’ve shut down the computer and moved my secondary hard drive to a port to test if it still works. After turning the PC on, every single sata_spd_limit changed to instead of only the ones whose ports are empty.

What did I do wrong? How do I fix it?

Edit: Apparently my board only supported sata 2, where you had to have the drives connected by their order, so moving the boot drive to 0 fixed it. I’m checking if it will be ok if I will move the secondery one to another slot