Skip to content
Commit bbf967b2 authored by Alex Williams's avatar Alex Williams Committed by Wolfram Sang
Browse files

i2c: cadence: Handle transfer_size rollover



Under certain conditions, Cadence's I2C controller's transfer_size
register will roll over and generate invalid read transactions. Before
this change, the ISR relied solely on the RXDV bit to determine when to
write more data to the user's buffer. The invalid read data would cause
overruns, smashing stacks and worse.

This change stops the buffer writes to the requested boundary and
reports the error. The controller will be reset so normal transactions
may resume.

Signed-off-by: default avatarAlex Williams <alex.williams@ni.com>
Reviewed-by: default avatarShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com> # in a seperate mail
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent f53938d2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment