From patchwork Wed May 12 14:49:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 435578 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4970423jao; Wed, 12 May 2021 09:10:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVlX6Nb5IQAu7ajZ2x63LfUXEvaQyTgIZj9sHx/5C+fkF//fYKCd3pMpKNx51N+kHqV4qI X-Received: by 2002:a02:a918:: with SMTP id n24mr33110473jam.125.1620835819230; Wed, 12 May 2021 09:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835819; cv=none; d=google.com; s=arc-20160816; b=piRcy2YEIGoHFiLLBQTJw3b7V3IS88kOyK9F0HN9k1iP66Lxle7jCWmq0QWDce6DVg ZvbeukIXRFoGV4582kRzhli2Gk/GzvAyi1SV58YZc+qdgdzm8bGO+jL6Nz+SF6N+YVxB AjPs4swSTwJm3sLi9gMeBso9e5lyz5FK8FEgKtC79J3k47uk7X/aqSrC5BMvHqT+B7Jq lrrRH2A5YSvG/u/FvIlgK+3lEupbc7aH/siteIzr6sPTKZ2PVBuQnAwNcvLyU5n6lSLq PXpSweRVyyUnv7wUG5yYgdFaWl9KCi+u3PjsXQcOoi7WUHJG8DAdGQo5F5cE1PaxJhcs PdmQ== 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=Dkbrw7tt9Gwj3BLDGmSiWAliQbZoh2krnNE8JrzBliX7SJXfeGJZSzLf5oOiWvxX2B g8d7zqZZ0WBJeIMqSDz/sEFdr1vleMIwmwHPs6n2l9EsRwEGFdb+JrqekLTzzQcvLiFb s9QNBhjxc0aW0/jmGe2YYMdHrTrvgNCyg06UNP/63NHLP+rxZc5xy92QJmR2g9pn77Q7 YuSPXT53sFimAE6XtEWvAcAd4U9vM0ajgdPp3uP3ShYv5zNGdV9LICz5/wSDv0mApiO4 iJdKXFUg58f/WKnUw/ahSSznnZEj3hMlvTdNof43WOVMwpMMSV9BTuv3kGbGsPa7bzbh yuxQ== 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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 q8si330223ior.12.2021.05.12.09.10.19; Wed, 12 May 2021 09:10:19 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S237305AbhELPto (ORCPT + 12 others); Wed, 12 May 2021 11:49:44 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.30.2 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);