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: Range of topics
This manual contains procedures for performing all required service
operations. The procedures are divided into the following five basic
operations:
Removal/Installation
Disassembly/Assembly
Replacement
Inspection
Adjustment
Simple operations which can be perf ...
Mazda 6 Owners Manual: Control valve body removal
On-Vehicle Removal
Warning
Using compressed air can cause dirt and other particles to fly
out, causing injury to the eyes. Wear protective eyes whenever using
compressed air.
Caution
Clean the transaxle exterior throughout with a steam cleaner or
cleaning solvents before removal ...