Re: Hack to fix not working spindown over Firewire

Stefan Richter
2008-04-30T13:37:52Z

I wrote:
> Tino Keitel wrote:
>> @@ -1788,8 +1788,16 @@ 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 */
>> + if(!strncmp(sdp->vendor, "WDC WD32", 8)) {
>> + cmd[4] |= (1 << 4); /* power condition */
>> + }
>> + } else {
>> + if(!strncmp(sdp->vendor, "WDC WD32", 8)) {
>> + cmd[4] |= (2 << 4); /* power condition */
>> + }
>> + }
>>
>> if (!scsi_device_online(sdp))
>> return -ENODEV;
>
[...]
> The traditional way to handle things like this is:
>
> - Implement this as a workaround in sd.
>
> - Make this workaround conditional on a quirks flag in
> struct scsi_device.
>
> - Switch this flag on in a place where it can be reliably
> detected that this device needs it. There is an interface
> to do this in userspace. But in this particular case, the
> best place is the sbp2 driver (ond firewire-sbp2 driver),
> because it can detect PL-3507 firmwares by means of firmware
> identifiers.
[...]
> On the other hand, perhaps we can enable the workaround unconditional
> for all firewire disks (switch in the flag in sbp2 and firewire-sbp2
> without looking at the device) or for all RBC disks (switch on the flag
> in sd.c if sdev->type == TYPE_RBC).

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.
--
Stefan Richter
-=====-==--- -=-- ====-