Changeset 47770


Ignore:
Timestamp:
2015-12-04T21:26:22+01:00 (2 years ago)
Author:
nbd
Message:

lantiq: fix a race condition in the SPI driver leading to rx FIFO overflows (and subsequent timeouts)

Signed-off-by: Felix Fietkau <nbd@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/lantiq/patches-4.1/0033-SPI-MIPS-lantiq-adds-spi-xway.patch

    r47767 r47770  
    4343--- /dev/null 
    4444+++ b/drivers/spi/spi-xway.c 
    45 @@ -0,0 +1,991 @@ 
     45@@ -0,0 +1,1003 @@ 
    4646+/* 
    4747+ * Lantiq SoC SPI controller 
     
    668668+{ 
    669669+       u32 rxreq, rxreq_max, rxtodo; 
     670+       u32 fstat, fifo_fill; 
    670671+ 
    671672+       rxtodo = ltq_spi_reg_read(hw, LTQ_SPI_RXCNT) & LTQ_SPI_RXCNT_TODO_MASK; 
     673+ 
     674+       /* 
     675+        * Check if there is remaining data in the FIFO before starting a new 
     676+        * receive request. The controller might have processed some more data 
     677+        * since the last FIFO poll. 
     678+        */ 
     679+       fstat = ltq_spi_reg_read(hw, LTQ_SPI_FSTAT); 
     680+       fifo_fill = ((fstat >> LTQ_SPI_FSTAT_RXFFL_SHIFT) 
     681+                       & LTQ_SPI_FSTAT_RXFFL_MASK); 
     682+       if (fifo_fill) 
     683+               return; 
    672684+ 
    673685+       /* 
Note: See TracChangeset for help on using the changeset viewer.