diff options
Diffstat (limited to 'drivers/spi/dw_spi.c')
-rw-r--r-- | drivers/spi/dw_spi.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/spi/dw_spi.c b/drivers/spi/dw_spi.c index 0838c79861e4..25238a82e45e 100644 --- a/drivers/spi/dw_spi.c +++ b/drivers/spi/dw_spi.c | |||
@@ -164,20 +164,23 @@ static inline void mrst_spi_debugfs_remove(struct dw_spi *dws) | |||
164 | 164 | ||
165 | static void wait_till_not_busy(struct dw_spi *dws) | 165 | static void wait_till_not_busy(struct dw_spi *dws) |
166 | { | 166 | { |
167 | unsigned long end = jiffies + 1 + usecs_to_jiffies(1000); | 167 | unsigned long end = jiffies + 1 + usecs_to_jiffies(5000); |
168 | 168 | ||
169 | while (time_before(jiffies, end)) { | 169 | while (time_before(jiffies, end)) { |
170 | if (!(dw_readw(dws, sr) & SR_BUSY)) | 170 | if (!(dw_readw(dws, sr) & SR_BUSY)) |
171 | return; | 171 | return; |
172 | cpu_relax(); | ||
172 | } | 173 | } |
173 | dev_err(&dws->master->dev, | 174 | dev_err(&dws->master->dev, |
174 | "DW SPI: Status keeps busy for 1000us after a read/write!\n"); | 175 | "DW SPI: Status keeps busy for 5000us after a read/write!\n"); |
175 | } | 176 | } |
176 | 177 | ||
177 | static void flush(struct dw_spi *dws) | 178 | static void flush(struct dw_spi *dws) |
178 | { | 179 | { |
179 | while (dw_readw(dws, sr) & SR_RF_NOT_EMPT) | 180 | while (dw_readw(dws, sr) & SR_RF_NOT_EMPT) { |
180 | dw_readw(dws, dr); | 181 | dw_readw(dws, dr); |
182 | cpu_relax(); | ||
183 | } | ||
181 | 184 | ||
182 | wait_till_not_busy(dws); | 185 | wait_till_not_busy(dws); |
183 | } | 186 | } |