From: Lan Tianyu Date: Thu, 15 Mar 2012 03:11:31 +0000 (+0800) Subject: [SCSI] sd: Add runtime pm in the sd_check_events() X-Git-Tag: v3.4-rc1~6^2~62 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e2247b2bd289f079349d6c69755f8cff4e31f2b;p=pandora-kernel.git [SCSI] sd: Add runtime pm in the sd_check_events() The sd_check_event() will be called periodly even when the device is in the suspended status to check media event. The scsi_test_unit_ready() in the sd_check_event() will issue scsi cmd request. Issuing scsi request when the device is in the suspeneded status will cause problem. For example, when a usb flash disk in the suspended status, scsi_test_unit_ready() issues a scsi request. The request will be returned as failed because the usb device is not active. The patch adds scsi_autopm_get_device() and scsi_autopm_put_device() around scsi_test_unit_ready() in the sd_check_event() to resolve such problem. Signed-off-by: Lan Tianyu Acked-by: Alan Stern Signed-off-by: James Bottomley --- Reading git-diff-tree failed