phy: fix phy_id detection also for broken hardware.