diff options
| -rw-r--r-- | drivers/ide/tx4938ide.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c index fa660f931a11..9c518e722707 100644 --- a/drivers/ide/tx4938ide.c +++ b/drivers/ide/tx4938ide.c | |||
| @@ -39,10 +39,17 @@ static void tx4938ide_tune_ebusc(unsigned int ebus_ch, | |||
| 39 | /* Address-valid to DIOR/DIOW setup */ | 39 | /* Address-valid to DIOR/DIOW setup */ |
| 40 | shwt = DIV_ROUND_UP(t->setup, cycle); | 40 | shwt = DIV_ROUND_UP(t->setup, cycle); |
| 41 | 41 | ||
| 42 | /* -DIOx recovery time (SHWT * 4) and cycle time requirement */ | ||
| 43 | while ((shwt * 4 + wt + (wt ? 2 : 3)) * cycle < t->cycle) | ||
| 44 | shwt++; | ||
| 45 | if (shwt > 7) { | ||
| 46 | pr_warning("tx4938ide: SHWT violation (%d)\n", shwt); | ||
| 47 | shwt = 7; | ||
| 48 | } | ||
| 42 | pr_debug("tx4938ide: ebus %d, bus cycle %dns, WT %d, SHWT %d\n", | 49 | pr_debug("tx4938ide: ebus %d, bus cycle %dns, WT %d, SHWT %d\n", |
| 43 | ebus_ch, cycle, wt, shwt); | 50 | ebus_ch, cycle, wt, shwt); |
| 44 | 51 | ||
| 45 | __raw_writeq((cr & ~(0x3f007ull)) | (wt << 12) | shwt, | 52 | __raw_writeq((cr & ~0x3f007ull) | (wt << 12) | shwt, |
| 46 | &tx4938_ebuscptr->cr[ebus_ch]); | 53 | &tx4938_ebuscptr->cr[ebus_ch]); |
| 47 | } | 54 | } |
| 48 | 55 | ||
