You could scrape off the loose paint to a firm edge… then apply a coat of oil base EXTERIOR sealer primer to All Of It… then finish coat with a high grade Exterior Oil Base Porch & Deck Paint (1 coat to cover)… (Optionally you could SPACKLE all the scraped firm edges to give a smoother finish, before priming but this step is really not required for most outside work)! Good Luck…