The sunshade can be opened and closed by hand.
The sunshade opens automatically when the moonroof is opened, but must be closed by hand.

CAUTION
Jam-safe Moonroof
Security SystemMazda 6 Owners Manual: Running light unit inspection
1. Connect the connector to the running light unit.
2. Connect the negative battery cable.
3. Measure the voltage at the running light unit using voltmeter.
When inspecting terminal D, H or P for continuity, disconnect the running light unit connector.
4. If the value are not as specif ...
Mazda 6 Owners Manual: Electrical parts
Battery cable
Before disconnecting connectors or removing electrical parts, disconnect
the negative battery cable.
Wiring Harness
To remove the wiring harness from the clip in the
engine room, pry up the hook of the clip using a
flathead screwdriver.
...