From patchwork Thu Nov 12 08:48:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Vincent_Stehl=C3=A9?= X-Patchwork-Id: 11899747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29A2CC55ABD for ; Thu, 12 Nov 2020 11:37:10 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A16CF206FB for ; Thu, 12 Nov 2020 11:37:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JbnOJSlV"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=laposte.net header.i=@laposte.net header.b="qkXroFtf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A16CF206FB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=laposte.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=3QkyRlL0thkb4HVINGPWZxC9PMcdVZPrCIBYiN3Sczo=; b=JbnOJSlV28ytRVAaBIO/QUx4n0 nFzVHCHTswrZZ23JugwFur//JrWVEUqdIuX9+891ovHUm54WvOSQkknTK9o5y7Jh3Ve9TZwH+qjYf mXCCl0dyaxbN/csae0gtSzQ6Igdhi+BOm1mwdpvdObfvcvfxTXdktJw9ep8iZDUfwsvTomt6cXl4t 1XuVcHrqL7ElIGIeZhEEeCCev5+5aBroXzRbhqrAk3T4uJE//yU1Or6RhRyo+1O3MF1oSkSgeVLFv vCE+cqp8lE+mQPJm3jaYTwHukkq0Abv9PL06XSAxl4GE3adn2khKP32Rl0boIuNHyDTGQmOoBDM+H 3Kku3bFQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdAtR-0004z0-Qs; Thu, 12 Nov 2020 11:35:57 +0000 Received: from smtp-outgoing.laposte.net ([160.92.124.105]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdAtI-0004vP-Vo for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2020 11:35:50 +0000 X-mail-filterd: {"version":"1.1.4", "queueID":"4CX0042YDYz10MQ4", "contextId":"ebf0f8af-98db-4cff-8680-f1f8c0471f72"} Received: from outgoing-mail.laposte.net (localhost.localdomain [127.0.0.1]) by mlpnf0120.laposte.net (SMTP Server) with ESMTP id 4CX0042YDYz10MQ4; Thu, 12 Nov 2020 12:35:32 +0100 (CET) X-mail-filterd: {"version":"1.1.4", "queueID":"4CX0014104z10MQT", "contextId":"0e7ca37c-c656-48c2-9d8a-64fa72269c86"} X-lpn-mailing: LEGIT X-lpn-spamrating: 36 X-lpn-spamlevel: not-spam X-lpn-spamcause: OK, (-100)(0000)gggruggvucftvghtrhhoucdtuddrgedujedruddvfedgtdehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecunfetrffquffvgfdpqfgfvfdpggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffogggtgfesthekredtredtjeenucfhrhhomhepgghinhgtvghnthcuufhtvghhlhoruceovhhinhgtvghnthdrshhtvghhlhgvsehlrghpohhsthgvrdhnvghtqeenucggtffrrghtthgvrhhnpeetiedvheeijedtgfelvdfghfevtdevjeehffdtueekueeiudduteejkedtueffteenucfkphepkeekrdduvddurddugeelrdegleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehrohhmuhgrlhgurdgsvghrghgvrhhivgdpihhnvghtpeekkedruddvuddrudegledrgeelpdhmrghilhhfrhhomhepvhhinhgtvghnthdrshhtvghhlhgvsehlrghpohhsthgvrdhnvghtpdhrtghpthhtohepsghgohhlrghsiigvfihskhhisegsrgihlhhisghrvgdrtghomhdprhgtphhtthhopegurghvvghmsegurghvvghmlhhofhhtrdhnvghtpdhrtghpthhtohepvhhinhgtvghnthdrshhtvghhlhgvsehlrghpohhsthgvrdhnvghtpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpt hhtoheplhhinhhugidqmhgvughirghtvghksehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhg Received: from romuald.bergerie (unknown [88.121.149.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mlpnf0120.laposte.net (SMTP Server) with ESMTPSA id 4CX0014104z10MQT; Thu, 12 Nov 2020 12:35:29 +0100 (CET) Received: from radicelle.bergerie (radicelle.bergerie [192.168.124.12]) by romuald.bergerie (Postfix) with ESMTPS id 6D2913D20EA2; Thu, 12 Nov 2020 09:48:56 +0100 (CET) Received: from vincent by radicelle.bergerie with local (Exim 4.94) (envelope-from ) id 1kd8Ho-0005k4-55; Thu, 12 Nov 2020 09:48:56 +0100 From: =?utf-8?q?Vincent_Stehl=C3=A9?= To: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: ethernet: mtk-star-emac: return ok when xmit drops Date: Thu, 12 Nov 2020 09:48:33 +0100 Message-Id: <20201112084833.21842-1-vincent.stehle@laposte.net> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=lpn-wlmd; t=1605180933; bh=ZqIXuytQtqNakK+uXCSUANljRRTY4GRLTUpiu+kdDGU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding; b=qkXroFtfeDXHVkL5JrYMJbEpOBWXwVN0v+hsgX1vFu9aPdju1lBGTp9mgKStAOWVcLZ47bgOOV3Ks4oASsQbo9nwl+K5/+Zv9i2EBbBFWfEOohJSsTdf7fpOCxwY1no/ZD5meax5Lmgju6YY5T43l2tIGzfFHGOHG95KdhP2t+Pis0iTdRr9nss4sRW+AHhnWfVfIFqpi0Ap9W/jvlZW5zczP1DmKseIfOLPCfhmnbplxUEJIQLnuIw12aWPT9S14tK3IHH0+XN9H+WAZN6Pk6tMLJJixOv7eMrJ+jFg07sD/ZNZKcXT+ApI+ujKZbNOigx/Q8uH/MLIGrfuArTmgw==; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_063549_205684_979917A8 X-CRM114-Status: GOOD ( 13.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Golaszewski , "David S . Miller" , =?utf-8?q?Vincent_Stehl=C3=A9?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The ndo_start_xmit() method must return NETDEV_TX_OK if the DMA mapping fails, after freeing the socket buffer. Fix the mtk_star_netdev_start_xmit() function accordingly. Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver") Signed-off-by: Vincent Stehlé Cc: David S. Miller Cc: Bartosz Golaszewski Acked-by: Bartosz Golaszewski --- drivers/net/ethernet/mediatek/mtk_star_emac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_star_emac.c b/drivers/net/ethernet/mediatek/mtk_star_emac.c index 13250553263b5..e56a26f797f28 100644 --- a/drivers/net/ethernet/mediatek/mtk_star_emac.c +++ b/drivers/net/ethernet/mediatek/mtk_star_emac.c @@ -1053,7 +1053,7 @@ static int mtk_star_netdev_start_xmit(struct sk_buff *skb, err_drop_packet: dev_kfree_skb(skb); ndev->stats.tx_dropped++; - return NETDEV_TX_BUSY; + return NETDEV_TX_OK; } /* Returns the number of bytes sent or a negative number on the first