linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: spi-nor: Support controllers with limited TX FIFO size
@ 2018-06-13  6:08 Yogesh Gaur
  2018-07-09 21:34 ` Boris Brezillon
  2018-10-03  7:10 ` Boris Brezillon
  0 siblings, 2 replies; 5+ messages in thread
From: Yogesh Gaur @ 2018-06-13  6:08 UTC (permalink / raw)
  To: linux-mtd
  Cc: boris.brezillon, frieder.schrempf, computersforpeace,
	david.wolfe, han.xu, festevam, marek.vasut, prabhakar.kushwaha,
	linux-spi, linux-kernel, Yogesh Gaur

Some SPI controllers can't write nor->page_size bytes in a single
step because their TX FIFO is too small.

Allow nor->write() to return a size that is smaller than the requested
write size to gracefully handle this case.

Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
---
 drivers/mtd/spi-nor/spi-nor.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 5bfa36e..3e63543 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1431,13 +1431,6 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len,
 			goto write_err;
 		*retlen += written;
 		i += written;
-		if (written != page_remain) {
-			dev_err(nor->dev,
-				"While writing %zu bytes written %zd bytes\n",
-				page_remain, written);
-			ret = -EIO;
-			goto write_err;
-		}
 	}
 
 write_err:
-- 
2.7.4

Patch is based on the spi-mem framework[1]
[1]https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/log/?h=for-4.18

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-03  7:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-13  6:08 [PATCH] mtd: spi-nor: Support controllers with limited TX FIFO size Yogesh Gaur
2018-07-09 21:34 ` Boris Brezillon
2018-09-18 10:51   ` Frieder Schrempf
2018-09-18 14:41     ` Boris Brezillon
2018-10-03  7:10 ` Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).