Just an FYI for those who may have the SES on because of a p0411 code, YOU CAN STILL PASS SMOG IN CA. All you need to do is warm up the car, clear the codes, drive about 10 miles, check the DME that all systems are complete and you'll pass. The key is that all systems have completed.
Obviously staring at an SES light is annoying at the least, so I would still suggest doing the powerchip or bmw fix, but if you have smog coming up at least you know now.