Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp871388ybv; Wed, 19 Feb 2020 11:00:15 -0800 (PST) X-Google-Smtp-Source: APXvYqzWAxG9k2a4SNnNo3g8hcnoNSwtl/8Ey/9U2A0d+ecUQQkvlsFyf5PJB83uEZOZI3jDMr9W X-Received: by 2002:aca:4994:: with SMTP id w142mr5353267oia.178.1582138815609; Wed, 19 Feb 2020 11:00:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582138815; cv=none; d=google.com; s=arc-20160816; b=Fr8QxkPBknP0wdqigY0MIJT1TDsXXUeXKOXRGN2dby2c8ghNU4u6gckiMdsIe8ytLf drPKX2Lipzyrp1+sbHR9LU8ISxeGcBq4OWukf4WU/VfGAV2mXH7xDWbjY5yYTzlyAyes vZgd1rsAuAS+1q9VAQjjZ6xyr/7QTbw8ouTcTfyI1rDKwNnD/DWEKlg2L6TMQYcdt2FB dewnlZDCmwxN9iBC7305udzMp/MFaiMDwBYPdgIiUxAfYV42T8e+DmZiDO+X01/D9R2U GxVBNPa0LESgHU5OdEe/XbHqiPnn4+uYFdgm436qiDkJR54Xold5Dz8cxZimHLRtQ/HC GG7w== 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=z3zrBcFMJdFCRl2ErKmyJiR7j3XuvHLrQNtNbqezc1U=; b=f0kg+4zTYrc8hyXadI4Cm5fMjxS1++VOG/ltUDsUjT0kiIJPI1Yle+SE/5S+KHl5g7 JKbU8PmxFnS/ShunM1w4y7Leay5NMpo0Bs9nsLenrmbzeBPLm+PrE6iEQypYdvkxek5J /eEum/0nMmSlEc+yAPKqRKmMjRQ4MsZoMldE1LMwRCKHQ2DM8CPkN0ZCb2vCM6iOITYp 5R3FxStGcmKP4L0TUpW1Zn/ZarkHGH6A+WMoHrDw7/fCVtY7tZYVARdWUpcWkNp45wHT QkNSquC4+xgyWoUTPL9f7DIfkIKOw+dTrNyJ04laKRb73Fs2EJSjB2nP14b2IbuKeV3W OzSw== 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 w7si308394otq.250.2020.02.19.11.00.03; Wed, 19 Feb 2020 11:00:15 -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 S1726703AbgBSS7z (ORCPT + 99 others); Wed, 19 Feb 2020 13:59:55 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:46346 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbgBSS7z (ORCPT ); Wed, 19 Feb 2020 13:59:55 -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 F181F15AD197E; Wed, 19 Feb 2020 10:59:54 -0800 (PST) Date: Wed, 19 Feb 2020 10:59:54 -0800 (PST) Message-Id: <20200219.105954.1568022053134111448.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: <65907810dd82de3fcaad9869f328ab32800c67ea.1582108989.git.esben@geanix.com> References: <65907810dd82de3fcaad9869f328ab32800c67ea.1582108989.git.esben@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]); Wed, 19 Feb 2020 10:59:55 -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: 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.