From patchwork Tue May 12 05:58:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 6385841 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 4AE889F1C2 for ; Tue, 12 May 2015 06:01:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8184920395 for ; Tue, 12 May 2015 06:01:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF41E202D1 for ; Tue, 12 May 2015 06:01:07 +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 1Ys3DU-0008P2-3v; Tue, 12 May 2015 05:58:56 +0000 Received: from mail-wi0-f181.google.com ([209.85.212.181]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ys3DQ-0008Ip-H1 for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2015 05:58:53 +0000 Received: by wizk4 with SMTP id k4so136230100wiz.1 for ; Mon, 11 May 2015 22:58:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=I3N2iOKmWnbEpGFKpMoSGI4/fQCAIAgmUrgpDXqxpXY=; b=iW0FIH+bAqyKEzpa9ahSmlN6MwVjO3vnzdzbfLouF42Zhfva0QOeQZ/RTxAfvK5jDU DAQ+iGVjpbO6TacC5DIHtA9iy8qnN17Zri8QKKpJzZ39ab8s8Jb8LOff99eFD83S73Dg iK5Galmd1OR/7xymMQWGCdRfN1lbupxnSmaLHUD19q5lFD0mH3/rHtEDfRmquN7jRaer DqlXdYE9Zb1xNHamTSQAjsZFPxPMcvPfLvSiNUFITWL0dLWPOcXUaaDqkgMmS4w1NHWA OAMqPv+DyMh5a7Qc9mJRFmQ/HzUMA/KaBVxWDwN8zTBn2YaFuHcKFV39wj9ENzhH5jBJ Fs/Q== X-Gm-Message-State: ALoCoQnn/Yu7YkXKE6OvMTaFufvvy4+MAmqjc8JeEZGwYltEh9atdQAYV9d275Co6vp+TakzeitU X-Received: by 10.180.108.147 with SMTP id hk19mr5428082wib.51.1431410309554; Mon, 11 May 2015 22:58:29 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by mx.google.com with ESMTPSA id l3sm1069500wiv.18.2015.05.11.22.58.27 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 22:58:28 -0700 (PDT) From: Michal Simek To: netdev@vger.kernel.org Subject: [PATCH] net: ll_temac: Fix DMA map size bug Date: Tue, 12 May 2015 07:58:22 +0200 Message-Id: X-Mailer: git-send-email 2.3.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150511_225852_734704_D1ABFE69 X-CRM114-Status: GOOD ( 10.00 ) X-Spam-Score: -0.7 (/) Cc: Subbaraya Sundeep Bhatta , monstr@monstr.eu, linux-kernel@vger.kernel.org, Markus Elfring , Fabian Frederick , Julia Lawall , =?UTF-8?q?Manuel=20Sch=C3=B6lling?= , "David S. Miller" , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 DMA allocates skb->len instead of headlen which is used for DMA. Signed-off-by: Michal Simek --- drivers/net/ethernet/xilinx/ll_temac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index ca640d04fd93..cfb6bdb37fdc 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -705,8 +705,8 @@ static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev) cur_p->app0 |= STS_CTRL_APP0_SOP; cur_p->len = skb_headlen(skb); - cur_p->phys = dma_map_single(ndev->dev.parent, skb->data, skb->len, - DMA_TO_DEVICE); + cur_p->phys = dma_map_single(ndev->dev.parent, skb->data, + skb_headlen(skb), DMA_TO_DEVICE); cur_p->app4 = (unsigned long)skb; for (ii = 0; ii < num_frag; ii++) {