By default, all layer 2 ports are in dynamic desirable mode, so the layer 2 port tries to form a trunk link and sends out DTP packets to the remote device. When a layer 3 interface is connected to a layer 2 switchport, it is not able to interpret these frames, which results in the input errors. use switchport nonegotiate command to avoid any negotiation.
In order to resolve this, change the mode of the switch port to static access or trunk as per your requirement.
Switch2(config)#int fa1/0/12
Switch2(config-if)#switchport mode access