OSDN Git Service

net: aquantia: fix potential IOMMU fault after driver unbind
authorDmitry Bogdanov <dmitry.bogdanov@aquantia.com>
Fri, 9 Nov 2018 11:53:57 +0000 (11:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Nov 2018 23:38:10 +0000 (15:38 -0800)
commit7a1bb49461b12b2e6332a4d054256835f45203f3
tree36f64e4609d757c18250932bde201f1c1ebcbb97
parent35e8e8b45d31bec34379dd36e7b71448e003efb2
net: aquantia: fix potential IOMMU fault after driver unbind

IOMMU fault may occurr on unbind/bind or if_down/if_up sequence.

Although driver disables the rings on down, this is not enough.
Due to internal HW design, during subsequent initialization
NIC sometimes may reuse RX descriptors cache and write to the
host memory from the descriptor cache.
That's get catched by IOMMU on host.

This patch invalidates the descriptor cache in NIC on interface down
to prevent writing to the cached descriptors and to the memory pointed
in those descriptors.

Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h