OSDN Git Service

net: ethernet: ti: cpdma: am437x: allow descs to be plased in ddr
authorGrygorii Strashko <grygorii.strashko@ti.com>
Fri, 6 Jan 2017 20:07:29 +0000 (14:07 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Jan 2017 01:48:14 +0000 (20:48 -0500)
commita6c83ccf3c534214e0aeb167a70391864da9b1fc
treeb9023fcf3b4eb34291a7df7adf684f684212ea1c
parent350a47189c7ab5fdc2e3af855585b99514114d72
net: ethernet: ti: cpdma: am437x: allow descs to be plased in ddr

It's observed that cpsw/cpdma is not working properly when CPPI
descriptors are placed in DDR instead of internal CPPI RAM on am437x
SoC:
- rx/tx silently stops processing packets;
- or - after boot it's working for sometime, but stuck once Network
load is increased (ping is working, but iperf is not).
(The same issue has not been reproduced on am335x and am57xx).

It seems that write to HDP register processed faster by interconnect
than writing of descriptor memory buffer in DDR, which is probably
caused by store buffer / write buffer differences as these functions
are implemented differently across devices. So, to fix this i come up
with two minimal, required changes:

1) all accesses to the channel register HDP/CP/RXFREE registers should
be done using sync IO accessors readl()/writel(), because all previous
memory writes writes have to be completed before starting channel
(write to HDP) or completing desc processing.

2) the change 1 only doesn't work on am437x and additional reading of
desc's field is required right after the new descriptor was filled
with data and before pointer on it will be stored in
prev_desc->hw_next field or HDP register.

In addition, to above changes this patch eliminates all relaxed ordering
I/O accessors in this driver as suggested by David Miller to avoid such
kind of issues in the future, but with one exception - relaxed IO accessors
will still be used to fill desc in cpdma_chan_submit(), which is safe as
there is read barrier at the end of write sequence, and because sync IO
accessors usage here will affect on net performance.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/davinci_cpdma.c