Only the head needs protection and if it was too loose it would have fallen off so you had no risk. No reason to test or take PEP.
The only ways HIV is transmitted is unprotected anal or vaginal sex or sharing IV drug needles. A halfway down but still covering the head of your penis condom issue is still giving you a barrier of protection so you did not risk hiv.