Critical constraint on inflationary magnetogenesis