From patchwork Wed Oct 10 12:07:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Tudor X-Patchwork-Id: 10634487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 82A4816B1 for ; Wed, 10 Oct 2018 12:31:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9A8129E86 for ; Wed, 10 Oct 2018 12:31:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDE6829EF5; Wed, 10 Oct 2018 12:31:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 42FC929EDE for ; Wed, 10 Oct 2018 12:31:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=nw+EHCE9ftM16dFY3/Lyh8gxtonK3tF9Knlnl7BLnGo=; b=O7pifu1daYUlucAQFRNaNyfC7s InIn0D1tIN+EdtxGDi97c8F5ASiUy3OOZsOh7WtuHURKOXoYVp/8WKBlNI6ndzClJHO6d8Ve7CXLQ TrHMcH5YQ86GlZQEkeWWNTjbXbAr2O28T3H8kChS8OmodRmtMC6Ga6RYZzrxb6PC0I8G6iBVNuZRh H+GUy7BuSfLAKSdbbqXUrMjd7etsTqv7GydXFCjt7kmCXweV5MPeTeggn8hianNTesGBprFQqsybX sKV3G/3KU06yT8Oz0zWZH1LJPuruoOuuHG910vN4s0RIpBX0uQ6egzXAwYJKoPeqjEbmbxkmehmPd DLniK+vg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gADe5-0003q9-G5; Wed, 10 Oct 2018 12:31:21 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gADHj-0006xR-2g for linux-arm-kernel@lists.infradead.org; Wed, 10 Oct 2018 12:08:28 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 873981A0195; Wed, 10 Oct 2018 14:07:55 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7AF0D1A016E; Wed, 10 Oct 2018 14:07:55 +0200 (CEST) Received: from fsr-ub1864-101.ea.freescale.net (fsr-ub1864-101.ea.freescale.net [10.171.82.46]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id C36D520604; Wed, 10 Oct 2018 14:07:54 +0200 (CEST) From: laurentiu.tudor@nxp.com To: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, arm@kernel.org Subject: [PATCH v3 12/22] dpaa_eth: base dma mappings on the fman rx port Date: Wed, 10 Oct 2018 15:07:27 +0300 Message-Id: <20181010120737.30300-10-laurentiu.tudor@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181010120737.30300-1-laurentiu.tudor@nxp.com> References: <20181010120737.30300-1-laurentiu.tudor@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181010_050815_312343_813E7A7B X-CRM114-Status: GOOD ( 11.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arnd@arndb.de, bharat.bhushan@nxp.com, madalin.bucur@nxp.com, shawnguo@kernel.org, roy.pledge@nxp.com, leoyang.li@nxp.com, robin.murphy@arm.com, davem@davemloft.net, Laurentiu Tudor MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Laurentiu Tudor The dma transactions initiator is the rx fman port so that's the device that the dma mappings should be done. Previously the mappings were done through the MAC device which makes no sense because it's neither dma-able nor connected in any way to smmu. Signed-off-by: Laurentiu Tudor Acked-by: Madalin Bucur --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 1ca4cfb79961..0dc0267844ca 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -2795,8 +2795,15 @@ static int dpaa_eth_probe(struct platform_device *pdev) return -ENODEV; } + mac_dev = dpaa_mac_dev_get(pdev); + if (IS_ERR(mac_dev)) { + dev_err(&pdev->dev, "dpaa_mac_dev_get() failed\n"); + err = PTR_ERR(mac_dev); + goto probe_err; + } + /* device used for DMA mapping */ - dev = pdev->dev.parent; + dev = fman_port_get_device(mac_dev->port[RX]); err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(40)); if (err) { dev_err(dev, "dma_coerce_mask_and_coherent() failed\n"); @@ -2821,13 +2828,6 @@ static int dpaa_eth_probe(struct platform_device *pdev) priv->msg_enable = netif_msg_init(debug, DPAA_MSG_DEFAULT); - mac_dev = dpaa_mac_dev_get(pdev); - if (IS_ERR(mac_dev)) { - dev_err(dev, "dpaa_mac_dev_get() failed\n"); - err = PTR_ERR(mac_dev); - goto free_netdev; - } - /* If fsl_fm_max_frm is set to a higher value than the all-common 1500, * we choose conservatively and let the user explicitly set a higher * MTU via ifconfig. Otherwise, the user may end up with different MTUs @@ -2963,9 +2963,9 @@ static int dpaa_eth_probe(struct platform_device *pdev) qman_release_cgrid(priv->cgr_data.cgr.cgrid); free_dpaa_bps: dpaa_bps_free(priv); -free_netdev: dev_set_drvdata(dev, NULL); free_netdev(net_dev); +probe_err: return err; }