lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tkrat.606fe302c67e64b4@s5r6.in-berlin.de>
Date:	Fri, 9 May 2008 23:13:41 +0200 (CEST)
From:	Stefan Richter <stefanr@...6.in-berlin.de>
To:	Tino Keitel <tino.keitel@....de>
cc:	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org
Subject: Re: Clean patch to fix not working spindown over Firewire

On  9 May, Tino Keitel wrote:
> On Wed, Apr 30, 2008 at 15:36:36 +0200, Stefan Richter wrote:
>> 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;

Yes, that's what I meant.  Would you test it on your disks and, if it
works, repost to LSML with your Signed-off-by line?
(See linux/Documentation/SubmittingPatches.)

Or write it as

 	if (start)
 		cmd[4] |= 1;	/* START */
+
+	if (sdp->type == TYPE_RBC)
+		cmd[4] |= start ? 1 << 4 : 3 << 4;	/* POWER CONDITION */


Alas the test for TYPE_RBC is not ideal.  As I wrote in my other mail,
there are some SBP-2 disks which pose as TYPE_DISK.  It's not a big
problem though because almost all of them also work with POWER
CONDITION = 0.  The only exception is DViCO Momobay CX-1 which goes
belly-up POWER CONDITION = 0 and START = 0.  Maybe I should simply
overwrite the CX-1's sdp->type by TYPE_RBC.  I suspect that this is what
it implements anyway.  The firmwares of the later Momobay models FX-3A
and IIRC CX-2 do so.
-- 
Stefan Richter
-=====-==--- -=-= -=--=
http://arcgraph.de/sr/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