If the selector lever will not move from P using the proper shift procedure, continue to hold down the brake pedal.

Take the vehicle to an Authorized Mazda Dealer to have the system checked.
Shift-Lock System
Manual Shift ModeDSC Sensor Initialization Procedure
WARNING:
If the DSC sensor initialization procedure is not completed, the DSC will
not operate properly and it might cause an unexpected accident. Therefore, after
replacing or removing the DSC HU/CM or SAS control module, make sure to perform
the DSC sensor initialization procedure ...
Liftgate/Trunk Lid
WARNING
Never allow a person to ride in the
luggage compartment/trunk:
Allowing a person to ride in the
luggage compartment/trunk is
dangerous. The person in the luggage
compartment/trunk could be seriously
injured or killed during sudden braking
or a collision.
D ...
Oil Control Valve (OCV) Inspection [Skyactiv G 2.0]
Coil Resistance Inspection
1. Remove the battery cover..
2. Disconnect the negative battery cable..
3. Remove the plug hole plate..
4. Disconnect the OCV connector.
5. Measure the resistance between terminals A and B using an ohmmeter.
OCV coil resistance
6.9—7.5 ohms [20°C ...