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 ModeElectric Variable Valve Timing Motor/Driver Removal/Installation [Skyactiv G
2.0]
WARNING:
A hot engine can cause severe burns. Turn off the engine and wait until it
is cool before servicing.
CAUTION:
Applying excessive force (force of 100 N {10.2 kgf, 22.5 lbf} or more) to
the electric variable valve timing motor/driver may cause a malfunction. When
...
Brakes SST
49 D043 0A0
Adapter set
49 U043 0A0A
Oil pressure gauge set
49 0221 600C
Disc brake expand tool
49 B033 001
Installer
49 G033 102
Handle
...
Floor Covering Removal/Installation
1. Disconnect the negative battery cable..
2. Remove the following parts:
a. Front seat.
b. Audio amplifier (Vehicles with Bose®).
c. Front scuff plate.
d. Joint cover.
e. Front side trim.
f. Fuel-filler lid opener lever bezel.
g. Selector lever knob (ATX).
h. Shift lever knob (MT ...