diff options
| author | Luca Ceresoli <[email protected]> | 2020-08-30 16:38:48 +0000 |
|---|---|---|
| committer | Moritz Fischer <[email protected]> | 2020-08-31 00:06:50 +0000 |
| commit | 16b7856d94807abeb62f615a8580fd7ae8a27515 (patch) | |
| tree | 5ba1b91eb82df9b0c7ae90fc8cfc1c531261a7f0 /drivers/fpga/fpga-region.c | |
| parent | fpga manager: xilinx-spi: remove final dot from dev_err() strings (diff) | |
| download | kernel-16b7856d94807abeb62f615a8580fd7ae8a27515.tar.gz kernel-16b7856d94807abeb62f615a8580fd7ae8a27515.zip | |
fpga manager: xilinx-spi: fix write_complete timeout handling
If this routine sleeps because it was scheduled out, it might miss DONE
going asserted and consider it a timeout. This would potentially make the
code return an error even when programming succeeded. Rewrite the loop to
always check DONE after checking if timeout expired so this cannot happen
anymore.
While there, also add error checking for gpiod_get_value(). Also avoid
checking the DONE GPIO in two places, which would make the error-checking
code duplicated and more annoying.
The new loop it written to still guarantee that we apply 8 extra CCLK
cycles after DONE has gone asserted, which is required by the hardware.
Reported-by: Tom Rix <[email protected]>
Reviewed-by: Tom Rix <[email protected]>
Signed-off-by: Luca Ceresoli <[email protected]>
Signed-off-by: Moritz Fischer <[email protected]>
Diffstat (limited to 'drivers/fpga/fpga-region.c')
0 files changed, 0 insertions, 0 deletions
