From patchwork Wed May 12 14:50:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 435677 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp5223596jao; Wed, 12 May 2021 14:50:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1Q5QWZO8zVIGKw89MlsVLX1LX23JtAMzhHuIqVjB6Gz0saAALwrpfA8ojR7TkCuvQPFXt X-Received: by 2002:a05:6402:4383:: with SMTP id o3mr45952496edc.333.1620856254283; Wed, 12 May 2021 14:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620856254; cv=none; d=google.com; s=arc-20160816; b=Qd6jGuU/+Y+CE3utduWQymtH6/DZoOfcywFLjrO6SfdV7HkBxKyD0V2XtNrd8+lVfu SmPR3ROAXM6Vq+uJyABA3LrUE/PvWZpFRQRUMpdUqT+NZIcpoMEpcDnZm3G5obkIo23c MdKfjWdLf8F5Rn0Jkpk/PdeEPY8U9Y/z1H+QDNLJxsSzzh9v0/DHkVB7gBqRFQENqWH9 I24tIfyPPU3u5sCXT+3Ofqd5LcmaMt0W5i4qn7e+gPW+N77Uwhi5/WPweBj5nqwllrfB TPxYCq8CEP9SUo07lI8c2CJbUPp4KUiepMRhmrcbs5lHj1SPQO5zJY11WsxChNtfszRT ybvQ== 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=MSm1PLMrNurqsBqmAkDAeLeO6zv4uIOAL4GecrP23qQ=; b=i/3t8dhR9Wu4XGUp//HCZjQRukOYaTYBuojc2ymizpU54RniTWEgVkHdRaqdxRABm+ t3BQH0ZIIe6WtsrASGVBmKfkzUa5gAIMqGDswLpY1xWQFSm+ZW56vXpQoUv82gimIDk3 x8HNs7j6JGH+ywmYFHEbzY2vmuz4z66Uas38p2AnmLxZj4NRbnD92Nit9Lw6i0jMA9Qm IeH2kURTPnZ5Lu4gocGiIRYGElbG8jYY6ZxipOOI7amBOUmr+ocOFQniKTMBWDjzB1bt 3cVQLGGZC88wSZhloEHIilCPzal5MkrOH360kU1c5Yi4ByevyaMjSrS1LzcZRf+5PSeX hRyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PBaG6bul; 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 u19si859013ejx.176.2021.05.12.14.50.54; Wed, 12 May 2021 14:50:54 -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=PBaG6bul; 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 S1344990AbhELRFh (ORCPT + 12 others); Wed, 12 May 2021 13:05:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:35912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244447AbhELQqG (ORCPT ); Wed, 12 May 2021 12:46:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C415A6101B; Wed, 12 May 2021 16:14:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620836096; bh=HLYi6aLt9FcfHvOVe52fF2AvTbB+esq6orx1a3UQmTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PBaG6bulvn/SMOIm8c+X/f52CdJvwwUwUQwnjXvIl4/ACHq+rS3w5Dh6J3oedzR6v iYIy5GG9ko62cLkr2yGaXP5ML+D7AxiEM3uWEmPfq0KYpGCUKPDk6+ISRhzy7an8fL KySCS0UioidoaJtIDMVw/x/a4n8ycHPuMNHh3wqY= 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.12 601/677] net: ethernet: ixp4xx: Set the DMA masks explicitly Date: Wed, 12 May 2021 16:50:47 +0200 Message-Id: <20210512144857.337079756@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144837.204217980@linuxfoundation.org> References: <20210512144837.204217980@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 0152f1e70783..9defaa21a1a9 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c @@ -1085,7 +1085,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; @@ -1435,6 +1435,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);