I have this board GA-Z170X-GAMING G5, and bought a M.2 stick of Samsung 950 pro to put it on. The stick works good on the upper slot, but it makes the SATA ports to cease functioning normally, the BIOS fail to detect any drives in every SATA 6gb connectors. If I remove the M.2 stick, the SATA connections are populating again in BIOS. The good news is it only happening with the upper slot (M2D-32gb) , if I connect the M.2 SSD on the second slot (M2H-32gb), everything works great. Still, I could use the other slot in the future, and I never been able to find a working solution.
I upgraded the BIOS to F5h as well and the problem persist.