From: Tony Battersby <tonyb@cybernetics.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>,
Aaro Koskinen <Aaro.Koskinen@nokia.com>
Cc: linux-scsi@vger.kernel.org, michaelc@cs.wisc.edu
Subject: Re: [PATCH] sym53c8xx_2: Keep transfer negotiations valid (2.6.27.5)
Date: Tue, 06 Jan 2009 15:00:02 -0500 [thread overview]
Message-ID: <4963B842.9080304@cybernetics.com> (raw)
In-Reply-To: <1230664572.18627.2.camel@localhost.localdomain>
On a device that negotiates asynchronous, this patch causes a WDTR
exchange on every command (not just inquiry/request sense), even on
devices that don't advertise wide support in the inquiry data. This is
unnecessary overhead, and may (in theory) cause problems for old devices
that don't handle WDTR correctly. The original code avoided this by
setting nego = 0 in sym_prepare_nego() if the current agreement matched
the goal. However, it was pointed out that the original code was buggy
because the sym_sir_bad_scsi_status()/S_CHECK_COND branch does not start
a new negotiation (to me it looks like the original code actually does
work if the negotiation will be PPR but not if the negotiation will be
WDTR/SDTR).
This patch forces either WDTR or PPR on every inquiry and request
sense. I think it would be better if the negotiation was skipped if the
current agreement and the goal are both narrow/asynchronous; that way we
don't try to negotiate at all for devices that don't support wide or sync.
If the current agreement is 16-bit wide with a nonzero sync offset, and
only the sync parameters need to be renegotiated (e.g. during DV), the
original code will use just SDTR without WDTR, and this patch will use
WDTR followed by SDTR. I agree that this is probably a good change.
However, if the current agreement is 8-bit narrow and only the sync
parameters need to be renegotiated, then I think it would be better to
use SDTR only. That way we don't rely on WDTR working in order to use
SDTR successfully.
To summarize, I think the following would be the best policy:
on every inquiry and request sense:
1) if both the current and goal are narrow/async, then don't negotiate
2) if the current and goal are both 8-bit narrow but with nonzero
offset, then use SDTR only
3) if either the current or goal are 16-bit wide, then use WDTR+SDTR or PPR
on commands other than inquiry and request sense:
4) if the current and goal are the same, then don't negotiate
5) if the current and goal are both 8-bit narrow but with nonzero
offset, then use SDTR only
6) if either the current or goal are 16-bit wide, then use WDTR+SDTR or PPR
If you tell sym_prepare_nego() whether or not the command is inquiry or
request sense, then it should be fairly straightforward to implement
this policy.
Tony
next prev parent reply other threads:[~2009-01-06 20:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-29 20:27 [PATCH] sym53c8xx_2: slave_alloc/destroy safety (2.6.27.5) Tony Battersby
2008-12-29 20:55 ` Tony Battersby
2008-12-30 10:10 ` Aaro Koskinen
2008-12-30 19:16 ` James Bottomley
2009-01-06 16:26 ` Tony Battersby
2009-01-07 10:57 ` Aaro Koskinen
2009-01-07 14:52 ` Tony Battersby
2009-01-06 20:00 ` Tony Battersby [this message]
2009-01-07 13:19 ` [PATCH] sym53c8xx_2: Keep transfer negotiations valid (2.6.27.5) Aaro Koskinen
2009-01-15 15:13 ` Aaro Koskinen
2009-01-16 14:28 ` Tony Battersby
2009-01-21 18:27 ` Tony Battersby
2009-01-06 22:00 ` [PATCH] sym53c8xx_2: lun to_clear flag not re-initialized (2.6.27.5) Tony Battersby
-- strict thread matches above, loose matches on Subject: below --
2008-08-17 20:18 [PATCH 1/1] sym53c8xx_2: Fix validation (Fix hotplug support) michaelc
2008-08-18 3:32 ` James Bottomley
2008-08-18 3:47 ` Mike Christie
2008-08-18 14:10 ` James Bottomley
2008-08-18 18:20 ` Mike Christie
2008-11-19 13:23 ` [PATCH] sym53c8xx_2: Keep transfer negotiations valid (2.6.27.5) Koskinen Aaro (NSN - FI/Helsinki)
2008-12-16 17:15 ` Aaro Koskinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4963B842.9080304@cybernetics.com \
--to=tonyb@cybernetics.com \
--cc=Aaro.Koskinen@nokia.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.