sane-project-website/old-archive/2001-01/0122.html

166 wiersze
6.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>sane-devel: Re: sanei_scsi_cmd / snapscan / Prisa640S</TITLE>
<META NAME="Author" CONTENT="Douglas Gilbert (dgilbert@interlog.com)">
<META NAME="Subject" CONTENT="Re: sanei_scsi_cmd / snapscan / Prisa640S">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Re: sanei_scsi_cmd / snapscan / Prisa640S</H1>
<!-- received="Thu Jan 11 07:22:27 2001" -->
<!-- isoreceived="20010111152227" -->
<!-- sent="Thu, 11 Jan 2001 10:43:54 -0500" -->
<!-- isosent="20010111154354" -->
<!-- name="Douglas Gilbert" -->
<!-- email="dgilbert@interlog.com" -->
<!-- subject="Re: sanei_scsi_cmd / snapscan / Prisa640S" -->
<!-- id="3A5DD4BA.C5A12C27@interlog.com" -->
<!-- inreplyto="200101101019.LAA10500@siegel.math.uni-frankfurt.de" -->
<STRONG>From:</STRONG> Douglas Gilbert (<A HREF="mailto:dgilbert@interlog.com?Subject=Re:%20sanei_scsi_cmd%20/%20snapscan%20/%20Prisa640S&In-Reply-To=&lt;3A5DD4BA.C5A12C27@interlog.com&gt;"><EM>dgilbert@interlog.com</EM></A>)<BR>
<STRONG>Date:</STRONG> Thu Jan 11 2001 - 07:43:54 PST
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0123.html">Joseph chock: "Dynotak 6P parallel port scanner . . ."</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0121.html">Douglas Gilbert: "Re: MICROTEK2 failure : out of memory with kernel 2.4"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0108.html">Christian Nassau: "sanei_scsi_cmd / snapscan / Prisa640S"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0128.html">Christian Nassau: "Re: sanei_scsi_cmd / snapscan / Prisa640S"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0128.html">Christian Nassau: "Re: sanei_scsi_cmd / snapscan / Prisa640S"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#122">[ date ]</A>
<A HREF="index.html#122">[ thread ]</A>
<A HREF="subject.html#122">[ subject ]</A>
<A HREF="author.html#122">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Christian Nassau wrote:
<BR>
<EM>&gt;
</EM><BR>
<EM>&gt; I'm currently trying to get an Acer ScanPrisa640S (patched atp870u
</EM><BR>
<EM>&gt; scsi driver, kernel version 2.2.16) working with a (modified) snapscan
</EM><BR>
<EM>&gt; backend. I had the following problem...
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; aborting scanimage in the middle of a scan with CRTL-C leads
</EM><BR>
<EM>&gt; to a system lock (requiring an instant reboot).
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; ...and have found that sanei_scsi_cmd(..) only protects the
</EM><BR>
<EM>&gt; scsi read and write instructions individually against user
</EM><BR>
<EM>&gt; breaks. The SCSI-Programming-FAQ (dated 1997) that I have says
</EM><BR>
<EM>&gt; that the **pair** (write/read) has to be protected, because
</EM><BR>
<EM>&gt; otherwise very bad things will happen... (depending on the
</EM><BR>
<EM>&gt; kernel version)...
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; ... so, I've created a wrapper &quot;sanei_scsi_protected_cmd(..)&quot; and
</EM><BR>
<EM>&gt; made snapscan use this function, and -- alas! -- userbreaks are
</EM><BR>
<EM>&gt; safe now.
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; Couldn't one make sanei_scsi_cmd(..) protected by default, or at
</EM><BR>
<EM>&gt; least provide a protected alternative? (or make the Makefile decide
</EM><BR>
<EM>&gt; which one to install, based on the kernel version?)
</EM><BR>
<P>Christian,
<BR>
Almost 2 years ago, the Linux sg driver was secured against
<BR>
a control-C induced failures. The latest SCSI-Programming-HOWTO
<BR>
that I can find is dated 7th May 1996 and what it said was
<BR>
correct then. Are you using the sg driver that came with
<BR>
lk 2.2.16 ?
<BR>
<P>The level of protection provided against a control-C
<BR>
prematurely terminating the sane process is to safely
<BR>
receive and dispose of any responses that arrive after
<BR>
the sg device fds have been closed. It is possible that
<BR>
the scanner gets upset because a subsequent SCSI command
<BR>
(e.g. RECEIVE) is not transmitted.
<BR>
<P>To debug such a lockup is difficult. Do the CapsLock and
<BR>
NumLock keys still operate the LEDs on the keyboard? If
<BR>
so, Alt-SysRq (&quot;p&quot; and &quot;t&quot;) may gather some information.
<BR>
Do you have a SCSI disk with your root partition on
<BR>
the same SCSI bus as the scanner?
<BR>
<P>So I think you have a very &quot;special&quot; case that does
<BR>
not require the sanei interface to be changed. The
<BR>
problem with such a lock, is that it will make SANE
<BR>
inoperable for the timeout period (often 10 minutes)
<BR>
if the scanner locks up before sending a response.
<BR>
<P>Doug Gilbert
<BR>
<P><PRE>
--
Source code, list archive, and docs: <A HREF="http://www.mostang.com/sane/">http://www.mostang.com/sane/</A>
To unsubscribe: echo unsubscribe sane-devel | mail <A HREF="mailto:majordomo@mostang.com?Subject=Re:%20sanei_scsi_cmd%20/%20snapscan%20/%20Prisa640S&In-Reply-To=&lt;3A5DD4BA.C5A12C27@interlog.com&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0123.html">Joseph chock: "Dynotak 6P parallel port scanner . . ."</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0121.html">Douglas Gilbert: "Re: MICROTEK2 failure : out of memory with kernel 2.4"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0108.html">Christian Nassau: "sanei_scsi_cmd / snapscan / Prisa640S"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0128.html">Christian Nassau: "Re: sanei_scsi_cmd / snapscan / Prisa640S"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0128.html">Christian Nassau: "Re: sanei_scsi_cmd / snapscan / Prisa640S"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#122">[ date ]</A>
<A HREF="index.html#122">[ thread ]</A>
<A HREF="subject.html#122">[ subject ]</A>
<A HREF="author.html#122">[ author ]</A>
</UL>
<!-- trailer="footer" -->
<HR NOSHADE>
<P>
<SMALL>
<EM>
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
: <EM>Thu Jan 11 2001 - 07:23:25 PST</EM>
</EM>
</SMALL>
</BODY>
</HTML>