[sane-devel] Re: Sane on Ultra Sparc

T. Ribbrock emgaron at gmx.net
Fri Jan 10 00:06:55 GMT 2003


On Wed, Jan 08, 2003 at 12:23:44AM +0100, abel deuring wrote:
> Dr. Ing. Dieter Jurzitza wrote:

[Problem with Mustek Scanner on UltraSparc/Linux]

> [sanei_scsi] sanei_scsi.issue: 0x70260008
> dev_max(currently)=11 max_active_device=6 (origin 1)
>  scsi_dma_free_sectors=2192 sg_pool_secs_aval=320 def_reserved_size=32768
>  >>> device=sg5 scsi1 chan=0 id=2 lun=0   em=0 sg_tablesize=127 excl=1
>    FD(1): timeout=60000ms bufflen=131072 (res)sgat=4 low_dma=0
>    cmd_q=1 f_packid=0 k_orphan=0 closed=0
>      No requests active
> [sanei_scsi] sanei_scsi.issue: bad write (errno=22) Invalid argument -1
> 
> errno 22 is EINVAL; this error is returned by the SG driver for version 
> 3 SG headers, if the header size passed by the caller (i.e., 
> sanei_scai.c, functions sanei_scsi_req_enter and issue) in a write() or 
> read() call does not match the size expected by the SG driver.
[...]

Sorry to barge in here, but as it happens I've been stumped by the
very same problem, so I thought I'd add some data:

I've seen it happen on two different configurations (both times with a
Mustek 600 II CD Scanner):

Box 1: Sun UltraSparc 5/400, no-name Symbios 53c810 SCSI card, no SCSI
       disks, Aurora Sparc Linux 0.42 w/ kernel 2.4.20, sane-backends
       1.0.7 (as comes with Aurora 0.42) and 1.0.9 (test build from
       the tarball)

Box 2: Sun UltraSparc 1/140, on-board esd SCSI controller, two SCSI
       disks, Aurora Sparc Linux 0.42 w/ kernel 2.4.18, sane 1.0.7 and
       1.0.9.

I'll include the output from
SANE_DEBUG_SANEI_SCSI=255 sane-find-scanner -vv > logfile 2>&1
for the latter config at the end.

Note: I built only sane-backends-1.0.9 and used this command to build:
CFLAGS="-g -O -Wall" ./configure --disable-shared
(given in the README to use if you want to debug).


I can confirm the errno=22 and it occurs in the write on line 1744
(sane 1.0.9) in sane_scsi.c - not knowing sane very well, I had to use
ddd to get there... ;-)

I've used the very same scanner with Aurora 0.4, sane 1.0.7 and
kernel 2.4.18 on a SparcStation 20 SMP and with Aurora 0.32, sane 1.0.7,
kernel 2.4.18 on a SparcStation 5/170 without any problems, so my
guess would indeed be that we're talking about a 32bit<->64bit issue,
especially, as the SparcStations are using the same SCSI controller
(esd) as the UltraSparc 1.
Unfortunately, I'm not knowledgable enought to solve this myself... I
can, however, offer to run tests on my box, if that's of any help.

It would be great if this was solvable... The U5 is a good bit faster
than the SS20... ;-)

Regards,

Thomas

P.S.: I've also taken this up with the Aurora developers, but from
      what I've seen in the sane archves, it seems to be more of a
      sane problem, as it does occur with other Linux's on UltraSparc
      as well.
-- 
-----------------------------------------------------------------------------
      Thomas Ribbrock    http://www.ribbrock.org    ICQ#: 15839919
   "You have to live on the edge of reality - to make your dreams come true!"
-------------- next part --------------
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_find_devices: vendor=(null) model=(null) type=Scanner
	bus=0 chan=0 id=4 lun=0  num=2
[sanei_scsi] lx_chk_id: 0,0  0,0  4,4  0,0
[sanei_scsi] lx_chk_devicename: matched device(direct): /dev/sg2
[sanei_scsi] get_max_buffer_size for /dev/sg2: 131072
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: sanei_scsi_max_request_size=131072 bytes
[sanei_scsi] sanei_scsi_open: SG driver version: 30123
[sanei_scsi] sanei_scsi_open_extended: using 131072 bytes as SCSI buffer
[sanei_scsi] trying to enable low level command queueing
[sanei_scsi] sanei_scsi_open: Host adapter queue depth: 1
[sanei_scsi] sanei_scsi_open: SG driver can change buffer size at run time
[sanei_scsi] sanei_scsi_open: using new SG header structure
[sanei_scsi] scsi_req_enter: entered 0x70242008
[sanei_scsi] sanei_scsi.issue: 0x70242008
dev_max(currently)=9 max_active_device=3 (origin 1)
 scsi_dma_free_sectors=96 sg_pool_secs_aval=320 def_reserved_size=32768
 >>> device=sg2 scsi0 chan=0 id=4 lun=0   em=0 sg_tablesize=255 excl=1
   FD(1): timeout=120000ms bufflen=131072 (res)sgat=4 low_dma=0
   cmd_q=1 f_packid=0 k_orphan=0 closed=0
     No requests active
