diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2024-02-13 13:48:47 +0100 |
---|---|---|
committer | Andi Shyti <andi.shyti@kernel.org> | 2024-02-27 01:51:35 +0100 |
commit | 197ecadad842855437a36ffc161648418ae02a97 (patch) | |
tree | 8a3cd038f6784420a5155434e8feb70a2a8852f6 /Documentation/isdn | |
parent | i2c: designware: Fix RX FIFO depth define on Wangxun 10Gb NIC (diff) | |
download | linux-197ecadad842855437a36ffc161648418ae02a97.tar.xz linux-197ecadad842855437a36ffc161648418ae02a97.zip |
i2c: designware: Implement generic polling mode code for Wangxun 10Gb NIC
I got an idea the i2c-designware should not need duplicated state
machines for the interrupt and polling modes. The IP is practically the
same and state transitions happens in response to the events that can be
observed from the DW_IC_RAW_INTR_STAT register. Either by interrupts or
by polling.
Another reasons are the interrupt mode is the most tested, has handling
for special cases as well as transmit abort handling and those are
missing from two polling mode quirks.
Patch implements a generic polling mode by using existing code for
interrupt mode. This is done by moving event handling from the
i2c_dw_isr() into a new i2c_dw_process_transfer() that will be called
both from the i2c_dw_isr() and a polling loop.
Polling loop is implemented in a new i2c_dw_wait_transfer() that is
shared between both modes. In interrupt mode it waits for the completion
object as before. In polling mode both completion object and
DW_IC_RAW_INTR_STAT are polled to determine completed transfer and state
transitions.
Loop tries to save power by sleeping "stetson guessed" range between
3 and 25 µS which falls between 10 cycles of High-speed mode 3.4 Mb/s
and Fast mode 400 kHz. With it the CPU usage was reduced under heavy
Fast mode I2C transfer without much increase in total transfer time but
otherwise no more effort has been put to optimize this.
I decided to convert the txgbe_i2c_dw_xfer_quirk() straight to generic
polling mode code in this patch. It doesn't have HW dependent quirks
like the amd_i2c_dw_xfer_quirk() does have and without users this patch
is needless.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Jiawen Wu <jiawenwu@trustnetic.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Diffstat (limited to 'Documentation/isdn')
0 files changed, 0 insertions, 0 deletions