From: James Bottomley <James.Bottomley@SteelEye.com>
To: Stefan Boresch <stefan@mdy.univie.ac.at>
Cc: linux-scsi@vger.kernel.org
Subject: Re: aic79xx problems
Date: Fri, 21 Sep 2007 18:01:40 -0500 [thread overview]
Message-ID: <1190415701.3333.59.camel@localhost.localdomain> (raw)
In-Reply-To: <1190299275.3360.22.camel@localhost.localdomain>
On Thu, 2007-09-20 at 09:41 -0500, James Bottomley wrote:
> On Thu, 2007-09-20 at 16:34 +0200, Stefan Boresch wrote:
> > So, since I seem to have a slightly broken machine at hand, let me
> > know whether I can try/test anything to fix the issues the newer
> > kernels might have.
>
> It will take me a while to set up the configuration, so the dmesg from
> the failing 2.6.2x might be helpful, just in case it's an obvious
> problem that doesn't need debugging (small chance, but still possible).
OK, did the cut cable test (finally). It turns out that our DV
interaction with aic79xx isn't very smart. After assessing that wide
isn't allowed and turning it off, it then merrily begins DV at the
lowest possible period it can think of, which turns wide back on again,
sigh.
Try this patch, it fixes the problem for me.
James
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 6f56f87..fccc62d 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -787,6 +787,7 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
struct scsi_target *starget = sdev->sdev_target;
struct Scsi_Host *shost = sdev->host;
int len = sdev->inquiry_len;
+ int min_period = spi_min_period(starget);
/* first set us up for narrow async */
DV_SET(offset, 0);
DV_SET(width, 0);
@@ -809,6 +810,11 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
!= SPI_COMPARE_SUCCESS) {
starget_printk(KERN_ERR, starget, "Wide Transfers Fail\n");
i->f->set_width(starget, 0);
+ /* Make sure we don't force wide back on by asking
+ * for a transfer period that requires it */
+ spi_max_width(starget) = 0;
+ if (min_period < 10)
+ min_period = 10;
}
}
@@ -828,7 +834,8 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
/* now set up to the maximum */
DV_SET(offset, spi_max_offset(starget));
- DV_SET(period, spi_min_period(starget));
+ DV_SET(period, min_period);
+
/* try QAS requests; this should be harmless to set if the
* target supports it */
if (scsi_device_qas(sdev)) {
@@ -837,14 +844,14 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
DV_SET(qas, 0);
}
- if (scsi_device_ius(sdev) && spi_min_period(starget) < 9) {
+ if (scsi_device_ius(sdev) && min_period < 9) {
/* This u320 (or u640). Set IU transfers */
DV_SET(iu, 1);
/* Then set the optional parameters */
DV_SET(rd_strm, 1);
DV_SET(wr_flow, 1);
DV_SET(rti, 1);
- if (spi_min_period(starget) == 8)
+ if (min_period == 8)
DV_SET(pcomp_en, 1);
} else {
DV_SET(iu, 0);
prev parent reply other threads:[~2007-09-21 23:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-20 13:04 aic79xx problems Stefan Boresch
2007-09-20 14:01 ` James Bottomley
2007-09-20 14:15 ` James Bottomley
2007-09-20 14:34 ` Stefan Boresch
2007-09-20 14:41 ` James Bottomley
2007-09-20 14:53 ` Stefan Boresch
2007-09-21 1:16 ` Julian Calaby
2007-09-21 23:01 ` James Bottomley [this message]
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=1190415701.3333.59.camel@localhost.localdomain \
--to=james.bottomley@steeleye.com \
--cc=linux-scsi@vger.kernel.org \
--cc=stefan@mdy.univie.ac.at \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox