linux_dsm_epyc7002/drivers/net/ethernet
Ard Biesheuvel 3125642695 net: netsec: reduce DMA mask to 40 bits
The netsec network controller IP can drive 64 address bits for DMA, and
the DMA mask is set accordingly in the driver. However, the SynQuacer
SoC, which is the only silicon incorporating this IP at the moment,
integrates this IP in a manner that leaves address bits [63:40]
unconnected.

Up until now, this has not resulted in any problems, given that the DDR
controller doesn't decode those bits to begin with. However, recent
firmware updates for platforms incorporating this SoC allow the IOMMU
to be enabled, which does decode address bits [47:40], and allocates
top down from the IOVA space, producing DMA addresses that have bits
set that have been left unconnected.

Both the DT and ACPI (IORT) descriptions of the platform take this into
account, and only describe a DMA address space of 40 bits (using either
dma-ranges DT properties, or DMA address limits in IORT named component
nodes). However, even though our IOMMU and bus layers may take such
limitations into account by setting a narrower DMA mask when creating
the platform device, the netsec probe() entrypoint follows the common
practice of setting the DMA mask uncondionally, according to the
capabilities of the IP block itself rather than to its integration into
the chip.

It is currently unclear what the correct fix is here. We could hack around
it by only setting the DMA mask if it deviates from its default value of
DMA_BIT_MASK(32). However, this makes it impossible for the bus layer to
use DMA_BIT_MASK(32) as the bus limit, and so it appears that a more
comprehensive approach is required to take DMA limits imposed by the
SoC as a whole into account.

In the mean time, let's limit the DMA mask to 40 bits. Given that there
is currently only one SoC that incorporates this IP, this is a reasonable
approach that can be backported to -stable and buys us some time to come
up with a proper fix going forward.

Fixes: 533dd11a12 ("net: socionext: Add Synquacer NetSec driver")
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Masahisa Kojima <masahisa.kojima@linaro.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-05-28 23:12:00 -04:00
..
3com 3c59x: convert to generic DMA API 2018-05-13 20:22:58 -04:00
8390 net: 8390: ne: Fix accidentally removed RBTX4927 support 2018-05-16 14:38:54 -04:00
adaptec
aeroflex
agere
alacritech
allwinner
alteon
altera ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
amazon net: ena: Eliminate duplicate barriers on weakly-ordered archs 2018-03-26 12:47:56 -04:00
amd pcnet32: add an error handling path in pcnet32_probe_pci() 2018-05-22 15:40:15 -04:00
apm
apple net/macmace: Drop redundant MACH_IS_MAC test 2018-02-28 12:00:27 -05:00
aquantia net: aquantia: Limit number of vectors to actually allocated irqs 2018-05-08 00:06:44 -04:00
arc net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred 2018-03-20 12:06:23 -04:00
atheros
aurora
broadcom tg3: Fix vunmap() BUG_ON() triggered from tg3_free_consistent(). 2018-05-04 12:57:17 -04:00
brocade ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
cadence treewide: fix up files incorrectly marked executable 2018-04-07 13:31:23 -07:00
calxeda
cavium net: thunderx: rework mac addresses list to u64 array 2018-04-09 10:59:38 -04:00
chelsio cxgb4: fix offset in collecting TX rate limit info 2018-05-18 13:54:48 -04:00
cirrus net/mac89x0: Replace custom debug logging with netif_* calls 2018-03-01 21:21:36 -05:00
cisco enic: set DMA mask to 47 bit 2018-05-24 23:05:30 -04:00
cortina net: gemini: fix memory leak 2018-03-20 12:08:45 -04:00
davicom treewide: simplify Kconfig dependencies for removed archs 2018-03-26 15:55:57 +02:00
dec
dlink
emulex ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
ezchip
faraday net: faraday add nds32 support. 2018-02-22 10:44:36 +08:00
freescale net: fec: Add a SPDX identifier 2018-05-22 13:42:05 -04:00
fujitsu
hisilicon net: hns: Avoid action name truncation 2018-04-19 16:30:26 -04:00
hp
huawei
i825xx
ibm ibmvnic: Fix partial success login retries 2018-05-25 16:32:48 -04:00
intel ixgbe: fix memory leak on ipsec allocation 2018-05-11 12:22:22 -07:00
marvell net: mvpp2: Fix clock resource by adding missing mg_core_clk 2018-04-27 11:22:55 -04:00
mediatek
mellanox mlx4_core: allocate ICM memory in page size chunks 2018-05-25 10:22:53 -04:00
micrel
microchip lan743x: make functions lan743x_csr_read and lan743x_csr_read static 2018-03-12 11:12:38 -04:00
moxa
myricom ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
natsemi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-03-23 11:31:58 -04:00
neterion
netronome Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 2018-05-13 21:07:02 -04:00
ni net: nixge: Address compiler warnings about signedness 2018-05-07 23:30:03 -04:00
nuvoton
nvidia
nxp
oki-semi
packetengines
pasemi
qlogic qed: Fix mask for physical address in ILT entry 2018-05-22 15:32:55 -04:00
qualcomm net: qualcomm: rmnet: Fix warning seen with fill_info 2018-04-18 21:23:06 -04:00
rdc
realtek r8169: fix powering up RTL8168h 2018-05-08 22:54:18 -04:00
renesas sh_eth: Change platform check to CONFIG_ARCH_RENESAS 2018-05-18 13:45:48 -04:00
rocker
samsung ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
seeq
sfc sfc: fix ARFS expiry check on EF10 2018-04-27 20:21:07 -04:00
sgi
silan
sis
smsc arch: remove obsolete architecture ports 2018-04-02 20:20:12 -07:00
socionext net: netsec: reduce DMA mask to 40 bits 2018-05-28 23:12:00 -04:00
stmicro net: stmmac: Disable ACS Feature for GMAC >= 4 2018-04-19 13:33:44 -04:00
sun net: ethernet: sun: niu set correct packet size in skb 2018-05-04 13:20:46 -04:00
synopsys
tehuti
ti net: ethernet: ti: cpsw: fix packet leaking in dual_mac mode 2018-05-02 11:08:23 -04:00
toshiba
tundra
via
wiznet
xilinx
xircom
xscale
dnet.c
dnet.h
ec_bhf.c ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
ethoc.c
fealnx.c
jme.c
jme.h
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-04-03 14:04:18 -07:00
korina.c
lantiq_etop.c
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-04-03 14:04:18 -07:00
netx-eth.c