He gained the grace of Lord Shiva through his wonderful devotion to his Guru, Appar, when he gladly served him food despite his son being bitten by a cobra.