sane-project-website/old-archive/1998-06/0068.html

77 wiersze
3.8 KiB
HTML

<!-- received="Sun Jun 7 19:42:42 1998 PDT" -->
<!-- sent="Sun, 7 Jun 1998 19:42:41 -0700" -->
<!-- name="David Mosberger-Tang" -->
<!-- email="David.Mosberger@acm.org" -->
<!-- subject="Re: Problems with CANCEL" -->
<!-- id="199806080242.TAA24452@panda.mostang.com" -->
<!-- inreplyto="199806071705.TAA00333@Babylon5.wolfsburg.de" -->
<title>sane-devel: Re: Problems with CANCEL</title>
<h1>Re: Problems with CANCEL</h1>
<b>David Mosberger-Tang</b> (<a href="mailto:David.Mosberger@acm.org"><i>David.Mosberger@acm.org</i></a>)<br>
<i>Sun, 7 Jun 1998 19:42:41 -0700</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#68">[ date ]</a><a href="index.html#68">[ thread ]</a><a href="subject.html#68">[ subject ]</a><a href="author.html#68">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0069.html">David Mosberger-Tang: "Re: Problems with Scanning !!!"</a>
<li> <b>Previous message:</b> <a href="0067.html">Ingo Witzky: "Problems with Scanning !!!"</a>
<li> <b>In reply to:</b> <a href="0066.html">Oliver.Rauch@Wolfsburg.DE: "Re: Problems with CANCEL"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0078.html">Oliver.Rauch@Wolfsburg.DE: "Re: Problems with CANCEL"</a>
<li> <b>Reply:</b> <a href="0078.html">Oliver.Rauch@Wolfsburg.DE: "Re: Problems with CANCEL"</a>
<!-- reply="end" -->
</ul>
<!-- body="start" -->
<i>&gt;&gt;&gt;&gt;&gt; On Sun, 7 Jun 1998 19:05:08 +0200 (MET DST), <a href="mailto:Oliver.Rauch@Wolfsburg.DE">Oliver.Rauch@Wolfsburg.DE</a> said:</i><br>
<p>
<i> &gt;&gt; Not really, but I'm not sure it's a good idea to block all</i><br>
<i> &gt;&gt; signals. You may want to play around with this part. Indeed,</i><br>
<i> &gt;&gt; for testing purposes you could not block anything and see whether</i><br>
<i> &gt;&gt; that helps.</i><br>
<p>
Oliver&gt; I will try that, but it is important to block all signals<br>
Oliver&gt; between scsi-command and scsi-answer, otherwise we may block<br>
Oliver&gt; the scsi-bus!<br>
<p>
Well, the reason the signals are blocked is to avoid a race condition.<br>
Without blocking the signals, it could happen that:<br>
<p>
(1) sanei_scsi.c:issue() gets called<br>
(2) req-&gt;running gets set<br>
(3) user hits ctrl-C (or something else that causes a signal)<br>
(4) sane_cancel() gets invoked <br>
(5) sanei_scsi_req_flush_all() gets called by sane_cancel()<br>
(6) sanei_scsi_req_flush_all() sees req-&gt;running is set and<br>
now attempts to read() the reply bytes, which of course<br>
will never happen (because issue() never got to write()<br>
the request)<br>
<p>
Because of this, all signals that could result in sane_cancel() being<br>
called must be blocked temporarily.<br>
<p>
Oliver&gt; Is it possible that it has to do something with<br>
Oliver&gt; command-queing and the cammand-queue is already full?<br>
<p>
I suppose it could be. Does the UMAX backend attempt to send any scsi<br>
commands during a sane_cancel() call? I thought not.<br>
<p>
--david<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">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0069.html">David Mosberger-Tang: "Re: Problems with Scanning !!!"</a>
<li> <b>Previous message:</b> <a href="0067.html">Ingo Witzky: "Problems with Scanning !!!"</a>
<li> <b>In reply to:</b> <a href="0066.html">Oliver.Rauch@Wolfsburg.DE: "Re: Problems with CANCEL"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0078.html">Oliver.Rauch@Wolfsburg.DE: "Re: Problems with CANCEL"</a>
<li> <b>Reply:</b> <a href="0078.html">Oliver.Rauch@Wolfsburg.DE: "Re: Problems with CANCEL"</a>
<!-- reply="end" -->
</ul>