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 ModeM Position Switch Inspection [Fw6 A EL]
Continuity Inspection
NOTE:
The M position switch is built into the selector lever component.
1. Remove the battery cover..
2. Disconnect the negative battery cable..
3. Remove the console..
4. Disconnect the selector lever component connector.
5. Verify that the continuit ...
Forced Ignition On [With Advanced Keyless Entry And Push Button Start System]
NOTE:
In order to perform a forced ignition ON, the M-MDS (IDS) is necessary. If
the servicing is being done outside of an Authorized Mazda dealership, contact
an Authorized Mazda dealership for instructions.
The forced ignition ON procedure forces a power supply to each part w ...
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 ...