In part, here is what the service manual says:
P3497-MDS RATIONALITY BANK 2
Theory of Operation
When all criteria has been met, power is supplied to each MDS Solenoid when the engine is making a transition
from 8 cylinder mode to 4 cylinder mode. By actuating the solenoid, oil pressure is raised to the pair of lifters that
coincide with each particular solenoid. The oil pressure pushes in the locking pins that allows the lifter to collapse,
decoupling the valves and camshaft.
When Monitored:
Transition from 8 to 4 cylinder mode.
Set Condition:
O2 sensor readings on Bank 2 side indicate a lean condition while in 4 cylinder mode.
Possible Causes
INSUFFICIENT OIL PRESSURE ACTING ON THE LIFTER LOCKING PINS
OIL PASSAGES RESTRICTED
LIFTER
MDS SOLENOID
There is much more in the service manual, most of which requires the Starscan tool and engine disassembly.
How many miles are on the engine?
Have the oil and filter been changed at recommended intervals with recommended type and grade of oil?
Has the engine operating temperature been pushed to high extremes?
Do you frequently drive short distances during which the engine does not reach proper operating temperature?
Are you using the recommended octane fuel?
If I were having this problem I'd start with an engine flush followed immediately with an oil and filter change to more or less assure that the oil passages were not restricted, and go from there.