mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 4/5] net: fec_imx: Return EFAULT when DMA mapping fails
Date: Thu, 30 Aug 2018 22:18:25 -0700	[thread overview]
Message-ID: <20180831051826.13587-4-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20180831051826.13587-1-andrew.smirnov@gmail.com>

EFAULT seems to be much more appropriate error code for DMA mapping
failure, it also produces more informative message, compare:

ping 192.168.53.7
WARNING: eth0: No MAC address set. Using random address 92:4e:f1:18:96:67
eth0: 100Mbps full duplex link detected
ping failed: Bad address

versus old message:

ping 192.168.53.7
WARNING: eth0: No MAC address set. Using random address c6:b7:67:bb:4a:c3
eth0: 100Mbps full duplex link detected
ping failed: I/O error

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/fec_imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index f459516df..33262bdfa 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -466,7 +466,7 @@ static int fec_send(struct eth_device *dev, void *eth_data, int data_length)
 
 	dma = dma_map_single(fec->dev, eth_data, data_length, DMA_TO_DEVICE);
 	if (dma_mapping_error(fec->dev, dma))
-		return -EIO;
+		return -EFAULT;
 
 	writel((uint32_t)(dma), &fec->tbd_base[fec->tbd_index].data_pointer);
 
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-08-31  5:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31  5:18 [PATCH 1/5] driver: Adopt DMA mask concept from Linux Andrey Smirnov
2018-08-31  5:18 ` [PATCH 2/5] net: fec_imx: Specify that DMA is 32-bit only Andrey Smirnov
2018-08-31  5:18 ` [PATCH 3/5] mci: imx-esdhc: " Andrey Smirnov
2018-08-31  5:18 ` Andrey Smirnov [this message]
2018-08-31  5:18 ` [PATCH 5/5] mci: imx-esdhc: Return EFAULT when DMA mapping fails Andrey Smirnov
2018-08-31  6:46 ` [PATCH 1/5] driver: Adopt DMA mask concept from Linux Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180831051826.13587-4-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox