Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2338508ybz; Thu, 23 Apr 2020 16:18:09 -0700 (PDT) X-Google-Smtp-Source: APiQypJzzHXYHR+i23fKVGeovKZeMp65vyMAiRtJR75NFVgtsIS1igVGPBJMAtDNTJ0F92pt8LGs X-Received: by 2002:a50:c389:: with SMTP id h9mr4977092edf.1.1587683889612; Thu, 23 Apr 2020 16:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587683889; cv=none; d=google.com; s=arc-20160816; b=IkXcj94MZNpZJYyWEhGWned7+8s5YA/LxiJx1DdiQXczkTsPwX9eio+LHYykwcKMws 1o2pJa+Y+gdwUThWIJ3HV4654M4XckoKVc9GkOb/EOnNgoQMTAQ/ZPJv4o8taywWcXzS rrWAV6bAQ0SCMZG0dYbQnmN8YHVGb+ybj4NHrGZVAf3duSXxVTS4esRLXtd1F8Do2VML VZ/KdnH+OxMsU/xRgTwEZokgmhdG4nItoGxPN4u2c7THsVk+fxug8K6hRwDqde9h4lyU Yxt2QaJdTOu/XPtIQLwvwH186cby4DOsEhSyHMiNzTG/ZNfXmXT5pN+exOGRLJfi4xg7 QynA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=bEwvlTJ+MCdvMjmlBl2ojN2o02CEw82nS9ZDV8m0CZw=; b=dHsHY3+ePYTV6eMMwCz4D5Iyk7emHpkMfo0QD0GdYxi06MM/kqEKzB6SQUxkGQcj8P u5B6YU/Q6SrfQSlcheWjtdTrXVJHE1rotvEB5Ja9lX6rwt0RWvKvIry0l6jYISk5xLpy f6LDEIMj33sn6KZPU5tvVt8+6ONUmSdEtm57bNsYe8VgeEpjwpF4gYs++8evlB7HTdsW NM7/z7CLDDSKoMuESiUP+IRIvrBTmsMkC4SIfLJVXN+ewS5va0RT5KrlktRV0Tt5NryV YI6iw0m5U/qbcA9zyrDueTBMvyZEjuh+X5v6LaQu2VqKgPNboymNnTv5offQLr6LBMCN MhyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si2112047edn.289.2020.04.23.16.17.46; Thu, 23 Apr 2020 16:18:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727979AbgDWXNY (ORCPT + 99 others); Thu, 23 Apr 2020 19:13:24 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50060 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728503AbgDWXGv (ORCPT ); Thu, 23 Apr 2020 19:06:51 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jRkva-0004lu-7I; Fri, 24 Apr 2020 00:06:42 +0100 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1jRkvY-00E6yG-9T; Fri, 24 Apr 2020 00:06:40 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "David S. Miller" , "Mao Wenan" Date: Fri, 24 Apr 2020 00:07:09 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 202/245] net: sonic: return NETDEV_TX_OK if failed to map buffer In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.83-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Mao Wenan commit 6e1cdedcf0362fed3aedfe051d46bd7ee2a85fe1 upstream. NETDEV_TX_BUSY really should only be used by drivers that call netif_tx_stop_queue() at the wrong moment. If dma_map_single() is failed to map tx DMA buffer, it might trigger an infinite loop. This patch use NETDEV_TX_OK instead of NETDEV_TX_BUSY, and change printk to pr_err_ratelimited. Fixes: d9fb9f384292 ("*sonic/natsemi/ns83829: Move the National Semi-conductor drivers") Signed-off-by: Mao Wenan Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- drivers/net/ethernet/natsemi/sonic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/natsemi/sonic.c +++ b/drivers/net/ethernet/natsemi/sonic.c @@ -221,9 +221,9 @@ static int sonic_send_packet(struct sk_b laddr = dma_map_single(lp->device, skb->data, length, DMA_TO_DEVICE); if (!laddr) { - printk(KERN_ERR "%s: failed to map tx DMA buffer.\n", dev->name); + pr_err_ratelimited("%s: failed to map tx DMA buffer.\n", dev->name); dev_kfree_skb(skb); - return NETDEV_TX_BUSY; + return NETDEV_TX_OK; } sonic_tda_put(dev, entry, SONIC_TD_STATUS, 0); /* clear status */