From patchwork Thu Jan 28 21:25:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 8154571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 69F9C9F9E8 for ; Thu, 28 Jan 2016 21:58:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9882C20218 for ; Thu, 28 Jan 2016 21:58:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C705E202F8 for ; Thu, 28 Jan 2016 21:58:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOuYy-0002Jm-DC; Thu, 28 Jan 2016 21:57:12 +0000 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOu7n-0005zU-Oc for linux-arm-kernel@lists.infradead.org; Thu, 28 Jan 2016 21:29:08 +0000 Received: by mail-pa0-x22f.google.com with SMTP id yy13so29102249pab.3 for ; Thu, 28 Jan 2016 13:28:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BkB24tev5JEIrWR77+DvTvk4acbg+axObFueD7crNwo=; b=viKRXEfxqYNPV5a9q64nqttMJ581thlmXvMlnt0H862If1ibQ2nHOlG+7DiMJVScFb AmStvAdyLhsa0JI0Mecuxda8KXA4kC9LPHC0puuM6fTmkytMZK2dcjcJQigdjViaX3aI 1qfUpjbzPtmvy56xPUTkqrUtl2PeZCr6uCaePC9fT6HtwWGEPohrc2iBBVNAQzXH8FQC lKUO4h1yGuNXuGJDNuEAEO+mTRI0z/LaGpHuG0S4z8H8KrPEr7RwUNMyEf3qzZNjoRtn CjlZgUmVFH985nQ7OSbkR+33W/5mMfakW+y4nGgvcvGaMN0EIV5DoskO4C7WgMUbvuCQ Dwpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BkB24tev5JEIrWR77+DvTvk4acbg+axObFueD7crNwo=; b=PmhG5QrzgUz6xchePgplXPWTN8dbGvap7x9EtJ1dUysElQcJ9aWIDcnCaH4xE0WbKL feL9x2NICJZWzH1sQ+0K3Iji3yaJJZj0LMc7MUdOh3BGGsW6BOP1wxQOvhQO2M6zJkFJ SUSl57OuBqX7isgmwRapEaVmemEj2boiuXy/5u9Yp1xT3ZIO6BZ6/UDKK8jf1OMy2zrV 0IOQyiyLMBFc5mRt22i2snnhs1pp2VIvg+PH1PE+DdQv5My4cuB+/QhKu4EzbDmCsh8x /CXlg6dtEd8d5gl6yNq5a8bgvQXboj+O/ZAGOzMZDD+nTpI/F7ovc1knLUT+AVcptAu0 jX2w== X-Gm-Message-State: AG10YOQCWFnq2QHEAPW2vM2sQjkE5Qd9cvtieHwnm8Qdw2ladXVqjyV2RLKnLZue8ONYpw== X-Received: by 10.66.149.7 with SMTP id tw7mr8039601pab.72.1454016527240; Thu, 28 Jan 2016 13:28:47 -0800 (PST) Received: from localhost.localdomain (wsip-70-184-93-199.ph.ph.cox.net. [70.184.93.199]) by smtp.googlemail.com with ESMTPSA id c90sm18583190pfd.31.2016.01.28.13.28.45 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jan 2016 13:28:46 -0800 (PST) From: Troy Kisky To: netdev@vger.kernel.org, davem@davemloft.net, B38611@freescale.com Subject: [PATCH net-next 23/40] net: fec: don't set cbd_bufaddr unless no mapping error Date: Thu, 28 Jan 2016 14:25:47 -0700 Message-Id: <1454016364-30985-24-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454016364-30985-1-git-send-email-troy.kisky@boundarydevices.com> References: <1454016364-30985-1-git-send-email-troy.kisky@boundarydevices.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160128_132907_960438_5CBA6E96 X-CRM114-Status: GOOD ( 11.15 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fabio.estevam@freescale.com, andrew@lunn.ch, linux@arm.linux.org.uk, Troy Kisky , laci@boundarydevices.com, l.stach@pengutronix.de, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org, tremyfr@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Troy Kisky --- drivers/net/ethernet/freescale/fec_main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index da2e3c530..29c5781 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -597,7 +597,7 @@ fec_enet_txq_put_hdr_tso(struct fec_enet_priv_tx_q *txq, int hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); struct bufdesc_ex *ebdp = container_of(bdp, struct bufdesc_ex, desc); void *bufaddr; - unsigned long dmabuf; + dma_addr_t dmabuf; unsigned short status; unsigned int estatus = 0; @@ -1287,19 +1287,21 @@ fec_enet_new_rxbdp(struct net_device *ndev, struct bufdesc *bdp, struct sk_buff { struct fec_enet_private *fep = netdev_priv(ndev); int off; + dma_addr_t dmabuf; off = ((unsigned long)skb->data) & fep->rx_align; if (off) skb_reserve(skb, fep->rx_align + 1 - off); - bdp->cbd_bufaddr = dma_map_single(&fep->pdev->dev, skb->data, - FEC_ENET_RX_FRSIZE - fep->rx_align, - DMA_FROM_DEVICE); - if (dma_mapping_error(&fep->pdev->dev, bdp->cbd_bufaddr)) { + dmabuf = dma_map_single(&fep->pdev->dev, skb->data, + FEC_ENET_RX_FRSIZE - fep->rx_align, + DMA_FROM_DEVICE); + if (dma_mapping_error(&fep->pdev->dev, dmabuf)) { if (net_ratelimit()) netdev_err(ndev, "Rx DMA memory map failed\n"); return -ENOMEM; } + bdp->cbd_bufaddr = dmabuf; return 0; }