[sanei_scsi] sanei_scsi.issue: bad write (errno=22) Invalid argument -1
[sanei_scsi] scsi_req_enter: queue_used: 0, queue_max: 1
[sanei_scsi] sanei_scsi_req_wait: waiting for 0x70242008
[sanei_scsi] sanei_scsi.issue: 0x70242008
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: SG driver version: 30123
[sanei_scsi] sanei_scsi_open: The device found for /dev/sg0 does not look like a scanner
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: SG driver version: 30123
[sanei_scsi] sanei_scsi_open: The device found for /dev/sg1 does not look like a scanner
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: SG driver version: 30123
[sanei_scsi] sanei_scsi_open_extended: using 131072 bytes as SCSI buffer
[sanei_scsi] trying to enable low level command queueing
[sanei_scsi] sanei_scsi_open: Host adapter queue depth: 1
[sanei_scsi] sanei_scsi_open: SG driver can change buffer size at run time
[sanei_scsi] sanei_scsi_open: using new SG header structure
[sanei_scsi] scsi_req_enter: entered 0x70242008
[sanei_scsi] sanei_scsi.issue: 0x70242008
dev_max(currently)=9 max_active_device=3 (origin 1)
 scsi_dma_free_sectors=96 sg_pool_secs_aval=320 def_reserved_size=32768
 >>> device=sg2 scsi0 chan=0 id=4 lun=0   em=0 sg_tablesize=255 excl=1
   FD(1): timeout=120000ms bufflen=131072 (res)sgat=4 low_dma=0
   cmd_q=1 f_packid=0 k_orphan=0 closed=0
     No requests active
[sanei_scsi] sanei_scsi.issue: bad write (errno=22) Invalid argument -1
[sanei_scsi] scsi_req_enter: queue_used: 0, queue_max: 1
[sanei_scsi] sanei_scsi_req_wait: waiting for 0x70242008
[sanei_scsi] sanei_scsi.issue: 0x70242008
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sg3' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sg4' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sg5' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sg6' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sg7' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sg8' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sg9' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: SG driver version: 30123
[sanei_scsi] sanei_scsi_open: The device found for /dev/sga does not look like a scanner
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: SG driver version: 30123
[sanei_scsi] sanei_scsi_open: The device found for /dev/sgb does not look like a scanner
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: SG driver version: 30123
[sanei_scsi] sanei_scsi_open_extended: using 131072 bytes as SCSI buffer
[sanei_scsi] trying to enable low level command queueing
[sanei_scsi] sanei_scsi_open: Host adapter queue depth: 1
[sanei_scsi] sanei_scsi_open: SG driver can change buffer size at run time
[sanei_scsi] sanei_scsi_open: using new SG header structure
[sanei_scsi] scsi_req_enter: entered 0x70242008
[sanei_scsi] sanei_scsi.issue: 0x70242008
dev_max(currently)=9 max_active_device=3 (origin 1)
 scsi_dma_free_sectors=96 sg_pool_secs_aval=320 def_reserved_size=32768
 >>> device=sg2 scsi0 chan=0 id=4 lun=0   em=0 sg_tablesize=255 excl=1
   FD(1): timeout=120000ms bufflen=131072 (res)sgat=4 low_dma=0
   cmd_q=1 f_packid=0 k_orphan=0 closed=0
     No requests active
