From patchwork Mon Sep 16 01:10:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 275089 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 5A80C2C011C for ; Mon, 16 Sep 2013 11:10:42 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 725B64A05F; Mon, 16 Sep 2013 03:10:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zoIJqHzjf8If; Mon, 16 Sep 2013 03:10:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F36724A060; Mon, 16 Sep 2013 03:10:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 904DF4A060 for ; Mon, 16 Sep 2013 03:10:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wWpGkTSDFbXv for ; Mon, 16 Sep 2013 03:10:27 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=SKIP(-1.5) (only DNSBL check requested) Received: from mail-ye0-f182.google.com (mail-ye0-f182.google.com [209.85.213.182]) by theia.denx.de (Postfix) with ESMTPS id 5C65E4A05F for ; Mon, 16 Sep 2013 03:10:25 +0200 (CEST) Received: by mail-ye0-f182.google.com with SMTP id l10so1442049yen.41 for ; Sun, 15 Sep 2013 18:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=cSWE4D9byMnlGb4c8RPLc3ddo+1tcV0SRY27+50tjVQ=; b=PXcUGsd/I2x0B7PnP/j3c6Xz24WnY/tmZV64ty/yQ/dHAMkKyE/K/T0aiSdonR8dGP SlW2Hf9KTzhnDuzm8rqQs3+OcvaRwqz9uTMDM3UwYBQvlu8B7Pra4NoheeM0H/+xRT3e Eph2Jv2sZ3Cu7cN002nEbqw/LBK7+vekC2pNN7SGzYbQpyIsRruR4CQuAFd6TQEEZ+hp /HFShIskF9KhOfCb/HTCqCuGeAD1KT0vmcquq8qUC80qIDJBvuEeljvqvZRC7yAlug9r i2vt1XuMJ14l8OMOpKucgbymy0S5VyMtRK8GRwzXmD+AP98eIcR0MpiLTFL05+zFnhDO qAcg== X-Received: by 10.236.15.162 with SMTP id f22mr26948395yhf.23.1379293824162; Sun, 15 Sep 2013 18:10:24 -0700 (PDT) Received: from localhost.localdomain ([186.207.93.139]) by mx.google.com with ESMTPSA id e65sm33073189yhc.18.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 15 Sep 2013 18:10:23 -0700 (PDT) From: Fabio Estevam To: joe.hershberger@ni.com Date: Sun, 15 Sep 2013 22:10:03 -0300 Message-Id: <1379293803-30650-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.8.1.2 Cc: marex@denx.de, Fabio Estevam , u-boot@lists.denx.de, hector.palacios@digi.com, robert.hodaszi@digi.com Subject: [U-Boot] [PATCH] net: fec_mxc: Fix timeouts during tftp transfer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Fabio Estevam Performing tftp transfers on mx28 results in random timeouts. Hector Palacios and Robert Hodaszi analyzed the root cause being related to the alignment of the 'buff' buffer inside fec_recv(). GCC versions such as 4.4/4.5 are more likely to exhibit such problem. Use ALLOC_CACHE_ALIGN_BUFFER() for making the proper alignment of buffer. Reported-by: Hector Palacios Tested-by: Oliver Metz Signed-off-by: Fabio Estevam Tested-by: Hector Palacios --- drivers/net/fec_mxc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 690e572..b423ff6 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -794,7 +794,7 @@ static int fec_recv(struct eth_device *dev) uint16_t bd_status; uint32_t addr, size, end; int i; - uchar buff[FEC_MAX_PKT_SIZE] __aligned(ARCH_DMA_MINALIGN); + ALLOC_CACHE_ALIGN_BUFFER(uchar, buff, FEC_MAX_PKT_SIZE); /* * Check if any critical events have happened