[sane-devel] a second try

Henning Meier-Geinitz henning at meier-geinitz.de
Sun Jul 31 13:10:50 UTC 2005


On Tue, Jul 26, 2005 at 05:35:06PM +0200, Dieter Jurzitza wrote:
> Mr. Meier - Geinitz, yes, you are right, the code did not change. But this 
> could be the problem.

I've tried to reproduce your problem with the Mustek ScanExpress 6000
SP and all worked well. Unfortunately that scanner doesn't seem to
fall asleep at all (at least not during the one hour I waited).

> The default value for the timeout related issues within this interface is 
> derived from the HZ-value (?).
> This changed from kernel 2.4 to 2.6, isn't it? Well ... I did what Martin 
> suggested and the scanner worked by setting the environment-variable to ~300. 

HZ changed inside the kernel, it didn't change for user programs:

#ifdef __KERNEL__
# define HZ             1000            /* Internal kernel timer frequency */
# define USER_HZ        100             /* .. some user interfaces are in "ticks" */
# define CLOCKS_PER_SEC         (USER_HZ)       /* like times() */

#ifndef HZ
#define HZ 100

I haven't checked the source bu I guess SG_SET_TIMEOUT inside the
kernel uses USER_HZ.

> the HZ value is used here for actually configuring - I would really appreciate 
> if someone could check. (But I did not find a place where SG_SET_TIMEOUT is 
> set ...)

Defined in /usr/include/scsi/sg.h, code is in drivers/scsi/sg.c of
linux kernel.


More information about the sane-devel mailing list