public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] spi: fsl_qspi: Pet watchdog even more
@ 2017-06-01  7:32 Alexander Stein
  2017-06-13 20:36 ` York Sun
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Stein @ 2017-06-01  7:32 UTC (permalink / raw)
  To: u-boot

Pet the watchdog once upon each command call (qspi_xfer) and during
each loop iteration in several commands.

This fixes a watchdog reset especially during erase command.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
 drivers/spi/fsl_qspi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
index e61c67b088..1dfa89afc9 100644
--- a/drivers/spi/fsl_qspi.c
+++ b/drivers/spi/fsl_qspi.c
@@ -493,6 +493,8 @@ static void qspi_op_rdbank(struct fsl_qspi_priv *priv, u8 *rxbuf, u32 len)
 		;
 
 	while (1) {
+		WATCHDOG_RESET();
+
 		reg = qspi_read32(priv->flags, &regs->rbsr);
 		if (reg & QSPI_RBSR_RDBFL_MASK) {
 			data = qspi_read32(priv->flags, &regs->rbdr[0]);
@@ -530,6 +532,8 @@ static void qspi_op_rdid(struct fsl_qspi_priv *priv, u32 *rxbuf, u32 len)
 
 	i = 0;
 	while ((RX_BUFFER_SIZE >= len) && (len > 0)) {
+		WATCHDOG_RESET();
+
 		rbsr_reg = qspi_read32(priv->flags, &regs->rbsr);
 		if (rbsr_reg & QSPI_RBSR_RDBFL_MASK) {
 			data = qspi_read32(priv->flags, &regs->rbdr[i]);
@@ -702,6 +706,8 @@ static void qspi_op_rdsr(struct fsl_qspi_priv *priv, void *rxbuf, u32 len)
 		;
 
 	while (1) {
+		WATCHDOG_RESET();
+
 		reg = qspi_read32(priv->flags, &regs->rbsr);
 		if (reg & QSPI_RBSR_RDBFL_MASK) {
 			data = qspi_read32(priv->flags, &regs->rbdr[0]);
@@ -757,6 +763,8 @@ int qspi_xfer(struct fsl_qspi_priv *priv, unsigned int bitlen,
 	static u32 wr_sfaddr;
 	u32 txbuf;
 
+	WATCHDOG_RESET();
+
 	if (dout) {
 		if (flags & SPI_XFER_BEGIN) {
 			priv->cur_seqid = *(u8 *)dout;
-- 
2.13.0

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

* [U-Boot] [PATCH 1/1] spi: fsl_qspi: Pet watchdog even more
  2017-06-01  7:32 [U-Boot] [PATCH 1/1] spi: fsl_qspi: Pet watchdog even more Alexander Stein
@ 2017-06-13 20:36 ` York Sun
  2017-06-14  5:48   ` Alexander Stein
  0 siblings, 1 reply; 4+ messages in thread
From: York Sun @ 2017-06-13 20:36 UTC (permalink / raw)
  To: u-boot

On 06/01/2017 04:26 AM, Alexander Stein wrote:
> Pet the watchdog once upon each command call (qspi_xfer) and during
> each loop iteration in several commands.
> 
> This fixes a watchdog reset especially during erase command.
> 

Funny you keep petting the watchdog for this driver. I am curious what 
watchdog are you using? Why no one else suffer the reset.

Jagan,

If you want to ack it, I can bring it in.

York

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

* [U-Boot] [PATCH 1/1] spi: fsl_qspi: Pet watchdog even more
  2017-06-13 20:36 ` York Sun
@ 2017-06-14  5:48   ` Alexander Stein
  2017-08-07 19:55     ` York Sun
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Stein @ 2017-06-14  5:48 UTC (permalink / raw)
  To: u-boot

On Tuesday 13 June 2017 20:36:35, York Sun wrote:
> On 06/01/2017 04:26 AM, Alexander Stein wrote:
> > Pet the watchdog once upon each command call (qspi_xfer) and during
> > each loop iteration in several commands.
> > 
> > This fixes a watchdog reset especially during erase command.
> 
> Funny you keep petting the watchdog for this driver. I am curious what
> watchdog are you using? Why no one else suffer the reset.

We use a SP706T with a timeout of 1.6s. Propably this short timeout causes the 
problem for me only.

Best regards,
Alexander

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

* [U-Boot] [PATCH 1/1] spi: fsl_qspi: Pet watchdog even more
  2017-06-14  5:48   ` Alexander Stein
@ 2017-08-07 19:55     ` York Sun
  0 siblings, 0 replies; 4+ messages in thread
From: York Sun @ 2017-08-07 19:55 UTC (permalink / raw)
  To: u-boot

On 06/13/2017 10:49 PM, Alexander Stein wrote:
> On Tuesday 13 June 2017 20:36:35, York Sun wrote:
>> On 06/01/2017 04:26 AM, Alexander Stein wrote:
>>> Pet the watchdog once upon each command call (qspi_xfer) and during
>>> each loop iteration in several commands.
>>>
>>> This fixes a watchdog reset especially during erase command.
>>
>> Funny you keep petting the watchdog for this driver. I am curious what
>> watchdog are you using? Why no one else suffer the reset.
> 
> We use a SP706T with a timeout of 1.6s. Propably this short timeout causes the
> problem for me only.
> 


Applied to fsl-qoriq master. Thanks.

York

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

end of thread, other threads:[~2017-08-07 19:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-01  7:32 [U-Boot] [PATCH 1/1] spi: fsl_qspi: Pet watchdog even more Alexander Stein
2017-06-13 20:36 ` York Sun
2017-06-14  5:48   ` Alexander Stein
2017-08-07 19:55     ` York Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox