1. Disconnect the negative battery cable.
2. Remove the headliner.
3. Disconnect the connector.
4. Remove the screws, and then remove the sunroof motor.

Sunroof unit disassembly/assembly
Sunroof motor installationMazda 6 Service Manual: Service warnings
Component Disassembly
Disassembling and reassembling the components of the air bag system
can render the system inoperative, which may result in serious injury or
death in the event of an accident. Do not disassemble any air bag system
components.
Wiring Harness Repair
Incorrec ...
Mazda 6 Service Manual: Rear door speaker removal/installation
1. Disconnect the negative battery cable.
2. Remove the rear door trim.
3. Remove in the order indicated in the table.
4. Install in the reverse order of removal.
Rear Door Speaker Installation Note
Attach the speaker with the wiring harness placed in the groove of the door
unit panel.
...