Mavericks beat Suns, grab playoff berth