Skip to content

Commit 8d892d6

Browse files
Linus Walleijdavem330
authored andcommitted
net: ethernet: ixp4xx: Set the DMA masks explicitly
The former fix only papered over the actual problem: the ethernet core expects the netdev .dev member to have the proper DMA masks set, or there will be BUG_ON() triggered in kernel/dma/mapping.c. Fix this by simply copying dma_mask and dma_mask_coherent from the parent device. Fixes: e45d0fa ("net: ethernet: ixp4xx: Use parent dev for DMA pool") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ed8157f commit 8d892d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/xscale/ixp4xx_eth.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ static int init_queues(struct port *port)
10851085
int i;
10861086

10871087
if (!ports_open) {
1088-
dma_pool = dma_pool_create(DRV_NAME, port->netdev->dev.parent,
1088+
dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev,
10891089
POOL_ALLOC_SIZE, 32, 0);
10901090
if (!dma_pool)
10911091
return -ENOMEM;
@@ -1435,6 +1435,9 @@ static int ixp4xx_eth_probe(struct platform_device *pdev)
14351435
ndev->netdev_ops = &ixp4xx_netdev_ops;
14361436
ndev->ethtool_ops = &ixp4xx_ethtool_ops;
14371437
ndev->tx_queue_len = 100;
1438+
/* Inherit the DMA masks from the platform device */
1439+
ndev->dev.dma_mask = dev->dma_mask;
1440+
ndev->dev.coherent_dma_mask = dev->coherent_dma_mask;
14381441

14391442
netif_napi_add(ndev, &port->napi, eth_poll, NAPI_WEIGHT);
14401443

0 commit comments

Comments
 (0)