This patch increments tx and rx buf pointers only if they are valid,
otherwise, they dont need to be incremented and its of no use.
Moreover, this patch fixes the issue of inconsistent processor
hang on AC701 while performing operations to spi flash due to these
incorrect operations on rxbuf when it is null.
Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
reg = readl(®s->spicr) & ~SPICR_MASTER_INHIBIT;
writel(reg, ®s->spicr);
txbytes -= count;
- txp += count;
+ if (txp)
+ txp += count;
timeout = 10000000;
do {
debug("txbytes:0x%x,txp:0x%p\n", txbytes, txp);
count = xilinx_spi_read_rxfifo(bus, rxp, rxbytes);
rxbytes -= count;
- rxp += count;
+ if (rxp)
+ rxp += count;
debug("rxbytes:0x%x rxp:0x%p\n", rxbytes, rxp);
}