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, ...@@ -394,6 +394,7 @@ spi_dv_retrain(struct scsi_request *sreq, u8 *buffer, u8 *ptr,
for (;;) { for (;;) {
int newperiod;
if (compare_fn(sreq, buffer, ptr, DV_LOOPS)) if (compare_fn(sreq, buffer, ptr, DV_LOOPS))
/* Successful DV */ /* Successful DV */
break; break;
...@@ -401,7 +402,8 @@ spi_dv_retrain(struct scsi_request *sreq, u8 *buffer, u8 *ptr, ...@@ -401,7 +402,8 @@ spi_dv_retrain(struct scsi_request *sreq, u8 *buffer, u8 *ptr,
/* OK, retrain, fallback */ /* OK, retrain, fallback */
if (i->f->get_period) if (i->f->get_period)
i->f->get_period(sdev); i->f->get_period(sdev);
period = spi_period(sdev); newperiod = spi_period(sdev);
period = newperiod > period ? newperiod : period;
if (period < 0x0d) if (period < 0x0d)
period++; period++;
else 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