8151E–AVR–02/10 (ATmega128A datasheet), p. 44 (8.8 External Clock)
... When applying an external clock, it is required to avoid sudden changes in the applied
clock frequency to ensure stable operation of the MCU. A variation in frequency of more than 2% from
one clock cycle to the next can lead to unpredictable behavior. It is required to ensure that the MCU
is kept in Reset during such changes in the clock frequency.