Commit c8dce76b authored by James Bottomley's avatar James Bottomley

Fix endless loop in SCSI SPI transport class

If the driver doesn't update the peroid, we go
around forever.  The fix is to keep our old period
unless the driver returns a greater one.
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent fddf7ae0
......@@ -394,6 +394,7 @@ spi_dv_retrain(struct scsi_request *sreq, u8 *buffer, u8 *ptr,
for (;;) {
int newperiod;
if (compare_fn(sreq, buffer, ptr, DV_LOOPS))
/* Successful DV */
break;
......@@ -401,7 +402,8 @@ spi_dv_retrain(struct scsi_request *sreq, u8 *buffer, u8 *ptr,
/* OK, retrain, fallback */
if (i->f->get_period)
i->f->get_period(sdev);
period = spi_period(sdev);
newperiod = spi_period(sdev);
period = newperiod > period ? newperiod : period;
if (period < 0x0d)
period++;
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment