On Fri, Sep 21, 2012 at 12:07:23AM +0200, Rafael J. Wysocki wrote: > On Wednesday, September 12, 2012, Aaron Lu wrote: > > static struct scsi_driver sr_template = { > > .owner = THIS_MODULE, > > @@ -87,6 +89,8 @@ static struct scsi_driver sr_template = { > > .name = "sr", > > .probe = sr_probe, > > .remove = sr_remove, > > + .suspend = sr_suspend, > > + .resume = sr_resume, > > }, > > .done = sr_done, > > }; > > @@ -172,6 +176,52 @@ static void scsi_cd_put(struct scsi_cd *cd) > > mutex_unlock(&sr_ref_mutex); > > } > > Besides, I need some help to understand how this is supposed to work. > > Do I think correctly that sr_suspend(), for example, will be run by the > SCSI bus type layer in case of a CD device runtime suspend? However, Yes. > won't this routine be used during system suspend as well and won't it cause > problems to happen if so? On system suspend, nothing needs to be done. I'll add the following code in next version. if (!PMSG_IS_AUTO(msg)) return 0; Thanks, Aaron -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html