Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4630699pxj; Wed, 12 May 2021 09:37:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwB71IWg5qgjNtKyOajD+fNy0DdICLZwVPR9SQCT/q0pCz8nfS75nF9WOIL4nU5qSYG94je X-Received: by 2002:a9d:2c48:: with SMTP id f66mr24040656otb.48.1620837427989; Wed, 12 May 2021 09:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837427; cv=none; d=google.com; s=arc-20160816; b=OqZrPxz52PEWwQar9gnmZSu4Z4/ibDeCNtN+s/JbTCCIwMIQyzmI7huFiwyglCxX3L dEg0y50HbLwGOrKdYdev06LPy9fZ2pGB53DFNakfiUt9QozCxE3lAovkPxEfHPYg8iqy nkUbfVvFPwpmijHdpi1asz4xJifVmbbtJsEEImzNWX4QTwnD6I/BocAUGPnKaGNUByA5 y0wu+HsGdI4I5FfeLlNg0mSwZtlVmd1sG2ROEhkwYmVcV7tan9g09nqw7grJ9b0P7Oz+ W0nd6dpPEmY84+zajO2MsyDYzrr3IlfecdGmrroK9JXWZRNJOlSIKTRGki7lrwavMC6b bKzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=q075/FUQiefqHKf6S/YWh2/nBK+zonAbiULQ8GeuDyo=; b=LR4OIdaesV7eVAuAz06awnElnskheJEelYz8BNnYW31SvqZ+tpTnsXfBeh/LOJmFXB ER3rr1uNn8J2PBd9EHd+cH+ccwEtJ9lXFtLvUeVFPsfUoot2SH/7eSQq2u2EnLfmUx3l 5fNshemXPLijSfEpwLMm1l5z7yK5O5pUloAHmqSIFY0TeXey7FKvAoYC7Ut5aklHbD2t yA0G3KGMpoJdQ3nGkDaGzTShzLHROodXHPLLrb/bZI6khkGdeevyUHSim/GGfHToII0n 6BzwNtaW8H54U1TX1Y+RofpZDdLbz2txRLM/bYl7ylyB4/jRI0DjMNA9yoIQInzW7ASi v4zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m+s7D613; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y206si463424oig.133.2021.05.12.09.36.53; Wed, 12 May 2021 09:37:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m+s7D613; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242733AbhELQfg (ORCPT + 99 others); Wed, 12 May 2021 12:35:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:56692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234205AbhELPlZ (ORCPT ); Wed, 12 May 2021 11:41:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C86C561C6C; Wed, 12 May 2021 15:21:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832900; bh=/eUJkXkBmOsXOpykiOeBOrZfPsjIwNMYCY4YJqVHwhc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m+s7D613P2mbqbEB6HVOFH8LvuTmkyPIBvM2OhBPWAb/hs8a6S2NOcsm5z/8C37Bf Oo8+AqlADwqo5w5o2JTg8ti1qwXkd/AKlAWaPXEvgG213Cuf7ltMTsxmz6LJPs+OBs InVfFAHf+9nVJu45wS90UZH3+e4Gqp1fzeFiN/HQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 468/530] net: ethernet: ixp4xx: Set the DMA masks explicitly Date: Wed, 12 May 2021 16:49:38 +0200 Message-Id: <20210512144835.146428496@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij [ Upstream commit 8d892d60941b00c86d2029c8a99db24ab4979673 ] 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: e45d0fad4a5f ("net: ethernet: ixp4xx: Use parent dev for DMA pool") Signed-off-by: Linus Walleij Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/xscale/ixp4xx_eth.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index 2e5202923510..403358f2c853 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c @@ -1086,7 +1086,7 @@ static int init_queues(struct port *port) int i; if (!ports_open) { - dma_pool = dma_pool_create(DRV_NAME, port->netdev->dev.parent, + dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev, POOL_ALLOC_SIZE, 32, 0); if (!dma_pool) return -ENOMEM; @@ -1436,6 +1436,9 @@ static int ixp4xx_eth_probe(struct platform_device *pdev) ndev->netdev_ops = &ixp4xx_netdev_ops; ndev->ethtool_ops = &ixp4xx_ethtool_ops; ndev->tx_queue_len = 100; + /* Inherit the DMA masks from the platform device */ + ndev->dev.dma_mask = dev->dma_mask; + ndev->dev.coherent_dma_mask = dev->coherent_dma_mask; netif_napi_add(ndev, &port->napi, eth_poll, NAPI_WEIGHT); -- 2.30.2