I've read many reports that the SDM autofocus motor in some Pentax lenses may stop working after several months or years of use. Why does this happen, and is there anything I can do to prevent failure or restore a lens with a failed SDM (aside from sending it in for repair)?
An answer that might help you is what I did when one of my lenses failed. I still use the K10D body and so I reverted to an earlier version of the firmware (1.2). This forced the camera to use all SDM lenses as screwmount. If you have a K10D body that hasn't been updated to 1.31 firmware, you can revert via a hex hack.
This is the only way that I know to still use AF with the SDM lenses when they fail.
When 2 of mine failed, the solution was the same: Send it back to the manufacturer. Once it was under warranty, the other time it was not. Pentax is notoriously slow at servicing parts and, sadly, it took between 2 and 4 months to get the lenses back.
These were some of their earliest lenses which had more problems. This has not happened with any of my newer lenses. Not sure if there was anything to do other than not use autofocus. It seems like a wear-and-tear issue because before mine failed, the AF was getting slower and slower on one lens and on the other it stopped working for certain distances. Eventually it stopped completely. Now since this was in the K20D times, maybe I would have just used MF for the out-of-warranty one, it is easy to focus faster than a K20D by hand :)
My first lesson learned here was that if you have a backup camera body, a lens eventually fails. Since then, I have both backup bodies and backup lenses.