[sanei_scsi] sanei_scsi.issue: bad write (errno=22) Invalid argument -1
[sanei_scsi] scsi_req_enter: queue_used: 0, queue_max: 1
[sanei_scsi] sanei_scsi_req_wait: waiting for 0x70242008
[sanei_scsi] sanei_scsi.issue: 0x70242008
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgd' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sge' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgf' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgg' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgh' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgi' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgj' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgk' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgl' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgm' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgn' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgo' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgp' failed: No such device or address
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgq' failed: No such file or directory
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgr' failed: No such file or directory
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgs' failed: No such file or directory
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgt' failed: No such file or directory
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgu' failed: No such file or directory
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgv' failed: No such file or directory
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgw' failed: No such file or directory
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgx' failed: No such file or directory
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgy' failed: No such file or directory
[sanei_debug] Setting debug level of sanei_scsi to 255.
[sanei_scsi] sanei_scsi_open: open of `/dev/sgz' failed: No such file or directory

searching for SCSI scanners:
checking /dev/scanner... open ok
inquiry for device /dev/scanner failed (Error during device I/O)
checking /dev/sg0... failed to open (Invalid argument)
checking /dev/sg1... failed to open (Invalid argument)
checking /dev/sg2... open ok
inquiry for device /dev/sg2 failed (Error during device I/O)
checking /dev/sg3... failed to open (Invalid argument)
checking /dev/sg4... failed to open (Invalid argument)
checking /dev/sg5... failed to open (Invalid argument)
checking /dev/sg6... failed to open (Invalid argument)
checking /dev/sg7... failed to open (Invalid argument)
checking /dev/sg8... failed to open (Invalid argument)
checking /dev/sg9... failed to open (Invalid argument)
checking /dev/sga... failed to open (Invalid argument)
checking /dev/sgb... failed to open (Invalid argument)
checking /dev/sgc... open ok
inquiry for device /dev/sgc failed (Error during device I/O)
checking /dev/sgd... failed to open (Invalid argument)
checking /dev/sge... failed to open (Invalid argument)
checking /dev/sgf... failed to open (Invalid argument)
checking /dev/sgg... failed to open (Invalid argument)
checking /dev/sgh... failed to open (Invalid argument)
checking /dev/sgi... failed to open (Invalid argument)
checking /dev/sgj... failed to open (Invalid argument)
checking /dev/sgk... failed to open (Invalid argument)
checking /dev/sgl... failed to open (Invalid argument)
checking /dev/sgm... failed to open (Invalid argument)
checking /dev/sgn... failed to open (Invalid argument)
checking /dev/sgo... failed to open (Invalid argument)
checking /dev/sgp... failed to open (Invalid argument)
checking /dev/sgq... failed to open (Invalid argument)
checking /dev/sgr... failed to open (Invalid argument)
checking /dev/sgs... failed to open (Invalid argument)
checking /dev/sgt... failed to open (Invalid argument)
checking /dev/sgu... failed to open (Invalid argument)
checking /dev/sgv... failed to open (Invalid argument)
checking /dev/sgw... failed to open (Invalid argument)
checking /dev/sgx... failed to open (Invalid argument)
checking /dev/sgy... failed to open (Invalid argument)
checking /dev/sgz... failed to open (Invalid argument)
  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a SCSI driver for your SCSI adapter.

searching for USB scanners:
checking /dev/usb/scanner... failed to open (Invalid argument)
checking /dev/usb/scanner0... failed to open (Invalid argument)
checking /dev/usb/scanner1... failed to open (Invalid argument)
checking /dev/usb/scanner2... failed to open (Invalid argument)
checking /dev/usb/scanner3... failed to open (Invalid argument)
checking /dev/usb/scanner4... failed to open (Invalid argument)
checking /dev/usb/scanner5... failed to open (Invalid argument)
checking /dev/usb/scanner5... failed to open (Invalid argument)
checking /dev/usb/scanner7... failed to open (Invalid argument)
checking /dev/usb/scanner8... failed to open (Invalid argument)
checking /dev/usb/scanner9... failed to open (Invalid argument)
checking /dev/usb/scanner10... failed to open (Invalid argument)
checking /dev/usb/scanner11... failed to open (Invalid argument)
checking /dev/usb/scanner12... failed to open (Invalid argument)
checking /dev/usb/scanner13... failed to open (Invalid argument)
checking /dev/usb/scanner14... failed to open (Invalid argument)
checking /dev/usb/scanner15... failed to open (Invalid argument)
checking /dev/usbscanner... failed to open (Invalid argument)
checking /dev/usbscanner0... failed to open (Invalid argument)
checking /dev/usbscanner1... failed to open (Invalid argument)
checking /dev/usbscanner2... failed to open (Invalid argument)
checking /dev/usbscanner3... failed to open (Invalid argument)
checking /dev/usbscanner4... failed to open (Invalid argument)
checking /dev/usbscanner5... failed to open (Invalid argument)
checking /dev/usbscanner6... failed to open (Invalid argument)
checking /dev/usbscanner7... failed to open (Invalid argument)
checking /dev/usbscanner8... failed to open (Invalid argument)
checking /dev/usbscanner9... failed to open (Invalid argument)
checking /dev/usbscanner10... failed to open (Invalid argument)
checking /dev/usbscanner11... failed to open (Invalid argument)
checking /dev/usbscanner12... failed to open (Invalid argument)
checking /dev/usbscanner13... failed to open (Invalid argument)
checking /dev/usbscanner14... failed to open (Invalid argument)
checking /dev/usbscanner15... failed to open (Invalid argument)
  # No USB scanners found. If you expected something different, make sure that
  # you have loaded a driver for your USB host controller and have installed a
  # kernel scanner module.

  # Scanners connected to the parallel port or other proprietary ports can't be
  # detected by this program.
done


More information about the sane-devel mailing list