atheros: fix a spiflash write performance regression
authorFelix Fietkau <nbd@openwrt.org>
Tue, 24 Mar 2009 23:41:29 +0000 (23:41 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 24 Mar 2009 23:41:29 +0000 (23:41 +0000)
SVN-Revision: 15027

target/linux/atheros/patches-2.6.28/120-spiflash.patch

index e661365..e33733e 100644 (file)
 +}
 +
 +static void
-+spiflash_wait_complete(struct spiflash_priv *priv)
++spiflash_wait_complete(struct spiflash_priv *priv, unsigned int timeout)
 +{
 +      busy_wait(priv, spiflash_sendcmd(priv, SPI_RD_STATUS, 0) &
-+              SPI_STATUS_WIP, 20);
++              SPI_STATUS_WIP, timeout);
 +      spiflash_done(priv);
 +}
 +
 +      reg |= op->tx_cnt | SPI_CTL_START;
 +      spiflash_write_reg(priv, SPI_FLASH_CTL, reg);
 +
-+      spiflash_wait_complete(priv);
++      spiflash_wait_complete(priv, 20);
 +
 +      instr->state = MTD_ERASE_DONE;
 +      if (instr->callback)
 +              reg |= (read_len + 4) | SPI_CTL_START;
 +              spiflash_write_reg(priv, SPI_FLASH_CTL, reg);
 +
-+              spiflash_wait_complete(priv);
++              spiflash_wait_complete(priv, 1);
 +
 +              bytes_left -= read_len;
 +              to += read_len;