OSDN Git Service

net: ipa: use a separate pointer for adjusted GSI memory
authorAlex Elder <elder@linaro.org>
Fri, 12 Feb 2021 14:33:58 +0000 (08:33 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Feb 2021 00:54:16 +0000 (16:54 -0800)
commit571b1e7e58ad30b3a842254aea50d2e83b2396e1
tree3cb608034ff3131b624db1e550ee19a37354f0b0
parent21cc70c75be0d1a38da34095d1933a75ce784b1d
net: ipa: use a separate pointer for adjusted GSI memory

This patch actually fixes a bug, though it doesn't affect the two
platforms supported currently.  The fix implements GSI memory
pointers a bit differently.

For IPA version 4.5 and above, the address space for almost all GSI
registers is adjusted downward by a fixed amount.  This is currently
handled by adjusting the I/O virtual address pointer after it has
been mapped.  The bug is that the pointer is not "de-adjusted" as it
should be when it's unmapped.

This patch fixes that error, but it does so by maintaining one "raw"
pointer for the mapped memory range.  This is assigned when the
memory is mapped and used to unmap the memory.  This pointer is also
used to access the two registers that do *not* sit in the "adjusted"
memory space.

Rather than adjusting *that* pointer, we maintain a separate pointer
that's an adjusted copy of the "raw" pointer, and that is used for
most GSI register accesses.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/gsi.c
drivers/net/ipa/gsi.h
drivers/net/ipa/gsi_reg.h