lkml.org 
[lkml]   [2008]   [May]   [9]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
Patch in this message
/
DateFri, 9 May 2008 22:16:36 +0200
FromTino Keitel <>
SubjectRe: Clean patch to fix not working spindown over Firewire
On Wed, Apr 30, 2008 at 15:36:36 +0200, Stefan Richter wrote:

[...]

> PS:
> If it works for all RBC devices (it should according to the spec...) &&
> your ICY Box exposes itself as RBC device (it should do so), then we
> don't need any changes to struct scsi_device and to sbp2/ firewire-sbp2.

Do you mean something like in the attached (untested) patch?

Regards,
Tino
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 01cefbb..6b927f6 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1787,8 +1787,13 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start)
 	struct scsi_device *sdp = sdkp->device;
 	int res;
 
-	if (start)
+	if (start) {
 		cmd[4] |= 1;	/* START */
+		/* active power condition */
+		cmd[4] |= (sdp->type == TYPE_RBC) ? (1 << 4) : 0; 
+	} else
+		/* standby power condition */
+		cmd[4] |= (sdp->type == TYPE_RBC) ? (3 << 4) : 0 ; 
 
 	if (!scsi_device_online(sdp))
 		return -ENODEV;
\
 
 \ /
  Last update: 2008-05-09 20:19    [from the cache]
©2003-2008