Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp950798ybv; Thu, 20 Feb 2020 10:11:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxOEZ3hNI794PKXDHZzhyh9PVSTpQFGtk246B46qBRE05J5rJbs2R9P70D7Ap04zDp7wMfY X-Received: by 2002:a9d:6f0a:: with SMTP id n10mr25505923otq.54.1582222284907; Thu, 20 Feb 2020 10:11:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582222284; cv=none; d=google.com; s=arc-20160816; b=YsbY97Vl5e4OdPa/NWQjSpSF0Se22zpZvgZ24i4VS4+2aNo4Ae4Heb+Bc0lDvUQFoN Opehcx3GnRWEW42W0k05KgZbagA3AzNnkZeK/IUirUNrVnQzxLXUS0/+XV/cY5sSo05m hmKDVQEsD47cEygMf80cSQox0LZYO8smCJ9NfRaghLiETa/zO4/OKsoLzl6RbghQkEEt 6u+1vxVmd2zv25j2zrfvfktMbMLUncsWWe2w2swlNBTLz4bL9HLPiO85ny5r2LXxqdmV X0HDe4LC2kzUku+oCFXSQUtSh/6bTMif1dxiUVhUPQZKL7f6J1UA6/BWLHJgsGAmA0qs VPFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=piq6nkzihIQwdk8pnBjS6TjDdxyULxRHRGnxAZrefsY=; b=zXyhdgiRddf440UZPPMIMKDUvt5MXO5AuYmNO5ExnVjVunuZusHJiv2MHNfxjCBG02 reG+y3WwbLmKsgXcW7PGjm9peuZCvo15lfNsu1+3inPzcta5ZLoPFAezrT8yviK1TQrt 5GiqOYz4o8AERNc1Uvu12JDmjlkqUDEP6I9CqYP9GNUumX7KHbqSjcRSIKtwsdkFtGE+ TADps2V6NzC1YocujvAWbrXagRCznzxWyUk45KBL6JDPbXIr9V1F6yrNkBEqWUBqYLp/ VCh3Mqn/DsOMyv4nOXA1G2mIyHEU3aYlV098BeSQMQsNe5+L+BjLl4ikefsa9MqqN6B8 5wqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x84si37176oia.27.2020.02.20.10.11.10; Thu, 20 Feb 2020 10:11:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728747AbgBTSLC (ORCPT + 99 others); Thu, 20 Feb 2020 13:11:02 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:56932 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727553AbgBTSLC (ORCPT ); Thu, 20 Feb 2020 13:11:02 -0500 Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 2F3A715AC0C32; Thu, 20 Feb 2020 10:11:02 -0800 (PST) Date: Thu, 20 Feb 2020 10:11:01 -0800 (PST) Message-Id: <20200220.101101.1993510182065744262.davem@davemloft.net> To: esben@geanix.com Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, andrew@lunn.ch, michal.simek@xilinx.com, ynezz@true.cz Subject: Re: [PATCH net 2/4] net: ll_temac: Add more error handling of dma_map_single() calls From: David Miller In-Reply-To: <87v9o18xqd.fsf@geanix.com> References: <65907810dd82de3fcaad9869f328ab32800c67ea.1582108989.git.esben@geanix.com> <20200219.105954.1568022053134111448.davem@davemloft.net> <87v9o18xqd.fsf@geanix.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 20 Feb 2020 10:11:02 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Esben Haabendal Date: Thu, 20 Feb 2020 09:32:58 +0100 > David Miller writes: > >> From: Esben Haabendal >> Date: Wed, 19 Feb 2020 11:54:00 +0100 >> >>> @@ -863,12 +865,13 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev) >>> skb_dma_addr = dma_map_single(ndev->dev.parent, skb->data, >>> skb_headlen(skb), DMA_TO_DEVICE); >>> cur_p->len = cpu_to_be32(skb_headlen(skb)); >>> + if (WARN_ON_ONCE(dma_mapping_error(ndev->dev.parent, skb_dma_addr))) >>> + return NETDEV_TX_BUSY; >> >> The appropriate behavior in this situation is to drop the packet and return >> NETDEV_TX_OK. > > Ok, and I guess the same goes for the error handling of dma_map_single() > of one of the fragments later in same function. Yes.